示例#1
0
$CLIENT_CONST_PAGEID = 'Client Profile';
//require_once(CLIENT_INCLUDES_PATH . 'client_authorize.inc.php');
require_once CLIENT_INCLUDES_PATH . 'client_db_function.inc.php';
require_once CLIENT_INCLUDES_PATH . 'profile_function.inc.php';
require_once INCLUDES_PATH . 'mail_common_function.inc.php';
////$strSessionVal = $_SESSION[CLIENT_SESSION_NAME];
//$arrSessions = explode(chr(5), $strSessionVal);
//$strCK_user_id = $arrSessions[3];
if (isset($_REQUEST["action"])) {
    switch ($_REQUEST["action"]) {
        case "reset":
            require_once CLIENT_INCLUDES_PATH . 'client_authorize.inc.php';
            $formMaps = client_profile_form_table_map();
            $updateparams = getUpdateQueryString($_REQUEST, $formMaps);
            $result = updateClientProfile($updateparams, $objDataHelper, $strSetClient_ID, $_REQUEST["action"]);
            echo $result;
            break;
        case "resetpwd":
            require_once CLIENT_INCLUDES_PATH . 'client_authorize.inc.php';
            $formMaps = client_profile_form_table_map();
            $updateparams = getUpdateQueryString($_REQUEST, $formMaps);
            $result = updateClientProfile($updateparams, $objDataHelper, $strSetClient_ID, $_REQUEST["action"]);
            echo $result;
            break;
        case "forgotpwd":
            //print_r($_REQUEST);
            $result = forgotPwd($objDataHelper);
            echo $result;
            break;
    }
}
     $data['reg_email'] = trim($_POST['reg_email']);
     $data['reg_username'] = trim($_POST['reg_username']);
     $data['reg_password'] = trim($_POST['reg_password']);
     $data['reg_bdate'] = trim($_POST['reg_bdate']);
     $data['reg_address'] = ucfirst(trim($_POST['reg_address']));
     $data['reg_mobile'] = trim($_POST['reg_mobile']);
     $result = newClient($data);
     echo $result;
 } elseif ($action == "updateClientProfile") {
     $data['ce_fname'] = ucfirst(trim($_POST['ce_fname']));
     $data['ce_lname'] = ucfirst(trim($_POST['ce_lname']));
     $data['ce_address'] = ucfirst(trim($_POST['ce_address']));
     $data['ce_email'] = trim($_POST['ce_email']);
     $data['ce_uname'] = trim($_POST['ce_uname']);
     $data['ce_contact'] = trim($_POST['ce_contact']);
     $result = updateClientProfile($data);
     echo $result;
 } else {
     if ($action == "userlogin") {
         $data['user_login_username'] = trim($_POST['user_login_username']);
         $data['user_login_password'] = trim($_POST['user_login_password']);
         $result = userLogin($data);
         if ($result) {
             echo $result;
         }
     } elseif ($action == "getClientProfile") {
         $result = getClientProfile();
         header('content-type: application/json');
         echo json_encode($result);
     } elseif ($action == "clientLogout") {
         clientLogout();