001.
<html>
002.
<head>
003.
<title>Untitled Document</title>
004.
<meta http-equiv=
"Content-Type"
content=
"text/html; charset=utf-8"
>
005.
<style type=
"text/css"
>
006.
<!--
007.
body,td,th {
008.
font-family: mS Sans Serif, microsoft Sans Serif, tahoma;
009.
font-size: 9pt;
010.
}
011.
-->
012.
</style>
013.
014.
<style type=
"text/css"
>
015.
<!--
016.
body,td,th {
017.
font-family: mS Sans Serif, microsoft Sans Serif;
018.
font-size: 11pt;
019.
}
020.
a:link { TEXT-DECORATION: none; color: #3F7CB9}
021.
a:visited { text-decoration: none;color: #3399FF}
022.
a:hover { text-decoration: none;color: #FF9900}
023.
-->
024.
</style>
025.
026.
</head>
027.
<body topmargin=
"0"
>
028.
<table width=
"500"
border=
"0"
cellspacing=
"1"
cellpadding=
"3"
>
029.
<tr><td>
030.
<table width=
"90%"
border=
"0"
cellspacing=
"0"
cellpadding=
"5"
>
031.
<tr><td>
032.
<!-- tag table ข้างล่างนี้ สร้างมาเพื่ออะไรครับ -->
033.
<table width=
"90%"
border=
"0"
cellspacing=
"0"
cellpadding=
"0"
>
034.
<!-- <tr>
035.
<td> </td>
036.
</tr> -->
037.
<?php
038.
039.
include
(
"db_conf.inc.php"
);
040.
include
(
"compare_date.php"
);
041.
042.
$now_year
=
date
(
"Y"
);
043.
$now_date
=
date
(
"/m/d"
);
044.
045.
if
(
$now_year
>2500){
046.
$now_year
=
$now_year
-543;
047.
}
048.
049.
$now_date
=
$now_year
.
$now_date
;
050.
051.
mysql_connect(
$hostname
,
$user
,
$password
);
052.
include
(
"charset.inc.php"
);
053.
054.
?>
055.
</table></td></tr>
056.
<tr>
057.
<!-- <td>...........................</td> -->
058.
</tr>
059.
<tr><td height=
"20"
>
060.
<table width=
"100%"
border=
"0"
cellspacing=
"0"
cellpadding=
"0"
>
061.
<?php
062.
echo
"<br>"
;
063.
064.
065.
066.
067.
068.
069.
070.
071.
$sql
=
"select count(*) from viannews where newsstyle='1' and status='1' "
;
072.
$db_query
= mysql_db_query(
$dbname
,
$sql
)
or
die
(
"sql ไม่ได้ "
);
073.
list(
$num_rows
) = mysql_fetch_row(
$db_query
); mysql_free_result(
$db_query
);
074.
075.
$ii
=1;
076.
$Per_Page
= 3;
077.
078.
079.
080.
081.
082.
083.
084.
085.
086.
$Page
= isset(
$_GET
[
'Page'
])?
$_GET
[
'Page'
] : 1;
087.
088.
089.
$Prev_Page
=
$Page
-1;
090.
$Next_Page
=
$Page
+1;
091.
092.
$Page_Start
=
$Page
*
$Per_Page
-
$Per_Page
;
093.
094.
095.
096.
097.
098.
099.
100.
101.
102.
103.
104.
105.
106.
107.
108.
109.
$Num_Page
=
ceil
(
$num_rows
/
$Per_Page
);
110.
111.
$i
=1;
112.
$j
=1;
113.
114.
115.
116.
if
(
$Page
> 1)
117.
{
118.
$i
= (
$Per_Page
* (
$Page
-1)) + 1;
119.
}
120.
121.
122.
$sql
=
"select * from viannews where newsstyle='1' and status='1' "
;
123.
$sql
.=
" order by postdate desc ,id desc LIMIT $Page_Start , $Per_Page"
;
124.
$db_query
= mysql_db_query(
$dbname
,
$sql
)
or
die
(
"sql ไม่ได้ "
);
125.
126.
if
(
$num_rows
>0){
127.
128.
echo
"<tr><td colspan=\"2\" valign=\"top\"><div align=\"left\"><font size=\"3\" face=\"Ms Sans Serif\" color=\"#CC0000\">+ + ฝ่ายบริหารทั่วไป</br></br></font></div></td></tr>"
;
129.
}
130.
131.
132.
133.
134.
135.
while
(
$result
= mysql_fetch_assoc(
$db_query
)){
136.
137.
138.
139.
140.
141.
142.
143.
144.
145.
146.
147.
148.
149.
150.
151.
152.
extract(
$result
);
153.
154.
155.
$countfile
=0;
156.
$countlink
=0;
157.
$str_tmp
=
""
;
158.
159.
if
(
$nfile1
!=
""
)
$countfile
++;
160.
if
(
$nfile2
!=
""
)
$countfile
++;
161.
if
(
$nfile3
!=
""
)
$countfile
++;
162.
if
(
$nfile4
!=
""
)
$countfile
++;
163.
164.
if
(
$countfile
>1)
$runfile
=1;
else
$runfile
=
""
;
165.
if
(
$nlink1
!=
""
)
$countlink
++;
166.
if
(
$nlink2
!=
""
)
$countlink
++;
167.
if
(
$nlink3
!=
""
)
$countlink
++;
168.
169.
if
(
$countlink
>1)
$runlink
=1;
else
$runlink
=
""
;
170.
171.
echo
"<tr >"
;
172.
echo
"<td valign=\"top\"><div align=\"left\"><font size=\"3\" color=\"#CC0000\">$i</font></div>"
;
173.
echo
"<td valign=\"top\"><font size=\"3\"><div align=\"left\">$nheader </div></font>"
;
174.
echo
"<td valign=\"top\"><div align=\"left\"><font size=\"3\" color=\"#CC0000\">$booknumber</font></div>"
;
175.
176.
if
(
$nfile1
!=
""
){
177.
echo
"<td valign=\"top\"><div align=\"left\"><font size=\"3\" color=\"#CC0000\"><a href=\"ocn_news/file/$nfile1\" target=\"_blank\"><font size=\"3\" color=\"#0066FF\">รายละเอียด $runfile </font></a></td>"
;
178.
$str_tmp
=
" | "
;
179.
$runfile
++;
180.
}
181.
if
(
$nlink1
!=
""
){
182.
echo
"<td valign=\"top\"><div align=\"left\"><font size=\"3\" color=\"#CC0000\">$str_tmp <a href=\"$nlink1\" target=\"_blank\"><font size=\"2\" color=\"#0066FF\">รายละเอียดเพิ่มเติม $runlink</font></a></td>"
;
183.
$runlink
++;
184.
$str_tmp
=
" | "
;
185.
}
186.
187.
$tmp_caldate
=calDate(seperateDate(
$postdate
),seperateDate(
$now_date
));
188.
if
(
$tmp_caldate
<=7){
189.
echo
" <td valign=\"top\"><div align=\"left\"><font size=\"3\" color=\"#CC0000\"><img src=\"img/i_new.gif\" width=\"30\" height=\"10\"></td> "
;
190.
}
191.
192.
echo
"</div></td>"
;
193.
echo
"</tr>"
;
194.
195.
$i
++;
196.
197.
}
198.
199.
200.
201.
?>
202.
</table></td>
203.
</tr>
204.
</table></td>
205.
</tr>
206.
<!-- <tr>
207.
<td> </td>
208.
</tr> -->
209.
</table>
210.
211.
<br>
212.
Total <?php
echo
$Num_Rows
;?> Record : <?php
echo
$Num_Pages
;?> Page :
213.
<?php
214.
if
(
$Prev_Page
)
215.
{
216.
echo
" <a href='$_SERVER[SCRIPT_NAME]?ppage=main&Page=$Prev_Page'><< Back</a> "
;
217.
}
218.
219.
for
(
$a
=1;
$a
<=
$Num_Pages
;
$a
++){
220.
if
(
$a
!=
$Page
)
221.
{
222.
echo
"[ <a href='$_SERVER[SCRIPT_NAME]?ppage=main&Page=$a'>$a</a> ]"
;
223.
}
224.
else
225.
{
226.
echo
"<b> $a </b>"
;
227.
}
228.
}
229.
if
(
$Page
!=
$Num_Pages
)
230.
{
231.
echo
" <a href ='$_SERVER[SCRIPT_NAME]?ppage=main&Page=$Next_Page'>Next>></a> "
;
232.
}
233.
mysql_close();
234.
?>
235.
</body>
236.
</html>