programa.php 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231
  1. <?php
  2. session_start();
  3. include("../functions.php");
  4. $con = startdb();
  5. $proto = getProtocol();
  6. $http_host = $_SERVER['HTTP_HOST'];
  7. $server = "$proto" . "$http_host";
  8. $gm = $_GET["gm"];
  9. if (isset($_GET["y"]) && intval($_GET["y"]) > 2013 && intval($_GET["y"]) <= date("Y")){
  10. $year = $_GET["y"];
  11. }
  12. else{
  13. $year = date("Y");
  14. }
  15. if ($gm == 1 || $gm == "margolari" || $gm == "margolariak"){
  16. $gm = 1;
  17. $schi = "gm";
  18. $url = "margolariak";
  19. }
  20. elseif ($gm == 0 || $gm == "municipal" || $gm == "ciudad"){
  21. $gm = 0;
  22. $schi = "city";
  23. $url = "municipal";
  24. }
  25. else{
  26. header("Location: $server/lablanca/programa/margolariak/$year");
  27. }
  28. //Language
  29. $lang = selectLanguage();
  30. include("../lang/lang_" . $lang . ".php");
  31. $cur_section = $lng['section_lablanca'];
  32. ?>
  33. <!DOCTYPE html>
  34. <html>
  35. <head>
  36. <meta content="text/html; charset=utf-8" http-equiv="content-type"/>
  37. <meta charset="utf-8"/>
  38. <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1">
  39. <title>
  40. <?=str_replace('#', $year, $lng["lablanca_schedule_year_" . $schi])?> - Gasteizko Margolariak
  41. </title>
  42. <link rel="shortcut icon" href="<?=$server?>/img/logo/favicon.ico">
  43. <!-- CSS files -->
  44. <style>
  45. <?php
  46. include("../css/ui.css");
  47. include("../css/lablanca.css");
  48. include("../css/map.css");
  49. ?>
  50. </style>
  51. <!-- CSS for mobile version -->
  52. <style media="(max-width : 990px)">
  53. <?php
  54. include("../css/m/ui.css");
  55. include("../css/m/lablanca.css");
  56. include("../css/m/map.css");
  57. ?>
  58. </style>
  59. <!-- Script files -->
  60. <script type="text/javascript">
  61. <?php
  62. include("../script/ui.js");
  63. include("../script/lablanca.js");
  64. include("../script/map.js");
  65. ?>
  66. </script>
  67. <script src="<?=$server?>/script/OpenLayers/ol.js"></script>
  68. <!-- Meta tags -->
  69. <link rel="canonical" href="<?=$server?>/lablanca/programa/<?=$url?>/<?=$year?>"/>
  70. <link rel="author" href="<?=$server?>"/>
  71. <link rel="publisher" href="<?=$server?>"/>
  72. <meta name="description" content="<?=str_replace('#', $year, $lng["lablanca_schedule_year_" . $schi . "_description"])?>"/>
  73. <meta property="og:title" content="<?=str_replace('#', $year, $lng["lablanca_schedule_year_" . $schi])?> - Gasteizko Margolariak"/>
  74. <meta property="og:url" content="<?=$server?>/lablanca/programa/<?=$url?>/<?=$year?>"/>
  75. <meta property="og:description" content="<?=str_replace('#', $year, $lng["lablanca_schedule_year_" . $schi . "_description"])?>"/>
  76. <meta property="og:image" content="<?=$server?>/img/logo/logo.png"/>
  77. <meta property="og:site_name" content="Gasteizko Margolariak"/>
  78. <meta property="og:type" content="website"/>
  79. <meta property="og:locale" content="<?=$lang?>"/>
  80. <meta name="twitter:card" content="summary"/>
  81. <meta name="twitter:title" content="<?=str_replace('#', $year, $lng["lablanca_schedule_year_" . $schi])?> - Gasteizko Margolariak"/>
  82. <meta name="twitter:description" content="<?=str_replace('#', $year, $lng["lablanca_schedule_year_" . $schi . "_description"])?>"/>
  83. <meta name="twitter:image" content="<?=$server?>/img/logo/logo.png"/>
  84. <meta name="twitter:url" content="<?=$server?>/lablanca/programa/<?=$url?>/<?=$year?>"/>
  85. <meta name="robots" content="index follow"/>
  86. </head>
  87. <body>
  88. <?php include("../header.php"); ?>
  89. <div id="content">
  90. <div class='section' id='schedule'>
  91. <h3 class='section_title'><?=str_replace('#', $year, $lng["lablanca_schedule_year_" . $schi])?></h3>
  92. <?php
  93. $q_days = mysqli_query($con, "SELECT DISTINCT date(DATE_SUB(start, INTERVAL 6 HOUR)) AS date, DATE_FORMAT(DATE_SUB(start, INTERVAL 6 HOUR), '%Y-%m-%d') AS isodate, (SELECT name_$lang FROM festival_day WHERE date = date(DATE_SUB(start, INTERVAL 6 HOUR))) AS name FROM festival_event_$schi WHERE year(start) = $year ORDER BY date");
  94. $i=0;
  95. while ($r_days = mysqli_fetch_array($q_days)){
  96. ?>
  97. <div class='entry'>
  98. <div onClick='expandDay(<?=$i?>);' class='day_title pointer'>
  99. <h4>
  100. <img class='slid' src='<?=$server?>/img/misc/slid-right.png' id='slid_day_<?=$i?>'/>
  101. <?php
  102. if($gm == 1 && $r_days['name'] != null){
  103. ?>
  104. <?=formatFestivalDate($r_days['date'], $lang)?> - <?=$r_days['name']?>
  105. <?php
  106. }
  107. else{
  108. ?>
  109. <?=formatFestivalDate($r_days['date'], $lang)?>
  110. <?php
  111. }
  112. ?>
  113. </h4>
  114. </div>
  115. <div class='day_schedule' id='day_schedule_<?=$i?>'>
  116. <?php
  117. $q_sch = mysqli_query($con, "SELECT festival_event_$schi.id AS id, title_$lang AS title, description_$lang AS description, host, place, date_format(start, '%H:%i') AS st, date_format(end, '%H:%i') AS end, place.name_$lang AS place, address_$lang AS address, lat, lon, route FROM festival_event_$schi, place WHERE place.id = festival_event_$schi.place AND date(DATE_SUB(start, INTERVAL 6 HOUR)) = str_to_date('$r_days[date]', '%Y-%m-%d') ORDER BY start");
  118. if (mysqli_num_rows($q_sch) > 0){
  119. ?>
  120. <table class='schedule'>
  121. <?php
  122. while ($r_sch = mysqli_fetch_array($q_sch)){
  123. ?>
  124. <tr>
  125. <td>
  126. <span class='time'><?=$r_sch['st']?></span>
  127. </td>
  128. <td class='timeline'>
  129. <img class='timeline_dot' alt=' ' src='<?=$server?>/img/misc/schedule-point.png'/>
  130. </td>
  131. <td>
  132. <span class='title'><?=$r_sch['title']?></span>
  133. <?php
  134. if (strlen($r_sch["description"]) > 0 && $r_sch["description"] != $r_sch["title"]){
  135. ?>
  136. <br/>
  137. <div class='description'><?=$r_sch["description"]?></div>
  138. <?php
  139. }
  140. ?>
  141. <div class='location'>
  142. <?php
  143. if ($r_sch["route"] != null && strlen($r_sch["route"]) != 0){
  144. ?>
  145. <!-- TODO: Add center coordinates and zoom -->
  146. <span class='fake_a pointer' onClick='showMapRoute(<?=$r_sch["route"]?>, "<?=$r_sch["title"]?>", <?=$r_sch["lat"]?>, <?=$r_sch["lon"]?>);'>
  147. <img class='pinpoint' alt=' ' src='<?=$server?>/img/misc/pinpoint-route.png'/>
  148. <?php
  149. //If name and address are the same, show only name
  150. if ($r_sch["place"] == $r_sch["address"]){
  151. ?>
  152. <?=$r_sch["place"]?>
  153. <?php
  154. }
  155. else{
  156. ?>
  157. <span class='desktop route_start'>
  158. <?=$lng["lablanca_schedule_start"]?>
  159. </span>
  160. <span class='address'><?=$r_sch["address"]?></span>
  161. <?php
  162. }
  163. ?>
  164. </span>
  165. <?php
  166. }
  167. else{
  168. ?>
  169. <span class='fake_a pointer' onClick='showMapPoint("<?=$r_sch["title"]?>", <?=$r_sch["lat"]?>, <?=$r_sch["lon"]?>);'>
  170. <img class='pinpoint' alt=' ' src='<?=$server?>/img/misc/pinpoint.png'/>
  171. <?php
  172. //If name and address are the same, show only name
  173. if ($r_sch["place"] == $r_sch["address"]){
  174. ?>
  175. <?=$r_sch["place"]?>
  176. <?php
  177. }
  178. else{
  179. ?>
  180. <?=$r_sch["place"]?>
  181. <span class='address'><?=$r_sch["address"]?></span>
  182. <?php
  183. }
  184. ?>
  185. </span>
  186. <?php
  187. }
  188. ?>
  189. </div>
  190. </td>
  191. </tr>
  192. <?php
  193. }
  194. ?>
  195. </table>
  196. <?php
  197. }
  198. ?>
  199. </div>
  200. </div>
  201. <?php
  202. $i ++;
  203. } // while ($r_days = mysqli_fetch_array($q_days))
  204. ?>
  205. </div>
  206. <div id='map_container'>
  207. <div class='section'>
  208. <h3 class='section_title'>
  209. <span id='map_title'>MAP</span>
  210. <div id='map_close_container'>
  211. <img id='map_close' class='pointer' alt=' ' src='<?=$server?>/img/misc/close.png' onClick='hideMap();'/>
  212. </div>
  213. </h3>
  214. <div id='map' class='entry'>
  215. </div> <!-- map -->
  216. </div> <!-- .section -->
  217. </div> <!-- .map_container -->
  218. </div> <!-- #content -->
  219. <?php
  220. include("../footer.php");
  221. $ad = ad($con, $lang, $lng);
  222. stats($ad, $ad_static, "fiestas", "");
  223. ?>
  224. </body>
  225. </html>