data); $sql = "select * from dining where din_status = 'ACTIVE' "; if ($filter != "") $sql .= $filter; if ($order == "") $sql .= " order by din_name "; else $sql .= $order; $DB->query($sql); $DB->getRow(); //echo "
\n";print_r($DB->data);echo "
\n"; foreach ($DB->data as $key => $val) { $arr[] = array ( "breakfast" => $val["din_breakfast"], "id" => $val["din_id"], "name" => $val["din_name"], "desc" => $val["din_times"], "lunch" => $val["din_lunch"], "dinner" => $val["din_dinner"], "break_time" => $val["din_breakfast_time"], "lunch_time" => $val["din_lunch_time"], "dinner_time" => $val["din_dinner_time"], "book_a_table_link" => $val["din_order_url"], "open_mon" => $val["din_open_mon"], "open_tue" => $val["din_open_tue"], "open_wed" => $val["din_open_wed"], "open_thu" => $val["din_open_thu"], "open_fri" => $val["din_open_fri"], "open_sat" => $val["din_open_sat"], "open_sun" => $val["din_open_sun"], "phone" => $val["din_phone"] ); } return $arr; } $DB = new DB (); $all_items = get_page_list ($DB); ?> Thredbo Dining Guide
Venue
Times
B/Fast
Lunch
Dinner
Menu
Book
\n"; print_r ($all_items); echo "\n"; foreach ($all_items as $key => $val) { $this_name = ucwords (strtolower($val["name"])); $this_phone = ucwords (strtolower($val["phone"])); $this_menu = "menus/" . str_replace(" ", "-", $this_name) . ".pdf"; $this_order = ucwords (strtolower($val["book_a_table_link"])); $this_desc = nl2br($val["desc"]); if ($val["break_time"] != "") { $this_breakfast = $val["break_time"]; } else { $this_breakfast = ($val["breakfast"]=="1" ? "✔" : "✘"); } if ($val["lunch_time"] != "") { $this_lunch = $val["lunch_time"]; } else { $this_lunch = ($val["lunch"]=="1" ? "✔" : "✘"); } if ($val["dinner_time"] != "") { $this_dinner = $val["dinner_time"]; } else { $this_dinner = ($val["dinner"]=="1" ? "✔" : "✘"); } $this_mon = ($val["open_mon"]=="1" ? "" : "-"); $this_tue = ($val["open_tue"]=="1" ? "" : "-"); $this_wed = ($val["open_wed"]=="1" ? "" : "-"); $this_thu = ($val["open_thu"]=="1" ? "" : "-"); $this_fri = ($val["open_fri"]=="1" ? "" : "-"); $this_sat = ($val["open_sat"]=="1" ? "" : "-"); $this_sun = ($val["open_sun"]=="1" ? "" : "-"); //$this_desc = preg_replace_callback('/([.!?])\s*(\w)/', function ($matches) { return strtoupper($matches[1] . ' ' . $matches[2]); }, ucfirst(strtolower($this_desc))); echo "
\n"; echo "
".$this_name."
Ph: ".$this_phone."
\n"; echo "
".$this_desc." \n"; echo "\n"; echo "
MO TU WE TH FR SA SU
$this_mon $this_tue $this_wed $this_thu $this_fri $this_sat $this_sun
\n"; echo "
".$this_breakfast."
\n"; echo "
".$this_lunch."
\n"; echo "
".$this_dinner."
\n"; if (file_exists($this_menu)) { echo "
\n"; } else { echo "
 
\n"; } if ($this_order!=""){ echo "
\n"; } else { echo "
 
\n"; } echo "
\n"; } ?>