'', "MSG" => '', 'DATAS' => ''); $cd_userid = trim($_SESSION["admin_cd_userid"]); $mode = trim(avoid_crack($_REQUEST["mode"])); $nm_number = trim(avoid_crack($_REQUEST["nm_number"])); $cd_car_history = trim(avoid_crack($_REQUEST["cd_car_history"])); try { switch($mode) { case 'view': $r = mysql_query("SELECT s.* FROM car_history_master s where cd_car_history = '$cd_car_history' and ds_type = 'admin' LIMIT 1"); $history_col = mysql_fetch_array($r); $r000 = $history_col["r000"]; $r001 = $history_col["r001"]; $r002 = $history_col["r002"]; $r003 = $history_col["r003"]; $r004 = $history_col["r004"]; $r005 = $history_col["r005"]; $r101 = $history_col["r101"]; $r102 = $history_col["r102"]; $r103 = $history_col["r103"]; $r104 = $history_col["r104"]; $r105 = $history_col["r105"]; $r106 = $history_col["r106"]; $r107 = $history_col["r107"]; $r108 = $history_col["r108"]; $r109 = $history_col["r109"]; $r111 = $history_col["r111"]; $r401 = $history_col["r401"]; $r402 = $history_col["r402"]; $r403 = $history_col["r403"]; $r404 = $history_col["r404"]; $r405 = $history_col["r405"]; $r406_01 = $history_col["r406_01"]; $r407 = $history_col["r407"]; $r408_01 = $history_col["r408_01"]; $r409 = $history_col["r409"]; $r410_01 = $history_col["r410_01"]; $r201 = $history_col["r201"]; $r202 = $history_col["r202"]; $r203 = $history_col["r203"]; $r204 = $history_col["r204"]; $r205 = $history_col["r205"]; $r510 = $history_col["r510"]; $r511_01 = $history_col["r511_01"]; $r501 = $history_col["r501"]; $r502 = $history_col["r502"]; $r301 = $history_col["r301"]; $r302 = $history_col["r302"]; $r303 = $history_col["r303"]; $r601 = $history_col["r601"]; $r602 = $history_col["r602"]; $r701 = $history_col["r701"]; //차량 보험처리 이력 전체 정보 include_once($_SERVER['DOCUMENT_ROOT'].'/common/inc/inc_car_history.php'); exit; break; case 'user_view': $r = mysql_query("SELECT s.* FROM car_history_master s where cd_car_history = '$cd_car_history' and ds_type = 'user' LIMIT 1"); $history_col = mysql_fetch_array($r); $r000 = $history_col["r000"]; $r001 = $history_col["r001"]; $r002 = $history_col["r002"]; $r003 = $history_col["r003"]; $r004 = $history_col["r004"]; $r005 = $history_col["r005"]; $r101 = $history_col["r101"]; $r102 = $history_col["r102"]; $r103 = $history_col["r103"]; $r104 = $history_col["r104"]; $r105 = $history_col["r105"]; $r106 = $history_col["r106"]; $r107 = $history_col["r107"]; $r108 = $history_col["r108"]; $r109 = $history_col["r109"]; $r111 = $history_col["r111"]; $r401 = $history_col["r401"]; $r402 = $history_col["r402"]; $r403 = $history_col["r403"]; $r404 = $history_col["r404"]; $r405 = $history_col["r405"]; $r406_01 = $history_col["r406_01"]; $r407 = $history_col["r407"]; $r408_01 = $history_col["r408_01"]; $r409 = $history_col["r409"]; $r410_01 = $history_col["r410_01"]; $r201 = $history_col["r201"]; $r202 = $history_col["r202"]; $r203 = $history_col["r203"]; $r204 = $history_col["r204"]; $r205 = $history_col["r205"]; $r510 = $history_col["r510"]; $r511_01 = $history_col["r511_01"]; $r501 = $history_col["r501"]; $r502 = $history_col["r502"]; $r301 = $history_col["r301"]; $r302 = $history_col["r302"]; $r303 = $history_col["r303"]; $r601 = $history_col["r601"]; $r602 = $history_col["r602"]; $r701 = $history_col["r701"]; //차량 보험처리 이력 전체 정보 include_once($_SERVER['DOCUMENT_ROOT'].'/common/inc/inc_car_history.php'); exit; break; case 'search': default: include_once($_SERVER['DOCUMENT_ROOT']."/common/lib/class.carhistory.php"); $g_bszUser_key = "db,f8,e7,7b,4b,53,28,04,fc,f8,99,62,70,d5,ad,bb"; $g_bszIV = "26,8d,66,a7,35,a8,1a,81,6f,ba,d9,fa,36,16,25,01"; $carHistory = new CarHistory(); if(empty($nm_number)) { throw new Exception('차량번호가 넘어오질 않았습니다.', 9999); } // $nm_number = "28부5708"; //$nm_number // $nm_number = "53라9319"; //$nm_number $data = array(); $data['sType'] = $carHistory->encrypt($g_bszIV, $g_bszUser_key, "1"); $data['carNum'] = $carHistory->encrypt($g_bszIV, $g_bszUser_key, $nm_number); $data['memberId'] = $carHistory->encrypt($g_bszIV, $g_bszUser_key, $cd_userid); $data['carNumType'] = "0"; $data['stdDate'] = date("Ymd"); $carData = $carHistory->getHistory($data); if($_SERVER['REMOTE_ADDR'] == '220.86.24.199') { // print_r($carData); // exit; } if($carData['r000'] != "000") { throw new Exception('차량이력정보를 가져오는데 실패하였습니다.', 9998); } $car_data = array(); $cur_date = date("Y-m-d H:i:s"); $car_data['dt_insert'] = $cur_date; $car_data['nm_insert'] = $cd_userid; $car_data['dt_update'] = $cur_date; $car_data['nm_update'] = $cd_userid; $db_result = $carHistory->db_update(0, $car_data, 'admin'); if (!$db_result) { throw new Exception('차량이력정보를 저장하는데 실패하였습니다.', 9997); } $DATAS = $carData; break; } $RES['CODE'] = '0000'; $RES['MSG'] = '정상처리'; $RES['DATAS'] = $DATAS; }catch(Exception $e) { $RES['CODE'] = $e->getCode(); $RES['MSG'] = $e->getMessage(); } echo json_encode($RES); exit; ?>