index.php 53 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794
  1. <?php
  2. session_start();
  3. $http_host = $_SERVER["HTTP_HOST"];
  4. include("functions.php");
  5. $proto = getProtocol();
  6. $con = startdb();
  7. $server = "$proto$http_host";
  8. //Language
  9. $lang = selectLanguage();
  10. include("lang/lang_" . $lang . ".php");
  11. $cur_section = $lng["section_home"];
  12. ?>
  13. <!DOCTYPE html>
  14. <html>
  15. <head>
  16. <meta content="text/html; charset=utf-8" http-equiv="content-type"/>
  17. <meta charset="utf-8"/>
  18. <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1"/>
  19. <title><?=$lng["index_title"]?></title>
  20. <link rel="shortcut icon" href="<?=$server?>/img/logo/favicon.ico"/>
  21. <!-- CSS files -->
  22. <style>
  23. <?php
  24. include("css/ui.css");
  25. include("css/index.css");
  26. ?>
  27. </style>
  28. <!-- CSS for mobile version -->
  29. <style media="(max-width : 990px)">
  30. <?php
  31. include("css/m/ui.css");
  32. include("css/m/index.css");
  33. ?>
  34. </style>
  35. <!-- Script files -->
  36. <script type="text/javascript">
  37. <?php include("script/ui.js"); ?>
  38. </script>
  39. <!-- Meta tags -->
  40. <link rel="canonical" href="<?=$server?>"/>
  41. <link rel="author" href="<?=$server?>"/>
  42. <link rel="publisher" href="<?=$server?>"/>
  43. <meta name="description" content="<?php echo $lng["index_us_content"];?>"/>
  44. <meta property="og:title" content="<?php echo $lng["index_title"];?>"/>
  45. <meta property="og:url" content="<?=$server?>"/>
  46. <meta property="og:description" content="<?=$lng["index_us_content"]?>"/>
  47. <meta property="og:image" content="<?=$server?>/img/logo/logo.png"/>
  48. <meta property="og:site_name" content="<?=$lng["index_title"]?>"/>
  49. <meta property="og:type" content="website"/>
  50. <meta property="og:locale" content="<?php echo $lang; ?>"/>
  51. <meta name="twitter:card" content="summary"/>
  52. <meta name="twitter:title" content="<?=$lng["index_title"]?>"/>
  53. <meta name="twitter:description" content="<?=$lng["index_us_content"]?>"/>
  54. <meta name="twitter:image" content="<?=$server?>/img/logo/logo.png"/>
  55. <meta name="twitter:url" content="<?=$server?>"/>
  56. <meta name="robots" content="index follow"/>
  57. </head>
  58. <body>
  59. <?php
  60. include("header.php");
  61. ?>
  62. <div id="content">
  63. <?php
  64. //Location section
  65. $q_location = mysqli_query($con, "SELECT lat, lon FROM location WHERE action = 'report' AND dtime > NOW() - INTERVAL 30 MINUTE ORDER BY dtime DESC LIMIT 1;");
  66. if (mysqli_num_rows($q_location) > 0){
  67. $r_location = mysqli_fetch_array($q_location);
  68. ?>
  69. <div class='section' id='location'>
  70. <h3 class='section_title'><?=$lng["index_festivals_location"]?></h3>
  71. <div class='entry' id='map'>
  72. <iframe src='https://www.google.com/maps/embed/v1/place?key=AIzaSyCZHP7t2on_G3eyyoCTfhGAlDx1mJnX7iI&q=<?=$r_location["lat"]?>,<?=$r_location["lon"]?>' allowfullscreen></iframe>
  73. </div>
  74. </div>
  75. <?php
  76. }
  77. //Festivals section
  78. $year = date("Y");
  79. $q_settings = mysqli_query($con, "SELECT value FROM settings WHERE name = 'festivals';");
  80. $r_settings = mysqli_fetch_array($q_settings);
  81. $festivals = $r_settings["value"];
  82. if ($festivals == 1){
  83. ?>
  84. <div class='section' id='festivals' itemscope itemtype='http://schema.org/Event'>
  85. <div class='hidden' itemprop='organizer performer' itemscope itemtype='http://schema.org/Organization'>
  86. <meta itemprop='legalName' content='Asociaci&oacute;n Cultural Recreativa Gasteizko Margolariak'/>
  87. <meta itemprop='name' content='Gasteizko Margolariak'/>
  88. <meta itemprop='logo' content='<?=$server?>/img/logo/logo.png'/>
  89. <meta itemprop='foundingDate' content='2013-02-03'/>
  90. <meta itemprop='telephone' content='+34637140371'/>
  91. </div> <!-- .hidden -->
  92. <meta itemprop='inLanguage' content='<?=$lang?>'/>
  93. <meta itemprop='name' content='<?=$lng["index_festivals_header"]?> <?=$year?>'/>
  94. <meta itemprop='description' content='<?=$lng["index_festivals_header"]?> <?=$year?>'/>
  95. <meta itemprop='startDate' content='<?=$year?>-08-04'/>
  96. <meta itemprop='endDate' content='<?=$year?>-08-09'/>
  97. <meta itemprop='url' content='<?=$server?>/lablanca/'/>
  98. <span class='hidden' itemprop='location' itemscope itemtype='http://schema.org/Place'>
  99. <meta itemprop='name' content='Vitoria-Gasteiz'/>
  100. <meta itemprop='address' content='Vitoria-Gasteiz'/>
  101. </span>
  102. <h3 class='section_title'><?=$lng["index_festivals_header"]?> <?=$year?></h3>
  103. <div class='entry' id='festivals_summary'>
  104. <?php
  105. // Offers (for metadata)
  106. $q_offer = mysqli_query($con, "SELECT name_$lang AS name, description_$lang AS description, price FROM festival_offer WHERE year = $year");
  107. while($r_offer = mysqli_fetch_array($q_offer)){
  108. ?>
  109. <span class='hidden' itemprop='offers' itemscope itemtype='http://schema.org/Offer'>
  110. <meta itemprop='name' content='<?=$r_offer["name"]?>'/>
  111. <meta itemprop='description' content='<?=$r_offer["description"]?>'/>
  112. <meta itemprop='price' content='<?=$r_offer["price"]?>'/>
  113. <meta itemprop='priceCurrency' content='EUR'/>
  114. <meta itemprop='url' content='<?=$server?>/lablanca/'/>
  115. <meta itemprop='availability' content='Sold Out'/>
  116. <meta itemprop='validfrom' content='<?=$year?>-07-25'/>
  117. </span>
  118. <?php
  119. }
  120. // Summary
  121. $q_festivals = mysqli_query($con, "SELECT text_$lang AS text, summary_$lang AS summary, img FROM festival WHERE year = $year;");
  122. if(mysqli_num_rows($q_festivals)){
  123. $r_festivals = mysqli_fetch_array($q_festivals);
  124. if ($r_festivals["img"] != ''){
  125. ?>
  126. <meta itemprop='image' content='<?=$server?>/img/fiestas/view/<?=$r_festivals["img"]?>'/>
  127. <img id='festivals_image' alt='<?=$lng["index_festivals_header"]?> <?=$year?>' src='<?=$server?>/img/fiestas/preview/<?=$r_festivals["img"]?>'/>
  128. <?php
  129. }
  130. if ($r_festivals["summary"] != ''){
  131. ?>
  132. <br/><span class='entry_title' id='festivals_summary_text'><?=$r_festivals["summary"]?></span>
  133. <br/><br/><br/>
  134. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href='<?=$server?>/lablanca/'><?=$lng["index_festivals_link"]?></a>
  135. <?php
  136. }
  137. else{
  138. ?>
  139. <span id='festivals_summary_text'>
  140. <br/>
  141. <span class='mobile'><?=cutText($r_festivals["text"], 300, "$lng[index_read_more]", "$server/lablanca/")?></span>
  142. <span class='desktop'><?=cutText($r_festivals["text"], 500, "$lng[index_read_more]", "$server/lablanca/")?></span>
  143. </span>
  144. <?php
  145. }
  146. }
  147. ?>
  148. </div> <!--festivals_summary - entry-->
  149. <div id='festivals_schedule_table'>
  150. <div id='festivals_schedule_row'>
  151. <div class='festivals_schedule_cell'>
  152. <?php
  153. //GM schedule
  154. $q_sch_curr = mysqli_query($con, "SELECT festival_event.id AS id, gm, title_$lang AS title, description_$lang AS description, host, place, date_format(start, '%H:%i') AS st, date_format(end, '%H:%i') AS end, DATE_FORMAT(start, '%Y-%m-%dT%H:%i:00') AS isostart, DATE_FORMAT(end, '%Y-%m-%dT%H:%i:00') AS isoend, place.name_$lang AS place, address_$lang AS address, lat, lon FROM festival_event, place WHERE place.id = festival_event.place AND gm = 1 AND start > NOW() - INTERVAL 45 MINUTE AND start < NOW() + INTERVAL 30 MINUTE ORDER BY start LIMIT 1;");
  155. $q_sch_next = mysqli_query($con, "SELECT festival_event.id AS id, gm, title_$lang AS title, description_$lang AS description, host, place, date_format(start, '%H:%i') AS st, date_format(end, '%H:%i') AS end, DATE_FORMAT(start, '%Y-%m-%dT%H:%i:00') AS isostart, DATE_FORMAT(end, '%Y-%m-%dT%H:%i:00') AS isoend, place.name_$lang AS place, address_$lang AS address, lat, lon FROM festival_event, place WHERE place.id = festival_event.place AND gm = 1 AND start > NOW() AND start < NOW() + INTERVAL 240 MINUTE ORDER BY start LIMIT 1;");
  156. if (mysqli_num_rows($q_sch_curr) > 0 || mysqli_num_rows($q_sch_next) > 0){
  157. ?>
  158. <div class='entry festival_schedule' id='festivals_gm'>
  159. <h3 class='entry_title'><?=$lng["index_festivals_gm_schedule"]?></h3>
  160. <?php
  161. if (mysqli_num_rows($q_sch_curr) > 0){
  162. $r_sch_curr = mysqli_fetch_array($q_sch_curr);
  163. ?>
  164. <div class='festival_event' itemprop='subEvent' itemscope itemtype='http://schema.org/Event'>
  165. <h4><?=$lng[index_festivals_schedule_now]?></h4>
  166. <meta itemprop='inLanguage' content='<?=$lang?>'/>
  167. <meta itemprop='name' content='<?=$r_sch_curr["title"]?>'/>
  168. <meta itemprop='startDate' content='<?=$r_sch_curr["isostart"]?>'/>
  169. <span class='hidden' itemprop='location' itemscope itemtype='http://schema.org/Place'>
  170. <meta itemprop='address' content='Vitoria-Gasteiz'/>
  171. </span>
  172. <?php
  173. if (strlen($r_sch_curr["isoend"]) > 0){
  174. ?>
  175. <meta itemprop='endDate' content='<?=$r_sch_curr["isoend"]?>'/>
  176. <?php
  177. }
  178. ?>
  179. <div class='schedule_content'>
  180. <span class='title'><?=$r_sch_curr["title"]?></span>
  181. <?php
  182. if (strlen($r_sch_curr["description"]) > 0 && $r_sch_curr["description"] != $r_sch_curr["title"]){
  183. ?>
  184. <br/><p class='description'><?=$r_sch_curr["description"]?></p>
  185. <meta itemprop='description' content='<?=$r_sch_curr["description"]?>'/>
  186. <?php
  187. }
  188. ?>
  189. <table class='location'>
  190. <tr>
  191. <td>
  192. <a target='_blank' href='http://maps.google.com/maps?q=<?=$r_sch_curr["lat"]?>,<?=$r_sch_curr["lon"]?>+Gasteizko+Margolariak)&z=14&ll=<?=$r_sch_curr["lat"]?>,<?=$r_sch_curr["lon"]?>'>
  193. <img alt='<?=$r_sch_curr["title"]?>'' src='<?=$server?>/img/misc/pinpoint.png'/>
  194. </a>
  195. </td>
  196. <td>
  197. <?php
  198. //If name and address are the same, show only name
  199. if ($r_sch_curr["place"] == $r_sch_curr["address"]){
  200. ?>
  201. <?=$r_sch_curr["place"]?>
  202. <?php
  203. }
  204. else{
  205. ?>
  206. <?=$r_sch_curr["place"]?><br/>
  207. <span class='address'><?=$r_sch_curr["address"]?></span>
  208. <?php
  209. }
  210. ?>
  211. </td>
  212. </tr>
  213. </table>
  214. </div> <!--.schedule_content -->
  215. </div> <!-- festival-event -->
  216. <?php
  217. } // if (mysqli_num_rows($q_sch_curr) > 0)
  218. if (mysqli_num_rows($q_sch_next) > 0){
  219. $r_sch_next = mysqli_fetch_array($q_sch_next);
  220. ?>
  221. <div class='festival_event' itemprop='subEvent' itemscope itemtype='http://schema.org/Event'>
  222. <h4><?=$lng["index_festivals_schedule_next"]?></h4>
  223. <meta itemprop='inLanguage' content='<?=$lang?>'/>
  224. <meta itemprop='name' content='<?=$r_sch_next["title"]?>'/>
  225. <meta itemprop='startDate' content='<?=$r_sch_next["isostart"]?>'/>
  226. <span class='hidden' itemprop='location' itemscope itemtype='http://schema.org/Place'>
  227. <meta itemprop='address' itemprop='name'>Vitoria-Gasteiz</meta>
  228. </span>
  229. <?php
  230. if (strlen($r_sch_curr["isoend"]) > 0){
  231. ?>
  232. <meta itemprop='endDate' content='<?=$r_sch_next["isoend"]?>'/>
  233. <?php
  234. }
  235. ?>
  236. <div class='schedule_content'>
  237. <span class='title'><?=$r_sch_next["title"]?> - <?=$r_sch_next["st"]?></span>
  238. <?php
  239. if (strlen($r_sch_next["description"]) > 0 && $r_sch_next["description"] != $r_sch_next["title"]){
  240. ?>
  241. <br/><p class='description'><?=$r_sch_next["description"]?></p>
  242. <meta itemprclass='entry' itemprop='description' content='<?=$r_sch_next["description"]?>'/>
  243. <?php
  244. }
  245. ?>
  246. <table class='location'>
  247. <tr>
  248. <td>
  249. <a target='_blank' href='http://maps.google.com/maps?q=<?=$r_sch_next["lat"]?>,<?=$r_sch_next["lon"]?>+(Gasteizko+Margolariak)&z=14&ll=<?=$r_sch_next["lat"]?>,<?=$r_sch_next["lon"]?>'>
  250. <img alt=' ' src='<?=server?>/img/misc/pinpoint.png'/>
  251. </a>
  252. </td>
  253. <td>
  254. <?php
  255. //If name and address are the same, show only name
  256. if ($r_sch_next["place"] == $r_sch_next["address"]){
  257. ?>
  258. <?$r_sch_next["place"]?>
  259. <?php
  260. }
  261. else{
  262. ?>
  263. <?=$r_sch_next["place"]?> </br><span class='address'> <?=$r_sch_next["address"]?></span>
  264. <?php
  265. }
  266. ?>
  267. </td>
  268. </tr>
  269. </table>
  270. </div> <!--.schedule_content -->
  271. </div> <!-- festival-event -->
  272. <?php
  273. }
  274. ?>
  275. </div> <!--festivals_gm-->
  276. <?php
  277. } // if (mysqli_num_rows($q_sch_curr) > 0 || ysqli_num_rows($q_sch_next) > 0)
  278. ?>
  279. </div> <!-- festivals_schedule_cell -->
  280. <div class='festivals_schedule_cell'>
  281. <?php
  282. //City schedule
  283. $q_sch_curr = mysqli_query($con, "SELECT festival_event.id AS id, gm, title_$lang AS title, description_$lang AS description, host, place, date_format(start, '%H:%i') AS st, date_format(end, '%H:%i') AS end, DATE_FORMAT(start, '%Y-%m-%dT%H:%i:00') AS isostart, DATE_FORMAT(end, '%Y-%m-%dT%H:%i:00') AS isoend, place.name_$lang AS place, address_$lang AS address, lat, lon FROM festival_event, place WHERE place.id = festival_event.place AND gm = 0 AND start > NOW() - INTERVAL 45 MINUTE AND start < NOW() + INTERVAL 30 MINUTE ORDER BY start LIMIT 1;");
  284. $q_sch_next = mysqli_query($con, "SELECT festival_event.id AS id, gm, title_$lang AS title, description_$lang AS description, host, place, date_format(start, '%H:%i') AS st, date_format(end, '%H:%i') AS end, DATE_FORMAT(start, '%Y-%m-%dT%H:%i:00') AS isostart, DATE_FORMAT(end, '%Y-%m-%dT%H:%i:00') AS isoend, place.name_$lang AS place, address_$lang AS address, lat, lon FROM festival_event, place WHERE place.id = festival_event.place AND gm = 0 AND start > NOW() AND start < NOW() + INTERVAL 240 MINUTE ORDER BY start LIMIT 1;");
  285. if (mysqli_num_rows($q_sch_curr) > 0 || mysqli_num_rows($q_sch_next) > 0){
  286. echo "<div class='entry festival_schedule' id='festivals_city'>\n";
  287. echo "<h3 class='entry_title'>$lng[index_festivals_city_schedule]</h3>\n";
  288. if (mysqli_num_rows($q_sch_curr) > 0){
  289. $r_sch_curr = mysqli_fetch_array($q_sch_curr);
  290. ?>
  291. <div class='festival_event' itemprop='subEvent' itemscope itemtype='http://schema.org/Event'>
  292. <h4><?=$lng["index_festivals_schedule_now"]?></h4>
  293. <meta itemprop='inLanguage' content='<?=$lang?>'/>
  294. <meta itemprop='name' content='<?=$r_sch_curr["title"]?>'/>
  295. <meta itemprop='startDate' content='<?=$r_sch_curr["isostart"]?>'/>
  296. <span class='hidden' itemprop='location' itemscope itemtype='http://schema.org/Place'>
  297. <meta itemprop='address' itemprop='name'>Vitoria-Gasteiz</meta>
  298. </span>
  299. <?php
  300. if (strlen($r_sch_curr["isoend"]) > 0){
  301. ?>
  302. <meta itemprop='endDate' content='<?=$r_sch_curr["isoend"]?>'/>
  303. <?php
  304. }
  305. ?>
  306. <div class='schedule_content'>
  307. <span class='title'><?=$r_sch_curr["title"]?></span>
  308. <?php
  309. if (strlen($r_sch_curr["description"]) > 0 && $r_sch_curr["description"] != $r_sch_curr["title"]){
  310. ?>
  311. <br/>
  312. <p class='description'><?=$r_sch_curr["description"]?></p>
  313. <meta itemprop='description' content='<?=$r_sch_curr["description"]?>'/>
  314. <?php
  315. }
  316. ?>
  317. <table class='location'>
  318. <tr>
  319. <td>
  320. <a target='_blank' href='http://maps.google.com/maps?q=<?=$r_sch_curr["lat"]?>,<?=$r_sch_curr["lon"]?>+(Gasteizko+Margolariak)&z=14&ll=<?=$r_sch_curr["lat"]?>,<?=$r_sch_curr["lon"]?>'>
  321. <img alt=' ' src='<?=$server?>/img/misc/pinpoint.png'/>
  322. </a>
  323. </td>
  324. <td>
  325. <?php
  326. //If name and address are the same, show only name
  327. if ($r_sch_curr["place"] == $r_sch_curr["address"]){
  328. ?>
  329. <?=$r_sch_curr["place"]?>
  330. <?php
  331. }
  332. else{
  333. ?>
  334. <?=$r_sch_curr["place"]?>
  335. <br/>
  336. <span class='address'> <?=$r_sch_curr["address"]?></span>
  337. <?php
  338. }
  339. ?>
  340. </td>
  341. </tr>
  342. </table>
  343. </div> <!--.schedule_content -->
  344. </div> <!-- festival-event -->
  345. <?php
  346. }
  347. if (mysqli_num_rows($q_sch_next) > 0){
  348. $r_sch_next = mysqli_fetch_array($q_sch_next);
  349. ?>
  350. <div class='festival_event' itemprop='subEvent' itemscope itemtype='http://schema.org/Event'>
  351. <h4><?=$lng["index_festivals_schedule_next"]?></h4>
  352. <meta itemprop='inLanguage' content='<?=$lang?>'/>
  353. <meta itemprop='name' content='<?=$r_sch_next["title"]?>'/>
  354. <meta itemprop='startDate' content='<?=$r_sch_next["isostart"]?>'/>
  355. <span class='hidden' itemprop='location' itemscope itemtype='http://schema.org/Place'>
  356. <meta itemprop='address' itemprop='name'>Vitoria-Gasteiz</meta>
  357. </span>
  358. <?php
  359. if (strlen($r_sch_curr["isoend"]) > 0){
  360. ?>
  361. <meta itemprop='endDate' content='<?=$r_sch_next["isoend"]?>'/>
  362. <?php
  363. }
  364. ?>
  365. <div class='schedule_content'>
  366. <span class='title'><?=$r_sch_next["title"]?> - <?=$r_sch_next["st"]?></span>
  367. <?php
  368. if (strlen($r_sch_next["description"]) > 0 && $r_sch_next["description"] != $r_sch_next["title"]){
  369. ?>
  370. <br/>
  371. <p class='description'><?=$r_sch_next["description"]?></p>
  372. <meta itemprop='description' content='<?=$r_sch_next["description"]?>'/>
  373. <?php
  374. }
  375. ?>
  376. <table class='location'>
  377. <tr>
  378. <td>
  379. <a target='_blank' href='http://maps.google.com/maps?q=<?=$r_sch_next["lat"]?>,<?=$r_sch_next["lon"]?>+(Gasteizko+Margolariak)&z=14&ll=<?=$r_sch_next["lat"]?>,<?=$r_sch_next["lon"]?>'>
  380. <img alt=' ' src='<?=$server?>/img/misc/pinpoint.png'/>
  381. </a>
  382. </td>
  383. <td>
  384. <?php
  385. //If name and address are the same, show only name
  386. if ($r_sch_next["place"] == $r_sch_next["address"]){
  387. ?>
  388. <?=$r_sch_next["place"]?>
  389. <?php
  390. }
  391. else{
  392. ?>
  393. <?=$r_sch_next["place"]?>
  394. <br/>
  395. <span class='address'> <?=$r_sch_next["address"]?></span>
  396. <?php
  397. }
  398. ?>
  399. </td>
  400. </tr>
  401. </table>
  402. </div> <!--.schedule_content -->
  403. </div> <!-- festival-event -->
  404. <?php
  405. }
  406. ?>
  407. </div> <!--festivals_schedule-->
  408. <?php
  409. }
  410. ?>
  411. </div> <!-- festivals_schedule_cell -->
  412. </div> <!-- festivals_schedule_row -->
  413. </div> <!-- festivals_schedule_table -->
  414. <a class='go_to_section' href='<?=$server?>/lablanca/'><?=$lng["index_festivals_link"]?></a>
  415. <br/>
  416. </div> <!-- festivals - section-->
  417. <?php
  418. }
  419. //Upcaming activity section
  420. $q_activity = mysqli_query($con, "SELECT id, permalink, date, DATE_FORMAT(date, '%Y-%m-%d') AS isodate, title_$lang AS title, text_$lang AS text, price, inscription, people, max_people, city FROM activity WHERE visible = 1 AND date >= date(now()) ORDER BY date LIMIT 2;");
  421. $upcoming_activity_shown = false;
  422. if (mysqli_num_rows($q_activity) > 0){
  423. $upcoming_activity_shown = true;
  424. ?>
  425. <div class='section'>
  426. <h3 class='section_title'><?=$lng["index_upcoming_activity"]?></h3>
  427. <?php
  428. while($r_activity = mysqli_fetch_array($q_activity)){
  429. ?>
  430. <div class='entry' itemscope itemtype='http://schema.org/Event'>
  431. <meta itemprop='inLanguage' content='<?=$lang?>'/>
  432. <meta itemprop='name' content='<?=$r_activity["title"]?>'/>
  433. <meta itemprop='description' content='<?=$r_activity["text"]?>'/>
  434. <meta itemprop='startDate endDate' content='<?=$r_activity["isodate"]?>'/>
  435. <span class='hidden' itemprop='location' itemscope itemtype='http://schema.org/Place'>
  436. <meta itemprop='address' itemprop='name' content='=<?=$r_activity["city"]?>'/>
  437. </span>
  438. <meta itemprop='url' content='<?=$server?>/actividades/<?=$r_activity["permalink"]?>'/>
  439. <div class='hidden' itemprop='organizer performer' itemscope itemtype='http://schema.org/Organization'>
  440. <meta itemprop='legalName' content='Asociaci&oacute;n Cultural Recreativa Gasteizko Margolariak'/>
  441. <meta itemprop='name' content='Gasteizko Margolariak'/>
  442. <meta itemprop='logo' content='<?=$server?>/img/logo/logo.png'/>
  443. <meta itemprop='foundingDate' content='2013-02-03'/>
  444. <meta itemprop='telephone' content='+34637140371'/>
  445. </div> <!-- .hidden -->
  446. <div id='upcoming_activity' class='table'>
  447. <div class='tr'>
  448. <?php
  449. //If image, show it
  450. $q_activity_image = mysqli_query($con, "SELECT image FROM activity_image WHERE activity = $r_activity[id] ORDER BY idx LIMIT 1;");
  451. if (mysqli_num_rows($q_activity_image) > 0){
  452. $r_activity_image = mysqli_fetch_array($q_activity_image);
  453. ?>
  454. <div class='td'>
  455. <div id='upcoming_image'>
  456. <a href='<?=$server?>/actividades/<?=$r_activity["permalink"]?>'>
  457. <meta itemprop='image' content='<?=$server?>/img/actividades/<?=$r_activity_image["image"]?>'/>
  458. <img src='<?=$server?>/img/actividades/miniature/<?=$r_activity_image["image"]?>' alt='<?=$r_activity["title"]?>'/>
  459. </a>
  460. </div> <!-- #upcoming_image -->
  461. </div> <!-- .td-->
  462. <?php
  463. }
  464. ?>
  465. <div class='td'>
  466. <div id='upcoming_text'>
  467. <h3 class='entry_title'>
  468. <a itemprop='url' href='<?=$server?>/actividades/<?=$r_activity["permalink"]?>'><?=$r_activity["title"]?></a>
  469. </h3>
  470. <p class='mobile'><?=cutText($r_activity["text"], 250, $lng["index_read_more"], "$server/actividades/$r_activity[permalink]")?></p>
  471. <p class='desktop'><?=cutText($r_activity["text"], 450, $lng["index_read_more"], "$server/actividades/$r_activity[permalink]")?></p>
  472. </div> <!-- #upcoming_text -->
  473. </div> <!-- .td -->
  474. <div class='td'>
  475. <div id='upcoming_details'>
  476. <table>
  477. <tr>
  478. <td><?=$lng["index_upcoming_activity_date"]?></td>
  479. <td><?=formatDate($r_activity["date"], $lang, false)?></td>
  480. </tr>
  481. <tr>
  482. <td><?=$lng["index_upcoming_activity_price"]?></td>
  483. <?php
  484. if ($r_activity["price"] == 0){
  485. ?>
  486. <td itemprop='offers' itemscope itemtype='http://schema.org/Offer'>
  487. <?=$lng["index_upcoming_activity_free"]?>
  488. <meta itemprop='priceCurrency' content='EUR'/>
  489. <meta itemprop='price' content='0'/>
  490. <meta itemprop='availability' content='Sold Out'/>
  491. <meta itemprop='validfrom' content='<?=$r_activity["isodate"]?>'/>
  492. <meta itemprop='url' content='<?=$server?>/actividades/<?=$r_activity["permalink"]?>'/>
  493. </td>
  494. </tr>
  495. <tr>
  496. <td><?=$lng["index_upcoming_activity_inscription"]?></td>
  497. <?php
  498. if ($r_activity["inscription"] == 1){
  499. ?>
  500. <td><?=$lng["yes"]?></td>
  501. <?php
  502. }
  503. else{
  504. ?>
  505. <td><?=$lng["no"]?></td>
  506. <?php
  507. }
  508. }
  509. else{
  510. ?>
  511. <td itemprop='offers' itemscope itemtype='http://schema.org/Offer'>
  512. <?=$r_activity["price"]?> €
  513. <meta itemprop='priceCurrency' content='EUR'/>
  514. <meta itemprop='availability' content='Sold Out'/>
  515. <meta itemprop='validfrom' content='<?=$r_activity["isodate"]?>'/>
  516. <meta itemprop='price' content='<?=$r_activity["price"]?>'/>
  517. </td>
  518. <?php
  519. }
  520. ?>
  521. </tr>
  522. <?php
  523. if ($r_activity["max_people"] > 0){
  524. ?>
  525. <tr>
  526. <td><?=$lng["index_upcoming_activity_max_people"]?></td>
  527. <td><?=$r_activity["max_people"]?></td>
  528. </tr>
  529. <?php
  530. }
  531. ?>
  532. </table>
  533. <a href='<?=$server?>/actividades/<?=$r_activity["permalink"]?>'><?=$lng["index_upcoming_activity_see"]?></a>
  534. <br/><br/>
  535. </div> <!-- #upcoming_details -->
  536. </div> <!-- .td -->
  537. </div> <!-- .tr -->
  538. </div> <!-- .table -->
  539. </div> <!-- .entry -->
  540. <?php
  541. } // while($r_activity = mysqli_fetch_array($q_activity))
  542. ?>
  543. <a class='go_to_section' href='<?=$server?>/actividades/'><?=$lng["index_upcoming_activity_see_all"]?></a>
  544. <br/>
  545. </div> <!-- .section -->
  546. <?php
  547. }
  548. ?>
  549. <div class='section' itemscope itemtype='http://schema.org/Organization'>
  550. <meta itemprop='url' content='<?=$server?>'/>
  551. <h3 class='section_title' itemprop='name'><?=$lng["index_us"]?></h3>
  552. <div class='entry' id='us'>
  553. <p itemprop='description'><?=$lng["index_us_content"]?></p>
  554. </div> <!-- .entry -->
  555. <a class='go_to_section' href='<?=$server?>/nosotros/'><?=$lng["index_us_more"]?></a>
  556. </br>
  557. </div> <!-- .section -->
  558. <br/>
  559. <div id='content_table'>
  560. <div class='content_row'>
  561. <div class='content_cell' id='cell_posts'>
  562. <div class='section' id='latest_posts'>
  563. <h3 class='section_title'><?=$lng["index_latest_posts"]?></h3>
  564. <?php
  565. $q_post = mysqli_query($con, "SELECT id, permalink, title_$lang AS title, text_$lang AS text, dtime, DATE_FORMAT(dtime, '%Y-%m-%dT%T') AS isodate FROM post WHERE visible = 1 ORDER BY dtime DESC LIMIT 2;");
  566. if (mysqli_num_rows($q_post) == 0){
  567. ?>
  568. <div class='entry'>
  569. <h3 class='entry_title'><?=$lng["index_no_post"]?></h3>
  570. </div>
  571. <?php
  572. }
  573. else{
  574. while ($r_post = mysqli_fetch_array($q_post)){
  575. ?>
  576. <div class='entry post' itemscope itemtype='http://schema.org/BlogPosting'>
  577. <meta itemprop='inLanguage' content='<?=$lang?>'/>
  578. <meta itemprop='datePublished dateModified' content='<?=$r_post["isodate"]?>'/>
  579. <meta itemprop='headline name' content='<?=$r_post["title"]?>'/>
  580. <meta itemprop='articleBody text' content='<?=$r_post["text"]?>'/>
  581. <meta itemprop='mainEntityOfPage' content='<?=$server?>'/>
  582. <div class='hidden' itemprop='author publisher' itemscope itemtype='http://schema.org/Organization'>
  583. <meta itemprop='legalName' content='Asociaci&oacute;n Cultural Recreativa Gasteizko Margolariak'/>
  584. <meta itemprop='name' content='Gasteizko Margolariak'/>
  585. <meta itemprop='logo' content='<?=$server?>/img/logo/logo.png'/>
  586. <meta itemprop='foundingDate' content='03-02-2013'/>
  587. <meta itemprop='telephone' content='+34637140371'/>
  588. <meta itemprop='url' content='<?=$server?>'/>
  589. </div>
  590. <?php
  591. $q_post_image = mysqli_query($con, "SELECT image FROM post_image WHERE post = $r_post[id] ORDER BY idx LIMIT 1;");
  592. if (mysqli_num_rows($q_post_image) > 0){
  593. $r_post_image = mysqli_fetch_array($q_post_image);
  594. ?>
  595. <a href='<?=$server?>/blog/<?=$r_post["permalink"]?>'>
  596. <img itemprop='image' src='<?=$server?>/img/blog/miniature/<?=$r_post_image["image"]?>'/>
  597. </a>
  598. <?php
  599. } //if (mysqli_num_rows($q_post_image) > 0)
  600. ?>
  601. <h3 class='entry_title'>
  602. <a itemprop='url' href='<?=$server?>/blog/<?=$r_post["permalink"]?>'><?=$r_post["title"]?></a>
  603. </h3>
  604. <p class='mobile'><?=cutText($r_post["text"], 100, $lng["index_read_more"], "$server/blog/$r_post[permalink]")?></p>
  605. <p class='desktop'><?=cutText($r_post["text"], 150, $lng["index_read_more"], "$server/blog/$r_post[permalink]")?></p>
  606. <span><?=formatDate($r_post["dtime"], $lang, false)?></span>
  607. </div> <!-- .entry -->
  608. <?php
  609. } //while ($r_post = mysqli_fetch_array($q_post))
  610. ?>
  611. <a class='go_to_section' href='<?=$server?>/blog/'><?$lng["index_see_all_posts"]?></a>
  612. <br/>
  613. <?php
  614. } //if (mysqli_num_rows($q_post) == 0) ELSE
  615. ?>
  616. </div> <!-- .section-->
  617. </div> <!-- .cell_posts-->
  618. <div class='content_cell' id='cell_photos'>
  619. <div class='section' id='latest_photos'>
  620. <h3 class='section_title'><?=$lng["index_latest_photos"]?></h3>
  621. <?php
  622. $q_photos = mysqli_query($con, "SELECT id, file, title_$lang AS title, DATE_FORMAT(uploaded, '%Y-%m-%d') AS isodate FROM photo WHERE approved = 1 ORDER BY uploaded DESC LIMIT 6;");
  623. if (mysqli_num_rows($q_photos) == 0){
  624. ?>
  625. <div class='entry'><?=$lng["index_no_photos"]?></div>
  626. <?php
  627. }
  628. else{
  629. ?>
  630. <div class='entry'>
  631. <table id='table_photos'>
  632. <tr>
  633. <?php
  634. $i = 0;
  635. while ($r_photos = mysqli_fetch_array($q_photos)){
  636. $q_album = mysqli_query($con, "select permalink from album, photo_album WHERE photo = $r_photos[id] AND id = album LIMIT 1;");
  637. $r_album = mysqli_fetch_array($q_album);
  638. ?>
  639. <td itemscope itemtype='http://schema.org/Photograph'>
  640. <meta itemprop='datePublished' content='<?=$r_photos["isodate"]?>'/>
  641. <a href='<?=$server?>/galeria/<?=$r_album["permalink"]?>'>
  642. <meta itemprop='image' content='<?=$server?>/img/galeria/<?=$r_photos["file"]?>'/>
  643. <img src='<?=$server?>/img/galeria/miniature/<?=$r_photos["file"]?>' alt='<?=$r_photos["title"]?>' />
  644. </a>
  645. </td>
  646. <?php
  647. $i ++;
  648. if ($i % 2 == 0){
  649. ?>
  650. </tr>
  651. <tr>
  652. <?php
  653. } //if ($i % 2 == 0)
  654. } //while ($r_photos = mysqli_fetch_array($q_photos))
  655. ?>
  656. </tr>
  657. </table>
  658. </div> <!-- .entry -->
  659. <a class='go_to_section' href='<?=$server?>/galeria/'><?=$lng["index_see_all_photos"]?></a>
  660. <br/>
  661. <?php
  662. } //if (mysqli_num_rows($q_photos) == 0) ELSE
  663. ?>
  664. </div> <!-- .section -->
  665. </div> <!-- .content_cell -->
  666. </div> <!-- .content_row -->
  667. </div> <!-- .table -->
  668. <?php
  669. if ($upcoming_activity_shown == false){
  670. $q_activity = mysqli_query($con, "SELECT id, permalink, date, DATE_FORMAT(date, '%Y-%m-%d') AS isodate, title_$lang AS title, text_$lang AS text, after_$lang AS after, price, inscription, people, max_people, city FROM activity WHERE visible = 1 ORDER BY date DESC LIMIT 2;");
  671. if (mysqli_num_rows($q_activity) > 0){
  672. ?>
  673. <div class='section' id='latest_activities'>
  674. <h3 class='section_title'><?=$lng["index_latest_activities"]?></h3>
  675. <?php
  676. while ($r_activity = mysqli_fetch_array($q_activity)){
  677. ?>
  678. <div class='entry' itemscope itemtype='http://schema.org/Event'>
  679. <meta itemprop='inLanguage' content='<?=$lang?>'/>
  680. <meta itemprop='name' content='<?=$r_activity["title"]?>'/>
  681. <meta itemprop='description' content='<?=$r_activity["text"]?>'/>
  682. <meta itemprop='startDate endDate' content='<?=$r_activity["isodate"]?>'/>
  683. <span class='hidden' itemprop='location' itemscope itemtype='http://schema.org/Place'>
  684. <meta itemprop='address' itemprop='name' content='<?=$r_activity["city"]?>'/>
  685. <meta itemprop='name' content='<?=$r_activity["city"]?>'/>
  686. </span>
  687. <div class='hidden' itemprop='organizer performer' itemscope itemtype='http://schema.org/Organization'>
  688. <meta itemprop='legalName' content='Asociaci&oacute;n Cultural Recreativa Gasteizko Margolariak'/>
  689. <meta itemprop='name' content='Gasteizko Margolariak'/>
  690. <meta itemprop='logo' content='<?=$server?>/img/logo/logo.png'/>
  691. <meta itemprop='foundingDate' content='03-02-2013'/>
  692. <meta itemprop='telephone' content='+34637140371'/>
  693. <meta itemprop='url' content='<?=$server?>'/>
  694. </div> <!-- .hidden -->
  695. <span class='hidden' itemprop='offers' itemscope itemtype='http://schema.org/Offer'>
  696. <meta itemprop='name' content='<?=$r_activity["title"]?>'/>
  697. <meta itemprop='description' content='<?=$r_activity["text"]?>'/>
  698. <meta itemprop='price' content='<?=$r_activity["price"]?>'/>
  699. <meta itemprop='priceCurrency' content='EUR'/>
  700. <meta itemprop='url' content='<?=$server?>/actividades/<?=$r_activity["permalink"]?>'/>
  701. <meta itemprop='availability' content='Sold Out'/>
  702. <meta itemprop='validfrom' content='<?=$r_activity["isodate"]?>'/>
  703. </span>
  704. <h3 class='entry_title'>
  705. <a itemprop='url' href='<?=$server?>/actividades/<?=$r_activity["permalink"]?>'><?=$r_activity["title"]?></a>
  706. </h3>
  707. <table class='latest_activity'>
  708. <tr>
  709. <?php
  710. $q_activity_image = mysqli_query($con, "SELECT image FROM activity_image WHERE activity = $r_activity[id] ORDER BY idx LIMIT 1;");
  711. if (mysqli_num_rows($q_activity_image) > 0){
  712. $r_activity_image = mysqli_fetch_array($q_activity_image);
  713. ?>
  714. <td class='latest_activity_image'>
  715. <a href='<?=$server?>/actividades/<?=$r_activity["permalink"]?>'>
  716. <meta itemprop='image' content='<?=$server?>/img/actividades/<?=$r_activity_image["image"]?>'/>
  717. <img src='<?=$server?>/img/actividades/miniature/<?=$r_activity_image["image"]?>' alt='<?=$r_activity["title"]?>'/>
  718. </a>
  719. </td>
  720. <?php
  721. } // if (mysqli_num_rows($q_activity_image) > 0)
  722. if ($r_activity["after"] == ''){
  723. ?>
  724. <td class='mobile latest_activity_text'>
  725. <?=cutText($r_activity["text"], 260, "$lng[index_read_more]", "$server/actividades/$r_activity[permalink]")?>
  726. </td>
  727. <td class='desktop latest_activity_text'>
  728. <?=cutText($r_activity["text"], 400, "$lng[index_read_more]", "$server/actividades/$r_activity[permalink]")?>
  729. </td>
  730. <?php
  731. } // if ($r_activity["after"] == '')
  732. else{
  733. ?>
  734. <td class='mobile latest_activity_text'>
  735. <?=cutText($r_activity["after"], 260, "$lng[index_read_more]", "$server/actividades/$r_activity[permalink]")?>
  736. </td>
  737. <td class='desktop latest_activity_text'>
  738. <?=cutText($r_activity["after"], 400, "$lng[index_read_more]", "$server/actividades/$r_activity[permalink]")?>
  739. </td>
  740. <?php
  741. } // if ($r_activity["after"] == '') ELSE
  742. ?>
  743. </tr>
  744. </table>
  745. </div> <!-- .entry -->
  746. <?php
  747. }
  748. ?>
  749. <a class='go_to_section' href='<?=$server?>/actividades/'><?=$lng["index_upcoming_activity_see_all"]?></a>
  750. <br/>
  751. </div> <!-- .section -->
  752. <?php
  753. } // if (mysqli_num_rows($q_activity) > 0)
  754. } // if ($upcoming_activity_shown == false)
  755. //Festivals section (if no festivals shown on top)
  756. if ($festivals == 0){
  757. ?>
  758. <div class='section'>
  759. <h3 class='section_title'><?=$lng["index_festivals_header"]?></h3>
  760. <div class='entry'>
  761. <span class='desktop'>
  762. <?=cutText($lng["lablanca_no_content"] . '<br/>' . $lng["lablanca_no_content_2"], 300, $lng["index_read_more"], "$server/lablanca/")?>
  763. </span>
  764. <span class='desktop'>
  765. <?=cutText($lng["lablanca_no_content"] . '<br/>' . $lng["lablanca_no_content_2"], 200, $lng["index_read_more"], "$server/lablanca/")?>
  766. </span>
  767. </div> <!-- .entry -->
  768. </div> <!-- .section -->
  769. <?php
  770. } // if ($festivals == 0)
  771. ?>
  772. </div> <!-- #content -->
  773. <?php
  774. //Footer
  775. include("footer.php");
  776. $ad = ad($con, $lang, $lng);
  777. stats($ad, $ad_static, "index", "");
  778. ?>
  779. </body>
  780. </html>