Permalink
Browse files

Merge commit 'origin/v2.2_dev'

  • Loading branch information...
2 parents 0aab4fa + c38e579 commit f3b9d73e52c7ec1c650b0e23add98a54366f9e9e @anon84 anon84 committed May 13, 2010
Showing with 1,023 additions and 1,124 deletions.
  1. +3 −0 .gitignore
  2. +18 −1 pos/backend/batch/batch.css
  3. +64 −30 pos/backend/batch/edit.php
  4. +27 −11 pos/backend/batch/index.php
  5. +61 −1 pos/backend/batch/sql.php
  6. +1 −1 pos/backend/item/form.php
  7. +5 −0 pos/backend/item/item.css
  8. BIN pos/backend/label/Screenshot.png
  9. +31 −0 pos/backend/label/index.php
  10. +3 −2 pos/backend/lib/materialized_batch.php
  11. +1 −1 pos/backend/lib/table_batchHeaders.php
  12. +1 −0 pos/backend/src/htmlparts.php
  13. +3 −0 pos/backend/src/screen.css
  14. +2 −1 pos/backend/sync/synchronizeproducts.php
  15. +5 −0 pos/db_connect
  16. BIN pos/documentation/Database Administrator Files/Server_is4c_op_database_layout.pdf
  17. +2 −2 pos/installation/get-lane.sh
  18. +3 −3 pos/installation/get-server.sh
  19. +2 −2 pos/installation/mysql/is4c_op/data/batchHeaders.insert
  20. +4 −2 pos/installation/mysql/is4c_op/tables/batchHeaders.table
  21. +2 −1 pos/installation/mysql/is4c_op/tables/batchProducts.table
  22. +1 −1 pos/installation/mysql/{is4c_op → opdata}/data/configuration.insert
  23. +5 −5 pos/installation/mysql/{is4c_op → opdata}/data/configurationGroups.insert
  24. +6 −6 pos/installation/mysql/{is4c_op → opdata}/tables/configuration.table
  25. +1 −1 pos/installation/mysql/{is4c_op → opdata}/tables/configurationGroups.table
  26. +5 −5 pos/installation/mysql/opdata/tables/employees.table
  27. +1 −0 pos/installation/mysql/script/create_lane_db.sql
  28. +11 −2 pos/installation/ubuntu/install-lane.sh
  29. +13 −3 pos/installation/ubuntu/install-server.sh
  30. +0 −90 pos/installation/ubuntu/mysql_lane.sh
  31. +0 −82 pos/installation/ubuntu/mysql_server.sh
  32. +0 −81 pos/installation/ubuntu/server-mysql.sh
  33. +1 −1 pos/is4c/adminlist.php
  34. +11 −4 pos/is4c/admintasks.php
  35. +4 −2 pos/is4c/authenticate3.php
  36. +31 −114 pos/is4c/configure.php
  37. +21 −10 pos/is4c/connect.php
  38. +4 −1 pos/is4c/end.php
  39. +0 −1 pos/is4c/endorse.php
  40. 0 pos/is4c/ini/{ini.php → ini.php.sample}
  41. +10 −103 pos/is4c/lib/apply_configurations.php
  42. +8 −6 pos/is4c/lib/authenticate.php
  43. +30 −215 pos/is4c/lib/conf.php
  44. +29 −0 pos/is4c/lib/initialize.php
  45. +103 −1 pos/is4c/lib/query.php
  46. 0 pos/is4c/log/is4c_errors
  47. +23 −1 pos/is4c/login.php
  48. +0 −120 pos/is4c/login2.php
  49. +0 −82 pos/is4c/login3.php
  50. +0 −27 pos/is4c/loginb.php
  51. +4 −3 pos/is4c/reload.php
  52. +5 −2 pos/is4c/session.php
  53. +81 −70 pos/is4c/upcscanned.php
  54. +1 −1 pos/is4c/variables.php
  55. +35 −26 pos/is4c/void.php
  56. +341 −0 pos/license/license.txt
