PageRenderTime 146ms CodeModel.GetById 28ms RepoModel.GetById 0ms app.codeStats 0ms

/php/event_page.php

https://bitbucket.org/isanneh/campus-pages
PHP | 410 lines | 272 code | 105 blank | 33 comment | 24 complexity | 6378578d88544eddf33be9f62f968578 MD5 | raw file
  1. <?php
  2. //Start session
  3. session_start();
  4. $date=$_POST["date"];
  5. if($date == '')
  6. {
  7. ?>
  8. <script>
  9. //window.location.reload();
  10. </script>
  11. <?php
  12. $_SESSION['date'] = $date;
  13. }
  14. else
  15. {
  16. $_SESSION['date']="wrong";
  17. }
  18. /* $date=$_GET["date"];
  19. if($date == '')
  20. {
  21. ?>
  22. <script>
  23. window.location.reload();
  24. </script>
  25. <?php
  26. $_SESSION['date'] = $date;
  27. }
  28. else
  29. {
  30. $_SESSION['date']="wrong";
  31. } */
  32. //include("connect.php");
  33. require_once('connect.php');
  34. $id=$_GET["id"];
  35. $qry="SELECT * from events where id='$id'";
  36. $result=@mysql_query($qry);
  37. if($result)
  38. {
  39. $row=mysql_fetch_assoc($result)
  40. ?>
  41. <!-- Put IE into quirks mode -->
  42. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  43. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  44. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
  45. <head>
  46. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  47. <!-- Le styles -->
  48. <link href="twitter-bootstrap-d991ef2/docs/assets/css/bootstrap.css" rel="stylesheet">
  49. <style type="text/css">
  50. body {
  51. padding-top: 60px;
  52. padding-bottom: 40px;
  53. }
  54. .sidebar-nav {
  55. padding: 9px 0;
  56. }
  57. @media (max-width: 980px) {
  58. /* Enable use of floated navbar text */
  59. .navbar-text.pull-right {
  60. float: none;
  61. padding-left: 5px;
  62. padding-right: 5px;
  63. }
  64. }
  65. </style>
  66. <link href="twitter-bootstrap-d991ef2/docs/assets/css/bootstrap-responsive.css" rel="stylesheet">
  67. <link href="bootstrap.css" rel="stylesheet">
  68. <link href="bootstrap.min.css" rel="stylesheet">
  69. <link href="twitter-bootstrap-d991ef2/docs/assets/js/google-code-prettify/prettify.css" rel="stylesheet">
  70. <script type="text/javascript" src="twitter-bootstrap-d991ef2/docs/assets/js/bootstrap-modal.js"></script>
  71. <script type="text/javascript" src="twitter-bootstrap-d991ef2/docs/assets/js/bootstrap.js"></script>
  72. <!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
  73. <!--[if lt IE 9]>
  74. <script src="../assets/js/html5shiv.js"></script>
  75. <![endif]-->
  76. <!-- Fav and touch icons -->
  77. <link rel="apple-touch-icon-precomposed" sizes="144x144" href="../../../assets/ico/apple-touch-icon-144-precomposed.png">
  78. <link rel="apple-touch-icon-precomposed" sizes="114x114" href="../../../assets/ico/apple-touch-icon-114-precomposed.png">
  79. <link rel="apple-touch-icon-precomposed" sizes="72x72" href="../../../assets/ico/apple-touch-icon-72-precomposed.png">
  80. <link rel="apple-touch-icon-precomposed" href="../../../assets/ico/apple-touch-icon-57-precomposed.png">
  81. <link rel="shortcut icon" href="../../../assets/ico/favicon.png">
  82. <link href="new.css" rel="stylesheet" type="text/css" />
  83. <title> <?php echo ' '.$row['title'].' '; ?> </title>
  84. <link href="new.css" rel="stylesheet" type="text/css" />
  85. <meta name="Author" content="Isatou" />
  86. <script type="text/javascript">
  87. function getTime()
  88. {
  89. var d = new Date();
  90. var c_hour = d.getHours();
  91. var c_min = d.getMinutes();
  92. var c_sec = d.getSeconds();
  93. var month = d.getMonth();
  94. var day = d.getDay();
  95. var year = d.getFullYear();
  96. //var t = d + ":" + c_hour + ":" + c_min + ":" + c_sec;
  97. var t= month + ' ' + day + ' ' + year;
  98. document.getElementById("demo").innerHTML=t;
  99. return t;
  100. }
  101. function getMonth()
  102. {
  103. var d=new Date();
  104. var month=new Array();
  105. month[0]="January";
  106. month[1]="February";
  107. month[2]="March";
  108. month[3]="April";
  109. month[4]="May";
  110. month[5]="June";
  111. month[6]="July";
  112. month[7]="August";
  113. month[8]="September";
  114. month[9]="October";
  115. month[10]="November";
  116. month[11]="December";
  117. var n = month[d.getMonth()];
  118. document.getElementById("demo").innerHTML=n;
  119. return n;
  120. }
  121. function getDay()
  122. {
  123. var d=new Date();
  124. var day= d.getDay();
  125. return day;
  126. }
  127. </script>
  128. </head>
  129. <body>
  130. <div id="fb-root"></div>
  131. <script>(function(d, s, id) {
  132. var js, fjs = d.getElementsByTagName(s)[0];
  133. if (d.getElementById(id)) return;
  134. js = d.createElement(s); js.id = id;
  135. js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";
  136. fjs.parentNode.insertBefore(js, fjs);
  137. }(document, 'script', 'facebook-jssdk'));</script>
  138. <div id="maincontainer">
  139. <div id="topsection"><div class="innertube">
  140. <?php
  141. include('menu.php');
  142. ?>
  143. </div></div>
  144. <div id="contentwrapper">
  145. <div id="contentcolumn">
  146. <div class="innertube">
  147. <?php
  148. if( isset($_SESSION['ERRMSG_ARR']) && is_array($_SESSION['ERRMSG_ARR']) && count($_SESSION['ERRMSG_ARR']) >0 ) {
  149. echo '<ul class="err">';
  150. foreach($_SESSION['ERRMSG_ARR'] as $msg) {
  151. echo '<li>',$msg,'</li>';
  152. }
  153. echo '</ul>';
  154. unset($_SESSION['ERRMSG_ARR']);
  155. }
  156. ?>
  157. <?php
  158. /*if($result)
  159. {
  160. if(mysql_num_rows($result)==0)
  161. {
  162. echo "The are no events!";
  163. }
  164. else
  165. {
  166. while($row=mysql_fetch_assoc($result))
  167. {
  168. */
  169. $extra=array();
  170. if($row['start_minute']==0)
  171. {
  172. $start='00';
  173. }
  174. else
  175. {
  176. $start=$row['start_minute'];
  177. }
  178. if($row['end_minute']==0)
  179. {
  180. $end='00';
  181. }
  182. else
  183. {
  184. $end=$row['end_minute'];
  185. }
  186. if($row['admission']==0)
  187. {
  188. $admission='free';
  189. }
  190. else
  191. {
  192. $admission='$';
  193. $admission .=$row['amount'];
  194. }
  195. if($row['reservation']==0)
  196. {
  197. $reservation='No';
  198. }
  199. else
  200. {
  201. $reservation="Yes";
  202. }
  203. if($row['refreshments']==1)
  204. {
  205. $extra[]='refreshments';
  206. }
  207. if($row['raffle']==1)
  208. {
  209. $extra[]="raffle";
  210. }
  211. echo '
  212. <IMG SRC="pin.jpg" HEIGHT="20" WIDTH="20" BORDER="0" style="margin-left: 200px;">
  213. <h1 align="center">'.$row['title'].'</h1>
  214. '.$row['details'].'
  215. <p><b>Date:</b> '.$row['month'].' '.$row['day'].' '.$row['year'].'</p>
  216. <p><b>Start Time:</b> '.$row['start_hour'].':'.$start.' '.$row['start'].'</p>
  217. <p><b>End Time:</b> '.$row['end_hour'].':'.$end.' '.$row['end'].'</p>
  218. <p><b>Location:</b> '.$row['location'].'</p>
  219. <p><b>Admission Fee:</b> '.$admission.'</p>
  220. <p><b>Reservation Required:</b> '.$reservation.'</p>';
  221. if(sizeof($extra) != 0)
  222. {
  223. echo '<p><b>Available:</b></p>';
  224. foreach ($extra as $i)
  225. {
  226. echo ' <li> '.$i.' </li>';
  227. }
  228. }
  229. if($row['contact_person'] != '')
  230. {
  231. echo 'Contact Person: '.$row['contact_person'].' ';
  232. }
  233. if($row['phone'] != '')
  234. {
  235. echo ' <p><b> Phone: </b>'.$row['phone'].' </p>';
  236. }
  237. if($row['email'] != '')
  238. {
  239. echo '<p><b> Email: </b>'.$row['contact_email'].' </p>';
  240. }
  241. if($row['website'] != '')
  242. {
  243. echo '<p><b> Website: </b> <a href="'.$row['website'].'" > '.$row['website'].' </a> </p>';
  244. }
  245. echo '<p><b>Event Type:</b> '.$row['category'].'</p>
  246. </div>';
  247. }
  248. else
  249. {
  250. die("Query failed!");
  251. }
  252. ?>
  253. <div class="fb-like" data-href="http://dagenda.phpfogapp.com/event_page.php?id=<?php echo ' '.$id.' ';?>" data-send="false" data-width="450" data-show-faces="true"></div>
  254. <br>
  255. <!-- Button to trigger modal -->
  256. <a href="#myModal" role="button" class="btn" data-toggle="modal">Add to board</a>
  257. <!-- Modal -->
  258. <div id="myModal" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
  259. <div class="modal-header">
  260. <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
  261. <h3 id="myModalLabel">Modal header</h3>
  262. </div>
  263. <div class="modal-body">
  264. <p>One fine body</p>
  265. </div>
  266. <div class="modal-footer">
  267. <button class="btn" data-dismiss="modal" aria-hidden="true">Close</button>
  268. <button class="btn btn-primary">Save changes</button>
  269. </div>
  270. </div>
  271. <script src="http://code.jquery.com/jquery-latest.js"></script>
  272. <script type="text/javascript" src="js/bootstrap.js" />
  273. <?php include('side_bar_admin.php'); ?>
  274. </div>
  275. </div>
  276. </div>
  277. <div id="leftcolumn">
  278. <div class="innertube">
  279. <?php
  280. /*if ( ($_SESSION['SESS_STATUS'] == 'admin') || ($_SESSION['SESS_STATUS'] == 'superadmin') && ($row['status' == 'pending') */
  281. {
  282. include('side_bar.php');
  283. }
  284. ?>
  285. </div>
  286. </div>
  287. <div id="rightcolumn">
  288. <div class="innertube">
  289. <?php
  290. include('adverts.php');
  291. ?>
  292. </div>
  293. </div>
  294. <div id="footer"><a href="http://www.dynamicdrive.com/style/">Copyright 2013</a></div>
  295. </div>
  296. </body></html>