/var/www/enzatesting.onesolution.hk/01_20240711_full_backup/ord_poset_finish.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
45
46
47
48
49
50
51
52
<?php 
$formid 
"Stone";
require_once 
"inc/configure.php";
require_once 
"inc/ord_po_func.php";


$refid             filter_var($_REQUEST['refid'], FILTER_SANITIZE_NUMBER_INT);
//(int)$_REQUEST['productID'];
//vdump($_REQUEST); exit;
if( $_REQUEST['action']=="ord_poset_finish" && !empty($refid) && $dtl=getDB("ord_podtl",$refid) ){

    
$dbh->beginTransaction();    

    
$createby        filter_var($_SESSION['user'], FILTER_SANITIZE_STRING);
    
$lastupby        filter_var($_SESSION['user'], FILTER_SANITIZE_STRING);
    

    
//finished receive
    
$sql "UPDATE ord_podtl SET
            status = :status,
            lastupby = :lastupby,
            lastupdate = GETDATE()
            WHERE refid = :refid"
;
                
    
$sth $dbh->prepare($sql);
    
$q $sth->execute( array(':status'=> 'FINISHED',
                            
':lastupby'=> $lastupby,
                            
':refid'=> $refid) );    
/*    echo $sth->getSQL(  );    */
    
pdo_showerror($sth$q);


//    exit;
    
    
$dbh->commit();        
    
    
$pomain getDB("ord_pomain"$dtl['pomain_refid']);     
    if(
poset_dtlAllFinished($pomain['refid'])){
        
poset_mainAsFinished($pomain['refid']);    
    }
        
    
header("Location: ord_poset_submitform.php?refid=$refid&msg=Saved.");
    print 
"Saved.";
    exit;
    
    
}
myerror(INVALID.WS.REQUEST);
exit;    


?>