<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<?php
header("Content-Type:text/html; charset=utf-8"); 
$servername = "localhost";
$username = "id21593489_id17615458_tangb";
$password = "c5t9QN19L(W6EPRq";
$database = "id21593489_id17615458_zadmin_website";

$conn = mysqli_connect($servername, $username, $password)or die("cannot connect to the db");//connect server
mysqli_select_db($conn,$database)or die("cannot open the selected db");//select db
mysqli_query($conn,"set names utf8");//utf8 to select data, allow show chinese
$data=mysqli_query($conn,"SELECT * FROM `liturgical_cal` WHERE 1;") or die("no data");//all table in contact db
?>
  <title>禮儀節日表</title>
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<link rel="icon" type="image/png" href="/images/favicon/favicon-32x32.png" sizes="32x32">
    	<link rel="icon" type="image/png" href="/images/favicon/favicon-16x16.png" sizes="16x16">
	<link rel="stylesheet" href="css/style.css">
    <link rel="stylesheet" href="css/w3.css">
</head>

<body>
<div id="wrapper">
<div id="main" class="clearfix">
<div class="w3-center w3-blue w3-padding-48">
<h1>禮儀節日表</h1>
</div>

<center>
<table> 
<tr> 
<th>主日及節日</th> 
<th>2017-2018(乙年)</th> 
<th>2018-2019(丙年)</th> 
<th>2019-2020(甲年)</th> 
</tr>
<?php
if (!$data)  die (""); 
	else {
	while ($row=mysqli_fetch_array($data,MYSQLI_ASSOC))  {
		echo "<tr>
        <td>" .$row["liturgical"]. "</td>
        <td>" .$row["2017-2018(B)"]. "</td>
        <td>" .$row["2018-2019(C)"]. "</td>
        <td>" .$row["2019-2020(A)"]. "</td>
        </tr>";
	}}			
	mysqli_close($conn);

?>
</table>
<p>資料出處: <a href="http://taipei.catholic.org.tw/taipei/files/CA_FileData_eng/FD_File/2010-2020%20Liturgical%20Calendar.pdf">天主教會台北教區</a></p>
<p></p><a href="http://catholic-dlc.org.hk/page2a.htm">禮儀年曆表   (香港教區)</a></p>
<p></p><a href="http://catholic-dlc.org.hk/st/bydate.htm">羅馬教會通用禮儀日曆及香港教區專用禮儀日曆一覽表</a></p>
</center>
</div>
</div>

<div id="footer" class="w3-center w3-dark-grey w3-padding-48 w3-hover-text-black">
	 &copy; 2016
	 <script>new Date().getFullYear()>2016&&document.write("-"+new Date().getFullYear()); </script>
	 , <a href="/">tangb.tk</a>, 
	 All Rights Reserved
     &middot; 
</div>


</body>
</html>