Skip to content

Commit

Permalink
Merge branch 'master' of git@github.com:maxolasersquad/FLOSS-POS
Browse files Browse the repository at this point in the history
  • Loading branch information
maxolasersquad committed Feb 24, 2010
2 parents 34459e5 + cb96f1b commit 2be7c82
Show file tree
Hide file tree
Showing 3 changed files with 87 additions and 195 deletions.
41 changes: 13 additions & 28 deletions pos/fannie/sync/index.php
Original file line number Diff line number Diff line change
@@ -1,35 +1,20 @@
<?php
require_once($_SERVER["DOCUMENT_ROOT"].'/src/htmlparts.php');

$html='<!DOCTYPE HTML>
<html>
<head>';

$html.=head();

$html.='
<title>IS4C - Synchronization</title>
<head>
<link href="screen.css" media="screen" rel="stylesheet" type="text/css"/>
<title>Synchronization</title>
</head>
<body>';

$html.=body();

$html.='
<div id="page_panel">
<h1>Synchronization</h1>
<ul>
<li><a href="reload.php?t=products">Products</a></li>
<li><a href="reload.php?t=custdata">Membership</a></li>
<li><a href="reload.php?t=employees">Employees</a></li>
<li><a href="reload.php?t=departments">Departments</a></li>
<li><a href="reload.php?t=subdepts">Subdepartments</a></li>
<li><a href="reload.php?t=tenders">Tenders</a></li>
</ul>
</div>';

$html.=foot();

$html.='
<body>
<h1>Synchronization</h1>
<ul>
<li><a href="reload.php?t=products">Products</a></li>
<li><a href="reload.php?t=custdata">Membership</a></li>
<li><a href="reload.php?t=employees">Employees</a></li>
<li><a href="reload.php?t=departments">Departments</a></li>
<li><a href="reload.php?t=subdepts">Subdepartments</a></li>
<li><a href="reload.php?t=tenders">Tenders</a></li>
</ul>
</body>
</html>';

Expand Down
33 changes: 10 additions & 23 deletions pos/fannie/sync/reload.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?php
require_once($_SERVER["DOCUMENT_ROOT"]."/define.conf");
require_once($_SERVER["DOCUMENT_ROOT"].'/src/htmlparts.php');

