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
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <title>เบญจพรกรุ๊ป Benjabhorn Group</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <link href="style.css" rel="stylesheet" type="text/css"> <style type="text/css"> <!-- body { background-image:url(images/bg-inside.jpg); background-position:top; background-repeat:repeat-x; } #apDiv1 { position:absolute; left:422px; top:136px; width:822px; height:310px; z-index:1; } #apDiv2 { position:absolute; left:130px; top:160px; width:1000px; height:50px; z-index:1; } --> </style></head> <body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0"> <!--<div id="apDiv1"> <iframe src="slide-project/index.html" width="800" height="300" frameborder="0" scrolling="no"></iframe></div> --> <center> <?php include("header.php"); ?>
<?php $rowPerPage=8; if((!$_GET['page'])||($_GET['page']==1)){ $_GET['page']=1; $startRow=0; }else{ $startRow=($_GET['page']-1)*$rowPerPage; } //------------------------------------------------------SELECT DEFAULT CATEGORY if($_GET['CateID']==''){ // $query="SELECT * FROM tbl_act_category ORDER BY id ASC LIMIT 0, 1"; // $resultCategory=mysql_query($query); // $dataCategory=mysql_fetch_assoc($resultCategory); // $_GET['CateID']=$dataCategory['id']; // $cateName="All news / ข่าวสารทั้งหมด"; } //------------------------------------------------------SELECT CATEGORY $query="SELECT * FROM tbl_act_category ORDER BY id ASC "; $resultCategory=mysql_query($query); //------------------------------------------------------------SELECT DATA if($_GET['CateID']==''){ $queryAct="SELECT a.*, b.category_name FROM tbl_act3_data a LEFT JOIN tbl_act_category b ON a.cate_id=b.id WHERE a.first_page='1' "; }else{ $queryAct="SELECT a.*, b.category_name FROM tbl_act3_data a LEFT JOIN tbl_act_category b ON a.cate_id=b.id WHERE a.first_page='1' AND a.cate_id= '".$_GET['CateID']."' "; } $queryActLm=$queryAct." ORDER BY a.date_post DESC LIMIT $startRow, $rowPerPage"; $resultAct=mysql_query($queryActLm); ?>
<table width="1000" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td width="1000" height="420" align="left" valign="top"><iframe src="Slideshow2/slide/index_slide.php" width="994" height="430" scrolling="no" frameborder="0" style="background:transparent;"></iframe></td> </tr> <tr> <td align="left" valign="top"> <table width="100%" border="0"> <tr> <td height="53" align="center"> <?php $n=1; while($cate=mysql_fetch_assoc($resultCategory)){?> <a href="news.php?CateID=<?php echo $cate['id']?>" class="bt-news"><img src="images/icon_news.png" alt="" width="35" height="28" border="0" align="absmiddle" style="margin-left:-10px; margin-top:-10px;"/><?php echo $cate['category_name']?></a> <?php if($n > 4){ echo "<br>"; $n=0;}?> <?php $n++; }?> </td> </tr> <tr> <td height="21" class="txt30"><hr size="2" noshade="noshade" /></td> </tr> <tr> <td height="53" class="txt30"><div id="showCategory"> </div></td> </tr> </table> </td> </tr> <?php while($act=mysql_fetch_assoc($resultAct)){ if($_GET['CateID']!=''){ $cateName=$act['category_name']; } else { $cateName="All News / ข่าวสารทั้งหมด"; } ?> <tr> <td height="35" align="left" valign="top" class="txt30"><p> </p> <table width="94%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="290" valign="top"><?php $query="SELECT * FROM tbl_act3_pic WHERE model_data_id = '".$act['id']."' LIMIT 0,1 "; $resultPix=mysql_query($query); $pix=mysql_fetch_assoc($resultPix); ?> <img src="<?php echo $path_product."thb/".$pix['pic_name']?>" alt="news" hspace="5" vspace="5" class="border"></td> <td width="655" valign="top"><a href="news_detail.php?NewsID=<?php echo $act['id']?>&page=<?php echo $_GET['page']?>&CateID=<?php echo $_GET['CateID']?>"><strong><?php echo $act['topic']?></strong></a> <?php $icon=" <img src='images/ico-4408.gif' width='30' height='10' border='0'/>"; GetNewIcon($act['date_start'],$icon)?> <br /> <br /> <?php $act['detail']=strip_tags($act['detail'], '<*>'); echo substr($act['detail'],0,1000);?> <br /> [<?php echo GetThaiDate2($act['date_post'])?>]</td> </tr> <tr> <td height="10" colspan="2" class="line"></td> </tr> </table> </td> </tr> <?php } ?> <tr> <td align="right" valign="top"><map name="Map" id="Map2"> <area shape="rect" coords="229,2,299,30" href="#" alt="" /> <area shape="rect" coords="306,2,383,30" href="type.php" alt="" /> </map></td> </tr> <tr> <td align="center" valign="top"> Page : <?php $self="news.php?CateID=".$_GET['CateID']; PageDisplay($queryAct,$rowPerPage,$_GET['page'],$self,$word)?></td> </tr> <tr> <td align="left" valign="top" class="txt30"> </td> </tr> </table> <script language="javascript"> document.getElementById('showCategory').innerHTML = '<p class="txt30"><?php echo $cateName?></p>'; </script> <p> </p> </center> <?php include("footer.php"); ?> </body> </html>
|