<?php
 function FinalData() {
    global $objAxpDB;
    $objAxpDB->Allow_Save(false);
    $strSQL=array();
    switch($_REQUEST[mode]) {
    case "final":
         $strSQL['Final POS'][]="
                UPDATE txproduction_order_sheet_hdr
                    SET  fnstatus=1,
                        fftotal_qty='".$_REQUEST['fftotal_qty']."',
                        fdforecasted_date='".CDate($_REQUEST['fdforecasted_date'])."',
                        ftnotes='".$_REQUEST['ftnotes']."'
                WHERE ftpos_no='{$_REQUEST['ftpos_no']}'";
         for($j=1; $j<count($_REQUEST['fnindexD0']); $j++) {
                    $strSQL['Update POS'][]="UPDATE txproduction_order_sheet_det SET
                                                ffqty='".CCur($_REQUEST['ffqtyD0'][$j])."'
                                                WHERE ftpos_no='{$_REQUEST['ftpos_no']}' and   concat(ftstock_group_code,ftstock_subgroup_code,ftdecal_code)='".$_REQUEST['fttype_barang_codeD0'][$j]."' and
                                                ftcolor_code='".$_REQUEST['ftcolor_codeD0'][$j]."' and
                                                ftsize_code='".$_REQUEST['ftsize_codeD0'][$j]."'";

             }
    break;

    }
    return $strSQL;
 }
  function UpdateData() {
        global $objAxpDB;
        $objAxpDB->Allow_Update(false);
        $strSQL=array();
        switch($_REQUEST[mode]) {
        case "update": 
             $strSQL['Update Status'][]="
                                        UPDATE txproduction_order_sheet_hdr
                                            SET  fnstatus='{$_REQUEST['fnstatus']}'
                                        WHERE ftpos_no='{$_REQUEST['ftpos_no']}'";
        }
        return $strSQL;
    }

    


?>
