'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"); // } $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_company_bp = '$ds_company_bp' , ds_branch = '$ds_branch' , ds_area = '$ds_area' , ds_area_sub = '$ds_area_sub' , 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"); } $_SESSION['s_staff_userid'] = null; $_SESSION['s_staff_user']=null; $_SESSION['s_nm_email'] = null; $_SESSION['s_nm_name'] = null; $_SESSION['s_nm_hp'] = null; $_SESSION['s_ds_type'] = null; $_SESSION['s_ds_level'] = null; $_SESSION['s_cd_user'] = null; $_SESSION['s_ds_area'] = null; $_SESSION['s_ds_area_sub'] = null; $_SESSION['s_ds_usertype'] = null; $_SESSION['s_ds_company_bp']=null; //관계사 $_SESSION['s_ds_branch']=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); ?>