include $_SERVER['DOCUMENT_ROOT'].'/sm/lib/basic.php';
$page = $_GET['page'];
$btype = str_replace( "'", "", $_GET['btype']);
$bunryu = (int)$_GET['bunryu'];
$bunryu2 = (int)$_GET['bunryu2'];
$srctxt = substr($_GET['srctxt'], 0,30);
if(!$bunryu) $bunryu = 1;
$no = $bunryu;
?>
$clson[$no] = "class='on'";
?>
$btype = "case_ko";
if($btype) $where = " and btype = '$btype' ";
if($bunryu) $where .= " and bunryu = $bunryu ";
if($bunryu2) $where .= " and bunryu2 = $bunryu2 ";
if($srctxt) $where .= " and title like '%$srctxt%' ";
$total = $db->getCnt( "select count(*) cnt from sw_board where 1=1 $where ", "cnt");
$page = (!$page) ? 1 : $page;
$pagesize = (!$pagesize) ? 8 :$pagesize;
$scale = 10;
$arr=array("btype"=>$btype, "bunryu"=>$bunryu, "bunryu2"=>$bunryu2);
$start_p = ($page -1) * $pagesize;
$pg=new pageSetUser($total,$page,$arr,$pagesize, $scale);
?>
$sql = "select idx, btype, bunryu, bunryu2, bunryu3, writor, tel, email, title, contents, percent, regdate from sw_board where 1=1 $where order by regdate desc limit $start_p , $pagesize ";
$stmt = $db->prepare($sql);
$stmt->execute();
while( $row = $stmt->fetch(PDO::FETCH_ASSOC) ) {
$img = "";
if($row['bunryu'] == 1 ) $piconstr = "토목분야";
else if($row['bunryu'] == 2 ) $piconstr = "건축분야";
else if($row['bunryu'] == 3 ) $piconstr = "플렌트분야";
else if($row['bunryu'] == 4 ) $piconstr = "해외분야";
$piconstr2 = "";
if($row['bunryu3'] == 1 ) $piconstr2 = "분양중";
else if($row['bunryu3'] == 2 ) $piconstr2 = "분양예정";
else if($row['bunryu3'] == 3 ) $piconstr2 = "분양완료";
else if($row['bunryu3'] == 4 ) $piconstr2 = "공사완료";
else if($row['bunryu3'] == 5 ) $piconstr2 = "공사중";
$picon = "";
if($row['bunryu3'] == 1 ) $picon = "co1";
else if($row['bunryu3'] == 2 ) $picon = "co2";
else if($row['bunryu3'] == 3 ) $picon = "co3";
else if($row['bunryu3'] == 4 ) $picon = "co3";
else if($row['bunryu3'] == 5 ) $picon = "co4";
$imgur = getImg( $row['idx']);
?>
-
=$piconstr2?>
=$row['title']?>
0){?>
}?>
}?>
$pg=new pageSetUser($total,$page,$arr,$pagesize, $scale);
echo $pg->getPage();
?>