| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192 |
- <?php
- include $_SERVER['DOCUMENT_ROOT'].'/common/lib/comm.php';
- include $_SERVER['DOCUMENT_ROOT'].ADMIN_PATH.'common/auth_chk.php';
- $DATAS = array();
- $RES = array("CODE"=> '', "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;
- ?>
|