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
|
<? include('_init.php');?> <? // $sql = "SELECT name_".$lang." as `name`,intro_".$lang." as `intro`,photo FROM bannerSingle WHERE refid = '4' LIMIT 1"; $sth1 = $dbh->prepare($sql); $sth1->execute(); $row_banner = $sth1->fetch(PDO::FETCH_ASSOC); // $sql = "SELECT count(*) as count FROM `event` where status = ? and deleted = ? and date >= ? and (display_date_from <= ? and ? <= display_date_to) order by date desc"; $sth1 = $dbh->prepare($sql); $parameter = array(1,0,date('Y-m-d'),date('Y-m-d'),date('Y-m-d')); $sth1->execute($parameter); $row = $sth1->fetch(PDO::FETCH_ASSOC); $page = @$_GET['page']?$_GET['page']:1; $item_total = $row['count']; $items_per_page = 4; list($page, $page_total, $limit_start) = parsePages($page, $item_total, $items_per_page); $number = $page_total; $sql = "SELECT refid,title_".$lang." as title,intro_".$lang." as intro,date,photo,time_to,time_from FROM `event` where status = ? and deleted = ? and date < ? and (display_date_from <= ? and ? <= display_date_to) order by date desc limit ".$limit_start.",".$items_per_page; $sth1 = $dbh->prepare($sql); $parameter = array(1,0,date('Y-m-d'),date('Y-m-d'),date('Y-m-d')); $sth1->execute($parameter); while ($row_event = $sth1->fetch(PDO::FETCH_ASSOC)) { $rows_event[] = $row_event; } // $sql = "SELECT DISTINCT(YEAR(date)) as year FROM `event` where status = ? and deleted = ? and date < ? and (display_date_from <= ? and ? <= display_date_to) order by date desc"; $sth1 = $dbh->prepare($sql); $parameter = array(1,0,date('Y-m-d'),date('Y-m-d'),date('Y-m-d')); $sth1->execute($parameter); while ($row_year = $sth1->fetch(PDO::FETCH_ASSOC)) { $rows_year[] = $row_year; } ?> <!DOCTYPE html> <html lang="<?=$lang?>"> <head> <? include('_head.php');?> </head>
<body>
<!-- Static navbar --> <? include('_header.php')?> <!-- Header --> <div class="eventsPhotoHeader" style="background-image:url(../file/bannerSingle/<?=$row_banner['photo']?>)"> <div class="container"> <div class="row"> <div class="col-lg-12"> <div class="subPage-intro-message"> <h4>我們有什麼</h4> <h3>活動照片</h3> <br><br> </div> </div> </div> </div> </div>
<div class="SelectionMenu"> <center><a class="show_hide"> <img src="../img/news/LinesMenu.png" wisth="20px" height="20px"></a></center> </div>
<div class="openSelectionMenu"> <div class="container"> <div class="row"> <div class="col-lg-12"> <div class="slidingDiv"> <span id="menuYear">年份 :</span> <? foreach($rows_year as $row_year){?> <a href="eventsphotos.php?year=<?=$row_year['year']?>&page=<?=$page?>" <? if($row_year['year']==$_GET['year']){?>style="background-color: #2086d5; color:#fff;"<? }?> class="MenuButton"><?=$row_year['year']?></a> <? }?> </div> </div> </div> </div> </div>
<div class="container"> <div class="row"> <? foreach($rows_event as $row_event){?> <div class="col-lg-4" id="EventsPhotoSection"> <div class="EventsPhotoImageA" style="background-image:url(../file/event/<?=$row_event['photo']?>); cursor:pointer;" onClick="location.href='eventsphoto_detail.php?id=<?=$row_event['refid']?>'"></div> <div class="EventTitle"><?=$row_event['title']?></div> <div class="EventContentA"> <?=$row_event['date']?> <span class="PhotoEventTime"><?=$row_event['time_from']?> ~ <?=$row_event['time_to']?></span> <br> <hr> <?=$row_event['intro']?> </div> </div> <? }?> </div> </div>
<div class="PageButtonSection"> <div class="container"> <div class="row"> <div class="col-lg-12"> <? for ($i=1; $i<=$number; $i++){ ?> <a href="eventsphotos.php?year=<?=$_GET['year']?>&page=<?=$i?>" <? if($i==$_GET['page']){?>style="border-color:#2086d5;background-color: #2086d5; color:#fff;"<? }?> class="PageButton"><?=$i?></a> <? }?> </div> </div> </div> </div>
<!-- Footer --> <!-- Static navbar --> <? include('_footer.php')?> </body> </html>
|