12'; // exit; $sql = "where s.ds_delind='N'"; // $orderby = "order by s.dt_insert desc"; $orderby = "order by s.dt_update desc"; //20191207 디비에 업데이트 날짜 기준으로 리스트 정렬하기 $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']; $ds_type = "A0"; //A0 : 매입 $sql = $sql. " and s.ds_type = '$ds_type' "; if($searchword != ""){ if($searchtype=="" || $searchtype==null){ $sql = $sql. " and (s.nm_name like '$searchword%' or a.nm_number like '$searchword%') "; }else{ $sql = $sql. " and $searchtype like '$searchword%'"; } } if($ds_usertype != ""){ $sql = $sql. " and s.ds_usertype = '$ds_usertype'"; } if($dt_start != "" && $dt_end != ""){ $sql = $sql. " and s.dt_insert between '$dt_start' and '$dt_end' "; } $sql = $sql. " and s.ds_status in ('E0','F0')"; //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //관계사/지점 Setting $admin_ds_company_bp = $_SESSION['admin_ds_company_bp']; //관계사 $admin_ds_branch = $_SESSION['admin_ds_branch']; //지점 $admin_bp_ok = ($admin_ds_company_bp != "" || $admin_ds_branch != "") ? true : false; //admin_ds_company_bp 나 admin_ds_branch 값이 하나라도 있으면 관계사로 보고 권한 제한한다. $admin_bp_ok == true 이면 해당 관계사/지점 데이타만 확인 가능하다. //관계사 일 경우 해당 관계사/지점 데이타만 확인 가능하다. if($admin_bp_ok){ if($admin_ds_company_bp != "" && $admin_ds_branch != ""){ $sql = $sql. " and s.ds_company_bp = '$admin_ds_company_bp' and s.ds_branch = '$admin_ds_branch' "; }else{ //admin_ds_company_bp 나 admin_ds_branch 값이 하나라도 없으면 데이타 확인 안되게 한다. $sql = $sql. " and 1 = 2 "; } } // $sql.= " and s.cd_sale = '3223'"; //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// $totalrows = @mysql_result(mysql_query("select count(*) from sale_master s inner join car_master a on ( s.cd_car = a.cd_car ) $sql"),0,0); ?> 0) { $r = mysql_query("SELECT a.* , b.nm_model , c.nm_grade , d.nm_brand , e.nm_model_sub , getCode('car_master','ds_type',a.ds_type) as nm_type , getCode('car_master','ds_open',a.ds_open) as nm_open , getCode('car_master','ds_sales',a.ds_sales) as nm_sales , getCode('car_master','ds_transmission',a.ds_transmission) as nm_transmission , getCode('member_master','ds_area',s.ds_area) as nm_area , getCode('sale_master','ds_status',s.ds_status) as nm_status , s.cd_sale , s.nm_name nm_name_sale , s.nm_recommend nm_recommend_sale , s.ds_status ds_status_sale , s.ds_status_contract ds_status_contract_sale , getRemainTimeByPhase(".LIMIT_TIME_TENDER.", ".LIMIT_TIME_SELL.", s.dt_approve, now()) as time_limit_sell , (select count(*) from tender_master it where it.cd_sale = s.cd_sale) as tender_cnt FROM sale_master s inner join car_master a on (s.cd_car = a.cd_car) left outer join car_model b on (a.cd_model = b.cd_model) left outer join car_grade c on (a.cd_grade = c.cd_grade) left outer join car_brand d on (a.cd_brand = d.cd_brand) left outer join car_model_sub e on (a.cd_model_sub = e.cd_model_sub) $sql $orderby "); $i=1; while($col = mysql_fetch_array($r)) { // inner join tender_master t on (s.cd_sale = t.cd_sale) $tender_sql = "select t.* , (select nm_company from dealer_master dm where dm.cd_dealer = t.cd_dealer_p) as nm_company from tender_master t where cd_sale = '$col[cd_sale]' ORDER BY cast(t.nm_price as decimal) desc"; $tender_res = mysql_query($tender_sql); $tender_num = 0; while($tender = mysql_fetch_array($tender_res)) { if($tender_num == 0) { ?>
번호 판매자 차종 모델 등급 차량번호 주행거리 지역 차량등록일 입찰업체 입찰금액 입찰담당자 입찰일
km 만원
만원
등록된 정보가 없습니다.