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
// using AJAX, monitor the barcode scanner, redirect, or alter page content as required
$HOST = isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : 'localhost';
echo <<<BLOCK
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta name="MSSmartTagsPreventParsing" content="TRUE">
<script type="text/javascript" src="/inc/books.js"></script>
<script type="text/javascript" src="/inc/ajax.js"></script>
<script type="text/javascript">
var ajaxObjects = new Array();
var currentpage = '';
function lookupComplete(ajaxIndex, error) {
// reconnect. This should happen every 5 minutes.
ajaxObjects[ajaxIndex].runAJAX()
}
function loading(ajaxIndex) {
// retrieve the barcode from the server:
var p = ajaxObjects[ajaxIndex].inPointer;
var text = ajaxObjects[ajaxIndex].xmlhttp.responseText.substring(p);
ajaxObjects[ajaxIndex].inPointer = ajaxObjects[ajaxIndex].xmlhttp.responseText.length;
if (top.fmain.window) {
var t = top.fmain.window.location.href;
var x = t.lastIndexOf('#');
if (x > 0) t = t.substr(0, x);
x = t.lastIndexOf('?');
if (x > 0) t = t.substr(0, x);
x = t.lastIndexOf('/');
currentpage = t.substr(x + 1);
} else {
currentpage = '';
}
// break up into components
text = text.replace(/^\s+|\s+$/g, '');
var elem = text.split('|');
switch(currentpage) {
case 'start.php':
if (elem[0] == 'x') {
top.fmain.checkbarcode(elem[1], elem[2]);
}
break;
case 'terminal.php':
if (elem[0] == 's') { // stock barcode - display price
Page3_PriceCheck(elem[1]);
} else if (elem[0] == 'm') { // members
if (!elem[2].length) { // unknown barcode
Page1_AddMember(elem[1]);
} else {
Page2_AddBooks(elem[2]); // barcode, memberid
}
} else if (elem[0] == 'x') {
top.fmain.window.location.href = 'http://$HOST/admin/special.php?id=' + escape(elem[2]);
}
break
case 'stocktake.php':
if (elem[0] == 's') { // stock barcode - display price
Page3_PriceCheck(elem[1]);
}
break;
case 'addbarcode.php':
break;
case 'special.php':
case 'scanbooks.php':
if (elem[0] == 's') { // only accept stock
Page3_StockScanned(elem[1], elem[2]);
} else if (elem[0] == 'x') {
Page3_SpecialAction(elem[2]);
}
break;
case 'complete.php':
if (elem[0] == 'm') { // ignore book scans here
if (!elem[2].length) { // unknown barcode
Page1_AddMember(elem[1]);
} else {
Page2_AddBooks(elem[2]); // barcode, memberid
}
} else if (elem[0] == 'x') {
top.fmain.window.location.href = 'http://$HOST/terminal.php';
}
break;
case '':
break;
default:
alert('unknown page - ' + text + ' ' +currentpage);
}
}
function Page2_AddBooks(memberid) {
top.fmain.window.location.href = 'http://$HOST/scanbooks.php?fn=barcode&id=' + memberid;
}
function Page3_StockScanned(barcodeid, titleid) {
top.fmain.bookbarcode(barcodeid, titleid);
}
function Page3_PriceCheck(barcodeid) {
top.fmain.pricecheck(barcodeid);
}
function Page3_SpecialAction(actionid) {
top.fmain.specialcode(actionid);
}
function Page1_AddMember(barcode) {
top.fmain.window.location.href = 'http://$HOST/addbarcode.php?id=' + escape(barcode);
}
ajaxIndex = ajaxObjects.length;
ajaxObjects[ajaxIndex] = new sack();
ajaxObjects[ajaxIndex].requestFile = 'http://$HOST/barcode_feed.php';
ajaxObjects[ajaxIndex].onCompletion = function() { lookupComplete(ajaxIndex, 0); } ;
ajaxObjects[ajaxIndex].onError = function() { lookupComplete(ajaxIndex, 1); } ;
ajaxObjects[ajaxIndex].onInteractive = function() { loading(ajaxIndex); } ;
ajaxObjects[ajaxIndex].inPointer = 0;
ajaxObjects[ajaxIndex].runAJAX(); // Execute AJAX function
</script>
</head>
<body>
</body>
</html>
BLOCK;
?>