| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217 |
- <?php
- include $_SERVER['DOCUMENT_ROOT'].'/common/lib/comm.php';
- include $_SERVER['DOCUMENT_ROOT'].ADMIN_PATH.'common/auth_chk.php';
- $list_url = "purchase_list.php";
- $mp = "40"; //set top nav
- $searchtype = $_REQUEST['searchtype'];
- $searchword = $_REQUEST['searchword'];
- $ds_usertype = $_REQUEST['ds_usertype'];
- $ds_status = $_REQUEST['ds_status'];
- $dt_start = $_REQUEST['dt_start'];
- $dt_end = $_REQUEST['dt_end'];
- $PageNo = $_REQUEST['pageno'];
- $PageSize = $_REQUEST['PageSize'];
- 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_delind='N'";
- $add_sql1 = "where 1=1";
- $ds_type = "A0"; //A0 : 매입
- $add_sql.= " AND s.ds_type = '$ds_type' ";
- if($searchword != ""){
- if($searchtype=="" || $searchtype==null){
- $add_sql.= " AND (s.nm_name like '$searchword%' or s.nm_name like '$searchword%') ";
- }else{
- $add_sql.= " AND $searchtype like '$searchword%'";
- }
- }
- if($dt_start != "" && $dt_end != ""){
- $sql1 = $sql1. " AND d.dt_insert between '$dt_start' and '$dt_end' ";
- }
- if($ds_usertype != ""){
- $add_sql.= " AND s.ds_usertype = '$ds_usertype'";
- }
- $add_sql.= " AND s.ds_status in ('ZS') ";
- $orderby = "order by st.cnt desc";
- $sql = "select count(*)
- from
- (
- select t.cd_dealer_p, count(*) cnt
- from sale_master s
- inner join tender_master t on (s.cd_sale = t.cd_sale and s.ds_status = 'ZS' and t.ds_status = 'Z0')
- $add_sql
- group by t.cd_dealer_p
- ) st
- inner join aap_master d on (st.cd_dealer_p = d.cd_dealer and d.ds_type = 'D0')
- $add_sql1 ";
- // echo $sql;
- // exit;
- $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="PageSize" name="PageSize">
- <input type="hidden" id="searchtype" name="searchtype">
- <table class="tbl_search">
- <colgroup>
- <col width="10%">
- <col width="35%">
- <col width="10%">
- <col width="*">
- </colgroup>
- <tr>
- <th>검색어</th>
- <td>
- <span class="select2" style="margin-right:5px;width:100px;" id="sel_searchtype">
- <select>
- <option value="">전체</option>
- <option value="s.nm_name"<? if($searchtype =="nm_name"){ ?> selected<?}?>>판매자</option>
- <!--option value="a.nm_number"<? if($searchtype =="nm_number"){ ?> selected<?}?>>차량번호</option-->
- </select>
- </span>
- <input type="text" id="searchword" name="searchword" class="inp_txt" style="width:60%;">
- </td>
- <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>
- <input type="submit" class="rnd_btn ty3 gray" value="검색" title="검색">
- </td>
- </tr>
- </table>
- </form>
- <div class="tbl_wrap">
- <table class="tbl_list">
- <colgroup>
- <col width="7%">
- <col width="20%">
- <col width="14%">
- <col width="*">
- <col width="18%">
- </colgroup>
- <thead>
- <tr>
- <th>번호</th>
- <th>업체</th>
- <th>낙찰횟수</th>
- <th>회원가입일</th>
- <th>마일리지</th>
- </tr>
- </thead>
- <?php
- if($totalrows>0) {
- $sql = "SELECT
- st.*
- , d.*
- from
- (
- select t.cd_dealer_p, count(*) cnt
- from sale_master s
- inner join tender_master t on (s.cd_sale = t.cd_sale and s.ds_status = 'ZS' and t.ds_status = 'Z0')
- $add_sql
- group by t.cd_dealer_p
- ) st
- inner join aap_master d on (st.cd_dealer_p = d.cd_dealer and d.ds_type = 'D0')
- $add_sql1
- $orderby
- LIMIT $pagestartpoint,$PageSize";
- $r = mysql_query($sql);
- $i=1;
- while($col = mysql_fetch_array($r)) {
- $tmpNum =$totalrows-($PageSize*($PageNo-1));
- $no = ($tmpNum - $i)+1;
- ?>
- <tr onclick="location.href='./purchase_view.php?list_url=<?=$list_url?>&cd_dealer=<?=$col['cd_dealer']?>&ListPageNo=<?=$PageNo?>';" style="cursor:pointer;">
- <td><?=$no?></td>
- <td><?=$col['nm_name']?></td>
- <td><?=$col['cnt']?></td>
- <td><?=$col['dt_insert']?></td>
- <td><?=$col['nm_deposit']?></td>
- </tr>
- <?php
- $i++;
- }
- }else{
- ?>
- <tr>
- <td colspan="5">등록된 정보가 없습니다.</td>
- </tr>
- <?php
- }
- ?>
- </table>
- </div>
- <div class="paging">
- <?
- $url = "./$list_url?searchtype=$searchtype&searchword=$searchword&ds_status=$ds_status&ds_usertype=$ds_usertype";
- ListPg1($url ,$PageNo,$PageSize,10,$totalrows,$leftboard[1],$rootpath);
- ?>
- </div>
- </section>
- <script language="javascript" type="text/javascript">
- $("#dt_start").datepicker({ dateFormat: 'yy-mm-dd' });
- $("#dt_end").datepicker({ dateFormat: 'yy-mm-dd' });
- $(document).ready(function() {
- $("#btn_cal1").bind("click",function(){
- $("#dt_start").datepicker('show');
- });
- $("#btn_cal2").bind("click",function(){
- $("#dt_end").datepicker('show');
- });
- });
- function fnSearch(){
- if($("#searchtype").val()!="" && $("#searchword").val()==""){
- alert("검색어를 입력하세요");
- return false;
- }
- $("#frmSearch").submit();
- }
- </script>
- <? include("../inc/inc_footer.php") ?>
- <? include("../inc/inc_bottom.php") ?>
- <?
- mysql_close($connect);
- ?>
|