/home/mjc1/public_html/receipt/page_header.php


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
40
41
42
43
44
45
46
47
<?
@extract($_REQUEST);

// ÃʱⰪÀ» ÁÖ¾î¾ßÇÒ º¯¼öµé
if (!$table_name) {$table_name=$doc_name;}
$page_num 10;
$page_block 20;
$tn $ware_table;
if (!
$page) {$page 1;}
//if (!$rows) {$rows = "billno";}                    // $rows : Á¤·Ä ±âÁØÀ» ÆÇ´ÜÇϴ º¯¼ö
//if (!$keyfield) {$keyfield = "to_cname";}

// °Ë»ö Á¶°Ç
//$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(*) from $table_name where login_id ='$sing_id'";
    
$result mysql_query($query);
    
$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;                    // ÇöÀç ºí·ÏÀÇ ¸¶Áö¸· ÆäÀÌÁö
?>