prepare_list.php 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630
  1. <?php
  2. include $_SERVER['DOCUMENT_ROOT'].'/common/lib/comm.php';
  3. include $_SERVER['DOCUMENT_ROOT'].ADMIN_PATH.'common/auth_chk.php';
  4. $list_url = "prepare_list.php";
  5. // $mp = "32"; //set top nav
  6. $mp = "31"; //set top nav 20190805
  7. $searchtype = $_REQUEST['searchtype'];
  8. $searchword = $_REQUEST['searchword'];
  9. $ds_usertype = $_REQUEST['ds_usertype'];
  10. $ds_status = $_REQUEST['ds_status'];
  11. $dt_start = $_REQUEST['dt_start'];
  12. $dt_end = $_REQUEST['dt_end'];
  13. $PageNo = $_REQUEST['pageno'];
  14. $PageSize = $_REQUEST['PageSize'];
  15. if (empty($PageNo)) {$PageNo=1;}else{$PageNo=$PageNo;}
  16. if (empty($PageSize)) {
  17. $PageSize=10; //목록개수설정
  18. }else{$PageSize=$PageSize;}
  19. $pagestartpoint = ($PageNo-1)*$PageSize;
  20. $add_sql = "where s.ds_delind='N'";
  21. // $orderby = "order by s.dt_insert desc"; //2200513 등록일 날짜 기준으로 리스트 정렬하기
  22. //$orderby = "order by s.dt_update desc"; //20191207 디비에 업데이트 날짜 기준으로 리스트 정렬하기
  23. if(empty($PageSort)) {
  24. $orderby = "order by s.dt_update desc";
  25. }else {
  26. $sort = explode("|", $PageSort);
  27. $orderby = "order by $sort[0] $sort[1] ";
  28. }
  29. $ds_type = "A0"; //A0 : 매입
  30. $add_sql.= " and s.ds_type = '$ds_type' ";
  31. if($searchword != ""){
  32. if($searchtype=="" || $searchtype==null){
  33. $add_sql.= " and (s.nm_name like '%$searchword%' or a.nm_number like '%$searchword%') ";
  34. }else{
  35. $add_sql.= " and $searchtype like '%$searchword%'";
  36. }
  37. }
  38. if($ds_usertype != ""){
  39. $add_sql.= " and s.ds_usertype = '$ds_usertype'";
  40. }
  41. if($dt_start != "" && $dt_end != ""){
  42. $add_sql.= " and s.dt_insert between '$dt_start' and '$dt_end 23:59:59' ";
  43. }
  44. $add_sql.= " and s.ds_status in ('E0','F0')";
  45. ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  46. //관계사/지점 Setting
  47. $admin_ds_company_bp = $_SESSION['admin_ds_company_bp']; //관계사
  48. $admin_ds_branch = $_SESSION['admin_ds_branch']; //지점
  49. $admin_bp_ok = ($admin_ds_company_bp != "" || $admin_ds_branch != "") ? true : false; //admin_ds_company_bp 나 admin_ds_branch 값이 하나라도 있으면 관계사로 보고 권한 제한한다. $admin_bp_ok == true 이면 해당 관계사/지점 데이타만 확인 가능하다.
  50. //관계사 일 경우 해당 관계사/지점 데이타만 확인 가능하다.
  51. // if($admin_bp_ok){
  52. // if($admin_ds_company_bp != "" && $admin_ds_branch != ""){
  53. // $add_sql.= " and s.ds_company_bp = '$admin_ds_company_bp' and s.ds_branch = '$admin_ds_branch' ";
  54. // }else{ //admin_ds_company_bp 나 admin_ds_branch 값이 하나라도 없으면 데이타 확인 안되게 한다.
  55. // $add_sql.= " and 1 = 2 ";
  56. // }
  57. // }
  58. ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  59. //오리지널
  60. $sql = "select count(*)
  61. from sale_master s
  62. inner join car_master a on ( s.cd_car = a.cd_car )
  63. LEFT OUTER JOIN car_model b on (a.cd_model = b.cd_model)
  64. LEFT OUTER JOIN car_brand d on (a.cd_brand = d.cd_brand)
  65. $add_sql";
  66. // $sql = "
  67. // SELECT COUNT(*)
  68. // FROM sale_master s
  69. // INNER JOIN car_master a ON s.cd_car = a.cd_car
  70. // LEFT OUTER JOIN car_model b ON a.cd_model = b.cd_model
  71. // LEFT OUTER JOIN car_brand d ON a.cd_brand = d.cd_brand
  72. //
  73. // $add_sql
  74. // ";
  75. $totalrows = @mysql_result(mysql_query($sql),0,0);
  76. ?>
  77. <? include("../inc/inc_top.php") ?>
  78. <? include("../inc/inc_header.php") ?>
  79. <section id="contents">
  80. <h2>입찰중 리스트</h2>
  81. <form id="frmSearch" name="frmSearch" method="post">
  82. <input type="hidden" id="PageSort" name="PageSort">
  83. <input type="hidden" id="PageSize" name="PageSize">
  84. <input type="hidden" id="pageno" name="pageno" value="<?=$PageNo?>">
  85. <input type="hidden" id="searchtype" name="searchtype" value="<?=$searchtype?>">
  86. <table class="tbl_search">
  87. <colgroup>
  88. <col width="10%">
  89. <col width="*">
  90. </colgroup>
  91. <tr>
  92. <th>검색어</th>
  93. <td>
  94. <span class="select2" style="margin-right:5px;width:100px;" id="sel_searchtype">
  95. <select>
  96. <option value="">전체</option>
  97. <option value="s.nm_name"<? if($searchtype =="s.nm_name"){?> selected<?}?>>판매자</option>
  98. <option value="a.nm_number"<? if($searchtype =="a.nm_number"){?> selected<?}?>>차량번호</option>
  99. <option value="d.nm_brand"<? if($searchtype =="d.nm_brand"){?> selected<?}?>>제조사</option>
  100. <option value="b.nm_model"<? if($searchtype =="b.nm_model"){?> selected<?}?>>모델명</option>
  101. <option value="a.nm_color"<? if($searchtype =="a.nm_color"){?> selected<?}?>>색상</option>
  102. </select>
  103. </span>
  104. <input type="text" id="searchword" name="searchword" class="inp_txt" style="width:60%;" value="<?=$searchword?>">
  105. </td>
  106. </tr>
  107. <tr>
  108. <th>기간검색</th>
  109. <td>
  110. <!--span class="select2" style="margin-right:5px;width:100px;">
  111. <select>
  112. <option value=""></option>
  113. </select>
  114. </span-->
  115. <input type="text" class="inp_txt" style="width:30%;" id="dt_start" name="dt_start" value="<?=$dt_start?>">
  116. <span class="btn_cal" id="btn_cal1">달력보기</span>
  117. ~
  118. <input type="text" class="inp_txt" style="width:30%;" id="dt_end" name="dt_end" value="<?=$dt_end?>">
  119. <span class="btn_cal" id="btn_cal2">달력보기</span>
  120. <div class="sel_period">
  121. <span onclick="setSearchDate('day',0)">오늘</span>
  122. <span onclick="setSearchDate('day',-7)">7일</span>
  123. <span onclick="setSearchDate('day',-15)">15일</span>
  124. <span onclick="setSearchDate('month',-1)">1개월</span>
  125. <span onclick="setSearchDate('month',-3)">3개월</span>
  126. <span onclick="setSearchDate('year',-1)">1년</span>
  127. </div>
  128. <input type="button" class="rnd_btn ty3 gray" value="검색" title="검색" onclick="fnSearch()">
  129. <div class="btn_right" style="margin-top:-28px">
  130. <a href="javascript:;" id="btn_download_excel" class="rnd_btn black" style='width:110px;'>엑셀 다운로드</a>
  131. </div>
  132. </td>
  133. </tr>
  134. <!-- <tr>
  135. <th>회원구분</th>
  136. <td colspan="3">
  137. <div class="radio_chk">
  138. <span class="check_wrap"><input type="radio" name="ds_usertype" id="radio1" value=""><i></i><label for="radio1">전체</label></span>
  139. <span class="check_wrap"><input type="radio" name="ds_usertype" id="radio2" value="A0"<?if($ds_usertype=="A0"){?> checked="checked"<?}?>><i></i><label for="radio2">개인회원</label></span>
  140. <span class="check_wrap"><input type="radio" name="ds_usertype" id="radio3" value="B0"<?if($ds_usertype=="B0"){?> checked="checked"<?}?>><i></i><label for="radio3">사업자회원</label></span>
  141. <span class="check_wrap"><input type="radio" name="ds_usertype" id="radio4" value="C0"<?if($ds_usertype=="C0"){?> checked="checked"<?}?>><i></i><label for="radio4">비회원</label></span>
  142. </div>
  143. <input type="submit" class="rnd_btn ty3 gray" value="검색" title="검색">
  144. <div class="btn_right" style="margin-top:-28px">
  145. <a href="javascript:;" id="btn_download_excel" class="rnd_btn black" style='width:110px;'>엑셀 다운로드</a>
  146. </div>
  147. </td>
  148. </tr> -->
  149. </table>
  150. </form>
  151. <div class="select_view_type">
  152. <span class="select" style="width:160px;" id="selSort">
  153. <select id="page_sort">
  154. <option value=""<? if($PageSort==""){ ?> selected<? } ?>>정렬</option>
  155. <!-- <option value="s.dt_update|asc"<? if($PageSort=="s.dt_update|asc"){ ?> selected<? } ?>>수정일자 ↑</option>
  156. <option value="s.dt_update|desc"<? if($PageSort=="s.dt_update|desc"){ ?> selected<? } ?>>수정일자 ↓</option>
  157. <option value="s.dt_insert|asc"<? if($PageSort=="s.dt_insert|asc"){ ?> selected<? } ?>>등록일자 ↑</option>
  158. <option value="s.dt_insert|desc"<? if($PageSort=="s.dt_insert|desc"){ ?> selected<? } ?>>등록일자 ↓</option> -->
  159. <option value="s.dt_insert|asc"<? if($PageSort=="s.dt_insert|asc"){ ?> selected<? } ?>>등록일 높은순</option>
  160. <option value="s.dt_insert|desc"<? if($PageSort=="s.dt_insert|desc"){ ?> selected<? } ?>>등록일 낮은순</option>
  161. </select>
  162. </span>
  163. </div>
  164. <div class="tbl_wrap">
  165. <table class="tbl_list ty2">
  166. <colgroup>
  167. <col width="5%">
  168. <col width="8%">
  169. <col width="*">
  170. <col width="9%">
  171. <col width="11%">
  172. <col width="7%">
  173. <!-- <col width="7%"> -->
  174. <col width="9%">
  175. <col width="9%">
  176. <!-- <col width="9%">
  177. <col width="9%"> -->
  178. <col width="9%">
  179. </colgroup>
  180. <thead>
  181. <tr>
  182. <th>No</th>
  183. <th>판매자</th>
  184. <th>차종</th>
  185. <th>차량번호</th>
  186. <th>주행거리</th>
  187. <th>색상</th>
  188. <!-- <th>변속기</th> -->
  189. <th>판매지역</th>
  190. <th>판매시간</th>
  191. <!-- <th>수정일</th> -->
  192. <th>등록일</th>
  193. <th>초기화</th>
  194. <th>내역초기화</th>
  195. <!-- <th>재입찰</th>
  196. <th>재입찰</th> -->
  197. </tr>
  198. </thead>
  199. <?
  200. if($totalrows>0) {
  201. //ds_status E0의 매물 갯수가 많으면 10초 걸려서 쿼리 튜닝
  202. // $r = mysql_query("SELECT
  203. // a.*
  204. // , b.nm_model
  205. // , c.nm_grade
  206. // , d.nm_brand
  207. // , e.nm_model_sub
  208. // , getCode('car_master','ds_type',a.ds_type) as nm_type
  209. // , getCode('car_master','ds_open',a.ds_open) as nm_open
  210. // , getCode('car_master','ds_sales',a.ds_sales) as nm_sales
  211. // , getCode('car_master','ds_transmission',a.ds_transmission) as nm_transmission
  212. // , getCode('member_master','ds_area',s.ds_area) as nm_area
  213. // , getCode('sale_master','ds_status',s.ds_status) as nm_status
  214. // , s.cd_sale
  215. // , s.nm_name nm_name_sale
  216. // , s.nm_recommend nm_recommend_sale
  217. // , s.ds_status ds_status_sale
  218. // , s.ds_status_contract ds_status_contract_sale
  219. // , getRemainTimeByPhase(".LIMIT_TIME_TENDER.", ".LIMIT_TIME_SELL.", s.dt_approve, now()) as time_limit_sell
  220. // , s.dt_update dt_update_sale
  221. // , s.dt_insert dt_insert_sale
  222. // FROM sale_master s
  223. // inner join car_master a on (s.cd_car = a.cd_car)
  224. // left outer join car_model b on (a.cd_model = b.cd_model)
  225. // left outer join car_grade c on (a.cd_grade = c.cd_grade)
  226. // left outer join car_brand d on (a.cd_brand = d.cd_brand)
  227. // left outer join car_model_sub e on (a.cd_model_sub = e.cd_model_sub)
  228. // $sql $orderby LIMIT $pagestartpoint,$PageSize");
  229. $sql = "SELECT *
  230. , getCode('car_master','ds_type',ds_type) as nm_type
  231. , getCode('car_master','ds_open',ds_open) as nm_open
  232. , getCode('car_master','ds_sales',ds_sales) as nm_sales
  233. , getCode('car_master','ds_transmission',ds_transmission) as nm_transmission
  234. , getCode('member_master','ds_area',ds_area_sale) as nm_area
  235. , getCode('sale_master','ds_status',ds_status_sale) as nm_status
  236. -- , getRemainTimeByPhase(".LIMIT_TIME_TENDER.", ".LIMIT_TIME_SELL.", dt_approve_sale, now()) as time_limit_sell
  237. -- , getRemainTimeByPhase(ds_auction_time, ".LIMIT_TIME_SELL.", dt_approve_sale, now()) as time_limit_sell
  238. , getRemainTimeByPhase(ds_auction_time, ds_auction_time, dt_approve_sale, now()) as time_limit_sell
  239. FROM (
  240. SELECT
  241. a.*
  242. , b.nm_model
  243. , d.nm_brand
  244. , s.cd_sale
  245. , s.nm_name nm_name_sale
  246. , s.nm_recommend nm_recommend_sale
  247. , s.ds_status ds_status_sale
  248. , s.ds_status_contract ds_status_contract_sale
  249. , s.ds_area ds_area_sale
  250. , s.dt_approve dt_approve_sale
  251. , s.dt_update dt_update_sale
  252. , s.dt_insert dt_insert_sale
  253. , s.ds_auction_time
  254. FROM sale_master s
  255. inner join car_master a on (s.cd_car = a.cd_car)
  256. left outer join car_model b on (a.cd_model = b.cd_model)
  257. left outer join car_brand d on (a.cd_brand = d.cd_brand)
  258. $add_sql $orderby LIMIT $pagestartpoint,$PageSize
  259. ) as car
  260. ";
  261. if($_SERVER['REMOTE_ADDR'] == '220.86.24.199') {
  262. // echo $sql;
  263. // exit;
  264. }
  265. // echo $sql;
  266. $r = mysql_query($sql);
  267. if($_SERVER['REMOTE_ADDR'] == '106.251.80.237') {
  268. // $is_staff = $col['is_staff'];
  269. //
  270. // $sa = array();
  271. // if($is_staff == 'Y') {
  272. // $sa_sql ="SELECT * FROM sa_master ";
  273. // $sa = mysql_fetch_array(mysql_query($sa_sql));
  274. // }
  275. // echo var_dump($sa);
  276. }
  277. $i=1;
  278. while($col = mysql_fetch_array($r)) {
  279. $tmpNum =$totalrows-($PageSize*($PageNo-1));
  280. $no = ($tmpNum - $i)+1;
  281. if($_SERVER['REMOTE_ADDR'] == '106.251.80.237') {
  282. //var_dump($col);
  283. }
  284. ?>
  285. <tr cd_sale='<?=$col['cd_sale']?>' uri='./buy_view.php?list_url=<?=$list_url?>&cd_sale=<?=$col['cd_sale']?>&ds_status_sale=<?=$col['ds_status_sale']?>&ds_status_contract_sale=<?=$col['ds_status_contract_sale']?>&ListPageNo=<?=$PageNo?>' _onclick="location.href=;" style="cursor:pointer;">
  286. <td><?=$no?></td>
  287. <td><?=$col['nm_name_sale']?></td>
  288. <td><?=$col['nm_brand']." ".$col['nm_model']?></td>
  289. <td><?=$col['nm_number']?></td>
  290. <td><?=$col['nm_mileage']?>km</td>
  291. <td><?=$col['nm_color']?></td>
  292. <!-- <td><?=$col['nm_transmission']?></td> -->
  293. <td><?=$col['nm_area']?></td>
  294. <td><?=$col['time_limit_sell']?></td>
  295. <td><?=$col['dt_insert_sale']?></td>
  296. <!-- <td><?=$col['dt_update_sale']?></td> -->
  297. <td class='time_reset'>입찰시간 초기화</td>
  298. <td class='time_history_reset'>입찰시간 및 내역 초기화</td>
  299. </tr>
  300. <?
  301. $i++;
  302. }
  303. }else{
  304. ?>
  305. <tr>
  306. <td colspan="11">등록된 정보가 없습니다.</td>
  307. </tr>
  308. <?
  309. }
  310. ?>
  311. </table>
  312. </div>
  313. <div class="paging">
  314. <?php
  315. $url = "./$list_url?searchtype=$searchtype&searchword=$searchword&ds_status=$ds_status&ds_usertype=$ds_usertype&dt_start=$dt_start&dt_end=$dt_end&PageSort=$PageSort";
  316. ListPg1($url ,$PageNo,$PageSize,10,$totalrows,$leftboard[1],$rootpath);
  317. ?>
  318. </div>
  319. <!-- layer popup1 -->
  320. <div class="layer_popup reset1_popup">
  321. <form id="frmFormResetTime" name="frmFormResetTime" method="post" enctype="multipart/form-data">
  322. <input type="hidden" name="cd_sale" value="">
  323. <div class="popup_wrap" style='width: 280px;height: 120px;'>
  324. <h4 style='padding:40px 0 20px 0;'>입찰시간이 초기화 됩니다</h4>
  325. <div class="btn_center">
  326. <a href="#" class="rnd_btn ty3 gray" onclick="closeLayer('reset1'); return false;">취소</a>
  327. <a href="#" class="rnd_btn ty3 black" id="btn_time_reset">확인</a>
  328. </div>
  329. </div>
  330. </form>
  331. <div class="close">레이어팝업 닫기</div>
  332. </div>
  333. <!-- // layer popup1 -->
  334. <!-- layer popup2 -->
  335. <div class="layer_popup reset2_popup">
  336. <form id="frmFormResetTimeHistory" name="frmFormResetTimeHistory" method="post" enctype="multipart/form-data">
  337. <input type="hidden" name="cd_sale" value="">
  338. <div class="popup_wrap" style='width: 280px;height: 120px;'>
  339. <h4 style='padding:40px 0 20px 0;'>입찰 시간 및 입찰내역이 초기화 됩니다</h4>
  340. <div class="btn_center">
  341. <a href="#" class="rnd_btn ty3 gray" onclick="closeLayer('reset2'); return false;">취소</a>
  342. <a href="#" class="rnd_btn ty3 black" id="btn_time_history_reset">확인</a>
  343. </div>
  344. </div>
  345. </form>
  346. <div class="close">레이어팝업 닫기</div>
  347. </div>
  348. <!-- // layer popup2 -->
  349. </section>
  350. <form name="excelForm" id="excelForm" method="GET">
  351. <input type="hidden" name="searchtype" value="<?=$searchtype?>">
  352. <input type="hidden" name="searchword" value="<?=$searchword?>">
  353. <input type="hidden" name="ds_usertype" value="<?=$ds_usertype?>">
  354. <input type="hidden" name="dt_start" value="<?=$dt_start?>">
  355. <input type="hidden" name="dt_end" value="<?=$dt_end?>">
  356. </form>
  357. <script language="javascript" type="text/javascript">
  358. $("#dt_start").datepicker({ dateFormat: 'yy-mm-dd' });
  359. $("#dt_end").datepicker({ dateFormat: 'yy-mm-dd' });
  360. function setSearchDate(arg1, arg2){
  361. var dtStart = getSearchDate(arg1, arg2);
  362. var dtEnd = getSearchDate("day", 0);
  363. $("#dt_start").val(dtStart);
  364. $("#dt_end").val(dtEnd);
  365. }
  366. $(document).ready(function() {
  367. // 엔터키로 검색 실행
  368. $("#searchword").on("keypress", function(e) {
  369. if(e.which == 13) {
  370. fnSearch();
  371. return false;
  372. }
  373. });
  374. $("#btn_cal1").bind("click",function(){
  375. $("#dt_start").datepicker('show');
  376. });
  377. $("#btn_cal2").bind("click",function(){
  378. $("#dt_end").datepicker('show');
  379. });
  380. $(".tbl_wrap td").on("click", function() {
  381. var cd_sale = $(this).closest("tr").attr("cd_sale");
  382. if($(this).hasClass('time_reset')) {
  383. var custom_opts = {
  384. title : '',
  385. btn_close_show : false,
  386. }
  387. var $parent = $(this).closest("tr");
  388. var cd_sale = $parent.attr("cd_sale");
  389. custom_opts.title = '입찰시간을 초기화 하시겠습니까?\n실행후에는 복구 할 수 없습니다';
  390. custom_modal_confirm(custom_opts, function(confirm) {
  391. if(confirm) {
  392. var data = { mode:"resetTime", cd_sale: cd_sale}
  393. $.ajax({
  394. url: "proc.php",
  395. type: 'post',
  396. data: data,
  397. dataType: 'json',
  398. success: function(res) {
  399. custom_modal_confirm_close();
  400. if(res.CODE != "0000") {
  401. custom_opts.title = res.MSG;//'실패하였습니다. 다시 시도해 주세요.';
  402. custom_modal_alert(custom_opts);
  403. return false;
  404. }
  405. custom_opts.title = '초기화 되었습니다.';
  406. custom_opts.event_esc_key = false;
  407. custom_modal_alert(custom_opts, function() {
  408. reload();
  409. });
  410. },
  411. error:function(request,status,error){
  412. custom_modal_confirm_close();
  413. alert("code:"+request.status+"\n"+"message:"+request.responseText+"\n"+"error:"+error);
  414. }
  415. });
  416. }else {
  417. return false;
  418. }
  419. });
  420. // $("#frmFormResetTime input[name=cd_sale]").val(cd_sale);
  421. // openLayer('reset1');
  422. }
  423. else if($(this).hasClass('time_history_reset')) {
  424. var custom_opts = {
  425. title : '',
  426. btn_close_show : false,
  427. }
  428. var $parent = $(this).closest("tr");
  429. var cd_sale = $parent.attr("cd_sale");
  430. custom_opts.title = '입찰시간 및 내역을 초기화 하시겠습니까?\n실행후에는 복구 할 수 없습니다';
  431. custom_modal_confirm(custom_opts, function(confirm) {
  432. if(confirm) {
  433. var data = { mode:"resetTimeHistory", cd_sale: cd_sale}
  434. $.ajax({
  435. url: "proc.php",
  436. type: 'post',
  437. data: data,
  438. dataType: 'json',
  439. success: function(res) {
  440. custom_modal_confirm_close();
  441. if(res.CODE != "0000") {
  442. custom_opts.title = res.MSG;//'실패하였습니다. 다시 시도해 주세요.';
  443. custom_modal_alert(custom_opts);
  444. return false;
  445. }
  446. custom_opts.title = '초기화 되었습니다.';
  447. custom_opts.event_esc_key = false;
  448. custom_modal_alert(custom_opts, function() {
  449. reload();
  450. });
  451. },
  452. error:function(request,status,error){
  453. custom_modal_confirm_close();
  454. alert("code:"+request.status+"\n"+"message:"+request.responseText+"\n"+"error:"+error);
  455. }
  456. });
  457. }else {
  458. return false;
  459. }
  460. });
  461. //
  462. // $("#frmFormResetTimeHistory input[name=cd_sale]").val(cd_sale);
  463. //
  464. // openLayer('reset2');
  465. }else {
  466. var uri = $(this).closest("tr").attr("uri");
  467. if(typeof uri != "undefined") {
  468. window.location.href = uri;
  469. }
  470. }
  471. });
  472. // $("#btn_time_reset").on("click", function() {
  473. //
  474. //
  475. // if(confirm('초기화 하시겠습니까? 실행후에는 복구 할 수 없습니다.')) {
  476. // var arg_cd_sale = $("#frmFormResetTime input[name=cd_sale]").val();
  477. //
  478. // $.post("proc.php", { mode:"resetTime", cd_sale: arg_cd_sale},function(data) {
  479. // if(data=="Y"){
  480. // alert("정상적으로 처리되었습니다.");
  481. // window.location.reload();
  482. // return;
  483. // }else{
  484. // alert("정상적으로 처리되지 않았습니다.");
  485. // return;
  486. // }
  487. // });
  488. // }
  489. // });
  490. $("#btn_time_history_reset").on("click", function() {
  491. // if(confirm('초기화 하시겠습니까? 실행후에는 복구 할 수 없습니다.')) {
  492. // var arg_cd_sale = $("#frmFormResetTimeHistory input[name=cd_sale]").val();
  493. //
  494. // $.post("proc.php", { mode:"resetTimeHistory", cd_sale: arg_cd_sale},function(data) {
  495. // if(data=="Y"){
  496. // alert("정상적으로 처리되었습니다.");
  497. // window.location.reload();
  498. // return;
  499. // }else if(data=="NO"){
  500. // alert("초기화는 완료 됐으나 사고보험정보를 가져오지 못해 갱신처리 되지 않았습니다.");
  501. // window.location.reload();
  502. // return;
  503. // }else{
  504. // alert("정상적으로 처리되지 않았습니다.");
  505. // return;
  506. // }
  507. // });
  508. // }
  509. });
  510. $("#selSort div.jq_sel ul li a").bind("click",function(){
  511. // alert(this.value);
  512. // $("#PageSort").val(this.value);
  513. $("#PageSort").val($("#selSort option:selected").val());
  514. $("#frmSearch").submit();
  515. });
  516. $("#sel_searchtype div.jq_sel ul li a").bind("click",function(){
  517. $("#searchtype").val($("#sel_searchtype option:selected").val());
  518. });
  519. });
  520. function fnSearch(){
  521. if($("#searchtype").val()!="" && $("#searchword").val()==""){
  522. alert("검색어를 입력하세요");
  523. return false;
  524. }
  525. // 검색 시 1페이지로 이동
  526. $("#pageno").val(1);
  527. $("#frmSearch").submit();
  528. }
  529. console.log($("#excelForm").serialize())
  530. $("#btn_download_excel").click(function(e) {
  531. var url = "prepare_list_excel.php?"+$("#excelForm").serialize();
  532. window.open(url, "excelWin");
  533. });
  534. </script>
  535. <? include("../inc/inc_footer.php") ?>
  536. <? include("../inc/inc_bottom.php") ?>
  537. <?
  538. mysql_close($connect);
  539. ?>