<?php
session_start();
require_once 'dbconfig.php';
require_once 'db_connection.php';


 $content = "";
 $ordertypeinfo = mysqli_fetch_array(mysqli_query($conn, "SELECT * FROM order_type WHERE order_type_id ='1'"));   
  $ordrtype = $ordertypeinfo['order_type'];
if($ordrtype=="Table"){
    $content .= '<div class="col-12 mt-3">
                    <label style="color:#fff; margin-bottom:3px;">Tables</label>
					<select class="form-control select2 inputele" id="table">
						<option value="0">None</option>';
                        $cus2 = "SELECT * FROM mobile_tables WHERE status=1";
						$result = $conn->query($cus2);
						if ($result->num_rows > 0) {
							while ($row = $result->fetch_assoc()) {
								$table_id = $row["table_id"];
								$table_no = $row["table_no"];
								
								$content .= '<option value="' . $table_no . '">' . $table_no . '</option>';
							}
						}
 $content .= '</select></div>';
 }else{
         $content .= '<input type="hidden" id="table" value="0">';
 }
 if($ordrtype!="Table" && $ordrtype!="Delivery" && $ordrtype!="None"){
    $content .= '<div class="col-12 mt-3">
                    <label style="color:#fff; margin-bottom:3px;">Rooms</label>
					<select class="form-control select2 inputele" id="room">
						<option value="0">None</option>';
                        $cus2 = "SELECT * FROM mobilerooms WHERE status=1";
						$result = $conn->query($cus2);
						if ($result->num_rows > 0) {
							while ($row = $result->fetch_assoc()) {
								$roomname = $row["roomname"];
								
								
								$content .= '<option value="' . $roomname . '">' . $roomname . '</option>';
							}
						}
 $content .= '</select></div>';
 }else{
    $content .= '<input type="hidden" id="room" value="0">';
 }

echo $content;

?>