if (isset($_REQUEST['t'])) {
switch ($_REQUEST['t']) {
Expand Down Expand Up @@ -39,21 +38,13 @@

$html='<!DOCTYPE HTML>
<html>
<head>';

$html.=head();

$html.='
<head>
<link href="screen.css" media="screen" rel="stylesheet" type="text/css"/>
<title>Synchronization - '.$type.'</title>
</head>
<body>';

$html.=body();

$html.='
<div id="page_panel">
<h1>Synchronize '.$type.'</h1>
<form action="./synchronize.php" method="post" name="synchronize">';
<body>
<h1>Synchronize '.$type.'</h1>
<form action="./synchronize.php" method="post" name="synchronize">';

// TODO - Auto generate lanes from define.conf, for now, hardcode
$lanes=array(
Expand All @@ -62,18 +53,14 @@

foreach ($lanes as $lane) {
$html.='
<fieldset>
<label>'.$lane['Name'].'</label>
<input checked name="lanes[]" type="checkbox" value="'.$lane['IP'].'"/>
</fieldset>';
<label>'.$lane['Name'].'</label>
<input checked name="lanes[]" type="checkbox" value="'.$lane['IP'].'"/>';
}

$html.='
<fieldset>
<input type="hidden" name="t" value="'.$name.'"/>
<input type="submit"/>
</fieldset>
</form>
<input type="hidden" name="t" value="'.$name.'"/>
<input type="submit"/>
</form>
<p class="status">';

$link=mysql_connect($_SESSION["mServer"], $_SESSION["mUser"], $_SESSION["mPass"]);
Expand Down
208 changes: 64 additions & 144 deletions pos/is4c/fannie/sync/reloadtenders.php
Original file line number Diff line number Diff line change
@@ -1,146 +1,66 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Fannie - Item Maintenance</title>
<link rel="STYLESHEET" href="../style.css" type="text/css">
</head>
<body bgcolor="FFFFFF">
<div align="center">
<table width="750" border="0" cellpadding="0" cellspacing="0">
<tr>
<td colspan="3" width="750">
<table width="750" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="750" colspan="3">
<span style="font-size:28px;color:330066">
Fannie
</span>
</td>
</tr>
<tr>
<td width="330">
<span style="font-size:20px;color:666666">
IS4C maintenance & reporting
</span>
</td>
<td width="400" align="right">
<table width="400" border="0" cellpadding="0" cellspacing="0">
<tr>
<td align="right" height="20">
<span style="color:AAAAAA">
search for product&nbsp;
</span>
<input type="text" onFocus="this.style.background='FFFFFF';" onBlur="this.style.background='F9F9F9';">&nbsp;
<input type="submit" style="padding:0;background-color:330066;border:0;color:FFFFFF;width:25;font-weight:bold" value="GO">
</td>
</tr>
</table>
</td>
<td width="20"></td>
</tr>
</table>
</td>
</tr>
<tr>
<td colspan="3" height="15" bgcolor="FFFFFF"></td>
</tr>
<tr>
<td colspan="3" height="1" bgcolor="CCCCCC"></td>
</tr>
<tr>
<td colspan="3" height="10" bgcolor="FFFFFF"></td>
</tr>
<tr>
<td width="170" bgcolor="FFFFFF" valign="top">
<span style="font-size:6px"><br></span>
<div align="center">
<?php
include_once('../navbar.html');
?>
<span style="font-size:6px"><br></span>
</div>
</td>
<td width="1" bgcolor="CCCCCC"></td>
<td width="579" valign="top">
<span style="font-size:6px"><br></span>
<div align="center">
<table width="549" border="0" cellpadding="0" cellspacing="0">
<tr>
<td colspan="4" height="1" bgcolor="AAAAAA"></td>
<td width="5" height="1" bgcolor="FFFFFF"></td>
</tr>
<tr>
<td width="1" bgcolor="AAAAAA"></td>
<td rowspan="2" colspan="2" width="542" height="27" bgcolor="F9F9F9" style="color:330066;font-size:15px">&nbsp;&nbsp;Update Registers</td>
<td width="1" bgcolor="AAAAAA"></td>
<td width="5" height="4" bgcolor="FFFFFF"></td>
</tr>
<tr>
<td width="1" bgcolor="AAAAAA"></td>
<td width="1" bgcolor="AAAAAA"></td>
<td width="5" bgcolor="F0F0F0" height="23"></td>
</tr>
<tr>
<td width="1" bgcolor="AAAAAA"></td>
<td colspan="2" height="1" bgcolor="AAAAAA"></td>
<td width="1" bgcolor="AAAAAA"></td>
<td width="5" bgcolor="F0F0F0"></td>
</tr>
<tr>
<td width="1" bgcolor="AAAAAA"></td>
<td colspan="2" bgcolor="FFFFFF">
<table width="542" border="0" cellpadding="17" cellspacing="0">
<tr>
<td style="color:999999;line-height:1.6em">
<div align="justify">
<?
include("reload.php");
<?php
/*
* Some places may be comfortable posting the form back to this page and
* using a status message to signal a successful synchronization. At the
* Wedge, we're more comfortable displaying the results per lane on a
* different page (synchronizeproducts.php) -jdp
*/

reloadtable("tenders");
require_once($_SERVER["DOCUMENT_ROOT"]."/define.conf");

?>
</div>
</td>
</tr>
</table>
</td>
<td width="1" bgcolor="AAAAAA"></td>
<td width="5" bgcolor="F0F0F0"></td>
</tr>
<tr>
<td width="1" bgcolor="AAAAAA"></td>
<td colspan="2" height="1" bgcolor="AAAAAA"></td>
<td width="1" bgcolor="AAAAAA"></td>
<td width="5" bgcolor="F0F0F0"></td>
</tr>
<tr>
<td width="1" height="5" bgcolor="FFFFFF"></td>
<td width="4" height="5" bgcolor="FFFFFF"></td>
<td width="538" height="5" bgcolor="F0F0F0"></td>
<td width="1" height="5" bgcolor="F0F0F0"></td>
<td width="5" height="5" bgcolor="F0F0F0"></td>
</tr>
</table>
<span style="font-size:6px"><br></span>
</div>
</td>
</tr>
<tr>
<td colspan="3" height="10" bgcolor="FFFFFF"></td>
</tr>
<tr>
<td colspan="3" height="1" bgcolor="CCCCCC"></td>
</tr>
<tr>
<td colspan="3" height="5" bgcolor="FFFFFF"></td>
</tr>
<tr>
<td colspan="3" bgcolor="FFFFFF" align="right">
Copyleft &#0169; 2006, <a href="http://www.designslife.com" style="font-size:12px;color:AAAAAA">designslife</a>. All Rights Reserved.
</td>
</tr>
</table>
</div>
</body>
</html>
$html='<!DOCTYPE HTML>
<html>
<head>
<link href="screen.css" media="screen" rel="stylesheet" type="text/css"/>
<title>Synchronization - Products</title>
</head>
<body>
<h1>Synchronize Products</h1>
<form action="./synchronizeproducts.php" method="post" name="synchronize_products">';

// TODO - Auto generate lanes from define.conf, for now, hardcode
$lanes=array(
array('Name'=>'Lane 01', 'IP'=>'10.10.10.115'),
array('Name'=>'Fake', 'IP'=>'10.10.10.100')
);
foreach ($lanes as $lane) {
$html.='
<label>'.$lane['Name'].'</label>
<input checked name="lanes[]" type="checkbox" value="'.$lane['IP'].'"/>';
}

$html.='
<input type="submit"/>
</form>
<p class="status">';

$link=mysql_connect($_SESSION["mServer"], $_SESSION["mUser"], $_SESSION["mPass"]);
if ($link) {
$query='SELECT `synchronizationLog`.`datetime` FROM `is4c_log`.`synchronizationLog` WHERE `synchronizationLog`.`name`=\'product\' AND `synchronizationLog`.`status`=1 ORDER BY `synchronizationLog`.`datetime` DESC LIMIT 1';
$result=mysql_query($query, $link);
if ($result && mysql_num_rows($result)==1) {
$row=mysql_fetch_array($result);
$html.='Last synchronized @ '.$row['datetime'];

$query='SELECT COUNT(*) AS \'count\' FROM `is4c_op`.`products` WHERE `products`.`modified`>=\''.$row['datetime'].'\'';
$result=mysql_query($query, $link);
if ($result && mysql_num_rows($result)==1) {
$row=mysql_fetch_array($result);
$html.='</p>
<p>'.$row['count'].' unsynchronized product'.(($row['count']==1)?'':'s');
} else {
// Should the user be notified?
}
} else {
$html.='Unable to query synchronization log.';
}
} else {
$html.='Unable to connect to main server.';
}

$html.='</p>
</body>
</html>';

print_r($html);
?>

0 comments on commit 2be7c82

Please sign in to comment.