5) { /* alert("관리자 승인이 필요합니다."); */ sleep(2); header ("Location:/login/logout.php"); exit; } header ("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past header ("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1 header ("Pragma: no-cache"); // HTTP/1.0 header("Expires: 0"); // rfc2616 - Section 14.21 //header("Refresh:0"); // reload refresh ?> 주일기업 통합정보시스템 '0000-00-00') order by num desc limit $first_num, $scale"; $b=" (as_check = '1') or (asday <> '0000-00-00') order by num desc"; if($year=="전체" ) // 기존 검색방법으로 검색 년도 선택이 없을때 as_check=""일때만 나오기 if($mode=="search" || $list==1){ if($search==""){ if($asprocess=="전체") { $sql="select * from chandj.work where " . $a; $sqlcon = "select * from chandj.work where " . $b; // 전체 레코드수를 파악하기 위함. } elseif($asprocess=="미접수") { $sql="select * from chandj.work where (as_state like '%$asprocess%') and (as_check = '1') order by num desc limit $first_num, $scale"; $sqlcon = "select * from chandj.work where (as_state like '%$asprocess%') and (as_check = '1') order by num desc"; // 전체 레코드수를 파악하기 위함. } else { $sql="select * from chandj.work where (as_state like '%$asprocess%') order by num desc limit $first_num, $scale"; $sqlcon = "select * from chandj.work where (as_state like '%$asprocess%') order by num desc"; } } elseif($find!="all"&&$search=="") { if($asprocess=="전체") { $sql="select * from chandj.work where ($find like '%$search%') and" . $a; $sqlcon = "select * from chandj.work where ($find like '%$search%') and" . $b; // 전체 레코드수를 파악하기 위함. } else { $sql="select * from chandj.work where (as_state like '%$asprocess%') and ($find like '%$search%') order by num desc limit $first_num, $scale"; $sqlcon = "select * from chandj.work where (as_state like '%$asprocess%') and ($find like '%$search%') order by num desc"; } } elseif($search!="") { // 각 필드별로 검색어가 있는지 쿼리주는 부분 if($asprocess=="전체") { $sql ="select * from chandj.work where ((condate like '%$search%' ) or (workplacename like '%$search%' ) or (chargedperson like '%$search%' )"; $sql .="or (firstord like '%$search%' ) or (secondord like '%$search%' ) or (worker like '%$search%' ) or (cablestaff like '%$search%' ) or "; $sql .=" (address like '%$search%' )) and (asday <> '0000-00-00') order by num desc limit $first_num, $scale "; $sqlcon ="select * from chandj.work where ((condate like '%$search%' ) or (workplacename like '%$search%' ) or (chargedperson like '%$search%' )"; $sqlcon .="or (firstord like '%$search%' ) or (secondord like '%$search%' ) or (worker like '%$search%' ) or (cablestaff like '%$search%' ) or "; $sqlcon .=" (address like '%$search%' )) and (asday <> '0000-00-00') order by num desc"; } else { $sql ="select * from chandj.work where ((condate like '%$search%' ) or (workplacename like '%$search%' ) or (chargedperson like '%$search%' )"; $sql .="or (firstord like '%$search%' ) or (secondord like '%$search%' ) or (worker like '%$search%' ) or (cablestaff like '%$search%' ) or "; $sql .=" (address like '%$search%' )) and ($find like '%$search%') and (asday <> '0000-00-00') and (as_state like '%$asprocess%') order by num desc limit $first_num, $scale "; $sqlcon ="select * from chandj.work where ((condate like '%$search%' ) or (workplacename like '%$search%' ) or (chargedperson like '%$search%' )"; $sqlcon .="or (firstord like '%$search%' ) or (secondord like '%$search%' ) or (worker like '%$search%' ) or (cablestaff like '%$search%' ) or "; $sqlcon .=" (address like '%$search%')) and ($find like '%$search%') and (asday <> '0000-00-00') and (as_state like '%$asprocess%') order by num desc"; } } } else { $sql="select * from chandj.work where " . $a; $sqlcon="select * from chandj.work where" . $b; } $a=" (condate <> '0000-00-00') order by num desc limit $first_num, $scale"; $b=" (condate <> '0000-00-00') order by num desc"; $temp1=$year."-01-01"; //$temp1=date("Y-m-d", strtotime( $temp1) ); $temp2=$year+1 . "-01-01"; //$temp2=date("Y-m-d", strtotime( $temp2) ); if($year!="전체" ) // 년도 선택을 했을때 검색조건 2019,2018 등 { if($mode=="search" || $list==1){ if($search==""){ if($process=="전체") { $sql="select * from chandj.work where (endworkday between date('$temp1') and date('$temp2')+1) and " . $a; $sqlcon = "select * from chandj.work where (endworkday between date('$temp1') and date('$temp2')+1) and" . $b; // 전체 레코드수를 파악하기 위함. } else // 진행현황이 다를때 처리구문 { $sql="select * from chandj.work where (work_state like '%$process%') and (endworkday between date('$temp1') and date('$temp2')+1) and" . $a; $sqlcon = "select * from chandj.work where (work_state like '%$process%') and (endworkday between date('$temp1') and date('$temp2')+1) and" . $b; } } elseif($search!=""&&$find!="all") { $sql="select * from chandj.work where ($find like '%$search%') and (endworkday between date('$temp1') and date('$temp2')+1) and" . $a; $sqlcon="select * from chandj.work where ($find like '%$search%') and (endworkday between date('$temp1') and date('$temp2')+1) and" . $b; } elseif($search!=""&&$find!="all"&&$process!="전체") // 진행현황에 대한 처리 추가 { $sql="select * from chandj.work where ($find like '%$search%') and (work_state like '%$process%') and (endworkday between date('$temp1') and date('$temp2')+1) and" . $a ; $sqlcon="select * from chandj.work where ($find like '%$search%') and (work_state like '%$process%') and (endworkday between date('$temp1') and date('$temp2')+1) and" . $b ; } elseif($search!="") { // 각 필드별로 검색어가 있는지 쿼리주는 부분 if($process=="전체") { $sql ="select * from chandj.work where ((condate like '%$search%' ) or (workplacename like '%$search%' ) or (chargedperson like '%$search%' )"; $sql .="or (firstord like '%$search%' ) or (secondord like '%$search%' ) or (worker like '%$search%' ) or (cablestaff like '%$search%' ) or (address like '%$search%' )) and (endworkday between date('$temp1') and date('$temp2')+1) and" . $a; $sqlcon ="select * from chandj.work where ((condate like '%$search%' ) or (workplacename like '%$search%' ) or (chargedperson like '%$search%' )"; $sqlcon .="or (firstord like '%$search%' ) or (secondord like '%$search%' ) or (worker like '%$search%' ) or (cablestaff like '%$search%' ) or (address like '%$search%')) and (endworkday between date('$temp1') and date('$temp2')+1) and" . $b; //limit를 사용해 레코드 개수를 한 페이지당 출력하는 수로 제한 } else { $sql ="select * from chandj.work where ((condate like '%$search%' ) or (workplacename like '%$search%' ) or (chargedperson like '%$search%' )"; $sql .="or (firstord like '%$search%' ) or (secondord like '%$search%' ) or (worker like '%$search%' ) or (cablestaff like '%$search%' ) or (address like '%$search%' )) and (work_state like '%$process%') and (endworkday between date('$temp1') and date('$temp2')+1) and" . $a; $sqlcon ="select * from chandj.work where ((condate like '%$search%' ) or (workplacename like '%$search%' ) or (chargedperson like '%$search%' )"; $sqlcon .="or (firstord like '%$search%' ) or (secondord like '%$search%' ) or (worker like '%$search%' ) or (cablestaff like '%$search%' ) or (address like '%$search%')) and (work_state like '%$process%') and (endworkday between date('$temp1') and date('$temp2')+1) and" . $b; //limit를 사용해 레코드 개수를 한 페이지당 출력하는 수로 제한 } } } else { $sql="select * from chandj.work where (endworkday between date('$temp1') and date('$temp2')+1) and" . $a; $sqlcon="select * from chandj.work where (endworkday between date('$temp1') and date('$temp2')+1) and" . $b; } } if($asprocess=="결선대기") { $sql="select * from chandj.work where (work_state like '%$asprocess%')" . " order by num desc limit $first_num, $scale"; $sqlcon = "select * from chandj.work where (work_state like '%$asprocess%') order by num desc " ; } if($cursort==1) { $sql="select * from chandj.work where (as_check = '1') or (asday <> '0000-00-00') order by asday asc limit $first_num, $scale"; $sqlcon="select * from chandj.work where (as_check = '1') or (asday <> '0000-00-00') order by asday asc"; } if($cursort==2) { $sql="select * from chandj.work where (as_check = '1') or (asday <> '0000-00-00') order by asday desc limit $first_num, $scale"; $sqlcon="select * from chandj.work where (as_check = '1') or (asday <> '0000-00-00') order by asday desc"; } if($cursort==3) { $sql="select * from chandj.work where (as_check = '1') or (asday <> '0000-00-00') order by asproday asc limit $first_num, $scale"; $sqlcon="select * from chandj.work where (as_check = '1') or (asday <> '0000-00-00') order by asproday asc"; } if($cursort==4) { $sql="select * from chandj.work where (as_check = '1') or (asday <> '0000-00-00') order by asproday desc limit $first_num, $scale"; $sqlcon="select * from chandj.work where (as_check = '1') or (asday <> '0000-00-00') order by asproday desc"; } if($cursort==5) { $sql="select * from chandj.work where (as_check = '1') or (asday <> '0000-00-00') order by setdate asc limit $first_num, $scale"; $sqlcon="select * from chandj.work where (as_check = '1') or (asday <> '0000-00-00') order by setdate asc"; } if($cursort==6) { $sql="select * from chandj.work where (as_check = '1') or (asday <> '0000-00-00') order by setdate desc limit $first_num, $scale"; $sqlcon="select * from chandj.work where (as_check = '1') or (asday <> '0000-00-00') order by setdate desc"; } try{ $allstmh = $pdo->query($sqlcon); // 검색 조건에 맞는 쿼리 전체 개수 $temp2=$allstmh->rowCount(); $stmh = $pdo->query($sql); // 검색조건에 맞는글 stmh $temp1=$stmh->rowCount(); $total_row = $temp2; // 전체 글수 $total_page = ceil($total_row / $scale); // 검색 전체 페이지 블록 수 $current_page = ceil($page/$page_scale); //현재 페이지 블록 위치계산 // print "$page $total_page $current_page $search $mode"; ?>
(총 개의 자료 파일이 있습니다.)
   전체    결선대기    미접수    접수완료    처리예약    세팅예약    처리완료
   전체    결선대기    미접수    접수완료    처리예약    세팅예약    처리완료
   전체    결선대기    미접수    접수완료    처리예약    세팅예약    처리완료
   전체    결선대기    미접수    접수완료    처리예약    세팅예약    처리완료
   전체    결선대기    미접수    접수완료    처리예약    세팅예약    처리완료
   전체    결선대기    미접수    접수완료    처리예약    세팅예약    처리완료
   전체    결선대기    미접수    접수완료    처리예약    세팅예약    처리완료
fetch(PDO::FETCH_ASSOC)) { ?> 0) $as_amount=$asfee_estimate; else $as_amount="유상(금액미정)"; else $as_amount=""; // $item_subject=str_replace(" ", " ", $row["workplacename"]); $item_subject=$row["workplacename"]; // if(strlen($item_subject)>=60) // $item_subject=substr($item_subject,0,58) . ".."; // 글자수가 초과하면 ...으로 표기됨 $state_work=0; if($row["checkbox"]==0) $state_work=1; if(substr($row["workday"],0,2)=="20") $state_work=2; if(substr($row["endworkday"],0,2)=="20") $state_work=3; if(substr($row["cableday"],0,2)=="20") $state_work=4; if(substr($row["endcableday"],0,2)=="20") $state_work=5; $font="black"; switch ($state_work) { case 1: $state_str="착공전"; $font="black";break; case 2: $state_str="시공중"; $font="blue"; break; case 3: $state_str="결선대기"; $font="brown"; break; case 4: $state_str="결선중"; $font="purple"; break; case 5: $state_str="결선완료"; $font="red";break; default: $font="grey"; $state_str="계약전"; } $state_as=0; // AS 색상 등 표현하는 계산 if(substr($row["asday"],0,2)=="20") $state_as=1; if(substr($row["asproday"],0,2)=="20") $state_as=2; if(substr($row["setdate"],0,2)=="20") $state_as=3; if(substr($row["asendday"],0,2)=="20") $state_as=4; $font_as_step="black"; $as_tmp=""; if($as_checkboxvalue1==null && $as_checkboxvalue2==null && $as_checkboxvalue3==null && $as_checkboxvalue4==null) $as_tmp=$as_step; else { if($as_checkboxvalue1=='Y') $as_tmp .= "AS "; if($as_checkboxvalue2=='Y') $as_tmp .= "결선 "; if($as_checkboxvalue3=='Y') $as_tmp .= "입결선 "; if($as_checkboxvalue4=='Y') $as_tmp .= "셔터시공"; } /* switch ($as_step) { case "AS" : $font_as_step="blue";break; case "결선" : $font_as_step="brown"; break; case "입결선" : $font_as_step="purple"; break; case "셔터시공": $font_as_step="red"; break; default: $font_as_step="grey"; } if($as_step=="없음") $as_step=""; */ if($asday=='0000-00-00') $asday=""; if($asproday=='0000-00-00') $asproday=""; if($setdate=='0000-00-00') $setdate=""; $font_as="black"; switch ($state_as) { case 1: $state_astext="접수완료"; $font_as="blue"; break; case 2: $state_astext="처리예약"; $font_as="grey"; break; case 3: $state_astext="세팅예약"; $font_as="green"; break; case 4: $state_astext="처리완료"; $font_as="red"; break; default: $state_astext="미접수"; } $sql="select * from chandj.work_ripple where parent=$item_num"; $allstmh = $pdo->query($sql); $num_ripple=$allstmh->rowCount(); ?> getMessage(); } // 페이지 구분 블럭의 첫 페이지 수 계산 ($start_page) $start_page = ($current_page - 1) * $page_scale + 1; // 페이지 구분 블럭의 마지막 페이지 수 계산 ($end_page) $end_page = $start_page + $page_scale - 1; ?>
번호 현장명 발주처 AS접수일 요청사항 처리예정일 세팅예정일 AS담당 공사단계 AS처리현황 무/유상 금액
  $num_ripple]"; ?>                  
$page_scale) { $prev_page = $page - $page_scale; // 이전 페이지값은 해당 페이지 수에서 리스트에 표시될 페이지수 만큼 감소 if($prev_page <= 0) $prev_page = 1; // 만약 감소한 값이 0보다 작거나 같으면 1로 고정 print ""; } for($i=$start_page; $i<=$end_page && $i<= $total_page; $i++) { // [1][2][3] 페이지 번호 목록 출력 if($page==$i) // 현재 위치한 페이지는 링크 출력을 하지 않도록 설정. print "[$i]"; else print "[$i]"; } if($page<$total_page) { $next_page = $page + $page_scale; if($next_page > $total_page) $next_page = $total_page; // netx_page 값이 전체 페이지수 보다 크면 맨 뒤 페이지로 이동시킴 print "

"; } ?>