}
else{?>
}?>
|
|
}
else{?>
|
}?>
|
¹øÈ£ |
Á¦¸ñ |
À̸§ |
Á¶È¸¼ö |
µî·ÏÀÏ |
|
////////////////
function substring($string,$position,$length=0) {
$a=0;$b=0;$c=0;$startposition=0;$chk=true;$chkposition=false;$length_count=0;
$cnt=strlen($string);
$i=0;
for($i=0;$i<$cnt;$i++) {//0,1
if(!$chkposition) {
if(($a+$c)==$position) {
if($chk)$startposition=$i;
else $startposition=$i-1;
$chkposition=true;
$a=0;$b=0;$c=0;
}
}
else {
if(($a+$c)<$length) $length_count++;
else break;
}
$ascii=ord($string[$i]);
if($ascii<=127) $a++;//1,
else {
$b++;//1,
$chk=false;
if($b%2==0) {
$c++;
$chk=true;
}
}
}
return substr($string,$startposition,$length_count+1);
}
$search = "";
$nPage = "";
$period = "";
IF($_POST['search']!=""){$search = $_POST['search'];}
ELSE IF($_GET['search']!=""){$search = $_GET['search'];}
IF($_GET['nPage']!=""){$nPage = $_GET['nPage'];}
IF($_GET['period']!=""){$period = $_GET['period'];}
if($search)
{
if($select == "Á¦¸ñ"){
$db->query("select * from board4 where c_title like '%$search%' order by ref DESC,re_step asc,c_date desc");
}
}
else
$db->query("select * from board4 order by ref DESC,re_step asc,c_date desc ");
$totalCount = $db->row_count();
$total = $db->row_count();
$recPg = 10;
$totalPg = ceil($totalCount/$recPg);
if(!$nPage) $nPage=1;
$startP = ($nPage-1)*$recPg;
$endP = $recPg;
$total = $total-(($nPage*$recPg)-$recPg);
$a=$total;
// page
include "../lib/pageskin.php";
//»ý¼ºÀÚ (URL, µ¥ÀÌÅÍÀüü°¹¼ö, ¶óÀÎÁÙ¼ö, ÇÏ´ÜÆäÀÌÁöÀ̵¿°¹¼ö)
$pageSkip = new pageSkip($_SERVER['PHP_SELF']."?search=$search&period=$period&nPage=", $totalCount, $recPg, 10);
////////////////
if($search)
{
if($select == "Á¦¸ñ"){
$db->query("select * from board4 where c_title like '%$search%' order by ref DESC,re_step asc,c_date desc limit $startP, $endP ");
}
}
else
$db->query("select * from board4 order by ref DESC,re_step asc,c_date desc limit $startP, $endP");
$b=1;
?>
|
|
| [ =$pageSkip->printPage($nPage);?>]
|
|
|
|
include '../board4_tail.htm'?>