include "../../dbcon.inc";
if (!$page) { $page=1;}
$pagesize=20;
$listsize=10; //ÇÏ´Ü ¸®½ºÆ® °¹¼ö
if ($div1==""){
if ($div2==""){
$query=mysql_query("select count(*) from $tname where opn='o'");
}else{
$query=mysql_query("select count(*) from $tname where div2='$div2' and opn='o'");
}
}else{
if ($div2==""){
$query=mysql_query("select count(*) from $tname where div1='$div1' and opn='o'");
}else{
$query=mysql_query("select count(*) from $tname where div1='$div1' and div2='$div2' and opn='o'");
}
}
$ro=mysql_fetch_array($query);
$total=$ro[0];
$lownumber=(($page-1)*$pagesize);
$totalpage = ceil($total/$pagesize); //ÃÑÆäÀÌÁö¼ö
$totalblock = ceil($totalpage/$listsize); //ÃÑºí·°¼ö
$block=ceil($page/$listsize); //ÇöÀç ºí·°
$first_page=($block-1)*$listsize; //ÇöÀçºí·°¿¡¼ Ãâ·ÂµÉ ù¹øÂ° ÆäÀÌÁö
$last_page=$block*$listsize; //ÇöÀçºí·°¿¡¼ Ãâ·ÂµÉ ¸¶Áö¸· ÆäÀÌÁö
if($block>=$totalblock){
$last_page=$totalpage;
}
if ($div1==""){
if ($div2==""){
$query1=mysql_query("select * from $tname where opn='o' order By num desc limit $lownumber,$pagesize");
}else{
$query1=mysql_query("select * from $tname where div2='$div2' and opn='o' order By num desc limit $lownumber,$pagesize");
}
}else{
if ($div2==""){
$query1=mysql_query("select * from $tname where div1='$div1' and opn='o' order By num desc limit $lownumber,$pagesize");
}else{
$query1=mysql_query("select * from $tname where div1='$div1' and div2='$div2' and opn='o' order By num desc limit $lownumber,$pagesize");
}
}
$query=mysql_query("select count(*) from $tname where div1='ST' and opn='o'");
$row1=mysql_fetch_array($query);
$cnt1=$row1[0];
$query=mysql_query("select count(*) from $tname where div1='ED' and opn='o'");
$row2=mysql_fetch_array($query);
$cnt2=$row2[0];
$query=mysql_query("select count(*) from $tname where div1='OD' and opn='o'");
$row3=mysql_fetch_array($query);
$cnt3=$row3[0];
$query=mysql_query("select count(*) from $tname where div1='CT' and opn='o'");
$row4=mysql_fetch_array($query);
$cnt4=$row4[0];
$query=mysql_query("select count(*) from $tname where div1='ET' and opn='o'");
$row5=mysql_fetch_array($query);
$cnt5=$row5[0];
?>
include "../../top.html";?>
include "../../left.html";?>
|
 |
 |
|
 |
 |
 |
|
|
if ($page>=2){
$cha=$pagesize*($page-1);
$total=$total-$cha;
}
while($row=mysql_fetch_array($query1))
{
$title=stripslashes($row[title]);
$ttitle1=$title;
$ttitle1=ereg_replace("\"","'",$ttitle1);
$titleLen=42;
if (strLen($title) >= $titleLen){
$title=substr($title,0,$titleLen-3)."...";
}
$writeday=substr($row[writeday],0,10);
$save_dir="../morgue_data";
?>
=$total?>
|
"> |
print("$title"); //±ÛÁ¦¸ñ
if ($writeday==date('Y-m-d')){
print(" "); //NEW Ç¥½Ã
}
?> |
=$row[name]?>
|
=$writeday?>
|
=$row[readnum]?>
|
|
$total--;
}
?>
 |
|
if($block>1){
$mypage=$first_page;
echo(" ");
}?>
for($i=$first_page+1;$i<=$last_page;$i++){
if($page==$i){
echo("$i ");
}else{
echo("$i ");
}
}
?>
if($block<$totalblock){
$mypage=$last_page+1;
echo(" ");
}
?>
|
|
|
|
 |
|
|
include "../../bottom.html";?>