| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238 |
- <?php
- include $_SERVER['DOCUMENT_ROOT'].'/common/lib/comm.php';
- include $_SERVER['DOCUMENT_ROOT'].ADMIN_PATH.'common/auth_chk.php';
- $list_url = "car_history.php";
- // $mp = "31"; //set top nav
- $mp = "60"; //set top nav 20190805
- $PageNo = $_REQUEST['pageno'];
- $PageSize = $_REQUEST['PageSize'];
- $PageSort = $_REQUEST['PageSort'];
- if (empty($PageNo)) {$PageNo=1;}else{$PageNo=$PageNo;}
- if (empty($PageSize)) {
- $PageSize=10; //목록개수설정
- }else{$PageSize=$PageSize;}
- $pagestartpoint=($PageNo-1)*$PageSize;
- $add_sql = " where s.ds_type = 'admin' and s.ds_delind='N' and cd_car = 0 ";
- if(empty($PageSort)) {
- $orderby = "order by s.dt_insert desc";
- }else {
- $sort = explode("|", $PageSort);
- $orderby = "order by $sort[0] $sort[1] ";
- }
- $searchtype = $_REQUEST['searchtype'];
- $searchword = $_REQUEST['searchword'];
- $ds_usertype = $_REQUEST['ds_usertype'];
- $ds_status = $_REQUEST['ds_status'];
- if($dt_start != "" && $dt_end != ""){
- $add_sql.= " and date(s.r001) between '$dt_start' and '$dt_end' ";
- }
- if($searchword != ""){
- if($searchtype=="" || $searchtype==null){
- $add_sql.= " and (s.nm_name like '$searchword%' or a.nm_number like '$searchword%') ";
- }else{
- $add_sql.= " and $searchtype like '$searchword%'";
- }
- }
- $sql = "select count(*) from car_history_master s $add_sql";
- // echo $sql;
- $totalrows = @mysql_result(mysql_query($sql),0,0);
- ?>
- <? include("../inc/inc_top.php") ?>
- <? include("../inc/inc_header.php") ?>
- <section id="contents">
- <h2>사고정보조회 리스트</h2>
- <form id="frmSearch" name="frmSearch" method="post">
- <input type="hidden" id="PageSort" name="PageSort">
- <input type="hidden" id="PageSize" name="PageSize">
- <input type="hidden" id="searchtype" name="searchtype" value="<?=$searchtype?>">
- <table class="tbl_search">
- <colgroup>
- <col width="10%">
- <col width="*">
- </colgroup>
- <tr>
- <th>차량번호</th>
- <td>
- <input type="text" id="nm_number" name="nm_number" class="inp_txt" style="width:30%;" value="" placeholder="차량번호를 입력하세요">
- <a href="#" class="rnd_btn ty2 black" id="btn_car_history" style="width:120px;">차량 정보 조회</a>
- </td>
- </tr>
- <tr>
- <th>검색어</th>
- <td>
- <span class="select2" style="margin-right:5px;width:100px;" id="sel_searchtype">
- <select>
- <option value="">전체</option>
- <option value="s.r002"<? if($searchtype =="s.r002"){?> selected<?}?>>차량번호</option>
- </select>
- </span>
- <input type="text" id="searchword" name="searchword" class="inp_txt" style="width:60%;" value="<?=$searchword?>">
- </td>
- </tr>
- <tr>
- <th>기간검색</th>
- <td>
- <input type="text" class="inp_txt" style="width:30%;" id="dt_start" name="dt_start" value="<?=$dt_start?>">
- <span class="btn_cal" id="btn_cal1">달력보기</span>
- ~
- <input type="text" class="inp_txt" style="width:30%;" id="dt_end" name="dt_end" value="<?=$dt_end?>">
- <span class="btn_cal" id="btn_cal2">달력보기</span>
- <div class="sel_period">
- <span onclick="setSearchDate('day',0)">오늘</span>
- <span onclick="setSearchDate('day',-7)">7일</span>
- <span onclick="setSearchDate('day',-15)">15일</span>
- <span onclick="setSearchDate('month',-1)">1개월</span>
- <span onclick="setSearchDate('month',-3)">3개월</span>
- <span onclick="setSearchDate('year',-1)">1년</span>
- </div>
- <input type="submit" class="rnd_btn ty3 gray" value="검색" title="검색">
- </td>
- </tr>
- </table>
- </form>
- <div class="tbl_wrap">
- <table class="tbl_list ty2">
- <colgroup>
- <col width="5%">
- <col width="16%">
- <col width="*">
- <col width="16%">
- <col width="16%">
- </colgroup>
- <thead>
- <tr>
- <th>번호</th>
- <th>차량번호</th>
- <th>차종</th>
- <th>조회일</th>
- <th>이력조회 보기</th>
- </tr>
- </thead>
- <?
- if($totalrows>0) {
- $r = mysql_query("SELECT
- s.*
- FROM car_history_master s
- $add_sql $orderby LIMIT $pagestartpoint,$PageSize");
- $i=1;
- while($col = mysql_fetch_array($r)) {
- $tmpNum =$totalrows-($PageSize*($PageNo-1));
- $no = ($tmpNum - $i)+1;
- ?>
- <tr>
- <td><?=$no?></td>
- <td><?=$col['r002']?></td>
- <td><?=$col['r005']?></td>
- <td><?=$col['dt_insert']?></td>
- <td><span class="btn_view" cd_car_history="<?=$col['cd_car_history']?>">보기</a></td>
- </tr>
- <?
- $i++;
- }
- }else{
- ?>
- <tr>
- <td colspan="5">등록된 정보가 없습니다.</td>
- </tr>
- <?
- }
- ?>
- </tr>
- </table>
- </div>
- <div class="paging">
- <?
- $url = "./$list_url?searchtype=$searchtype&searchword=$searchword&ds_status=$ds_status&ds_usertype=$ds_usertype&PageSort=$PageSort&dt_start=$dt_start&dt_end=$dt_end";
- ListPg1($url ,$PageNo,$PageSize,10,$totalrows,$leftboard[1],$rootpath);
- ?>
- </div>
- <!-- layer popup1 -->
- <div class="layer_popup history_popup">
- <div class="close">팝업닫기</div>
- <h3>중고차 보험처리 이력정보 보고서</h3>
- <div class="scr_cont" id="scr_cont">
- </div>
- </div>
- </section>
- <script language="javascript" type="text/javascript">
- function setSearchDate(arg1, arg2){
- var dtStart = getSearchDate(arg1, arg2);
- var dtEnd = getSearchDate("day", 0);
- $("#dt_start").val(dtStart);
- $("#dt_end").val(dtEnd);
- }
- $(document).ready(function() {
- $("#dt_start").datepicker({ dateFormat: 'yy-mm-dd' });
- $("#dt_end").datepicker({ dateFormat: 'yy-mm-dd' });
- $("#sel_searchtype div.jq_sel ul li a").bind("click",function(){
- $("#searchtype").val($("#sel_searchtype option:selected").val());
- });
- //차량정보 조회
- $("#btn_car_history").on("click", function() {
- var fieldlist = [["nm_number","차량번호"]] ;
- if (!fnCheckForm(fieldlist)){
- return false;
- }
- $.post("car_history.ajax.php", { mode: 'search', nm_number: $("#nm_number").val()},function(data) {
- var obj = JSON.parse(data); //JSON형식으로 리턴 받을 때
- console.log(data);
- var INFO = obj.INFO;
- if(obj.CODE != "0000"){ //정상이 아닐때
- alert(obj.MSG);
- return false;
- }
- fnSearch();
- });
- });
- });
- //차량이력정보 보기 팝업
- $(".btn_view").on("click", function() {
- $.get("car_history.ajax.php", { mode: 'view', cd_car_history: $(this).attr("cd_car_history")},function(data) {
- $("#scr_cont").html(data);
- viewPopup('history');
- });
- });
- function fnSearch(){
- $("#frmSearch").submit();
- }
- </script>
- <? include("../inc/inc_footer.php") ?>
- <? include("../inc/inc_bottom.php") ?>
- <?
- mysql_close($connect);
- ?>
|