<?php



 function SaveData() {
        global $objAxpDB;
        $strSQL=array();
        switch($_REQUEST[mode]) {
        case "simpan":
                $strSQL['update tlemployee'][]=" UPDATE tlemployee
                                            SET fttemp=ftshift_code";

                for($j=1; $j<count($_REQUEST['fnindexD0']); $j++) {
                    $ftdivision_code="";
                    $ftdepartment_code="";
                    $ftposition_code="";
                    if($_REQUEST['ftdivision_codeD0'][$j]!="SELURUH") {
                            $ftdivision_code=" AND ftdivision_code='{$_REQUEST['ftdivision_codeD0'][$j]}'";
                    }
                    if($_REQUEST['ftdepartment_codeD0'][$j]!="SELURUH") {
                            $ftdepartment_code=" AND ftdepartment_code='{$_REQUEST['ftdepartment_codeD0'][$j]}'";
                    }
                    if($_REQUEST['ftposition_codeD0'][$j]!="SELURUH") {
                            $ftposition_code=" AND ftposition_code='{$_REQUEST['ftposition_codeD0'][$j]}'";
                    }

                    $where="WHERE fttemp='{$_REQUEST['ftshift_code_fromD0'][$j]}' 
                                    {$ftdivision_code} {$ftdepartment_code} {$ftposition_code}
                                    ";
                    $strSQL['update tlemployee'][]="UPDATE tlemployee
                                                    SET ftshift_code='{$_REQUEST['ftshift_code_toD0'][$j]}'
                                                    {$where} 
                                                     ";
                }
                break;
         }
    return $strSQL;
 }

  


?>
