/var/www/hkosl.com/chineseaaedu/en/news.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
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
<? include('_init.php');?>
<?

//
$sql "SELECT name_".$lang." as `name`,intro_".$lang." as `intro`,photo FROM bannerSingle WHERE refid = '2' LIMIT 1";
$sth1 $dbh->prepare($sql);
$sth1->execute();
$row_banner $sth1->fetch(PDO::FETCH_ASSOC);
//
$sql "SELECT count(*) as count 
        FROM `news` 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 3;
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,editor_".$lang." as editor,date,photo
        FROM `news` 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_news $sth1->fetch(PDO::FETCH_ASSOC)) {
    
$rows_news[] = $row_news;
}
//
$sql "SELECT DISTINCT(YEAR(date)) as year
        FROM `news` 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="newsHeader" 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><?=nl2br($row_banner['intro'])?></h4>
                        <h3><?=$row_banner['name']?></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="news.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>
<? for($i=0;$i<count($rows_news);$i++){?>
<?
$row_news 
$rows_news[$i];
?>
<div class="News">
  <div class="container">
      <div class="row">
        <div class="col-lg-6">   
          <div class="NewsImageA" style="background-image:url(../file/news/<?=$row_news['photo']?>);cursor:pointer" onClick="location.href='news_detail.php?id=<?=$row_news['refid']?>'"></div>      
        </div>
        <div class="col-lg-6" id="NewsConent">
          <h11><?=$row_news['title']?></h11> <br>
           <img src="../img/news/writerIcon.png" width="15px" height="15"> &nbsp;<?=$row_news['editor']?> 
           &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
           <img src="../img/news/timeIcon.png" width="15px" height="15"> &nbsp;<?=$row_news['date']?>
           <br><br>
           <?=nl2br($row_news['intro'])?>
        </div>
      </div>
  </div>
</div>
<? if($i+1<count($rows_news)){?>
<div class="container">
  <div class="row">
    <div class="col-lg-12">
      <div class="bottomline">  
      </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="news.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 -->
<? include('_footer.php')?>
  </body>
</html>