Warning: chmod(): Operation not permitted in /var/www/hopeinstoughton_www/wp-content/plugins/simple-universal-google-analytics/main.php on line 8 [0] in function chmod in /var/www/hopeinstoughton_www/wp-content/plugins/simple-universal-google-analytics/main.php on line 8 [1] in function include_once in /var/www/hopeinstoughton_www/wp-settings.php on line 560 [2] in function require_once in /var/www/hopeinstoughton_www/wp-config.php on line 85 [3] in function require_once in /var/www/hopeinstoughton_www/wp-load.php on line 50 [4] in function require_once in /var/www/hopeinstoughton_www/wp-blog-header.php on line 13 [5] in function require in /var/www/hopeinstoughton_www/index.php on line 17
| Server IP : 94.177.8.99 / Your IP : 216.73.217.165 Web Server : Apache/2.4.58 (Ubuntu) System : Linux aries 6.8.0-134-generic #134-Ubuntu SMP PREEMPT_DYNAMIC Fri Jun 26 18:43:11 UTC 2026 x86_64 User : www-data ( 33) PHP Version : 8.1.34 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /var/www/hopeinstoughton_books/_oldsite/ |
Upload File : |
<?php
require './inc/include.php';
$member = isset($_GET['id']) ? intval($_GET['id']) : 0;
$tranid = isset($_GET['tid']) ? intval($_GET['tid']) : 0;
$fn = isset($_GET['fn']) ? $_GET['fn'] : '';
$auth = isset($_COOKIE['auth']) ? $_COOKIE['auth'] : '';
if ($auth != $VALIDATION && $USERID == '') ip_access_denied();
$VARIABLE['menu_right'] = '';
$DATABASE->Open();
if (!$tranid) {
$DATA = array('__table' => 'dt_tranh', '__existing' => 0);
$DATA['bh_terminal'] = $_SERVER['REMOTE_ADDR'];
$DATA['bh_member'] = $member;
$DATA['bh_datetime'] = gmdate('Y-m-d H:i:s');
$DATA['bh_type'] = '0'; // incomplete
$DATA['bh_scanned'] = $fn === 'barcode' ? 1 : 0;
$DATABASE->SaveRecord($DATA, 'bh_id');
DatabaseError();
$tranid = $DATA['bh_id'];
$additional = '';
} else {
$additional = ip_ReadTransaction($tranid);
}
if (!$member) { // member may be blank, in which case retrive the info from the transaction
$DATA = $DATABASE->Lookup("select bh_member from dt_tranh where bh_id=$tranid");
DatabaseError();
if ($DATA['__existing']) $member = intval($DATA['bh_member']);
}
$cash = $member == -2;
ip_ShowMemberDetails($member);
// space for title, author, cost
$VARIABLE['default_right'] .= <<<BLOCK
<br>
<h4> Current Item </h4>
<span id="titleinfo"></span>
BLOCK;
DatabaseError();
$DATABASE->Close();
$VARIABLE['javascript'] .= <<<BLOCK
var
lastscanned = '';
subtotal = 0;
function addItem(title, price, titleid, purchase, iwd, iht) {
var itemid = 'c_' + titleid;
price = CurrencyFormatted(price);
var ltb = document.getElementById("ltbody");
var tbodyElem = document.getElementById("lttbody");
var trElem, tdElem, txtNode;
var sellprice = price;
var img;
var k = tbodyElem.rows.length % 2;
trElem = tbodyElem.insertRow(tbodyElem.rows.length);
trElem.className = "r" + k;
tdElem = trElem.insertCell(trElem.cells.length);
if (purchase) {
tdElem.className = "ltcol0 buy";
} else {
tdElem.className = "ltcol0";
price = '0.00';
}
txtNode = document.createTextNode(title);
tdElem.appendChild(txtNode);
tdElem = trElem.insertCell(trElem.cells.length);
tdElem.className = "ltcol1";
txtNode = document.createTextNode(price);
txtNode.id = itemid;
tdElem.appendChild(txtNode);
lastscanned = itemid;
ltb.scrollTop = trElem.offsetTop;
img = '';
if (iwd > 0 && iht > 0) {
img = '<img src="/inc/image.php?id=' + titleid + '">';
}
k = MM_findObj('titleinfo');
k.innerHTML = '<table border="0"><td valign="top">Title:</td><td><b>' + title + '</b></td></tr>' +
'<tr><td>Price:</td><td align="right">$' + sellprice + '</td></tr>'+
'<tr><td colspan="2" align="center">' + img + '</td></tr>'+
'</table>';
price = eval(price);
subtotal += price;
k = MM_findObj('subtotal');
k.innerHTML = CurrencyFormatted(subtotal);
return false;
}
function specialcode(actionid) {
document.location.href = 'http://$HOST/complete.php?tid=$tranid&id=' + escape(actionid);
}
function bookbarcode(barcodenum, titlenum) {
if (!titlenum.length) { // unknown allocated barcode - associate a book with it
document.location.href = 'http://$HOST/inc/newbook.php?tid=$tranid&bc=' + escape(barcodenum);
} else {
$.getScript('http://$HOST/inc/scanned.php?tid=$tranid&bc=' + escape(barcodenum));
}
}
function keydown(e) {
var key = e? e.which: window.event.keyCode;
if (key == 32) {
document.location.href = 'http://$HOST/complete.php?tid=$tranid&id=50';
return false;
}
return true;
}
document.onkeypress = keydown;
$(document).ready(function() {
$additional
});
BLOCK;
echo page_header('Scan Books');
$action = ($cash) ? 'purchase' : 'purchase';
echo <<<BLOCK
<h2>Quick Checkout</h2>
<h3>Step 2 of 3: Scan the Books</h3>
<p>Please scan the HopeInStoughton barcodes found on the back cover of the books you wish to $action.</p>
<p><strong>When you are finished, please scan the DONE barcode, or press the SPACEBAR.</strong></p>
<div id="ltcontainer">
<div id="lttitle">
<span class="lttcell ltcol0">Title, Author</span>
<span class="lttcell ltcol1">Price</span>
</div>
<div id="ltbody">
<table width="100%" cellspacing="0" cellpadding="0">
<tbody id="lttbody">
</tbody>
</table>
</div>
<div id="lttitle">
<span class="lttcell ltcol0"></span>
<span class="lttcell ltcol1">US\$<b id="subtotal">0.00</b></span>
</div>
</div>
BLOCK;
if (!$cash) echo '<p>If you wish to purchase any of the books, please scan the PURCHASE barcode after you have scanned the barcode on the back of the book.</p>';
echo "<p>Scan a barcode a second time to remove it from the list</p>\n";
echo page_footer();
// if it is a known book, AJAX call made: update transaction database, return html entries that will be displayed for that item
// if book already scanned, ignore it (to do: remove from list)
// if unknown book -> enter details
// if done, change state to check out., move on to next step -> print, pause, firststep
// if cancel, prompt; discard transactions, move back to first step
?>