View
3 .gitignore
@@ -0,0 +1,3 @@
+*.pyc
+pos/is4c/ini/ini.php
+*~
View
19 pos/backend/batch/batch.css
@@ -1,3 +1,7 @@
+H1 {
+ margin-left: 2px;
+}
+
LABEL[for="addBatch_name"],
LABEL[for="editBatch_name"],
LABEL[for="searchBatch_upc"],
@@ -21,4 +25,17 @@ INPUT[name="addProduct_price"] {
height: 2em;
line-height: 2em;
vertical-align: baseline;
-}
+}
+
+FORM[name="listBatch"] TABLE,
+FORM[name="searchResults"] TABLE,
+FORM[name="listProduct"] TABLE {
+ margin-left: auto;
+ margin-right: auto;
+}
+
+FORM[name="listBatch"] TD,
+FORM[name="searchResults"] TD,
+FORM[name="listProduct"] TD {
+ padding: 0px 3px 0px 3px;
+}
View
94 pos/backend/batch/edit.php
@@ -8,8 +8,6 @@
* All in all, some things to do
*/
- // Test update, #2
-
// Back to the main batch page if no id set
if (!isset($_REQUEST['id'])) {
header ("Location: /batch");
@@ -38,32 +36,30 @@
$search_batchProducts_result=search_batchProducts(&$backoffice, $_REQUEST['id'], $_REQUEST['searchProduct_upc']);
if ($search_batchProducts_result) {
if (mysql_num_rows($search_batchProducts_result)==1) {
- print_r('one result');
- // Populate Add/Modify/Remove form
+ $search_resultMatched=$search_batchProducts_result;
} else if (mysql_num_rows($search_batchProducts_result)>1) {
- print_r('more than one result');
- // Display a list of matches
+ $search_result=$search_batchProducts_result;
} else {
- print_r('no results');
// Search products table for UPC
$search_allProducts_result=search_allProducts(&$backoffice, $_REQUEST['searchProduct_upc']);
if ($search_allProducts_result) {
if (mysql_num_rows($search_allProducts_result)==1) {
- print_r('one new result');
- // Populate Add/Modify/Remove form
+ $search_resultMatched=$search_allProducts_result;
} else if (mysql_num_rows($search_allProducts_result)>1) {
- print_r('more than new one result');
- // Display a list of matches
+ $search_result=$search_allProducts_result;
} else {
- print_r('no new results');
+ array_push($backoffice['status'], 'No results found for '.$_REQUEST['searchProduct_upc']);
}
} else {
- // Already covered
+ array_push($backoffice['status'], 'batchProducts_result==0, allProducts_result error ('.mysql_error($link).')');
}
}
} else {
- // Already covered
+ // TODO - Maybe still try to search products table?
+ array_push($backoffice['status'], 'batchProducts_result error('.mysql_error($link).')');
}
+ } else if (isset($_REQUEST['a']) && $_REQUEST['a']=='addProduct') {
+ addProduct(&$backoffice);
}
require_once($_SERVER["DOCUMENT_ROOT"].'/lib/materialized_batch.php');
@@ -116,7 +112,7 @@
</form>
</div>
<div>
- <form action="./edit.php" method="post" name="searchProduct">
+ <form action="./edit.php" method="get" name="searchProduct">
<fieldset>
<legend>Search</legend>
<input name="a" type="hidden" value="searchProduct"/>
@@ -126,7 +122,44 @@
<input type="submit" value="Search"/>
</fieldset>
</form>
- </div>
+ </div>';
+ if (isset($search_result)) {
+ $html.='
+ <div>
+ <form action="./edit.php" method="post" name="searchResults" onsubmit="return false;">
+ <fieldset>
+ <legend>Search Results</legend>
+ <table>
+ <thead>
+ <tr>
+ <th>UPC</th>
+ <th>Description</th>
+ <th>Normal Price</th>
+ <th>Sale Price</th>
+ </tr>
+ </thead>
+ <tfoot/>
+ <tbody>';
+ while ($row=mysql_fetch_array($search_result)) {
+ $html.='
+ <tr>
+ <td><a href="edit.php?a=searchProduct&id='.$_REQUEST['id'].'&searchProduct_upc='.$row['upc'].'">'.$row['upc'].'</a></td>
+ <td>'.$row['description'].'</td>
+ <td class="textAlignRight">'.$row['normal_price'].'</td>
+ <td class="textAlignRight">'.(isset($row['price'])?$row['price']:'').'</td>
+ </tr>';
+ }
+ $html.='
+ </tbody>
+ </table>
+ </fieldset>
+ </form>
+ </div>';
+ }
+
+ if (isset($search_resultMatched)) {
+ $row=mysql_fetch_array($search_resultMatched);
+ $html.='
<div>
<form action="./edit.php" method="post" name="addProduct">
<fieldset>
@@ -135,21 +168,24 @@
<input name="a" type="hidden" value="addProduct"/>
<input name="id" type="hidden" value="'.$_REQUEST['id'].'"/>
<label for="addProduct_upc">UPC</label>
- <input id="addProduct_upc" name="addProduct_upc" readonly type="text"/>
+ <input id="addProduct_upc" name="addProduct_upc" readonly type="text" value="'.$row['upc'].'"/>
<label for="addProduct_description">Description</label>
- <input id="addProduct_description" name="addProduct_description" readonly type="text"/>
+ <input id="addProduct_description" name="addProduct_description" readonly type="text" value="'.$row['description'].'"/>
<label for="addProduct_normal_price">Normal Price</label>
- <input id="addProduct_normal_price" name="addProduct_normal_price" readonly type="text"/>
+ <input id="addProduct_normal_price" name="addProduct_normal_price" readonly type="text" value="'.$row['normal_price'].'"/>
<label for="addProduct_price"><span class="accesskey">P</span>rice</label>
- <input accesskey="p" id="addProduct_price" name="addProduct_price" type="number"/>
+ <input accesskey="p" id="addProduct_price" name="addProduct_price" type="number" value="'.(isset($row['price'])?$row['price']:$row['normal_price']).'"/>
</div>
<div class="edit_row">
<input type="submit" value="Update"/>
- <input type="button" value="Remove"/>
+ <input disabled type="button" value="Remove"/>
</div>
</fieldset>
</form>
- </div>
+ </div>';
+ }
+
+ $html.='
<div>
<form action="./edit.php" method="post" name="listProduct">
<fieldset>
@@ -161,26 +197,24 @@
<tr>
<th>UPC</th>
<th>Description</th>
- <th>Retail</th>
- <th>Sales Retail</th>
- <th>Action</th>
+ <th>Normal Price</th>
+ <th>Sale Price</th>
</tr>
</thead>
<tfoot>
<tr>
- <td colspan=5><input type="button" value="print"/></td>
+ <td class="textAlignRight" colspan=5><input disabled type="button" value="print"/></td>
</tr>
</tfoot>
<tbody>';
while ($row=mysql_fetch_array($batchProducts_result)) {
$html.='
<tr>
- <td>'.$row['upc'].'</td>
+ <td><a href="edit.php?a=searchProduct&id='.$_REQUEST['id'].'&searchProduct_upc='.$row['upc'].'">'.$row['upc'].'</a></td>
<td>'.$row['description'].'</td>
- <td>'.$row['normal_price'].'</td>
- <td>'.$row['price'].'</td>
- <td>X</td>
+ <td class="textAlignRight">'.$row['normal_price'].'</td>
+ <td class="textAlignRight">'.$row['price'].'</td>
</tr>';
}
$html.='
View
38 pos/backend/batch/index.php
@@ -33,6 +33,8 @@
if (isset($_REQUEST['a']) && $_REQUEST['a']=='addBatch') {
addBatch(&$backoffice);
+ } else if (isset($_REQUEST['a']) && $_REQUEST['a']=='listBatch') {
+ listBatch(&$backoffice);
}
// This needs to happen after any addBatch, deleteBatch, or editBatch request
@@ -79,7 +81,9 @@
<input type="submit" value="Add"/>
</fieldset>
</form>
- </div>
+ </div>';
+ /*
+ * Going to leave searching all batches for the future
<div>
<form action="./" method="get" name="searchBatch">
<fieldset>
@@ -90,11 +94,15 @@
<input type="submit" value="Search"/>
</fieldset>
</form>
- </div>
+ </div> */
+ $html.='
<div>
<form action="./" method="post" name="listBatch">
<fieldset>
<legend>List of Active Batches</legend>
+ <input name="a" type="hidden" value="listBatch"/>';
+ if ($batchList_result && mysql_num_rows($batchList_result)>0) {
+ $html.='
<table>
<thead>
<tr>
@@ -107,25 +115,33 @@
<th>Delete</th>
</tr>
</thead>
- <tfoot/>
+ <tfoot>
+ <tr>
+ <td class="textAlignRight" colspan=7"><input type="submit"/></td>
+ </tr>
+ </tfoot>
<tbody>';
- // TODO - This throws a E_WARNING when there are no batches...
- while ($row=mysql_fetch_array($batchList_result)) {
- $html.='
+ while ($row=mysql_fetch_array($batchList_result)) {
+ $html.='
<tr>
<td><a href="./edit.php?id='.$row['id'].'">'.$row['batchHeaders name'].'</a></td>
<td>'.$row['batchMerges modified'].'</td>
<td>'.$row['batchTypes name'].'</td>
<td>'.strftime("%F", strtotime($row['start'])).'</td>
<td>'.strftime("%F", strtotime($row['end'])).'</td>
- <td><input type="checkbox"/></td>
- <td><input type="checkbox"/></td>
+ <td class="textAlignCenter"><input name="listBatch_mergeFlag[]" type="checkbox" value="'.$row['id'].'" /></td>
+ <td class="textAlignCenter"><input name="listBatch_deleteFlag[]" type="checkbox"value="'.$row['id'].'" /></td>
</tr>';
+ }
+ $html.='
+ </tbody>
+ </table>';
+ } else {
+ $html.='
+ <h2>No batches found</h2>';
}
$html.='
- </tbody>
- </table>
- </fieldset>
+ </fieldset>
</form>
</div>
<div id="page_panel_statuses">';
View
62 pos/backend/batch/sql.php
@@ -3,7 +3,7 @@ function addBatch($backoffice) {
// TODO - Check name, start, end, type against expected values
$link=mysql_connect($_SESSION["mServer"], $_SESSION["mUser"], $_SESSION["mPass"]);
if ($link) {
- $query='INSERT INTO `is4c_op`.`batchHeaders` (`name`,`start`,`end`,`batchType_id`,`modified`,`whomodified`) VALUES (\''.$_REQUEST['addBatch_name'].'\', \''.$_REQUEST['addBatch_start'].'\', \''.$_REQUEST['addBatch_end'].'\', '.$_REQUEST['addBatch_type'].', NOW(), \''.$_SERVER['REMOTE_ADDR'].'\')';
+ $query='INSERT INTO `is4c_op`.`batchHeaders` (`name`,`start`,`end`,`batchType_id`,`modified`,`whomodified`,`active`) VALUES (\''.$_REQUEST['addBatch_name'].'\', \''.$_REQUEST['addBatch_start'].'\', \''.$_REQUEST['addBatch_end'].'\', '.$_REQUEST['addBatch_type'].', NOW(), \''.$_SERVER['REMOTE_ADDR'].'\', 1)';
$result=mysql_query($query, $link);
if ($result) {
$batchHeader_id=mysql_insert_id($link);
@@ -87,4 +87,64 @@ function search_allProducts($backoffice, $upc) {
array_push($backoffice['status'], 'Error connecting to MySQL');
}
}
+
+ function addProduct($backoffice) {
+ // TODO - Validate data
+ $link=mysql_connect($_SESSION["mServer"], $_SESSION["mUser"], $_SESSION["mPass"]);
+ if ($link) {
+ $query='INSERT INTO `is4c_op`.`batchProducts` (`batchHeader_id`,`upc`,`price`,`modified`,`whomodified`) VALUES ('.$_REQUEST['id'].', \''.$_REQUEST['addProduct_upc'].'\', '.$_REQUEST['addProduct_price'].', NOW(), \''.$_SERVER['REMOTE_ADDR'].'\') ON DUPLICATE KEY UPDATE `price`='.$_REQUEST['addProduct_price'].', `modified`=NOW(), `whomodified`=\''.$_SERVER['REMOTE_ADDR'].'\'';
+ $result=mysql_query($query, $link);
+ if ($result) {
+ array_push($backoffice['status'], 'Added/modified product');
+ } else {
+ array_push($backoffice['status'], 'Error with MySQL query: '.mysql_error($link));
+ }
+ } else {
+ array_push($backoffice['status'], 'Error connecting to MySQL');
+ }
+ }
+
+ function listBatch($backoffice) {
+ // For now, just mark a batchHeader as active=0 to delete it
+ $link=mysql_connect($_SESSION["mServer"], $_SESSION["mUser"], $_SESSION["mPass"]);
+ if ($link) {
+ if (isset($_REQUEST['listBatch_deleteFlag'])) {
+ foreach ($_REQUEST['listBatch_deleteFlag'] as $key=>$id) {
+ $query='UPDATE `is4c_op`.`batchHeaders` SET `active`=0 WHERE `id`='.$id.' LIMIT 1;';
+ $result=mysql_query($query, $link);
+ if ($result) {
+ array_push($backoffice['status'], 'Deleted batchHeader #'.$id);
+ } else {
+ array_push($backoffice['status'], 'Error with MySQL query: '.mysql_error($link));
+ }
+ }
+ }
+
+ if (isset($_REQUEST['listBatch_mergeFlag'])) {
+ foreach ($_REQUEST['listBatch_mergeFlag'] as $key=>$id) {
+ $query='UPDATE `is4c_op`.`products`, `is4c_op`.`batchProducts`, `is4c_op`.`batchHeaders` SET
+ `products`.`special_price`=`batchProducts`.`price`,
+ `products`.`specialpricemethod`=`batchProducts`.`pricemethod`,
+ /* `products`.`specialgroupprice`=`batchProducts`.`groupprice`,
+ `products`.`specialquantity`=`batchProducts`.`quantity`, */
+ `products`.`start_date`=`batchHeaders`.`start`,
+ `products`.`end_date`=`batchHeaders`.`end`,
+ `products`.`modified`=NOW()
+ WHERE 1=1
+ AND `products`.`upc`=`batchProducts`.`upc`
+ AND `batchProducts`.`batchHeader_id`=`batchHeaders`.`id`
+ AND `batchHeaders`.`id`='.$id.'';
+ $result=mysql_query($query, $link);
+ if ($result) {
+ // TODO - Add information to merge log!!!
+ array_push($backoffice['status'], 'Merged batch #'.$id.', updated '.mysql_affected_rows($link).' products');
+ } else {
+ array_push($backoffice['status'], 'Error with MySQL query: '.mysql_error($link));
+ }
+ }
+ }
+ } else {
+ array_push($backoffice['status'], 'Error connecting to MySQL');
+ }
+ }
?>
View
2 pos/backend/item/form.php
@@ -94,7 +94,7 @@ function form($backoffice) {
<fieldset>
<legend>Actions</legend>
<input disabled type="button" value="Clone"/>
- <input type="button" value="Delete"/>
+ <input disabled type="button" value="Delete"/>
<input disabled type="button" value="Reset"/>
<input type="submit" value="Save"/>
</fieldset>
View
5 pos/backend/item/item.css
@@ -86,6 +86,11 @@ LABEL[for="edit_inuse"] {
overflow-y: scroll;
}
+#results_similar_products {
+ margin-left: auto;
+ margin-right: auto;
+}
+
INPUT[name="edit_upc"] {
border: 0px;
}
View
BIN pos/backend/label/Screenshot.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
31 pos/backend/label/index.php
@@ -0,0 +1,31 @@
+<?php
+ require_once($_SERVER["DOCUMENT_ROOT"]."/define.conf");
+
+ require_once($_SERVER["DOCUMENT_ROOT"].'/src/htmlparts.php');
+
+ $html='<!DOCTYPE HTML>
+<html>
+ <head>';
+
+ $html.=head();
+
+ $html.='
+ <title>IS4C - Labels</title>
+ </head>
+ <body>';
+
+ $html.=body();
+
+ $html.='
+ <div id="page_panel">
+ <img src="Screenshot.png" alt="Screenshot of Wedge Label Maker"/>
+ </div>';
+
+ $html.=foot();
+
+ $html.='
+ </body>
+</html>';
+
+ print_r($html);
+?>
View
5 pos/backend/lib/materialized_batch.php
@@ -14,7 +14,8 @@ function get_batchList($backoffice) {
`batchMerges`.`modified` AS \'batchMerges modified\'
FROM `is4c_op`.`batchHeaders`
JOIN `is4c_op`.`batchTypes` ON `batchHeaders`.`batchType_id`=`batchTypes`.`id`
- LEFT JOIN `is4c_log`.`batchMerges` ON `batchHeaders`.`id`=`batchMerges`.`batchHeader_id`
+ LEFT JOIN `is4c_log`.`batchMerges` ON `batchHeaders`.`id`=`batchMerges`.`batchHeader_id`
+ WHERE `batchHeaders`.`active`=1
ORDER BY `id` DESC';
$result=mysql_query($query, $link);
if ($result) {
@@ -45,7 +46,7 @@ function get_batchInfo($backoffice, $id) {
FROM `is4c_op`.`batchHeaders`
JOIN `is4c_op`.`batchTypes` ON `batchHeaders`.`batchType_id`=`batchTypes`.`id`
LEFT JOIN `is4c_log`.`batchMerges` ON `batchHeaders`.`id`=`batchMerges`.`batchHeader_id`
- WHERE `batchHeaders`.`id`='.$id.'
+ WHERE `batchHeaders`.`id`='.$id.' AND `batchHeaders`.`active`=1
LIMIT 1';
$result=mysql_query($query, $link);
if ($result) {
View
2 pos/backend/lib/table_batchHeaders.php
@@ -5,7 +5,7 @@ function get_batchHeaders($backoffice) {
$link=mysql_connect($_SESSION["mServer"], $_SESSION["mUser"], $_SESSION["mPass"]);
if ($link) {
// TODO - Order by freshness?
- $query='SELECT `id`, `name`, `start`, `end`, `batchType_id`, `modified`, `whomodified` FROM `is4c_op`.`batchHeaders` ORDER BY `id` DESC';
+ $query='SELECT `id`, `name`, `start`, `end`, `batchType_id`, `modified`, `whomodified` FROM `is4c_op`.`batchHeaders` WHERE `active`=1 ORDER BY `id` DESC';
$result=mysql_query($query, $link);
if ($result) {
if (mysql_num_rows($result)==0) {
View
1 pos/backend/src/htmlparts.php
@@ -11,6 +11,7 @@ function body() {
<ul>
<li><a href="/item">Item Maintenance</a></li>
<li><a href="/batch">Sale Batches</a></li>
+ <li><a href="/label">Label Maker</a></li>
<li>Reports</li>
<li>Dayend Balancing</li>
<li><a href="/sync">Synchronization</a></li>
View
3 pos/backend/src/screen.css
@@ -76,6 +76,9 @@ UL {
color: #00297A;
}
+.textAlignCenter {
+ text-align: center;
+}
.textAlignRight {
text-align: right;
}
View
3 pos/backend/sync/synchronizeproducts.php
@@ -6,6 +6,7 @@ function make_synchronization_query() {
if ($link) {
$query='SELECT `synchronizationLog`.`datetime` FROM `is4c_log`.`synchronizationLog` WHERE `synchronizationLog`.`name`=\'products\' 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);
@@ -14,7 +15,7 @@ function make_synchronization_query() {
$result=mysql_query($query, $link);
if ($result) {
if (mysql_num_rows($result)>0) {
- $query='INSERT INTO `is4c_op`.`products` (`upc`, `description`, `normal_price`, `pricemethod`, `groupprice`, `quantity`, `special_price`, `specialpricemethod`, `specialgroupprice`, `specialquantity`, `start_date`, `end_date`, `department`, `size`, `tax`, `foodstamp`, `scale`, `mixmatchcode`, `modified`, `advertised`, `tareweight`, `discount`, `discounttype`, `unitofmeasure`, `wicable`, `qttyEnforced`, `inUse`, `subdept`, `deposit`, `id`) VALUES ';
+ $query='INSERT INTO `opdata`.`products` (`upc`, `description`, `normal_price`, `pricemethod`, `groupprice`, `quantity`, `special_price`, `specialpricemethod`, `specialgroupprice`, `specialquantity`, `start_date`, `end_date`, `department`, `size`, `tax`, `foodstamp`, `scale`, `mixmatchcode`, `modified`, `advertised`, `tareweight`, `discount`, `discounttype`, `unitofmeasure`, `wicable`, `qttyEnforced`, `inUse`, `subdept`, `deposit`, `id`) VALUES ';
while ($row=mysql_fetch_array($result)) {
$query.=' ( '.$row['upc'].', \''.$row['description'].'\', '.$row['normal_price'].', '.$row['pricemethod'].', '.$row['groupprice'].', '.$row['quantity'].', '.$row['special_price'].', '.$row['specialpricemethod'].', '.$row['specialgroupprice'].', '.$row['specialquantity'].', \''.$row['start_date'].'\', \''.$row['end_date'].'\', '.$row['department'].', \''.$row['size'].'\', '.$row['tax'].', '.$row['foodstamp'].', '.$row['scale'].', \''.$row['mixmatchcode'].'\', \''.$row['modified'].'\', '.$row['advertised'].', '.$row['tareweight'].', '.$row['discount'].', '.$row['discounttype'].', \''.$row['unitofmeasure'].'\', '.$row['wicable'].', '.$row['qttyEnforced'].', '.$row['inUse'].', '.$row['subdept'].', '.$row['deposit'].', '.$row['id'].' ),';
}
View
5 pos/db_connect
@@ -0,0 +1,5 @@
+database: mysql
+server: 127.0.0.1
+schemas: opdata
+username: is4clane
+password: is4clane
View
BIN pos/documentation/Database Administrator Files/Server_is4c_op_database_layout.pdf
Binary file not shown.
View
4 pos/installation/get-lane.sh
@@ -3,8 +3,8 @@
# TODO - Oh, a lot. Use user-defined variables. Use system-defined variable. Set environments.
cd /tmp
-wget http://is4c.coop/download/IS4C.tgz
-tar -xzf /tmp/IS4C.tgz
+wget http://is4c.coop/download/IS4C.2.2_dev.tgz
+tar -xzf /tmp/IS4C.2.2_dev.tgz
cp -r /tmp/IS4C/pos /
/pos/installation/ubuntu/install-lane.sh
View
6 pos/installation/get-server.sh
@@ -3,10 +3,10 @@
# TODO - Oh, a lot. Use user-defined variables. Use system-defined variable. Set environments.
cd /tmp
-wget http://is4c.coop/download/IS4C.tgz
-tar -xzf /tmp/IS4C.tgz
+wget http://is4c.coop/download/IS4C.2.2_dev.tgz
+tar -xzf /tmp/IS4C.2.2_dev.tgz
cp -r /tmp/IS4C/pos /
/pos/installation/ubuntu/install-server.sh
-cat /tmp/IS4C/README
+cat /tmp/IS4C/README
View
4 pos/installation/mysql/is4c_op/data/batchHeaders.insert
@@ -1,3 +1,3 @@
USE `is4c_op`;
-INSERT INTO `is4c_op`.`batchHeaders` (`id`, `name`, `start`, `end`, `batchType_id`, `modified`, `whomodified`) VALUES
-(1, 'Sample Batch', '2010-08-01 00:00:00', '2010-08-31 00:00:00', 1, '2010-04-12 13:22:47', '10.10.10.57');
+INSERT INTO `is4c_op`.`batchHeaders` (`id`, `name`, `start`, `end`, `batchType_id`, `modified`, `whomodified`, `active`) VALUES
+(1, 'Sample Batch', '2010-08-01 00:00:00', '2010-08-31 00:00:00', 1, '2010-04-12 13:22:47', '10.10.10.57', 1);
View
6 pos/installation/mysql/is4c_op/tables/batchHeaders.table
@@ -8,5 +8,7 @@ CREATE TABLE `is4c_op`.`batchHeaders` (
`batchType_id` SMALLINT UNSIGNED NOT NULL ,
`modified` DATETIME NOT NULL ,
`whomodified` VARCHAR( 50 ) NULL ,
- PRIMARY KEY ( `id` )
-) ENGINE = MYISAM ;
+ `active` TINYINT UNSIGNED NOT NULL ,
+ PRIMARY KEY ( `id` ) ,
+ INDEX ( `active` )
+) ENGINE = MYISAM ;
View
3 pos/installation/mysql/is4c_op/tables/batchProducts.table
@@ -9,6 +9,7 @@ CREATE TABLE `is4c_op`.`batchProducts` (
`quantity` SMALLINT NULL ,
`modified` DATETIME NOT NULL ,
`whomodified` VARCHAR( 50 ) NULL ,
+ PRIMARY KEY (`batchHeader_id`, `upc`),
INDEX (`batchHeader_id`),
INDEX (`upc`)
-) ENGINE = MYISAM ;
+) ENGINE = MYISAM ;
View
2 ...n/mysql/is4c_op/data/configuration.insert → ...on/mysql/opdata/data/configuration.insert
@@ -1,4 +1,4 @@
-use is4c_op;
+use opdata;
INSERT INTO configuration
VALUES
View
10 ...l/is4c_op/data/configurationGroups.insert → ...ql/opdata/data/configurationGroups.insert
@@ -1,12 +1,8 @@
-use is4c_op;
+use opdata;
INSERT INTO configurationGroups
VALUES
(
- 0,
- 'setup'
- ),
- (
1,
'General'
),
@@ -39,4 +35,8 @@ INSERT INTO configurationGroups
'Miscellaneous Settings'
);
+UPDATE configurationGroups
+ SET group_id = 0
+ WHERE group_name = 'setup';
+
UNLOCK TABLES;
View
12 .../mysql/is4c_op/tables/configuration.table → ...n/mysql/opdata/tables/configuration.table
@@ -1,11 +1,11 @@
-use is4c_op;
-
-DROP TABLE IF EXISTS `configuration`;
+use opdata;
+
+DROP TABLE IF EXISTS `configuration`;
CREATE TABLE `configuration` (
`conf_id` smallint(6) NOT NULL AUTO_INCREMENT COMMENT 'Primary key',
`key` varchar(20) NOT NULL COMMENT 'The configuration key',
- `value` varchar(20) NOT NULL COMMENT 'The configuration value',
+ `value` varchar(60) NOT NULL COMMENT 'The configuration value',
`type` varchar(20) NOT NULL COMMENT 'The type of configuration; text, flag',
`group_id` smallint(6) NOT NULL COMMENT 'The group this configuration item belongs to. A foreign key to the configurationGroups table.',
- KEY `conf_id` (`conf_id`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1;
+ KEY `conf_id` (`conf_id`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1;
View
2 .../is4c_op/tables/configurationGroups.table → ...l/opdata/tables/configurationGroups.table
@@ -1,4 +1,4 @@
-use is4c_op;
+use opdata;
DROP TABLE IF EXISTS `configurationGroups`;
CREATE TABLE `configurationGroups` (
View
10 pos/installation/mysql/opdata/tables/employees.table
@@ -3,13 +3,13 @@ use opdata;
DROP TABLE IF EXISTS `employees`;
CREATE TABLE `employees` (
`emp_no` smallint(6) default NULL,
- `CashierPassword` int(11) default NULL COMMENT 'The password the user will use to log into the cash register.',
- `AdminPassword` int(11) default NULL COMMENT 'Users with an Admin password can use it to approve some administrative tasks.',
+ `CashierPassword` int(11) default NULL comment 'The password the user will use to log into the cash register.',
+ `AdminPassword` int(11) default NULL comment 'Users with an Admin password can use it to approve some administrative tasks.',
`FirstName` varchar(255) default NULL,
`LastName` varchar(255) default NULL,
`JobTitle` varchar(255) default NULL,
- `EmpActive` tinyint(4) default NULL COMMENT '1 if the employee is active. 0 if they are inactive.',
- `frontendsecurity` smallint(6) default NULL COMMENT 'Defines the front-end security available to the user.',
- `backendsecurity` smallint(6) default NULL COMMENT 'Defines the front-end security available to the user.',
+ `EmpActive` tinyint(4) default NULL comment '1 if the employee is active. 0 if they are inactive.',
+ `frontendsecurity` smallint(6) default NULL comment 'Defines the front-end security available to the user.',
+ `backendsecurity` smallint(6) default NULL comment 'Defines the front-end security available to the user.',
KEY `emp_no` (`emp_no`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
View
1 pos/installation/mysql/script/create_lane_db.sql
@@ -1,3 +1,4 @@
CREATE DATABASE IF NOT EXISTS `is4c_op`;
+CREATE DATABASE IF NOT EXISTS `is4c_log`;
CREATE DATABASE IF NOT EXISTS `opdata`;
CREATE DATABASE IF NOT EXISTS `translog`;
View
13 pos/installation/ubuntu/install-lane.sh
@@ -1,6 +1,15 @@
-#!/bin/sh
+#!/bin/bash
-/pos/installation/ubuntu/mysql_lane.sh
+aptitude update -y
+aptitude safe-upgrade -y
+echo -e "Enter the password for the root user in MySQL: \c"
+read -s ROOT_PASSWORD
+echo "mysql-server mysql-server/root_password select $ROOT_PASSWORD" | debconf-set-selections
+echo "mysql-server mysql-server/root_password_again select $ROOT_PASSWORD" | debconf-set-selections
+echo "python-mysqldb mysql-server/root_password select $ROOT_PASSWORD" | debconf-set-selections
+echo "python-mysqldb mysql-server/root_password_again select $ROOT_PASSWORD" | debconf-set-selections
+aptitude install -y mysql-server apache2 php5 libapache2-mod-php5 python-mysqldb php5-mysql
+python /pos/installation/install_lane.py
/pos/installation/ubuntu/ssd_server.sh
View
16 pos/installation/ubuntu/install-server.sh
@@ -1,6 +1,16 @@
-#!/bin/sh
+#!/bin/bash
-/pos/installation/ubuntu/mysql_server.sh
+aptitude update -y
+aptitude safe-upgrade -y
+echo -e "Enter the password for the root user in MySQL: \c"
+read -s ROOT_PASSWORD
+echo "mysql-server mysql-server/root_password select $ROOT_PASSWORD" | debconf-set-selections
+echo "mysql-server mysql-server/root_password_again select $ROOT_PASSWORD" | debconf-set-selections
+echo "python-mysqldb mysql-server/root_password select $ROOT_PASSWORD" | debconf-set-selections
+echo "python-mysqldb mysql-server/root_password_again select $ROOT_PASSWORD" | debconf-set-selections
+aptitude install -y mysql-server apache2 php5 libapache2-mod-php5 python-mysqldb php5-mysql
+
+python /pos/installation/install_server.py
/pos/installation/ubuntu/php_server.pl
-/pos/installation/ubuntu/apache_server.pl
+/pos/installation/ubuntu/apache_server.pl
View
90 pos/installation/ubuntu/mysql_lane.sh
@@ -1,90 +0,0 @@
-#!/bin/sh
-
-# TODO - Why not import opdata data
-
-# TODO - Better warning about needing to be root
-CMD="mysql --defaults-file=/etc/mysql/debian.cnf"
-
-cd /pos/installation/mysql/script
-
-${CMD} < create_lane_db.sql
-
-cd /pos/installation/mysql/translog/tables
-
-${CMD} < activities.table
-${CMD} < activitylog.table
-${CMD} < activitytemplog.table
-${CMD} < alog.table
-${CMD} < dtransactions.table
-${CMD} < localtemptrans.table
-${CMD} < localtrans.table
-${CMD} < localtransarchive.table
-${CMD} < suspended.table
-
-cd /pos/installation/mysql/translog/views
-
-${CMD} < localtranstoday.viw
-${CMD} < suspendedtoday.viw
-${CMD} < suspendedlist.viw
-
-${CMD} < lttsummary.viw
-${CMD} < lttsubtotals.viw
-${CMD} < subtotals.viw
-
-${CMD} < ltt_receipt.viw
-${CMD} < receipt.viw
-
-${CMD} < rp_ltt_receipt.viw
-${CMD} < rp_receipt_header.viw
-${CMD} < rp_receipt.viw
-${CMD} < rp_list.viw
-
-${CMD} < screendisplay.viw
-
-${CMD} < memdiscountadd.viw
-${CMD} < memdiscountremove.viw
-${CMD} < staffdiscountadd.viw
-${CMD} < staffdiscountremove.viw
-
-${CMD} < memchargetotals.viw
-
-cd /pos/installation/mysql/opdata/tables
-
-${CMD} < chargecode.table
-${CMD} < couponcodes.table
-${CMD} < custdata.table
-${CMD} < departments.table
-${CMD} < employees.table
-${CMD} < globalvalues.table
-${CMD} < products.table
-${CMD} < promomsgs.table
-${CMD} < tenders.table
-
-cd /pos/installation/mysql/opdata/data
-
-${CMD} < couponcodes.insert
-${CMD} < custdata.insert
-${CMD} < departments.insert
-${CMD} < employees.insert
-${CMD} < globalvalues.insert
-${CMD} < products.insert
-${CMD} < tenders.insert
-
-cd /pos/installation/mysql/opdata/views
-
-${CMD} < chargecodeview.viw
-${CMD} < memchargebalance.viw
-
-cd /pos/installation/mysql/is4c_op/tables
-
-${CMD} < chargecode.table
-${CMD} < couponcodes.table
-${CMD} < custdata.table
-${CMD} < departments.table
-${CMD} < employees.table
-${CMD} < products.table
-${CMD} < tenders.table
-
-cd /pos/installation/mysql/script/
-
-${CMD} < create_lane_acct.sql
View
82 pos/installation/ubuntu/mysql_server.sh
@@ -1,82 +0,0 @@
-#!/bin/sh
-
-# TODO - Better warning about needing to be root
-CMD="mysql --defaults-file=/etc/mysql/debian.cnf"
-
-cd /pos/installation/mysql/script
-
-${CMD} < create_server_db.sql
-
-cd /pos/installation/mysql/is4c_log/tables/
-
-${CMD} < activitylog.table
-${CMD} < batchMerges.table
-${CMD} < dtransactions.table
-${CMD} < productsLog.table
-${CMD} < suspended.table
-${CMD} < synchronizationLog.table
-
-
-cd /pos/installation/mysql/is4c_log/views/
-
-${CMD} < dlog.viw
-${CMD} < tendertape.viw
-${CMD} < buspasstotals.viw
-${CMD} < cctenders.viw
-${CMD} < cctendertotal.viw
-${CMD} < cktenders.viw
-${CMD} < cktendertotal.viw
-${CMD} < dctenders.viw
-${CMD} < dctendertotal.viw
-${CMD} < memchargebalance.viw
-${CMD} < memchargetotals.viw
-${CMD} < mitenders.viw
-${CMD} < mitendertotal.viw
-${CMD} < suspendedtoday.viw
-
-cd /pos/installation/mysql/is4c_op/tables/
-
-${CMD} < batchHeaders.table
-${CMD} < batchProducts.table
-${CMD} < batchTypes.table
-${CMD} < chargecode.table
-${CMD} < couponcodes.table
-${CMD} < custdata.table
-${CMD} < departments.table
-${CMD} < employees.table
-${CMD} < error_log.table
-${CMD} < globalvalues.table
-${CMD} < likecodes.table
-${CMD} < meminfo.table
-${CMD} < memtype.table
-${CMD} < newMembers.table
-${CMD} < products.table
-${CMD} < prodUpdate.table
-${CMD} < promomsgs.table
-${CMD} < subdepts.table
-${CMD} < tenders.table
-${CMD} < UNFI.table
-${CMD} < upclike.table
-
-cd /pos/installation/mysql/is4c_op/views/
-
-${CMD} < chargecodeview.viw
-${CMD} < memchargebalance.viw
-${CMD} < subdeptIndex.viw
-${CMD} < volunteerDiscounts.viw
-
-cd /pos/installation/mysql/is4c_op/data/
-
-${CMD} < batchTypes.insert
-${CMD} < custdata.insert
-${CMD} < departments.insert
-${CMD} < employees.insert
-${CMD} < globalvalues.insert
-${CMD} < memtype.insert
-${CMD} < products.insert
-${CMD} < subdepts.insert
-${CMD} < tenders.insert
-
-cd /pos/installation/mysql/script/
-
-${CMD} < create_server_acct.sql
View
81 pos/installation/ubuntu/server-mysql.sh
@@ -1,81 +0,0 @@
-#!/bin/sh
-
-# TODO - Better warning about needing to be root
-CMD="mysql --defaults-file=/etc/mysql/debian.cnf"
-
-cd /pos/installation/mysql/script
-
-${CMD} < create_server_db.sql
-
-cd /pos/installation/mysql/is4c_log/tables/
-
-${CMD} < activitylog.table
-${CMD} < dtransactions.table
-${CMD} < productsLog.table
-${CMD} < suspended.table
-${CMD} < synchronizationLog.table
-
-
-cd /pos/installation/mysql/is4c_log/views/
-
-${CMD} < dlog.viw
-${CMD} < tendertape.viw
-${CMD} < buspasstotals.viw
-${CMD} < cctenders.viw
-${CMD} < cctendertotal.viw
-${CMD} < cktenders.viw
-${CMD} < cktendertotal.viw
-${CMD} < dctenders.viw
-${CMD} < dctendertotal.viw
-${CMD} < memchargebalance.viw
-${CMD} < memchargetotals.viw
-${CMD} < mitenders.viw
-${CMD} < mitendertotal.viw
-${CMD} < suspendedtoday.viw
-
-cd /pos/installation/mysql/is4c_op/tables/
-
-${CMD} < batches.table
-${CMD} < batchList.table
-${CMD} < chargecode.table
-${CMD} < couponcodes.table
-${CMD} < custdata.table
-${CMD} < departments.table
-${CMD} < employees.table
-${CMD} < error_log.table
-${CMD} < globalvalues.table
-${CMD} < likecodes.table
-${CMD} < meminfo.table
-${CMD} < memtype.table
-${CMD} < newMembers.table
-${CMD} < products.table
-${CMD} < prodUpdate.table
-${CMD} < promomsgs.table
-${CMD} < subdepts.table
-${CMD} < tenders.table
-${CMD} < UNFI.table
-${CMD} < upclike.table
-
-cd /pos/installation/mysql/is4c_op/views/
-
-${CMD} < chargecodeview.viw
-${CMD} < memchargebalance.viw
-${CMD} < subdeptIndex.viw
-${CMD} < volunteerDiscounts.viw
-
-cd /pos/installation/mysql/is4c_op/data/
-
-${CMD} < batches.insert
-${CMD} < batchList.insert
-${CMD} < custdata.insert
-${CMD} < departments.insert
-${CMD} < employees.insert
-${CMD} < globalvalues.insert
-${CMD} < memtype.insert
-${CMD} < products.insert
-${CMD} < subdepts.insert
-${CMD} < tenders.insert
-
-cd /pos/installation/mysql/script/
-
-${CMD} < create_server_acct.sql
View
2 pos/is4c/adminlist.php
@@ -54,7 +54,7 @@ function keyDown(e) {
<tr>
<td bgcolor='#004080' height='150' width='260' valign='center' align='center'>
<font face='arial' color='white'><b>administrative tasks</b></font>
- <from name='selectform' method='post' action='admintasks.php'>
+ <form name='selectform' method='post' action='admintasks.php'>
<select name='selectlist' onblur='document.selectform.selectlist.focus();' >
<option value=''></option>
<option value='SUSPEND'>1. Suspend Transaction</option>
View
15 pos/is4c/admintasks.php
@@ -59,10 +59,17 @@
}
}
elseif ($admin_task == "TR") {
- getsubtotals();
- if ($_SESSION["LastID"] != 0) {
- msgscreen("transaction in progress");
- }
+ getsubtotals();
+ if ($_SESSION["LastID"] != 0) {
+ msgscreen("transaction in progress");
+ }
+ elseif ($_SESSION["standalone"] != 0) {?>
+ <script type="text/javascript">
+ alert('Unable to contact server. Please make sure both the lane and server are connected to the network and the server is powered on. You can check connectivity to the server by looking for the gren connection icon next to the date and time field.');
+ </script>
+ <?php
+ gohome();
+ }
else {
tenderReport();
}
View
6 pos/is4c/authenticate3.php
@@ -20,9 +20,11 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*********************************************************************************/
-
-include("ini/ini.php");
+if (!function_exists("get_config_auto")) {
+ include_once("/pos/is4c/lib/conf.php");
+ apply_configurations();
+}
if(!function_exists("pconnect")) include("connect.php");
if(!function_exists("addactivity")) include("additem.php");
View
145 pos/is4c/configure.php
@@ -1,7 +1,7 @@
<?php
- include_once("connect.php");
- include_once("lib/query.php");
- include_once("lib/conf.php");
+ include_once("lib/conf.php");
+ include_once("connect.php");
+ include_once("lib/query.php");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
@@ -34,120 +34,37 @@
<tr>
<td>&nbsp;</td>
<td>
+ <p>
+ <?php
+ if (isset($_SESSION["config_saved"]) && $_SESSION["config_saved"]) {?>
+ Configurations Saved
+ <?php
+ $_SESSION["config_saved"] = FALSE;
+ }
+ ?>
+ </p>
<div class='config_forms'>
- <form action='/lib/apply_configurations.php' method='post'>
- <input type='submit' value='Save Changes' />
- <fieldset>
- <legend>General:</legend>
- <label for='general_os'>Operating System:</label>
- <input type='text' value="<?=get_os($contents)?>" name='general_os' id='general_os' size='6' /> <input type='button' value='Auto' onclick="$('#general_os').attr('value', '<?=strtolower(PHP_OS)?>'); return false" /><br />
- <label for='general_store'>Store Name:</label>
- <input type='text' value="<?=get_store_name($contents)?>" name='general_store' id='general_store' size='20' /><br />
- <label for='general_lane'>Lane Number:</label>
- <input type='text' value="<?=get_lane_number($contents)?>" name='general_lane' id='general_lane' size='1' />
- </fieldset>
- <fieldset>
- <legend>Server Database</legend>
- <label for='server_ip'>IP Address:</label>
- <input type='text' value="<?=get_server_ip($contents)?>" name='server_ip' id='server_ip' size='10' /><br />
- <label for='server_type'>Database Type:</label>
- <input type='text' value="<?=get_server_database_type($contents)?>" name='server_type' id='server_type' size='6' /><br />
- <label for='server_database'>Log Database:</label>
- <input type='text' value="<?=get_server_database($contents)?>" name='server_database' id='server_database' size='6' /><br />
- <label for='server_username'>User Name:</label>
- <input type='text' value="<?=get_server_username($contents)?>" name='server_username' id='server_username' size='6' /><br />
- <label for='server_password'>Password:</label>
- <input type='password' value="<?=get_server_password($contents)?>" name='server_password' id='server_password' size='6' /><br />
- </fieldset>
+ <form action='/lib/apply_configurations.php' method='post'>
+ <input type='submit' value='Save Changes'/>
+ <?php
+ $groups = get_configuration_groups();
+ foreach ($groups as $group) {
+ ?>
<fieldset>
- <legend>Local Database:</legend>
- <label for='local_ip'>IP Address:</label>
- <input type='text' value="<?=get_local_ip($contents)?>" name='local_ip' id='local_ip' size='10' /> <input type='button' value='Auto' onclick="$('#local_ip').attr('value', '<?=$_SERVER['SERVER_ADDR']?>'); return false" /><br />
- <label for='local_type'>Database Type:</label>
- <input type='text' value="<?=get_local_database_type($contents)?>" name='local_type' id='local_type' size='6' /><br />
- <label for='local_ops'>Operations Database:</label>
- <input type='text' value="<?=get_local_op_database($contents)?>" name='local_ops' id='local_ops' size='6' /><br />
- <label for='local_trans'>Transaction Database:</label>
- <input type='text' value="<?=get_local_trans_database($contents)?>" name='local_trans' id='local_trans' size='6' /><br />
- <label for='local_username'>User Name:</label>
- <input type='text' value="<?=get_local_username($contents)?>" name='local_username' id='local_username' size='6' /><br />
- <label for='local_password'>Password:</label>
- <input type='password' value="<?=get_local_password($contents)?>" name='local_password' id='local_password' size='6' /><br />
- </fieldset>
- <fieldset>
- <legend>Receipt and Printer Settings</legend>
- <label for='printer_active'>Printer Active:</label>
- <input type='checkbox' value='1' <?=get_print_flag($contents) != 0 ? "checked='checked'" : " " ?> name='printer_active' id='printer_active' /> <br />
- <label for='printer_port'>Printer Port:</label>
- <input type='text' value="<?=get_printer_port($contents)?>" name='printer_port' id='printer_port' /> <br />
- <label for='receipt_header_1'>Receipt Header Line 1:</label>
- <input type='text' value="<?=get_receipt_header_1($contents)?>" name='receipt_header_1' id='receipt_header_1' /> <br />
- <label for='receipt_header_2'>Receipt Header Line 2:</label>
- <input type='text' value="<?=get_receipt_header_2($contents)?>" name='receipt_header_2' id='receipt_header_2' /> <br />
- <label for='receipt_header_3'>Receipt Header Line 3:</label>
- <input type='text' value="<?=get_receipt_header_3($contents)?>" name='receipt_header_3' id='receipt_header_3' /> <br />
- <label for='receipt_footer_1'>Receipt Footer Line 1:</label>
- <input type='text' value="<?=get_receipt_footer_1($contents)?>" name='receipt_footer_1' id='receipt_footer_1' /> <br />
- <label for='receipt_footer_2'>Receipt Footer Line 2:</label>
- <input type='text' value="<?=get_receipt_footer_2($contents)?>" name='receipt_footer_2' id='receipt_footer_2' /> <br />
- <label for='receipt_footer_3'>Receipt Footer Line 3:</label>
- <input type='text' value="<?=get_receipt_footer_3($contents)?>" name='receipt_footer_3' id='receipt_footer_3' /> <br />
- <label for='receipt_footer_4'>Receipt Footer Line 4:</label>
- <input type='text' value="<?=get_receipt_footer_4($contents)?>" name='receipt_footer_4' id='receipt_footer_4' /> <br />
- </fieldset>
- <fieldset>
- <legend>Check and Charge Slip Settings</legend>
- <label for='check_endorse_1'>Check Endorse Line 1:</label>
- <input type='text' value="<?=get_check_endorse_1($contents)?>" name='check_endorse_1' id='check_endorse_1' /> <br />
- <label for='check_endorse_2'>Check Endorse Line 2:</label>
- <input type='text' value="<?=get_check_endorse_2($contents)?>" name='check_endorse_2' id='check_endorse_2' /> <br />
- <label for='check_endorse_3'>Check Endorse Line 3:</label>
- <input type='text' value="<?=get_check_endorse_3($contents)?>" name='check_endorse_3' id='check_endorse_3' /> <br />
- <label for='check_endorse_4'>Check Endorse Line 4:</label>
- <input type='text' value="<?=get_check_endorse_4($contents)?>" name='check_endorse_4' id='check_endorse_4' /> <br />
- <label for='charge_slip_1'>Charge Slip Line 1:</label>
- <input type='text' value="<?=get_charge_slip_1($contents)?>" name='charge_slip_1' id='charge_slip_1' /> <br />
- <label for='charge_slip_2'>Charge Slip Line 2:</label>
- <input type='text' value="<?=get_charge_slip_2($contents)?>" name='charge_slip_2' id='charge_slip_2' /> <br />
- </fieldset>
- <fieldset>
- <legend>Screen Message Settings</legend>
- <label for='welcome_message_1'>Welcome Message Line 1:</label>
- <input type='text' value="<?=get_welcome_message_1($contents)?>" name='welcome_message_1' id='welcome_message_1' /> <br />
- <label for='welcome_message_2'>Welcome Message Line 2:</label>
- <input type='text' value="<?=get_welcome_message_2($contents)?>" name='welcome_message_2' id='welcome_message_2' /> <br />
- <label for='welcome_message_3'>Welcome Message Line 3:</label>
- <input type='text' value="<?=get_welcome_message_3($contents)?>" name='welcome_message_3' id='welcome_message_3' /> <br />
- <label for='training_message_1'>Training Message Line 1:</label>
- <input type='text' value="<?=get_training_message_1($contents)?>" name='training_message_1' id='training_message_1' /> <br />
- <label for='training_message_2'>Training Message Line 2:</label>
- <input type='text' value="<?=get_training_message_2($contents)?>" name='training_message_2' id='training_message_2' /> <br />
- <label for='farewell_message_1'>Farewell Message Line 1:</label>
- <input type='text' value="<?=get_farewell_message_1($contents)?>" name='farewell_message_1' id='farewell_message_1' /> <br />
- <label for='farewell_message_2'>Farewell Message Line 2:</label>
- <input type='text' value="<?=get_farewell_message_2($contents)?>" name='farewell_message_2' id='farewell_message_2' /> <br />
- <label for='farewell_message_3'>Farewell Message Line 3:</label>
- <input type='text' value="<?=get_farewell_message_3($contents)?>" name='farewell_message_3' id='farewell_message_3' /> <br />
- <label for='alert_bar'>Alert Bar Message:</label>
- <input type='text' value="<?=get_alert_bar($contents)?>" name='alert_bar' id='alert_bar' /> <br />
- </fieldset>
- <fieldset>
- <legend>Credit Card Transaction Settings</legend>
- <label for='credit_card_flag'>Process Credit Card Transactions:</label>
- <input type='checkbox' value='1' <?=get_credit_card_active($contents) != 0 ? "checked='checked'" : " " ?> name='credit_card_flag' id='credit_card_flag' /> <br />
- <label for='credit_card_server'>Credit Card Server:</label>
- <input type='text' value="<?=get_credit_card_server($contents)?>" name='credit_card_server' id='credit_card_server' /> <br />
- <label for='credit_card_share'>Credit Card Share:</label>
- <input type='text' value="<?=get_credit_card_share($contents)?>" name='credit_card_share' id='credit_card_share' /><br />
- </fieldset>
- <fieldset>
- <legend>Miscellaneous Settings</legend>
- <label for='screen_lock_flag'>Lock screen after inactivity:</label>
- <input type='checkbox' value='1' <?=get_screen_lock($contents) != 0 ? "checked='checked'" : " " ?> name='screen_lock_flag' id='screen_lock_flag' /> <br />
- <label for='logout_time'>Logout time (ms):</label>
- <input type='text' value="<?=get_logout_time($contents)?>" name='logout_time' id='logout_time' />
+
+ <legend><?=$group["group_name"]?></legend>
+ <?php
+ $configs = get_configuration_settings($group["group_id"]);
+ foreach ($configs as $config) {
+ ?>
+ <label for='<?=$config["key"]?>'><?=$config["key"]?>:</label>
+ <input type='<?=$config["type"]=="flag"?'checkbox':'text'?>' <?=$config["type"]=="flag"&&$config["value"]==1?'checked=\'checked\'':''?> value='<?=$config["type"]=="flag"?1:$config["value"]?>' name='<?=$config["key"]?>' id='<?=$config["key"]?>' /> <?=get_config_auto($config["key"])?> <br />
+ <?php } ?>
+
</fieldset>
- <input type='submit' value='Save Changes' />
+ <?php
+ }
+ ?>
</form>
</div>
</td>
View
31 pos/is4c/connect.php
@@ -20,10 +20,20 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*********************************************************************************/
+if (!function_exists("get_config_auto")) {
+ include_once("lib/conf.php");
+ # apply_configurations();
+}
-if (!function_exists("setglobalflags")) include("loadconfig.php");
-if (!function_exists("pinghost")) include("lib.php");
-if (!function_exists("wmdiscount")) include("prehkeys.php");
+if (!function_exists("setglobalflags")) {
+ include("loadconfig.php");
+}
+if (!function_exists("pinghost")) {
+ include("lib.php");
+}
+if (!function_exists("wmdiscount")) {
+ include("prehkeys.php");
+}
/***********************************************************************************************
@@ -316,7 +326,7 @@ function sql_connect($server, $user, $pass) {
$connection = mssql_connect($server, $user, $pass);
}
else {
- $connection = mysql_connect($server, $user, $pass) or die(mysql_error());
+ $connection = mysql_connect($server, $user, $pass);
}
return $connection;
}
@@ -367,15 +377,16 @@ function sql_fetch_array($result) {
return $row;
}
-
function sql_fetch_assoc_array($result) {
- if ($_SESSION['DBMS'] == 'mssql') {
- return mssql_fetch_assoc($result);
- }
- return mysql_fetch_assoc($result);
+ if ($_SESSION["DBMS"] == "mssql") {
+ $row = mssql_fetch_assoc($result);
+ }
+ else {
+ $row = mysql_fetch_assoc($result);
+ }
+ return $row;
}
-
function sql_fetch_row($result) {
if ($_SESSION["DBMS"] == "mssql") {
$row = mssql_fetch_row($result);
View
5 pos/is4c/end.php
@@ -2,7 +2,10 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<body bgcolor='#ffffff'>
<?
- include_once("ini/ini.php");
+ if (!function_exists("get_config_auto")) {
+ include_once("/pos/is4c/lib/conf.php");
+ apply_configurations();
+ }
include_once("session.php");
include_once("printLib.php");
include_once("printReceipt.php");
View
1 pos/is4c/endorse.php
@@ -3,7 +3,6 @@
<head></head>
<body bgcolor='#ffffff'>
<?php
- include_once("ini/ini.php");
include_once("session.php");
include_once("printLib.php");
include_once("printReceipt.php");
View
0 pos/is4c/ini/ini.php → pos/is4c/ini/ini.php.sample
File renamed without changes.
View
113 pos/is4c/lib/apply_configurations.php
@@ -1,105 +1,12 @@
<?php
- include_once("conf.php");
-
- // An array of regular expressions that will be replaced by $replacements.
- $patterns = array
- (
- "/SESSION\[\"OS\"\]\s=\s\".*\";/",
- "/SESSION\[\"store\"\]\s=\s\".*\";/",
- "/SESSION\[\"mServer\"\]\s=\s\".*\";/",
- "/SESSION\[\"mDatabase\"\]\s=\s\".*\";/",
- "/SESSION\[\"remoteDBMS\"\]\s=\s\".*\";/",
- "/SESSION\[\"mUser\"\]\s=\s\".*\";/",
- "/SESSION\[\"mPass\"\]\s=\s\".*\";/",
- "/SESSION\[\"localhost\"\]\s=\s\".*\";/",
- "/SESSION\[\"pDatabase\"\]\s=\s\".*\";/",
- "/SESSION\[\"tDatabase\"\]\s=\s\".*\";/",
- "/SESSION\[\"DBMS\"\]\s=\s\".*\";/",
- "/SESSION\[\"localUser\"\]\s=\s\".*\";/",
- "/SESSION\[\"localPass\"\]\s=\s\".*\";/",
- "/SESSION\[\"laneno\"\]\s=\s\".*\";/",
- "/SESSION\[\"print\"\]\s=\s.*/",
- "/SESSION\[\"printerPort\"\]\s=\s\".*\";/",
- "/SESSION\[\"receiptHeader1\"\]\s=\s\".*\";/",
- "/SESSION\[\"receiptHeader2\"\]\s=\s\".*\";/",
- "/SESSION\[\"receiptHeader3\"\]\s=\s\".*\";/",
- "/SESSION\[\"receiptFooter1\"\]\s=\s\".*\";/",
- "/SESSION\[\"receiptFooter2\"\]\s=\s\".*\";/",
- "/SESSION\[\"receiptFooter3\"\]\s=\s\".*\";/",
- "/SESSION\[\"receiptFooter4\"\]\s=\s\".*\";/",
- "/SESSION\[\"ckEndorse1\"\]\s=\s\".*\";/",
- "/SESSION\[\"ckEndorse2\"\]\s=\s\".*\";/",
- "/SESSION\[\"ckEndorse3\"\]\s=\s\".*\";/",
- "/SESSION\[\"ckEndorse4\"\]\s=\s\".*\";/",
- "/SESSION\[\"chargeSlip1\"\]\s=\s\".*\";/",
- "/SESSION\[\"chargeSlip2\"\]\s=\s\".*\";/",
- "/SESSION\[\"welcomeMsg1\"\]\s=\s\".*\";/",
- "/SESSION\[\"welcomeMsg2\"\]\s=\s\".*\";/",
- "/SESSION\[\"welcomeMsg3\"\]\s=\s\".*\";/",
- "/SESSION\[\"trainingMsg1\"\]\s=\s\".*\";/",
- "/SESSION\[\"trainingMsg2\"\]\s=\s\".*\";/",
- "/SESSION\[\"farewellMsg1\"\]\s=\s\".*\";/",
- "/SESSION\[\"farewellMsg2\"\]\s=\s\".*\";/",
- "/SESSION\[\"farewellMsg3\"\]\s=\s\".*\";/",
- "/SESSION\[\"alertBar\"\]\s=\s\".*\";/",
- "/SESSION\[\"ccLive\"\]\s=\s.*/",
- "/SESSION\[\"ccServer\"\]\s=\s\".*\";/",
- "/SESSION\[\"ccShare\"\]\s=\s\".*\";/",
- "/SESSION\[\"lockScreen\"\]\s=\s.*/",
- "/SESSION\[\"timedlogout\"\]\s=\s.*/"
- );
- $replacements = array
- (
- 'SESSION["OS"] = "' . $_POST['general_os'] . '";',
- 'SESSION["store"] = "' . $_POST['general_store'] . '";',
- 'SESSION["mServer"] = "' . $_POST['server_ip'] . '";',
- 'SESSION["mDatabase"] = "' . $_POST['server_type'] . '";',
- 'SESSION["remoteDBMS"] = "' . $_POST['server_database'] . '";',
- 'SESSION["mUser"] = "' . $_POST['server_username'] . '";',
- 'SESSION["mPass"] = "' . $_POST['server_password'] . '";',
- 'SESSION["localhost"] = "' . $_POST['local_ip'] . '";',
- 'SESSION["pDatabase"] = "' . $_POST['local_ops'] . '";',
- 'SESSION["tDatabase"] = "' . $_POST['local_trans'] . '";',
- 'SESSION["DBMS"] = "' . $_POST['local_type'] . '";',
- 'SESSION["localUser"] = "' . $_POST['local_username'] . '";',
- 'SESSION["localPass"] = "' . $_POST['local_password'] . '";',
- 'SESSION["laneno"] = "' . $_POST['general_lane'] . '";',
- 'SESSION["print"] = ' . (isset($_POST['printer_active'])?1:0) . ';',
- 'SESSION["printerPort"] = "' . $_POST['printer_port'] . '";',
- 'SESSION["receiptHeader1"] = "' . $_POST['receipt_header_1'] . '";',
- 'SESSION["receiptHeader2"] = "' . $_POST['receipt_header_2'] . '";',
- 'SESSION["receiptHeader3"] = "' . $_POST['receipt_header_3'] . '";',
- 'SESSION["receiptFooter1"] = "' . $_POST['receipt_footer_1'] . '";',
- 'SESSION["receiptFooter2"] = "' . $_POST['receipt_footer_2'] . '";',
- 'SESSION["receiptFooter3"] = "' . $_POST['receipt_footer_3'] . '";',
- 'SESSION["receiptFooter4"] = "' . $_POST['receipt_footer_4'] . '";',
- 'SESSION["ckEndorse1"] = "' . $_POST['check_endorse_1'] . '";',
- 'SESSION["ckEndorse2"] = "' . $_POST['check_endorse_2'] . '";',
- 'SESSION["ckEndorse3"] = "' . $_POST['check_endorse_3'] . '";',
- 'SESSION["ckEndorse4"] = "' . $_POST['check_endorse_4'] . '";',
- 'SESSION["chargeSlip1"] = "' . $_POST['charge_slip_1'] . '";',
- 'SESSION["chargeSlip2"] = "' . $_POST['charge_slip_2'] . '";',
- 'SESSION["welcomeMsg1"] = "' . $_POST['welcome_message_1'] . '";',
- 'SESSION["welcomeMsg2"] = "' . $_POST['welcome_message_2'] . '";',
- 'SESSION["welcomeMsg3"] = "' . $_POST['welcome_message_3'] . '";',
- 'SESSION["trainingMsg1"] = "' . $_POST['training_message_1'] . '";',
- 'SESSION["trainingMsg2"] = "' . $_POST['training_message_2'] . '";',
- 'SESSION["farewellMsg1"] = "' . $_POST['farewell_message_1'] . '";',
- 'SESSION["farewellMsg2"] = "' . $_POST['farewell_message_2'] . '";',
- 'SESSION["farewellMsg3"] = "' . $_POST['farewell_message_3'] . '";',
- 'SESSION["alertBar"] = "' . $_POST['alert_bar'] . '";',
- 'SESSION["ccLive"] = ' . (isset($_POST['credit_card_flag'])?1:0) . ';',
- 'SESSION["ccServer"] = "' . $_POST['credit_card_server'] . '";',
- 'SESSION["ccShare"] = "' . $_POST['credit_card_share'] . '";',
- 'SESSION["lockScreen"] = ' . (isset($_POST['screen_lock_flag'])?1:0) . ';',
- 'SESSION["timedlogout"] = ' . $_POST['logout_time']
- );
- $contents = preg_replace($patterns, $replacements, $contents);
-
- $handle = fopen("/pos/is4c/ini/ini.php", "w");
- if ($handle) {
- fwrite($handle, $contents);
- echo 'Contents successfully saved.';
- }
- fclose($handle);
+ include_once("query.php");
+ save_configurations($_POST);
+?>
+ S A V I N G . . .
+ <?php
+ $_SESSION["config_saved"] = TRUE;
+ ?>
+ <script type='text/javascript'>
+ window.top.location = '/configure.php';
+ </script>
View
14 pos/is4c/lib/authenticate.php
@@ -20,8 +20,11 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*********************************************************************************/
- include("../ini/ini.php");
- include("query.php");
+ if (!function_exists("get_config_auto")) {
+ include_once("/pos/is4c/lib/conf.php");
+ apply_configurations();
+ }
+
if (!function_exists("pDataConnect")) {
include("../connect.php");
}
@@ -45,8 +48,7 @@
$password = str_replace(array("TRAINING", "'", ",", "+"), array('9999', ""), strtoupper(trim($_POST["reginput"])));
$global_values = get_global_values();
-
- //Check if someone is already logged in.
+
if (!$global_values["LoggedIn"]) {
$employee_number = user_pass($password);
@@ -84,8 +86,8 @@
header("Location:/login.php");
}
}
- else {
- if ($password == $global_values["CashierNo"]) {
+ else {
+ if (get_user_info(user_pass($password)) == $global_values["CashierNo"]) {
loadglobalvalues();
testremote();
loginscreen();
View
245 pos/is4c/lib/conf.php
@@ -1,226 +1,41 @@
<?php
-
- $handle = fopen("/pos/is4c/ini/ini.php", "r");
- $contents = '';
- if ($handle) {
- while (!feof($handle)) {
- $contents .= fread($handle, 8192);
+ include_once("/pos/is4c/lib/initialize.php");
+ if (!function_exists("get_users")) {
+ include_once("/pos/is4c/lib/query.php");
+ }
+
+ function get_config_auto($config_item){
+ switch ($config_item){
+ case "OS":
+ return ("<input type='button' value='Auto' onclick=\"$('#OS').attr('value', '" . strtolower(PHP_OS) . "'); return false\" />");
+ break;
+ case "localhost":
+ return ("<input type='button' value='Auto' onclick=\"$('#localhost').attr('value', '" . $_SERVER['SERVER_ADDR'] . "'); return false\" />");
+ break;
+ default:
+ return "";
}
}
- fclose($handle);
- function get_os($contents) {
- preg_match("/SESSION\[\"OS\"\]\s=\s\".*\";/", $contents, $val);
- return str_replace('";', "", substr($val[0], 17));
+ function get_configuration_groups(){
+ $conf_groups = get_configuration_groups_query();
+ return $conf_groups;
}
- function get_store_name($contents) {
- preg_match("/SESSION\[\"store\"\]\s=\s\".*\";/", $contents, $val);
- return str_replace('";', "", substr($val[0], 20));
+ function get_configuration_settings($configuration_group){
+ $conf_settings = get_configuration_group_settings_query($configuration_group);
+ return $conf_settings;
}
- function get_server_ip($contents) {
- preg_match("/SESSION\[\"mServer\"\]\s=\s\".*\";/", $contents, $val);
- return str_replace('";', "", substr($val[0], 22));
- }
-
- function get_server_database($contents) {
- preg_match("/SESSION\[\"mDatabase\"\]\s=\s\".*\";/", $contents, $val);
- return str_replace('";', "", substr($val[0], 24));
- }
-
- function get_server_database_type($contents) {
- preg_match("/SESSION\[\"remoteDBMS\"\]\s=\s\".*\";/", $contents, $val);
- return str_replace('";', "", substr($val[0], 25));
- }
-
- function get_server_username($contents) {
- preg_match("/SESSION\[\"mUser\"\]\s=\s\".*\";/", $contents, $val);
- return str_replace('";', "", substr($val[0], 20));
- }
-
- function get_server_password($contents) {
- preg_match("/SESSION\[\"mPass\"\]\s=\s\".*\";/", $contents, $val);
- return str_replace('";', "", substr($val[0], 20));
- }
-
- function get_local_ip($contents) {
- preg_match("/SESSION\[\"localhost\"\]\s=\s\".*\";/", $contents, $val);
- return str_replace('";', "", substr($val[0], 24));
- }
-
- function get_local_op_database($contents) {
- preg_match("/SESSION\[\"pDatabase\"\]\s=\s\".*\";/", $contents, $val);
- return str_replace('";', "", substr($val[0], 24));
- }
-
- function get_local_trans_database($contents) {
- preg_match("/SESSION\[\"tDatabase\"\]\s=\s\".*\";/", $contents, $val);
- return str_replace('";', "", substr($val[0], 24));
- }
-
- function get_local_database_type($contents) {
- preg_match("/SESSION\[\"DBMS\"\]\s=\s\".*\";/", $contents, $val);
- return str_replace('";', "", substr($val[0], 19));
- }
-
- function get_local_username($contents) {
- preg_match("/SESSION\[\"localUser\"\]\s=\s\".*\";/", $contents, $val);
- return str_replace('";', "", substr($val[0], 24));
- }
-
- function get_local_password($contents) {
- preg_match("/SESSION\[\"localPass\"\]\s=\s\".*\";/", $contents, $val);
- return str_replace('";', "", substr($val[0], 24));
- }
-
- function get_lane_number($contents) {
- preg_match("/SESSION\[\"laneno\"\]\s=\s\".*\";/", $contents, $val);
- return str_replace('";', "", substr($val[0], 21));
- }
-
- function get_print_flag($contents) {
- preg_match("/SESSION\[\"print\"\]\s=\s.*/", $contents, $val);
- return str_replace('";', "", substr($val[0], 19));
- }
-
- function get_printer_port($contents) {
- preg_match("/SESSION\[\"printerPort\"\]\s=\s\".*\";/", $contents, $val);
- return str_replace('";', "", substr($val[0], 26));
- }
-
- function get_receipt_header_1($contents) {
- preg_match("/SESSION\[\"receiptHeader1\"\]\s=\s\".*\";/", $contents, $val);
- return str_replace('";', "", substr($val[0], 29));
- }
-
- function get_receipt_header_2($contents) {
- preg_match("/SESSION\[\"receiptHeader2\"\]\s=\s\".*\";/", $contents, $val);
- return str_replace('";', "", substr($val[0], 29));
- }
-
- function get_receipt_header_3($contents) {
- preg_match("/SESSION\[\"receiptHeader3\"\]\s=\s\".*\";/", $contents, $val);
- return str_replace('";', "", substr($val[0], 29));
- }
-
- function get_receipt_footer_1($contents) {
- preg_match("/SESSION\[\"receiptFooter1\"\]\s=\s\".*\";/", $contents, $val);
- return str_replace('";', "", substr($val[0], 29));
- }
-
- function get_receipt_footer_2($contents) {
- preg_match("/SESSION\[\"receiptFooter2\"\]\s=\s\".*\";/", $contents, $val);
- return str_replace('";', "", substr($val[0], 29));
- }
-
- function get_receipt_footer_3($contents) {
- preg_match("/SESSION\[\"receiptFooter3\"\]\s=\s\".*\";/", $contents, $val);
- return str_replace('";', "", substr($val[0], 29));
- }
-
- function get_receipt_footer_4($contents) {
- preg_match("/SESSION\[\"receiptFooter4\"\]\s=\s\".*\";/", $contents, $val);
- return str_replace('";', "", substr($val[0], 29));
- }
-
- function get_check_endorse_1($contents) {
- preg_match("/SESSION\[\"ckEndorse1\"\]\s=\s\".*\";/", $contents, $val);
- return str_replace('";', "", substr($val[0], 25));
- }
-
- function get_check_endorse_2($contents) {
- preg_match("/SESSION\[\"ckEndorse2\"\]\s=\s\".*\";/", $contents, $val);
- return str_replace('";', "", substr($val[0], 25));
- }
-
- function get_check_endorse_3($contents) {
- preg_match("/SESSION\[\"ckEndorse3\"\]\s=\s\".*\";/", $contents, $val);
- return str_replace('";', "", substr($val[0], 25));
- }
-
- function get_check_endorse_4($contents) {
- preg_match("/SESSION\[\"ckEndorse4\"\]\s=\s\".*\";/", $contents, $val);
- return str_replace('";', "", substr($val[0], 25));
- }
-
- function get_charge_slip_1($contents) {
- preg_match("/SESSION\[\"chargeSlip1\"\]\s=\s\".*\";/", $contents, $val);
- return str_replace('";', "", substr($val[0], 26));
- }
-
- function get_charge_slip_2($contents) {
- return str_replace('";', "", substr($val[0], 26));
- }
- preg_match("/SESSION\[\"chargeSlip2\"\]\s=\s\".*\";/", $contents, $val);
-
- function get_welcome_message_1($contents) {
- preg_match("/SESSION\[\"welcomeMsg1\"\]\s=\s\".*\";/", $contents, $val);
- return str_replace('";', "", substr($val[0], 26));
- }
-
- function get_welcome_message_2($contents) {
- preg_match("/SESSION\[\"welcomeMsg2\"\]\s=\s\".*\";/", $contents, $val);
- return str_replace('";', "", substr($val[0], 26));
- }
-
- function get_welcome_message_3($contents) {
- preg_match("/SESSION\[\"welcomeMsg3\"\]\s=\s\".*\";/", $contents, $val);
- return str_replace('";', "", substr($val[0], 26));
- }
-
- function get_training_message_1($contents) {
- preg_match("/SESSION\[\"trainingMsg1\"\]\s=\s\".*\";/", $contents, $val);
- return str_replace('";', "", substr($val[0], 27));
- }
-
- function get_training_message_2($contents) {
- preg_match("/SESSION\[\"trainingMsg2\"\]\s=\s\".*\";/", $contents, $val);
- return str_replace('";', "", substr($val[0], 27));
- }
-
- function get_farewell_message_1($contents) {
- preg_match("/SESSION\[\"farewellMsg1\"\]\s=\s\".*\";/", $contents, $val);
- return str_replace('";', "", substr($val[0], 27));
- }
-
- function get_farewell_message_2($contents) {
- preg_match("/SESSION\[\"farewellMsg2\"\]\s=\s\".*\";/", $contents, $val);
- return str_replace('";', "", substr($val[0], 27));
- }
-
- function get_farewell_message_3($contents) {
- preg_match("/SESSION\[\"farewellMsg3\"\]\s=\s\".*\";/", $contents, $val);
- return str_replace('";', "", substr($val[0], 27));
- }
-
- function get_alert_bar($contents) {
- preg_match("/SESSION\[\"alertBar\"\]\s=\s\".*\";/", $contents, $val);
- return str_replace('";', "", substr($val[0], 23));
- }
-
- function get_credit_card_active($contents) {
- preg_match("/SESSION\[\"ccLive\"\]\s=\s.*/", $contents, $val);
- return str_replace('";', "", substr($val[0], 20));
- }
-
- function get_credit_card_server($contents) {
- preg_match("/SESSION\[\"ccServer\"\]\s=\s\".*\";/", $contents, $val);
- return str_replace('";', "", substr($val[0], 23));
- }
-
- function get_credit_card_share($contents) {
- preg_match("/SESSION\[\"ccShare\"\]\s=\s\".*\";/", $contents, $val);
- return str_replace('";', "", substr($val[0], 22));
- }
-
- function get_screen_lock($contents) {
- preg_match("/SESSION\[\"lockScreen\"\]\s=\s.*/", $contents, $val);
- return str_replace('";', "", substr($val[0], 24));
+ function apply_configurations()
+ {
+ $conf_settings = get_configurations();
+ foreach($conf_settings as $conf_setting) {
+ $_SESSION[$conf_setting["key"]] = $conf_setting["value"];
+ }
}
-