Exemplo n.º 1
0
<?php

require_once 'common/init.php';
$inventorty = new inventory();
if (isset($_GET['bc'])) {
    $barcode = $_GET['bc'];
    $results = $inventorty->get_product($barcode);
    if ($results) {
        foreach ($results as $res) {
            $barcode_detail = array('product_id' => $res->inv_id, 'name' => $res->inv_name, 'price' => $res->inv_price, 'quantity' => 1);
            $_SESSION['barcode'] = $barcode;
            print_f($_SESSION['barcode']);
            $_SESSION['barcode_detail'] = $barcode_detail;
            print_f($_SESSION['barcode_detail']);
        }
    } else {
        echo 'Error';
    }
}
/*
echo $barcode = $_GET['bc'];

$barcode_detail = array (
	'product_id' => 1,
	'name' => 'Shahsons Picasso Ball Pen',
	'price' => '100',
	'quantity' => 1,
	);

$_SESSION['barcode'] = $barcode;
$_SESSION['barcode_detail'] = $barcode_detail;
Exemplo n.º 2
0
<?php

require_once 'common/init.php';
$inventorty = new inventory();
if (isset($_GET['bc'])) {
    $barcode = $_GET['bc'];
    $product = $inventorty->get_product($barcode);
    if ($product) {
        $_SESSION['barcode'] = $barcode;
        $_SESSION['barcode_detail'] = $product;
        print_f($_SESSION['barcode_detail']);
    } else {
        echo 'Error';
    }
}
Exemplo n.º 3
0
						if(current == '0'){newcurrent = $codeVal; }
						$(".calculator input").val(newcurrent);
					}
				});
            });
        </script> 
</head>
<body>
	<?php 
if (!isset($_SESSION['faizan'])) {
    $inventorty = new inventory();
    $terminallist = new terminal();
    $barcode = array(987654321, 1234567891, 159753825, 123456788);
    foreach ($barcode as $value) {
        $_SESSION['barcode'] = $value;
        $_SESSION['barcode_detail'] = $inventorty->get_product($value);
        $terminallist->add_item_list(1);
    }
}
?>
	<!-- Payment Mode -->
	<span id="paymentMode" style="display:none;">cash</span>

	<!-- Modal -->
	<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
	  <div class="modal-dialog" role="document">
	    <div class="modal-content">
	      <div class="modal-header">
	        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
	        <h4 class="modal-title" id="myModalLabel">Swtich Sessions</h4>
	      </div>