<?php
 
    function SaveData() {
        global $objAxpDB;
        $objAxpDB->Allow_Save(false);
        switch($_REQUEST[mode]) {
        case "simpan":
           $sql1="select ftusername 
                  from tluser 
                  where ftusername='{$_REQUEST['ftusername']}' and 
                        ftpassword='{$_REQUEST['ftpassword']}'";
           
            $url = $_SERVER["PHP_SELF"];
            $form = $_REQUEST["form"];
           if(!RetRstField($sql1)) {
               echo "<script>
                          alert('Ganti password gagal...');                             
                          window.location='{$url}?form={$form}&mode=edit';
                    </script>";              
                die("");
           }
          else {
             $sql1="update tluser 
                      set ftpassword='{$_REQUEST['password_confirm1']}' 
                    where ftusername='{$_REQUEST['ftusername']}'";
               mysql_query($sql1);
                echo "<script>
                          alert('Ganti password sukses...');                             
                          window.location='{$url}?p=1';
                    </script>";              
                die("");
          }
          
        break;
        }
      return $strSQL;
    }

?>
