1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
<? // ÃʱⰪÀ» ÁÖ¾î¾ßÇÒ º¯¼öµé //if (!$table_name) {$table_name="mijin_notice";} $page_num = 10; $page_block = 10; $tn = $ware_table; if (!$page) {$page = 1;} if (!$rows) {$rows = "w_name";} // $rows : Á¤·Ä ±âÁØÀ» ÆÇ´ÜÇÏ´Â º¯¼ö if (!$keyfield) {$keyfield = "w_code";}
// °Ë»ö Á¶°Ç //$where = "$where and w_general='n'"; // Áַ»óǰ¸¸ Ãâ·Â if ($ware) {$where = "$where and $ware=1";} // »óǰºÐ·ù(½Å±Ô,Àαâ,¿¹¾à,±âȹ»óǰ) if ($kind1) {$where = "$where and kind1='$kind1'";} if ($kind2) {$where = "$where and kind2='$kind2'";} if ($kind3) {$where = "$where and kind3='$kind3'";} if (!$ch_sort) {if ($sort == "asc") {$sort = "desc";} else {$sort = "asc";}} // ÆäÀÌÁö ³Ñ±æ ¶§´Â sortÇÏÁö ¾ÊÀ½ $encoded_key = urlencode($key); $url = "keyfield=$keyfield&key=$encoded_key&find_key=$find_key&sort=$sort&ware=$ware&kind1=$kind1&kind2=$kind2&kind3=$kind3";
$query = "select count(uid) from $table_name"; $result = mysql_query($query); if (!$result) {error("QUERY_ERROR");} $total_record = mysql_result($result,0,0); mysql_free_result($result); $total_page = ceil($total_record/$page_num); if ($total_record == 0) { $first = 1; $last = 0; } else { $first = $page_num*($page-1); // ù¹øÂ° ·¹ÄÚµåÀÇ ¹øÈ£¸¦ ¾Ë¾Æ³»±â À§ÇÑ ÄÚµå $last = $page_num*$page; // ¸¶Áö¸· ·¹Å©µåÀÇ ¹øÈ£¸¦ ¾Ë¾Æ³»±â À§ÇÑ ÄÚµå } $total_block = ceil($total_page/$page_block); // ÃÑ ºí·Ï $block = ceil($page/$page_block); // ÇöÀç ºí·Ï $first_page = ($block-1)*$page_block; // ÇöÀç ºí·ÏÀÇ Ã¹¹øÂ° ÆäÀÌÁö $last_page = $block*$page_block; // ÇöÀç ºí·ÏÀÇ ¸¶Áö¸· ÆäÀÌÁö ?>
|