<?php

     function UpdateData() {
        global $objAxpDB;
        $objAxpDB->Allow_Update(false);
        switch($_REQUEST[mode]) {

        case "update":

             foreach ($_REQUEST['fnS']  as $key => $value) {
                $m="$value";
                if(isset($_REQUEST['c'.$m])) {
                    $c="1";
                }
                else {
                    $c="0";
                }

                $strSQL['Insert tluser'][]="
                REPLACE INTO tluser_access_setting (
                        fnid,ftbranch_code,ftusername,
                        ftsecurity_code,fbaccess,ftcreated_user,
                        fdcreated_date,ftmodified_user,fdmodified_date
                        )
                        SELECT
                        '' AS fnid,'{$_SESSION['strbranch']}' AS ftbranch_code,'{$_REQUEST['ftusername']}' AS ftusername,
                        '{$value}' AS fnsecurity_access,'{$c}' AS fnsecurity,'{$_SESSION['username']}' AS ftcreated_user,
                        now() AS fdcreated_date,'{$_SESSION['username']}' AS ftmodified_user,now() AS fdmodified_date";


             }
        break;
        }
      return $strSQL;
    }

?>