public function create() { $days = dayList(); return view('admin.cafe.create', compact('days')); }
<?php session_start(); include "connect.php"; function dayList() { $days = array(0 => "Sunday", 1 => "Monday", 2 => "Tuesday", 3 => "Wednesday", 4 => "Thursday", 5 => "Friday", 6 => "Saturday"); return $days; } $days = dayList(); $rest_id = $_SESSION['rest_id']; $cat_id = $_POST['cat_id']; $query_get_info = "\r\n\tSELECT * FROM Menu_Category_Disable_Hours \r\n\tWHERE rest_id = '{$rest_id}'\r\n\tAND cat_id = '{$cat_id}'\r\n\t"; $result_get_info = mysqli_query($dbc, $query_get_info); $outputtext .= "\r\n\t<action type='popup' name='editCategoryDisableHours' title='Edit Disable Hours for " . $_POST['category_name'] . "'>\r\n\t\t<text>\r\n\t\t<center>\r\n\t\t\t<form onSubmit='submitInput(this," . '"setcategorydisablehours.php"' . ");return false;' method='post' class='login_form'>\r\n\t\t\t\t\r\n\t\t\t\t<input type='hidden' value='::C' />\r\n\t\t\t\t<input type='hidden' value='" . $cat_id . "' />\r\n\t\t\t\t<table id='registrationtable'>\r\n\t"; if (@mysqli_num_rows($result_get_info) > 0) { // A match was made. while ($info_row = mysqli_fetch_array($result_get_info, MYSQLI_ASSOC)) { $outputtext .= "\r\n\t\t\t\t\t<tr class='delivery-location'>\r\n\t\t\t\t\t\t<td>\r\n\t\t\t\t\t\t\t<input type='hidden' value='::H' />\r\n\t\t\t\t\t\t\t<i onClick='deleteRow(this)' class='icon-cancel'></i>\r\n\t\t\t\t\t\t\t<i onClick='addCategoryDisableHours(this)' class='icon-add'></i>\r\n\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t<td>\r\n\t\t\t\t\t\t\t<table id='registrationtable'>\r\n\t\t\t\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t\t\t\t<th colspan='2' class='optional' id='start_day_test'>Start Day</th>\r\n\t\t\t\t\t\t\t\t\t<th colspan='2' class='center'>\r\n\t\t\t"; $day_num = $info_row['day_num']; $outputtext .= "<select type='text' id='start_day' name='start_day' >"; foreach ($days as $key => $value) { $outputtext .= "<option value='" . $key . "' "; if ($key == $day_num) { $outputtext .= "selected='selected' "; } $outputtext .= ">" . $value . "</option>"; } $outputtext .= "</select>"; $outputtext .= "\r\n\t\t\t\t\t\t\t\t\t</th>\r\n\t\t\t\t\t\t\t\t</tr>\r\n\t\t\t\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t\t\t\t<th colspan='2' class='optional' id='start_time_test'>Zip Code</th>\r\n\t\t\t\t\t\t\t\t\t<th colspan='2' class='center'><input type='time' id='start_time' name='start_time' value='" . $info_row['start'] . "' size='30' /></th>\r\n\t\t\t\t\t\t\t\t</tr>\r\n\t\t\t\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t\t\t\t<th colspan='2' class='optional' id='start_day_test'>Start Day</th>\r\n\t\t\t\t\t\t\t\t\t<th colspan='2' class='center'>\r\n\t\t\t"; $stop_day_num = $info_row['stop_day_num'];