PageRenderTime 37ms CodeModel.GetById 0ms RepoModel.GetById 0ms app.codeStats 0ms

/php/events2_prev.php

https://bitbucket.org/isanneh/campus-pages
PHP | 273 lines | 198 code | 67 blank | 8 comment | 34 complexity | 1a43275c95d3f336b884cdeb25f1015b MD5 | raw file
  1. <!-- Put IE into quirks mode -->
  2. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  3. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  4. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
  5. <head>
  6. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  7. <title> College Campus Events </title>
  8. <link href="new.css" rel="stylesheet" type="text/css" />
  9. <meta name="Author" content="Isatou" />
  10. <script type="text/javascript" src="jquery-1.2.6.pack.js"></script>
  11. <script type="text/javascript">
  12. $(document).ready(function(){
  13. function last_msg_funtion()
  14. {
  15. var ID=$(".message_box:last").attr("id");
  16. $('div#last_msg_loader').html('<img src="bigLoader.gif">');
  17. $.post("events2.php?action=get&last_msg_id="+ID,
  18. function(data){
  19. if (data != "") {
  20. $(".message_box:last").after(data);
  21. }
  22. $('div#last_msg_loader').empty();
  23. });
  24. };
  25. $(window).scroll(function(){
  26. if ($(window).scrollTop() == $(document).height() - $(window).height()){
  27. last_msg_funtion();
  28. }
  29. });
  30. });
  31. </script>
  32. </head>
  33. <body>
  34. <?php
  35. //include("connect.php");
  36. require_once('connect.php');
  37. $month=$_GET["month"];
  38. $year=$_GET["year"];
  39. $free=$_GET["free"];
  40. $refreshments=$_GET["refreshments"];
  41. $giveaways=$_GET["giveaways"];
  42. //$qry .= ", group by month";
  43. if($month=='January')
  44. {
  45. $month_calendar=1;
  46. }
  47. else if($month=='February')
  48. {
  49. $month_calendar=2;
  50. }
  51. else if($month=='March')
  52. {
  53. $month_calendar=3;
  54. }
  55. else if($month=='April')
  56. {
  57. $month_calendar=4;
  58. }
  59. else if($month=='May')
  60. {
  61. $month_calendar=5;
  62. }
  63. else if($month=='June')
  64. {
  65. $month_calendar=6;
  66. }
  67. else if($month=='July')
  68. {
  69. $month_calendar=7;
  70. }
  71. else if($month=='August')
  72. {
  73. $month_calendar=8;
  74. }
  75. else if($month=='September')
  76. {
  77. $month_calenar=9;
  78. }
  79. else if($month=='October')
  80. {
  81. $month_calendar=10;
  82. }
  83. else if($month=='November')
  84. {
  85. $month_calendar=11;
  86. }
  87. else if($month=='December')
  88. {
  89. $month_calendar=12;
  90. }
  91. //promoted event
  92. $qry_pro="SELECT * from events WHERE month='December' and year='2012' and day='18'";
  93. $qry_pro .= $part_qry;
  94. $qry_pro .="ORDER BY year ASC, month ASC, day ASC";
  95. /*SELECT YEAR(GETDATE()) as "Year";
  96. SELECT MONTH(GETDATE()) as "Month";
  97. SELECT DAY(GETDATE()) as "Day"; */
  98. $result=@mysql_query($qry);
  99. ?>
  100. <?php
  101. include('promotion.php');
  102. ?>
  103. <div id="maincontainer">
  104. <div id="topsection"><div class="innertube">
  105. <?php
  106. include('menu.php');
  107. ?>
  108. </div></div>
  109. <div id="contentwrapper">
  110. <div id="content2column">
  111. <div class="innertube">
  112. <?php
  113. $result_pro=mysql_query($qry_pro);
  114. if($result_pro)
  115. {
  116. if(mysql_num_rows($result_pro) != 0)
  117. {
  118. ?>
  119. <b style="color:#0196e3";> Promoted Event: </b>
  120. <?php
  121. $row_pro=mysql_fetch_assoc($result_pro);
  122. $url="event_page.php?id=";
  123. $url .=$row_pro['id'];
  124. echo ' <div id="submissionPromotion" style="color:#0196e3";>
  125. <b #0196e3><a href="'.$url.'"> '.$row_pro['title'].' @ '.$row_pro['location'].' from '.$row_pro['start_hour'].':'.$start.' '.$row_pro['start'].' to '.$row_pro['end_hour'].':'.$end.' '.$row_pro['end'].'</a></b>
  126. <br/>
  127. '.$row_pro['details'].'
  128. <br/>';
  129. foreach ($extra as $i)
  130. {
  131. echo ' *'.$i.'* ';
  132. }
  133. }
  134. }
  135. else
  136. {
  137. die("promotion query failed!");
  138. }
  139. ?>
  140. <?php
  141. if( isset($_SESSION['ERRMSG_ARR']) && is_array($_SESSION['ERRMSG_ARR']) && count($_SESSION['ERRMSG_ARR']) >0 ) {
  142. echo '<ul class="err">';
  143. foreach($_SESSION['ERRMSG_ARR'] as $msg) {
  144. echo '<li>',$msg,'</li>';
  145. }
  146. echo '</ul>';
  147. unset($_SESSION['ERRMSG_ARR']);
  148. }
  149. ?>
  150. <?php
  151. $last_msg_id=$_GET['last_msg_id'];
  152. $action=$_GET['action'];
  153. if($action <> "get")
  154. {
  155. ?>
  156. <p>
  157. <input type="checkbox" value='0' name="free" id="free">free events
  158. <input type="checkbox" value='1' name="refreshments" id="refreshments">refreshments served
  159. <input type="checkbox" value='1' name="giveaways" id="giveaways">giveaways
  160. <select name="department" id="drop">
  161. <option style="background-color:#58B9EB"; value="choose_department">All Departments</option>
  162. <option style="background-color:#58B9EB"; value="Engineering">Engineering</option>
  163. <option style="background-color:#58B9EB"; value="Science">Science</option>
  164. <option style="background-color:#58B9EB"; value="Humanities">Humanities</option>
  165. <option style="background-color:#58B9EB"; value="Sophie Davis">Sophie Davis</option>
  166. <option style="background-color:#58B9EB"; value="Architecture">Architecture</option>
  167. <option style="background-color:#58B9EB"; value="Education">Education</option>
  168. </select>
  169. <input type="submit" id="submit" value="Update">
  170. </form>
  171. <br/>
  172. </p>
  173. <?php
  174. include('load_first.php');
  175. ?>
  176. <div id="last_msg_loader"></div>
  177. </div>
  178. </div>
  179. </div>
  180. </div>
  181. <div id="leftcolumn">
  182. <div class="innertube">
  183. <?php
  184. include('side_bar.php');
  185. ?>
  186. </div>
  187. </div>
  188. <div id="rightcolumn">
  189. <div class="innertube">
  190. <?php
  191. include('adverts.php');
  192. ?>
  193. </div>
  194. </div>
  195. <div id="footer"><a href="http://www.dynamicdrive.com/style/">Copyright 2013</a></div>
  196. </div>
  197. </body></html>
  198. <?php
  199. }
  200. else
  201. {
  202. include('load_second.php');
  203. }
  204. ?>