'9999', 'MSG'=>''); try { if(!$_POST) { throw new Exception("정상적인 접근이 아닙니다.", "9999"); } if(empty($nm_name)) { throw new Exception("이름이 없습니다.", "9995"); } if(empty($nm_hp) || $nm_hp == "--") { throw new Exception("휴대번호가 없습니다.", "9993"); } // if(empty($nm_email) || $nm_email == "@") { // throw new Exception("이메일이 없습니다.", "9993"); // } $nm_hp = preg_replace("/[^0-9]*/s", "", $nm_hp); $nm_hp = add_hyphen($nm_hp); $add_pwd_sql = ""; if(!empty($nm_pass)) { $add_pwd_sql = " , nm_pass = password('".$nm_pass."') "; } $sql = "UPDATE $table_name SET nm_name = '$nm_name' , nm_hp = '$nm_hp' , nm_email = '$nm_email' , ds_area = '$ds_area' , dt_update = now() , nm_update = '$cd_procid' $add_pwd_sql WHERE cd_userid = '$cd_procid' "; // echo $sql; // exit; $result = mysql_query($sql,$connect); if(!$result) { throw new Exception("정보 수정에 실패 하였습니다.잠시후 다시 시도해 주세요.", "9990"); } // throw new Exception("정보 수정에 실패 하였습니다.잠시후 다시 시도해 주세요.", "9990"); $_SESSION['s_cd_userid'] = null; $_SESSION['s_nm_email'] = null; $_SESSION['s_nm_name'] = null; $_SESSION['s_nm_hp'] = null; $_SESSION['s_nm_hp_form'] = null; $_SESSION['s_ds_type'] = null; $_SESSION['s_ds_level'] = null; $_SESSION['s_cd_user'] = null; $_SESSION['s_cd_dealer'] = null; $_SESSION['s_cd_dealer_p'] = null; $_SESSION['s_nm_area'] = null; $_SESSION['s_ds_area'] = null; $_SESSION['s_ds_area_sub'] = null; $_SESSION['s_ds_usertype'] = null; setcookie ('ESMotorsStaff', '', time() - 1, "/"); $RES['CODE'] = "0000"; $RES['MSG'] = "정보수정이 완료되었습니다."; }catch(Exception $e){ $RES['CODE'] = $e->getCode(); $RES['MSG'] = $e->getMessage(); } @mysql_close($connect); echo json_encode($RES); exit; break; case 'Withdrawal': $RES = array('CODE'=>'9999', 'MSG'=>''); try { if(!$_POST) { throw new Exception("정상적인 접근이 아닙니다.", "9999"); } $sql = "UPDATE $table_name SET dt_withdrawal = now() , ds_status = 'W0' , dt_update = now() , nm_update = '$cd_procid' WHERE cd_userid = '$cd_procid' "; // echo $sql; // exit; $result = mysql_query($sql,$connect); if(!$result) { throw new Exception("탈퇴신청에 실패 하였습니다.잠시후 다시 시도해 주세요.", "9990"); } // throw new Exception("정보 수정에 실패 하였습니다.잠시후 다시 시도해 주세요.", "9990"); $_SESSION['s_cd_userid'] = null; $_SESSION['s_nm_email'] = null; $_SESSION['s_nm_name'] = null; $_SESSION['s_nm_hp'] = null; $_SESSION['s_nm_hp_form'] = null; $_SESSION['s_ds_type'] = null; $_SESSION['s_ds_level'] = null; $_SESSION['s_cd_user'] = null; $_SESSION['s_cd_dealer'] = null; $_SESSION['s_cd_dealer_p'] = null; $_SESSION['s_nm_area'] = null; $_SESSION['s_ds_area'] = null; $_SESSION['s_ds_area_sub'] = null; $_SESSION['s_ds_usertype'] = null; setcookie ('ESMotorsStaff', '', time() - 1, "/"); $RES['CODE'] = "0000"; $RES['MSG'] = "탈퇴가 완료되었습니다."; }catch(Exception $e){ $RES['CODE'] = $e->getCode(); $RES['MSG'] = $e->getMessage(); } @mysql_close($connect); echo json_encode($RES); exit; break; default : AlertBack("지정되지않은 요청입니다"); break; } mysql_close($connect); ?>