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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
|
<?php include_once("./dbcon.php");
include_once("../Page/common/header_manual.php"); include_once("./manual_sub_header.php"); ?>
<style> .sound_only{display:none;} .content_section{width: 900px;} .func_head h3{font-size: 24px;line-height: 52px;font-weight: bold;}
.func_table{width: 100%;} thead tr{border-top: 2px solid #343434;border-bottom: 1px solid #E9E9E9;} thead tr th{font-size: 14px;font-weight: bold;text-align: center;line-height: 32px;} tbody tr{height: 52px;border-bottom: 1px solid #E9E9E9;} tbody tr td{line-height: 32px;font-size: 16px;padding: 0px 5px;}
.func_num{text-align: center;font-weight: bold;} .func_tit a{display: block;width: 100%;font-size: 16px;color: #343434;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;word-break: break-all;} .func_cate{font-size: 14px;color: #5797D2;}
.func_bottom{margin-top: 25px;}
.func_bottom select{width: 120px;height: 32px;box-sizing: border-box;border: 1px solid #B8B8B8;font-size: 14px;color: #343434;cursor: pointer;padding: 0px 5px;} </style>
<?php
@extract($_GET); @extract($_POST); $qstr = $_SERVER['QUERY_STRING'];
$where = "";
if($c2 != "") { $where .= " AND a.cidx_2 = '{$c2}'"; } if($c3 != "") { $where .= " AND a.cidx_3 = '{$c3}'"; }
$total_sql = "SELECT COUNT(*) AS cnt FROM mBoard_menual AS a WHERE 1=1 $where"; $total_res = mysql_query($total_sql,$connect_web); $total_row = mysql_fetch_array($total_res); $total_count = $total_row['cnt'];
$list_num = "10"; $total_page = ceil($total_count / $list_num); // Àüü ÆäÀÌÁö °è»ê if ($page < 1) { $page = 1; } // ÆäÀÌÁö°¡ ¾øÀ¸¸é ù ÆäÀÌÁö (1 ÆäÀÌÁö) $from_record = ($page - 1) * $list_num; // ½ÃÀÛ ¿À» ±¸ÇÔ
// ¸®½ºÆ® Ãëµæ $sql = "SELECT a.idx, a.title, a.link, a.content, b.name AS cname_1, c.name AS cname_2, d.name AS cname_3 FROM mBoard_menual AS a INNER JOIN mBoard_menual_cate1 AS b ON a.cidx_1 = b.idx INNER JOIN mBoard_menual_cate2 AS c ON a.cidx_2 = c.idx LEFT JOIN mBoard_menual_cate3 AS d ON a.cidx_3 = d.idx WHERE 1=1 $where ORDER BY idx ASC LIMIT $from_record, $list_num"; echo $sql; $res = mysql_query($sql,$connect_web); if(!$res) { echo "¸®½ºÆ® °¡Á®¿À±â¿¡ ½ÇÆÐÇß½À´Ï´Ù."; }
// ÇÑÆäÀÌÁö¿¡ º¸¿©ÁÙ Çà, ÇöÀçÆäÀÌÁö, ÃÑÆäÀÌÁö¼ö, URL function get_paging($write_pages, $cur_page, $total_page, $url, $add="") { $v = explode("&",substr($url,1,strlen($url))); $new_url = "?"; foreach($v as $key=>$val){ $vv = explode("=",$val); if($vv[0]!='page'){ $new_url .= "{$vv[0]}={$vv[1]}&"; } } $url = substr($new_url,0,strlen($new_url)-1); //$url = preg_replace('#&page=[0-9]*(&page=)$#', '$1', $url); if($url==''){ $url = "?page="; } else { $url = preg_replace('#&page=[0-9]*#', '', $url) . '&page='; }
$str = ''; if ($cur_page > 1) { $str .= '<a href="'.$url.'1'.$add.'" class="pg_page pg_start">prev</a>'.PHP_EOL; }
$start_page = ( ( (int)( ($cur_page - 1 ) / $write_pages ) ) * $write_pages ) + 1; $end_page = $start_page + $write_pages - 1;
if ($end_page >= $total_page) $end_page = $total_page;
if ($start_page > 1) $str .= '<a href="'.$url.($start_page-1).$add.'" class="pg_page pg_prev">ÀÌÀü</a>'.PHP_EOL;
if ($total_page > 1) { for ($k=$start_page;$k<=$end_page;$k++) { if ($cur_page != $k) $str .= '<a href="'.$url.$k.$add.'" class="pg_page">'.$k.'<span class="sound_only">ÆäÀÌÁö</span></a>'.PHP_EOL; else $str .= '<span class="sound_only">¿¸°</span><strong class="pg_current">'.$k.'</strong><span class="sound_only">ÆäÀÌÁö</span>'.PHP_EOL; } }
if ($total_page > $end_page) $str .= '<a href="'.$url.($end_page+1).$add.'" class="pg_page pg_next">´ÙÀ½</a>'.PHP_EOL;
if ($cur_page < $total_page) { $str .= '<a href="'.$url.$total_page.$add.'" class="pg_page pg_end">next</a>'.PHP_EOL; }
if ($str) return "<nav class=\"pg_wrap\"><span class=\"pg\">{$str}</span></nav>"; else return ""; }
?>
<div style="padding: 35px 0px;"> <div class="wrap" style="display: flex;justify-content: space-between;"> <?php include("./left_navi.inc.php"); ?>
<div class="content_section"> <div class="func_head"> <h3>Ä«Å×°í¸®¸í</h3><!--¸ñÂ÷¿¡¼ Ŭ¸¯ÇÑ Ä«Å×°í¸®¸í(2Â÷Ä«Å×°í¸® Ŭ¸¯Çؼ ¿ÔÀ» °æ¿ì, 2Â÷ Ä«Å×°í¸® Ç¥½Ã/3Â÷Ä«Å×°í¸® Ŭ¸¯Çؼ ¿ÔÀ» °æ¿ì, 3Â÷Ä«Å×°í¸® Ç¥½Ã)--> </div> <table class="func_table" style="table-layout: fixed;"> <colgroup><col width="60"></col><col width="600"></col><!-- <col width="340"></col> --></colgroup> <thead> <tr> <th>¹øÈ£</th> <th>±ÛÁ¦¸ñ</th> <th>¸Å´º¾ó À§Ä¡</th> </tr> </thead> <tbody> <?php while($info = mysql_fetch_array($res)) { $catloc = $info['cname_1']; if($info['cname_2'] != "") { $catloc .= " > ".$info['cname_2']; } if($info['cname_3'] != "") { $catloc .= " > ".$info['cname_3']; } ?> <tr> <td class="func_num"><?php echo $info['idx']; ?></td><!--ÇöÀç Ä«Å×°í¸®³»¿¡¼ ¼ø¹ø--> <td class="func_tit"> <!-- href¿¡´Â ¸Å´º¾ó»ó¼¼ ÁÖ¼Ò, ±ÛÁ¦¸ñÀº ȸ»ç°ü¸®ÀÚ¿¡¼ ÀÛ¼ºÇÑ ±ÛÁ¦¸ñ(Ä«Å×°í¸®¸í ¾Æ´Ô)--> <a href="./func_detail.php?idx=<?php echo $info['idx']; ?>"><?php echo $info['title']; ?></a> </td> <td class="func_cate"><?php echo $catloc; ?></td> </tr> <?php } ?> </tbody> </table>
<ul class="pagingul"> <?php echo get_paging($list_num, $page, $total_page, "?$qstr");?> </ul> </div> </div> </div>
<?php include("./manual_footer.php")?>
|