/var/www/hkosl.com/oneMotorChunHing_delete20240201/html/receiptdetailadd.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
35
36
37
38
39
40
41
42
43
44
<?
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();
}
if (
checkObject(7) <> 1){
    die(
"Unauthorized Access");
    exit();
}
?>
<?
$invoiceno        
$_POST['invoiceno'];
$receiptno        $_POST['receiptno'];
$amount            $_POST['amount'];
$creationdate    date("YmdGis");

$sql "delete from AR_RECEIPT_DTL where receiptno = $receiptno and invoiceno = $invoiceno";
$result mysql_query($sql);

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

$sql "
insert into AR_RECEIPT_DTL
(receiptno, invoiceno, amount)
values
(
$receiptno$invoiceno$amount)
"
;
//echo $sql;
$result mysql_query($sql);

if (!
$result) {
    die(
'Invalid query: ' mysql_error());
}
$msg "Updated successful!";

header("Location: receiptdetail.php?receiptno=$receiptno&msg=$msg");
?>