sadiq81

newTable.php

Aug 29th, 2011
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.93 KB | None | 0 0
  1. <?php
  2. $including = true;
  3.  
  4. include ('helper.php');
  5.  
  6.  
  7. $q=$_GET["q"];
  8. $day=$_GET["day"];
  9.  
  10.  
  11.  
  12. $array = array();
  13.  
  14.     switch ($q)
  15.     {
  16.         case "Rice with chicken" :
  17.             $array = getRiceWithChickenArray();
  18.             shuffle($array);
  19.             break;
  20.         case "Rice with ghost" :
  21.             $array = getRiceWithGhostArray ();
  22.             shuffle($array);
  23.             break;
  24.         case "Roti with chicken" :
  25.             $array = getRotiWithChickenArray ();
  26.             shuffle($array);
  27.             break;
  28.         case "Roti with ghost" :
  29.             $array = getRotiWithGhostArray ();
  30.             shuffle($array);
  31.             break;
  32.         case "Other" :
  33.             $array = getOtherArray ();
  34.             shuffle($array);
  35.             break;
  36.         case "Weekend" :
  37.             $array = getWeekendArray ();
  38.             shuffle($array);
  39.             break;
  40.     }
  41.  
  42. $weekday = str_replace ( "Table", "", $day );
  43. $Weekday = ucfirst(str_replace ( "Table", "", $day ));
  44.  
  45.  
  46.  
  47. print ("<table border=1 width=\"600\">");
  48. print ("<tr onmouseover=\"style.background='#C0C0C0'\" onmouseout=\"style.background='white'\"> ");
  49. print ("<th align=\"left\" width=\"20%\">".$Weekday.":&nbsp;</th>");
  50. print ("<th align=\"left\" width=\"20%\">". ($q) ."&nbsp;</th>");
  51. print ("<th align=\"left\" width=\"20%\">");
  52.            
  53.                 ${$weekday.'sdish'} = array_pop ($array);
  54.                
  55.                 print (${$weekday.'sdish'} ['name']);
  56.  
  57. print ("&nbsp");
  58. print ("</th>");
  59. print ("<th align=\"left\" width=\"20%\">". ${$weekday.'sdish'}['DATE_FORMAT(last_mad,\'%d/%m/%Y\')']);
  60. print ("&nbsp;</th>");
  61.            
  62.             if (${$weekday.'sdish'} != null)
  63.             {
  64. print ("<th align=\"left\" width=\"20%\"><input type=\"button\" value=\"Try again\" onclick=\"getNewReceipe('" . ($_GET ["q"]). "','".($_GET ["day"])."')\">&nbsp;</th>");         
  65.             }
  66.             if (${$weekday.'sdish'} == null)
  67.             {
  68. print ("<th align=\"left\" width=\"20%\">&nbsp;</th>");
  69.             }
  70. print ("</tr>");
  71. print ("</table>");
  72. print ("<input type=\"hidden\" value=\"". (${$weekday.'sdish'}['name'])."\" name=\"sunday\">");
  73. print ("<input type=\"hidden\" value=\"".$q."\" name=\"sundayCategori\">");
  74. ?>
Advertisement
Add Comment
Please, Sign In to add comment