<?php
 function FinalData() {
        global $objAxpDB;
        $objAxpDB->Allow_Final(false);
        $strSQL=array();
        switch($_REQUEST[mode]) {
        case "final":
               
                $strSQL["Final "][]="UPDATE  txpayroll_slip_hdr 
										SET 
										fnstatus=1, ftnotes='{$_REQUEST['ftnotes']}' 
										WHERE ftpayroll_slip_no='{$_REQUEST['ftpayroll_slip_no']}'";
               
          break;
	 }
    return $strSQL;
   }

 function UpdateData() {
        global $objAxpDB;
        $objAxpDB->Allow_Update(false);
        $strSQL=array();
        switch($_REQUEST[mode]) {
        case "update":
//            for($j=1; $j<count($_REQUEST['fnindexD0']); $j++) {
//                    $strSQL["n"][]="update txpayroll_slip_emp
//                                 set fnstatus_tunda='".$_REQUEST['fnstatus_tundaD0'][$j]."'
//                                 where ftpayroll_slip_no='{$_REQUEST['ftpayroll_slip_no']}' AND
//                                        ftemployee_code='".$_REQUEST['ftemployee_codeD0'][$j]."'";
//			}
//              $ssql="UPDATE
//                        txpayroll_slip_hdr ,(SELECT ftpayroll_slip_no,
//                                                SUM(fcincome_amount) AS  fcincome_amount,
//                                                SUM(fcdeduction_amount) AS fcdeduction_amount,
//                                                SUM(fcamount) AS fcamount
//                                                FROM txpayroll_slip_emp
//                                                WHERE ftpayroll_slip_no='{$_REQUEST['ftpayroll_slip_no']}' and
//                                                    fnstatus_tunda=0
//                                                GROUP BY ftpayroll_slip_no
//                                                ) txpayroll_slip_emp
//                        SET txpayroll_slip_hdr.fcgrand_income_amount=txpayroll_slip_emp.fcincome_amount,
//                                txpayroll_slip_hdr.fcgrand_deduction_amount=txpayroll_slip_emp.fcdeduction_amount,
//                                        txpayroll_slip_hdr.fcgrand_total=txpayroll_slip_emp.fcamount
//                        WHERE txpayroll_slip_hdr.ftpayroll_slip_no=txpayroll_slip_emp.ftpayroll_slip_no AND
//                                   txpayroll_slip_hdr.ftpayroll_slip_no='{$_REQUEST['ftpayroll_slip_no']}'
//                                                ";
//            $strSQL["n"][]=$ssql;
          $strSQL["n"][]= "UPDATE  txpayroll_slip_hdr
										SET
										 ftnotes='{$_REQUEST['ftnotes']}'
										WHERE ftpayroll_slip_no='{$_REQUEST['ftpayroll_slip_no']}'";
          break;
	 }
    return $strSQL;
   }
   
?>