/php/default.php

https://bitbucket.org/isanneh/diners-best · PHP · 469 lines · 309 code · 145 blank · 15 comment · 3 complexity · 0d4279b789a6d33b5adcb059884896bb MD5 · raw file

  1. <?php
  2. //include 'menu.php';
  3. session_start();
  4. //Include database connection details
  5. include('connect.php');
  6. $root= "http://foodie.comuv.com/";
  7. $qry= "SELECT * FROM `images` ";
  8. $result = @mysql_query($qry);
  9. $qry2= "SELECT * FROM `hangouts` ";
  10. $result2 = @mysql_query($qry2);
  11. $qryq= "SELECT * FROM `hangouts` ";
  12. $resultq = @mysql_query($qryq);
  13. $qryp= "SELECT * FROM `images` ";
  14. $resultp = @mysql_query($qryp);
  15. $qryp2= "SELECT * FROM `images` ";
  16. $resultp2 = @mysql_query($qryp2);
  17. $qryp3= "SELECT * FROM `images` ";
  18. $resultp3 = @mysql_query($qryp3);
  19. ?>
  20. <html>
  21. <head>
  22. <link rel="stylesheet" type="text/css" href="http://foodie.comuv.com/hm31.css" />
  23. <link rel="stylesheet" type="text/css" href="http://foodie.comuv.com/funny.css" />
  24. <style type="text/css">
  25. .rollover img {      display : block;
  26.                      width : 100px;
  27.                      height : 100px;
  28.                       }
  29. .rollover img:hover {  display : block;
  30.                       width : 200px;
  31.                       height : 200px;
  32.                       }
  33. ul
  34. {
  35. list-style-type:none;
  36. margin:0;
  37. padding:0;
  38. }
  39. li
  40. {
  41. display:inline;
  42. }
  43. #MainWrapper {
  44. width:100%;
  45. width: 1300px; /* you would need to set this to whatever size you wanted your site to be, which would fix the rest of the content with in that */
  46. }
  47. </style>
  48. </head>
  49. <body>
  50. <div id="MainWrapper">
  51. <div id="header">
  52. <table width="100%">
  53. <tr>
  54. <td align="left"><a href="user_registration.php">User Registration</a>
  55. <a href="restaurant_registration.php">Restaurant Registration</a></td>
  56. <td align="right"><a href="login-form.php">Login</a></td>
  57. </tr>
  58. </table>
  59. </div>
  60. <div id="body">
  61.    
  62.    
  63. <div id="main">
  64. <div id="content-1">
  65. <?php
  66. /* <ul align="center">
  67. <li><a href=\"user_registration.php\">User Registration</a></li>
  68. <li><a href=\"restaurant_registration.php\">Restaurant Registration</a></li>
  69. <li><a href=\"login-form.php\">Login</a></li>
  70. </ul> */
  71. echo
  72. '<table>
  73. <tr>';
  74. if($result)
  75. {
  76. $j=0;
  77. $total2=mysql_num_rows($result);
  78. /*$r=mysql_fetch_assoc($result);
  79. $p=$result;
  80. $split_results=array_chunk($r, 3, true);*/
  81. echo
  82. '
  83. <td valign="top">
  84. <table>';
  85. while($row=mysql_fetch_assoc($result))
  86. //foreach ($split_results as $row)
  87. {
  88. $j++;
  89. $qry10= "SELECT * FROM `restaurants` WHERE `Restaurant_Id`='".$row['Restaurant_Id']."'";
  90. $result10 = @mysql_query($qry10);
  91. $row10=mysql_fetch_assoc($result10);
  92. echo
  93. '
  94. <tr><td>
  95. <div id="cover">
  96. <p> <a href=\' '.$row['Food_Url'].' \'> '.$row['Food_Name'].' </a> </p>
  97. <a href=\' '.$row['Food_Url'].' \'> <img border="0" src="'.$row['Image_Url'].'" alt="Profile Picture" width="160" height="150" />  </a>
  98. <p> <a href=\' '.$row10['Profile_Url'].' \'> '.$row10['Restaurant_Name'].' </a> </p>
  99. </div>
  100. </td>
  101. </tr>
  102. ';
  103. }
  104. echo '
  105. </td>
  106. </table>
  107. <td valign="top">
  108. <table>';
  109. $tota=mysql_num_rows($resultp);
  110. while($ro=mysql_fetch_assoc($resultp))
  111. //foreach ($split_results as $ro)
  112. {
  113. $j++;
  114. $qry10= "SELECT * FROM `restaurants` WHERE `Restaurant_Id`='".$ro['Restaurant_Id']."'";
  115. $result10 = @mysql_query($qry10);
  116. $row10=mysql_fetch_assoc($result10);
  117. echo
  118. '
  119. <tr><td>
  120. <div id="cover">
  121. <p> <a href=\' '.$ro['Food_Url'].' \'> '.$ro['Food_Name'].' </a> </p>
  122. <a href=\' '.$ro['Food_Url'].' \'> <img border="0" src="'.$ro['Image_Url'].'" alt="Profile Picture" width="160" height="150" />  </a>
  123. <p> <a href=\' '.$row10['Profile_Url'].' \'> '.$row10['Restaurant_Name'].' </a> </p>
  124. </div>
  125. </td>
  126. </tr>
  127. ';
  128. }
  129. echo '
  130. </td>
  131. </table>
  132. <td valign="top">
  133. <table>';
  134. $tota=mysql_num_rows($resultp2);
  135. while($ro2=mysql_fetch_assoc($resultp2))
  136. //foreach ($split_results as $ro2)
  137. {
  138. $j++;
  139. $qry10= "SELECT * FROM `restaurants` WHERE `Restaurant_Id`='".$ro2['Restaurant_Id']."'";
  140. $result10 = @mysql_query($qry10);
  141. $row10=mysql_fetch_assoc($result10);
  142. echo
  143. '
  144. <tr><td>
  145. <div id="cover">
  146. <p> <a href=\' '.$ro2['Food_Url'].' \'> '.$ro2['Food_Name'].' </a> </p>
  147. <a href=\' '.$ro2['Food_Url'].' \'> <img border="0" src="'.$ro2['Image_Url'].'" alt="Profile Picture" width="160" height="150" />  </a>
  148. <p> <a href=\' '.$row10['Profile_Url'].' \'> '.$row10['Restaurant_Name'].' </a> </p>
  149. </div>
  150. </td>
  151. </tr>
  152. ';
  153. }
  154. echo '
  155. </td>
  156. </table>
  157. <td valign="top">
  158. <table>';
  159. $tota=mysql_num_rows($resultp3);
  160. while($ro3=mysql_fetch_assoc($resultp3))
  161. //foreach ($split_results as $ro3)
  162. {
  163. $j++;
  164. $qry10= "SELECT * FROM `restaurants` WHERE `Restaurant_Id`='".$ro3['Restaurant_Id']."'";
  165. $result10 = @mysql_query($qry10);
  166. $row10=mysql_fetch_assoc($result10);
  167. echo
  168. '
  169. <tr><td>
  170. <div id="cover">
  171. <p> <a href=\' '.$ro3['Food_Url'].' \'> '.$ro3['Food_Name'].' </a> </p>
  172. <a href=\' '.$ro3['Food_Url'].' \'> <img border="0" src="'.$ro3['Image_Url'].'" alt="Profile Picture" width="160" height="150" />  </a>
  173. <p> <a href=\' '.$row10['Profile_Url'].' \'> '.$row10['Restaurant_Name'].' </a> </p>
  174. </div>
  175. </td>
  176. </tr>
  177. ';
  178. }
  179. echo '
  180. </td>
  181. </table>
  182. <td valign="top">
  183. <table>';
  184. if($result2)
  185. {
  186. $total=mysql_num_rows($result2);
  187. while($row2=mysql_fetch_assoc($result2))
  188. {
  189. echo '<tr><td>
  190. <div id="cover">';
  191. $qry3= "SELECT * FROM `hangout_info` WHERE `Hangout_Id`='".$row2['Hangout_Id']."'";
  192. $result3 = @mysql_query($qry3);
  193. $row3=mysql_fetch_assoc($result3);
  194. $qry4= "SELECT * FROM `hangout_attendees` WHERE `Hangout_Id`='".$row2['Hangout_Id']."'";
  195. $result4 = @mysql_query($qry4);
  196. $row4=mysql_fetch_assoc($result4);
  197. $qry5= "SELECT * FROM `restaurants` WHERE `Restaurant_Id`='".$row2['Restaurant_Id']."'";
  198. $result5 = @mysql_query($qry5);
  199. $row5=mysql_fetch_assoc($result5);
  200. $spots_taken=mysql_num_rows($result4);
  201. $spots_left=$row2['People']- $spots_taken;
  202. echo
  203. '
  204. <p> <a href=\' '.$row3['Url'].' \'> '.$row2['Title'].' </a> @ <a href=\' '.$row5['Profile_Url'].' \'> '.$row5['Restaurant_Name'].' </a> </p>
  205. <p>Date: '.$row2['Month'].' '.$row2['Day'].' '.$row2['Year'].' @ '.$row2['Time'].' </p>
  206. </div>
  207. </td>
  208. </tr>
  209. ';
  210. }
  211. }
  212. else
  213. {
  214. die('Query failed!');
  215. }
  216. echo '
  217. </td>
  218. </table>
  219. <td valign="top">
  220. <table>';
  221. if($resultq)
  222. {
  223. $total=mysql_num_rows($resultq);
  224. while($row2=mysql_fetch_assoc($resultq))
  225. {
  226. echo '<tr><td>
  227. <div id="cover">';
  228. $qry3= "SELECT * FROM `hangout_info` WHERE `Hangout_Id`='".$row2['Hangout_Id']."'";
  229. $result3 = @mysql_query($qry3);
  230. $row3=mysql_fetch_assoc($result3);
  231. $qry4= "SELECT * FROM `hangout_attendees` WHERE `Hangout_Id`='".$row2['Hangout_Id']."'";
  232. $result4 = @mysql_query($qry4);
  233. $row4=mysql_fetch_assoc($result4);
  234. $qry5= "SELECT * FROM `restaurants` WHERE `Restaurant_Id`='".$row2['Restaurant_Id']."'";
  235. $result5 = @mysql_query($qry5);
  236. $row5=mysql_fetch_assoc($result5);
  237. $spots_taken=mysql_num_rows($result4);
  238. $spots_left=$row2['People']- $spots_taken;
  239. echo
  240. '
  241. <p> <a href=\' '.$row3['Url'].' \'> '.$row2['Title'].' </a> @ <a href=\' '.$row5['Profile_Url'].' \'> '.$row5['Restaurant_Name'].' </a> </p>
  242. <p>Date: '.$row2['Month'].' '.$row2['Day'].' '.$row2['Year'].' @ '.$row2['Time'].' </p>
  243. </div>
  244. </td>
  245. </tr>
  246. ';
  247. }
  248. }
  249. else
  250. {
  251. die('Query failed!');
  252. }
  253. echo '
  254. </td>
  255. </table>
  256. </tr>
  257. </table>';
  258. }
  259. else
  260. {
  261. die('Query failed!');
  262. }
  263. ?>
  264. </div>
  265. <?php
  266. echo '<div id="footer" >';
  267. $qry6= "SELECT * FROM `users` ";
  268. $result6 = @mysql_query($qry6);
  269. while($row6=mysql_fetch_assoc($result6))
  270. {
  271. echo '<a  href=\' '.$row6['Profile_Url'].' \'> <img border="0" src="'.$row6['Profile_Image_Url'].'"  alt="Profile Picture" width="50" height="50" />  </a>';
  272. $Profile_Url= "http://foodie.comuv.com/isanneh.php";
  273. $Profile_Image_Url= "http://foodie.comuv.com/user/isanneh/profile_picture.jpg";
  274. }
  275. echo '<a  href=\' '.$Profile_Url.' \'> <img border="0" src="'.$Profile_Image_Url.'"  alt="Profile Picture" width="50" height="50" />  </a>';
  276. echo '<a  href=\' '.$Profile_Url.' \'> <img border="0" src="'.$Profile_Image_Url.'"  alt="Profile Picture" width="50" height="50" />  </a>';
  277. echo '<a  href=\' '.$Profile_Url.' \'> <img border="0" src="'.$Profile_Image_Url.'"  alt="Profile Picture" width="50" height="50" />  </a>';
  278. echo '<a  href=\' '.$Profile_Url.' \'> <img border="0" src="'.$Profile_Image_Url.'"  alt="Profile Picture" width="50" height="50" />  </a>';
  279. echo '<a  href=\' '.$Profile_Url.' \'> <img border="0" src="'.$Profile_Image_Url.'"  alt="Profile Picture" width="50" height="50" />  </a>';
  280. echo '<a  href=\' '.$Profile_Url.' \'> <img border="0" src="'.$Profile_Image_Url.'"  alt="Profile Picture" width="50" height="50" />  </a>';
  281. echo '<a  href=\' '.$Profile_Url.' \'> <img border="0" src="'.$Profile_Image_Url.'"  alt="Profile Picture" width="50" height="50" />  </a>';
  282. echo '<a  href=\' '.$Profile_Url.' \'> <img border="0" src="'.$Profile_Image_Url.'"  alt="Profile Picture" width="50" height="50" />  </a>';
  283. echo '<a  href=\' '.$Profile_Url.' \'> <img border="0" src="'.$Profile_Image_Url.'"  alt="Profile Picture" width="50" height="50" />  </a>';
  284. echo '<a  href=\' '.$Profile_Url.' \'> <img border="0" src="'.$Profile_Image_Url.'"  alt="Profile Picture" width="50" height="50" />  </a>';
  285. echo '<a  href=\' '.$Profile_Url.' \'> <img border="0" src="'.$Profile_Image_Url.'"  alt="Profile Picture" width="50" height="50" />  </a>';
  286. echo '<a  href=\' '.$Profile_Url.' \'> <img border="0" src="'.$Profile_Image_Url.'"  alt="Profile Picture" width="50" height="50" />  </a>';
  287. echo '<a  href=\' '.$Profile_Url.' \'> <img border="0" src="'.$Profile_Image_Url.'"  alt="Profile Picture" width="50" height="50" />  </a>';
  288. echo '<a  href=\' '.$Profile_Url.' \'> <img border="0" src="'.$Profile_Image_Url.'"  alt="Profile Picture" width="50" height="50" />  </a>';
  289. echo '<a  href=\' '.$Profile_Url.' \'> <img border="0" src="'.$Profile_Image_Url.'"  alt="Profile Picture" width="50" height="50" />  </a>';
  290. echo '<a  href=\' '.$Profile_Url.' \'> <img border="0" src="'.$Profile_Image_Url.'"  alt="Profile Picture" width="50" height="50" />  </a>';
  291. echo '<a  href=\' '.$Profile_Url.' \'> <img border="0" src="'.$Profile_Image_Url.'"  alt="Profile Picture" width="50" height="50" />  </a>';
  292. echo '</div>';
  293. echo '
  294. <table>
  295. <tr>
  296. <td>
  297. <table>
  298. <tr><td><a  href=\' '.$Profile_Url.' \'> <img border="0" src="'.$Profile_Image_Url.'"  alt="Profile Picture" width="50" height="50" />  </a></td></tr>';
  299. echo '<tr><td><a  href=\' '.$Profile_Url.' \'> <img border="0" src="'.$Profile_Image_Url.'"  alt="Profile Picture" width="50" height="50" /> </a></td></tr></table>
  300. </td>
  301. <td>
  302. <table> ';
  303. echo '<tr><td><a  href=\' '.$Profile_Url.' \'> <img border="0" src="'.$Profile_Image_Url.'"  alt="Profile Picture" width="50" height="50" />  </a></td></tr>';
  304. echo '<td><a  href=\' '.$Profile_Url.' \'> <img border="0" src="'.$Profile_Image_Url.'"  alt="Profile Picture" width="50" height="50" />  </a></td></tr>
  305. </table>
  306. </td>
  307. </tr>
  308. </table>';
  309. ?>
  310. </div>
  311. </div>
  312. </body>
  313. </html>