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/jquery-1.6.4.min.js"></script>
<script type="text/javascript" src="/inc/books.js"></script>
<script type="text/javascript">
var currentpage = '';
var isrunning = false;
setInterval('wait_for_barcode()', 333);
function wait_for_barcode() {
if (isrunning) return;
isrunning = true;
var today = new Date();
var unixtime = parseInt(today.getTime() / 1000);
$.ajax({
url: '/barcode_feed.php?t=' + unixtime,
success: function(json){
var text = unescape(json.data);
window.status = unixtime + ' ' + text;
if (text.length > 3) processText(text);
// if (text.length > 3) alert(text);
},
complete: function() {
isrunning = false;
},
dataType: 'jsonp',
timeout: 16000
});
}
function processText(text) {
// retrieve the barcode from the server:
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]);
} else if (elem[0] == 'x') {
top.fmain.window.location.href = 'http://$HOST/terminal.php';
}
break;
case 'addbarcode.php':
break;
case 'newbook.php':
if (elem[0] == 'x') {
Page3_SpecialAction(elem[2]);
} else if (elem[0] == 'p') {
Page3_PriceCheck(elem[2]); // not a price check
}
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);
}
//wait_for_barcode();
</script>
</head>
<body>
</body>
</html>
BLOCK;
?>