/var/www/hkosl.com/oneMotorChunHing_delete20240201/html/posadd.php


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<?
require("inc/configure.php");
require(
"inc/global.php");
require(
"inc/checklogin.php");
if (
$logged_in == 0) {
    
//echo 'Not logged in. <a href="login.php">Login</a>';
    
header('Window-target: _parent');
    
header('Location: login.php');
    exit();
}
?>
<?
$qty        
isnull($_POST['qty'],0);
$barcode    $_POST['barcode'];
$creationby    $_SESSION['uname'];

$sql "
insert into TMP_POS_DTL
(prodid, prodname, description, uomid, uom, qty, price, cost, discount, amount, creationby)
select prodid, prodname, description, a.uomid, uom, 
$qty, price, cost, 0, $qty*price
, '
$creationby'
from INV_PRODUCT a
, INV_UOM b
where a.uomid = b.uomid
and barcode = 
$barcode
"
;
$result mysql_query($sql);

if (!
$result) {
    die(
'Invalid query: ' mysql_error());
}

header("Location: pos.php?msg=$msg");
?>