fiestas.php 4.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. <div class='section'>
  2. <h3 class='section_title'><?php echo str_replace('#', $year, $lng['lablanca_title']);?></h3>
  3. <div class='entry'>
  4. <?php
  5. //Some text for the festivals
  6. $q_f = mysqli_query($con, "SELECT * FROM festival WHERE year = $year");
  7. if (mysqli_num_rows($q_f) > 0){
  8. $r_f = mysqli_fetch_array($q_f);
  9. if (strlen($r_f['img']) > 0){
  10. echo "<img id='festivals_image' src='$proto$http_host/img/festival/$r_f[img]'>\n";
  11. }
  12. echo $r_f["text_$lang"] . "\n";
  13. }
  14. ?>
  15. </div>
  16. </div>
  17. <div id='content_table'>
  18. <div class='content_tr'>
  19. <div class='content_td' id='content_td_schedule'>
  20. <div class='section' id='schedule'>
  21. <h3 class='section_title'><?php echo $lng['lablanca_schedule']; ?></h3>
  22. <?php
  23. $q_days = mysqli_query($con, "SELECT id, date, DATE_FORMAT(date, '%Y-%m-%d') AS isodate, name_$lang AS name FROM festival_day WHERE year(date) = $year ORDER BY date");
  24. while ($r_days = mysqli_fetch_array($q_days)){
  25. echo "<div class='entry'>\n";
  26. echo "<div onClick='expandDay($r_days[id]);' class='day_title pointer'>\n";
  27. echo "<h4><img class='slid' src='$proto$http_host/img/misc/slid-right.png' id='slid_day_$r_days[id]'/>\n";
  28. echo formatFestivalDate($r_days['date']) . " - $r_days[name]</h4>\n";
  29. echo "</div>\n";
  30. echo "<div class='day_schedule' id='day_schedule_$r_days[id]'>\n";
  31. $q_sch = 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, 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 > str_to_date(addtime('$r_days[isodate] 00:00:00', '08:00:00'), '%Y-%m-%d %T') AND start < str_to_date(addtime('$r_days[isodate] 00:00:00', '32:00:00'), '%Y-%m-%d %T') ORDER BY start;");
  32. if (mysqli_num_rows($q_sch) > 0){
  33. echo "<table class='schedule'>\n";
  34. while ($r_sch = mysqli_fetch_array($q_sch)){
  35. echo "<tr><td><span class='time'>$r_sch[st]</span></td><td class='timeline'><img class='timeline_dot' alt=' ' src='$proto$http_host/img/misc/schedule-point.png'/></td>\n";
  36. echo "<td><span class='title'>$r_sch[title]\n";
  37. //if (strlen($r_sch['end']) > 0){
  38. // echo " ($r_sch[st] - $r_sch[end])\n";
  39. //}
  40. echo "</span>\n";
  41. if (strlen($r_sch["description"]) > 0 && $r_sch["description"] != $r_sch["title"]){
  42. echo "<br/><span class='description'>$r_sch[description]</span>\n";
  43. }
  44. echo "<table class='location'><tr>\n";
  45. //TODO: td for image, if any
  46. echo "<td><a target='_blank' href='http://maps.google.com/maps?q=$r_sch[lat],$r_sch[lon]+(My+Point)&z=14&ll=$r_sch[lat],$r_sch[lon]'><img alt=' ' src='$proto$http_host/img/misc/pinpoint.png'/></a></td>\n";
  47. //If name and address are the same, show only name
  48. if ($r_sch['place'] == $r_sch['address']){
  49. echo "<td>$r_sch[place]</td></tr></table>\n";
  50. }
  51. else{
  52. echo "<td>$r_sch[place] <span class='address'>- $r_sch[address]</span></td></tr></table>\n";
  53. }
  54. echo "</td></tr>\n";
  55. }
  56. echo "</table>\n";
  57. }
  58. echo "</div>\n";
  59. echo "</div>\n";
  60. }
  61. ?>
  62. </div>
  63. </div>
  64. <div class='content_td' id='content_td_prices'>
  65. <div class='section' id='prices'>
  66. <h3 class='section_title'><?php echo $lng['lablanca_prices']; ?></h3>
  67. <div class='entry'>
  68. <?php
  69. $q_days = mysqli_query($con, "SELECT id, date, DATE_FORMAT(date, '%Y-%m-%d') AS isodate, name_$lang AS name, price FROM festival_day WHERE year(date) = $year ORDER BY date");
  70. if (mysqli_num_rows($q_days) > 0){
  71. echo "<h4>$lng[lablanca_prices_days]</h4>\n";
  72. echo "<table id='table_days'>\n";
  73. while ($r_days = mysqli_fetch_array($q_days)){
  74. echo "<tr><td>" . formatFestivalDate($r_days['date']) . "</td>\n";
  75. echo "<td class='price'>$r_days[price] &euro;</td></tr>\n";
  76. }
  77. echo "</table>\n</div>\n<div class='entry'>\n";
  78. $q_offers = mysqli_query($con, "SELECT id, name_$lang AS name, description_$lang AS description, price FROM festival_offer WHERE year = $year ORDER BY days;");
  79. if (mysqli_num_rows($q_offers) > 0){
  80. echo "<h4>$lng[lablanca_prices_offers]</h4>\n";
  81. echo "<table id='table_offers'>\n";
  82. while ($r_offers = mysqli_fetch_array($q_offers)){
  83. echo "<tr><td><span class='name'>$r_offers[name]</span><br/><p class='description'>$r_offers[description]</p></td>\n";
  84. echo "<td class='price'>$r_offers[price] &euro;</td></tr>\n";
  85. }
  86. echo "</table>\n";
  87. }
  88. }
  89. ?>
  90. </div>
  91. </div>
  92. </div> <!--TD-->
  93. </div> <!--TR-->
  94. </div> <!--Table-->