Exemplo n.º 1
0
 function operations_page()
 {
     $raw_branches = get_branches();
     $raw_rooms = get_rooms();
     $branches = '';
     $rooms = '';
     foreach ($raw_branches as $value) {
         $branches .= '<option value="' . esc_attr($value["id"]) . '">' . esc_html($value["branch"]) . '</option>';
     }
     foreach ($raw_rooms as $value) {
         $rooms .= '<option value="' . esc_attr($value["id"]) . '">' . esc_html($value["room"]) . '</option>';
     }
     ?>
     <div id="sr_status"><p style="visibility:hidden">Content goes here</p></div>
     <h2>Branch Operations</h2>
         <select class="branch operation">
             <option value="add">Add Branch</option>
             <option value="edit">Edit Branch</option>
             <option value="delete">Delete Branch</option>
         </select>
         <select class="branch branches">
             <option value="">Select Branch</option>
             
               <?php 
     echo $branches;
     ?>
             
         </select>
         <input type="text" class="branch name" size="20"></input>
         <input type="button" class="branch operate" value="Submit"></input>
         
     <h2>Room Operations</h2>
         <select class="room operation">
             <option value="add">Add Room</option>
             <option value="edit">Edit Room</option>
             <option value="delete">Delete Room</option>
         </select>
         <select class="room rooms">
             <option value="">Select Room</option>
             <?php 
     echo $rooms;
     ?>
         </select>
         <select class="room branches">
             <option value="">Select Branch</option>
             <?php 
     echo $branches;
     ?>
         </select>
         <input type="text" class="room name" size="20"></input>
         <input type="button" class="room operate" value="Submit"></input>
         
     <h2>Clear Reservations</h2>
         <span>Remove expired and cancelled reservations <input type="button" id="clear_reservations" value="Submit"></input></span>
 <?php 
 }
Exemplo n.º 2
0
<?php

require_once "../../util/main.php";
require_once "../../model/teacher_db.php";
$testTypes = get_test_types();
$rooms = get_rooms();
$action = strtolower(filter_input(INPUT_POST, 'action'));
if ($action == NULL) {
    $action = strtolower(filter_input(INPUT_GET, 'action'));
    if ($action == NULL) {
        $action = 'list_tests';
    }
}
switch ($action) {
    case 'list_tests':
        $testList = get_test_list($user->usr_id, 0, 0, 0, 0);
        break;
    case 'add_test':
        $error_msg = '';
        $choice = filter_input(INPUT_POST, 'choice');
        $test_name = filter_input(INPUT_POST, 'test_name');
        $date = filter_input(INPUT_POST, 'date');
        $one_three = intval(filter_input(INPUT_POST, 'one_three'));
        $four_six = intval(filter_input(INPUT_POST, 'four_six'));
        $seven_nine = intval(filter_input(INPUT_POST, 'seven_nine'));
        $ten_twelve = intval(filter_input(INPUT_POST, 'ten_twelve'));
        $thirteen_fifteen = intval(filter_input(INPUT_POST, 'thirteen_fifteen'));
        $sixteen_eighteen = intval(filter_input(INPUT_POST, 'sixteen_eighteen'));
        $nineteen_twentyone = intval(filter_input(INPUT_POST, 'nineteen_twentyone'));
        $twentytwo_twentyfour = intval(filter_input(INPUT_POST, 'twentytwo_twentyfour'));
        $twentyfive_twentyseven = intval(filter_input(INPUT_POST, 'twentyfive_twentyseven'));
Exemplo n.º 3
0
function format_rooms()
{
    $raw_rooms = get_rooms();
    $rooms = "<option value=''>Select Room</option>";
    foreach ($raw_rooms as $value) {
        $rooms .= "<option value='" . esc_attr($value['id']) . "'>" . esc_html($value['room']) . "</option>";
    }
    echo $rooms;
}
Exemplo n.º 4
0
														<th class="text-center"> Tình trạng</th>
														<th class="text-center"> Loại phòng</th>
														<th class="text-center"> Phương thức</th>
													</tr>
												</thead>
												<tbody>

													<?php 
$i = 1;
$status = "";
if (isset($_REQUEST['suaphong'])) {
    $phongId = $_REQUEST['suaphong'];
} else {
    $phongId = null;
}
$result_dm = get_rooms(2, 0);
while ($row_dm = mysql_fetch_array($result_dm, MYSQL_ASSOC)) {
    if ($row_dm['id'] == $phongId) {
        echo "<tr><form name='form_edit' method='POST'>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<td class='text-center'>{$i}</td>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<td class='text-center'><input type='text' name='label' value='{$row_dm['label']}'></td>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<td class='text-center'><input type='text' name='description' value='{$row_dm['description']}'></td>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<td class='text-center'>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<select name='chonstatus' class='form-control'>";
        if (isset($_REQUEST['chonstatus'])) {
            $chonstatus = $_REQUEST['chonstatus'];
        } else {
            $chonstatus = $row_dm[status];
        }
        if ($chonstatus == 1) {
            echo "<option value='1' selected='selected' >Đã thuê</option><option value='0'>Trống</option>";
        } else {
            echo "<option value='1' >Đã thuê</option><option value='0' selected='selected' >Trống</option>";
        }
        echo "</td>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<td class='text-center'><input type='text' name='name' value='{$row_dm['name']}' disabled></td>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<td class='text-center'>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class='btn-group'>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<button class='btn btn-info' type='submit' name='btn_save'><i class='icon_check_alt2'></i>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<a class='btn btn-warning' href='admin.php?option=hangtrung'><i class='icon_blocked'></i>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div></td></form>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</tr>";
    } else {
Exemplo n.º 5
0
    public function __construct()
    {
        $rooms = get_rooms();
        ?>
        <option value="">Select a Conference Room</option>
        <?php 
        foreach ($rooms as $room) {
            ?>
 <option value="<?php 
            echo esc_attr($room["id"]);
            ?>
"><?php 
            echo esc_html($room["room"]);
            ?>
</option> <?php 
        }
        $default_month = idate('m');
        $default_day = idate('d');
        $month_array = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
        $month_values = '';
        $day_values = '';
        for ($i = 1; $i <= 12; $i++) {
            $month_values .= '<option value="' . esc_attr($i) . '" ';
            if ($default_month == $i) {
                $month_values .= 'selected ';
            }
            $month_values .= '>' . esc_html($month_array[$i - 1]) . '</option>';
        }
        for ($i = 1; $i <= 31; $i++) {
            $day_values .= '<option value="' . esc_attr($i) . '" ';
            if ($default_day == $i) {
                $day_values .= 'selected ';
            }
            $day_values .= '>' . esc_html($i) . '</option>';
        }
        ?>
        </select>
        <select id="sr_month">
            <?php 
        echo $month_values;
        ?>
        </select>
        <select id="sr_day">
            <?php 
        echo $day_values;
        ?>
        </select>
        <select id="sr_year">
            <option value="<?php 
        echo esc_attr(idate("Y"));
        ?>
"><?php 
        echo esc_html(idate("Y"));
        ?>
</option>
            <option value="<?php 
        echo esc_attr(idate("Y") + 1);
        ?>
"><?php 
        echo esc_html(idate("Y") + 1);
        ?>
</option>
        </select>
        <input type="button" id="display_reservation" value="Check Reservations"></input>
        
        <table id="display_reservation_status">
        </table>
        <div id="add_reservation_form" style="display:none">
            <div id="add_reservation_status">
            </div>
            <div>
            <label for="sr_start_hour">Start</label>
                <select id="sr_start_hour">
                    <option value="1">1</option>
                    <option value="2">2</option>
                    <option value="3">3</option>
                    <option value="4">4</option>
                    <option value="5">5</option>
                    <option value="6">6</option>
                    <option value="7">7</option>
                    <option value="8">8</option>
                    <option value="9">9</option>
                    <option value="10">10</option>
                    <option value="11">11</option>
                    <option value="0">12</option>
                </select>
                :
                <select id="sr_start_minute">
                    <option value="0">00</option>
                    <option value="5">05</option>
                    <option value="10">10</option>
                    <option value="15">15</option>
                    <option value="20">20</option>
                    <option value="25">25</option>
                    <option value="30">30</option>
                    <option value="35">35</option>
                    <option value="40">40</option>
                    <option value="45">45</option>
                    <option value="50">50</option>
                    <option value="55">55</option>
                </select>
                <select id="sr_start_ampm">
                    <option value="0">AM</option>
                    <option value="12">PM</option>
                </select>
            </div>
            </br>
            <div>
            <label for="sr_end_hour">End</label>
                <select id="sr_end_hour">
                    <option value="1">1</option>
                    <option value="2">2</option>
                    <option value="3">3</option>
                    <option value="4">4</option>
                    <option value="5">5</option>
                    <option value="6">6</option>
                    <option value="7">7</option>
                    <option value="8">8</option>
                    <option value="9">9</option>
                    <option value="10">10</option>
                    <option value="11">11</option>
                    <option value="0">12</option>
                </select>
                :
                <select id="sr_end_minute">
                    <option value="0">00</option>
                    <option value="5">05</option>
                    <option value="10">10</option>
                    <option value="15">15</option>
                    <option value="20">20</option>
                    <option value="25">25</option>
                    <option value="30">30</option>
                    <option value="35">35</option>
                    <option value="40">40</option>
                    <option value="45">45</option>
                    <option value="50">50</option>
                    <option value="55">55</option>
                </select>
                <select id="sr_end_ampm">
                    <option value="0">AM</option>
                    <option value="12">PM</option>
                </select>
            </div>
            </br>
            <div>
                <label for="sr_purpose">Purpose</label>
                <input type="text" id="sr_purpose"/>*
            </div>
            </br>
            <div>
                <label for="sr_name">Name</label>
                <input type="text" id="sr_name"/>*
            </div>
            </br>
            <div>
                <label for="sr_email">Email</label>
                <input type="text" id="sr_email"/>*
            </div>
            </br>
            <div>
                <label for="sr_phone">Phone</label>
                <input type="text" id="sr_phone"/>*
            </div>
            </br>
            <div>
                <input type="button" id="add_reservation" value="Submit Reservation"></input>
            </div>
        </div>
        <?php 
        add_action('wp_footer', array($this, 'enqueue_reservation_scripts'));
    }
Exemplo n.º 6
0
														<th class="text-center"> Tình trạng</th>
														<th class="text-center"> Loại phòng</th>
														<th class="text-center"> Phương thức</th>
													</tr>
												</thead>
												<tbody>

													<?php 
$i = 1;
$status = "";
if (isset($_REQUEST['suaphong'])) {
    $phongId = $_REQUEST['suaphong'];
} else {
    $phongId = null;
}
$result_dm = get_rooms(3, 0);
while ($row_dm = mysql_fetch_array($result_dm, MYSQL_ASSOC)) {
    if ($row_dm['id'] == $phongId) {
        echo "<tr><form name='form_edit' method='POST'>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<td class='text-center'>{$i}</td>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<td class='text-center'><input type='text' name='label' value='{$row_dm['label']}'></td>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<td class='text-center'><input type='text' name='description' value='{$row_dm['description']}'></td>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<td class='text-center'>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<select name='chonstatus' class='form-control'>";
        if (isset($_REQUEST['chonstatus'])) {
            $chonstatus = $_REQUEST['chonstatus'];
        } else {
            $chonstatus = $row_dm[status];
        }
        if ($chonstatus == 1) {
            echo "<option value='1' selected='selected' >Đã thuê</option><option value='0'>Trống</option>";
        } else {
            echo "<option value='1' >Đã thuê</option><option value='0' selected='selected' >Trống</option>";
        }
        echo "</td>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<td class='text-center'><input type='text' name='name' value='{$row_dm['name']}' disabled></td>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<td class='text-center'>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class='btn-group'>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<button class='btn btn-info' type='submit' name='btn_save'><i class='icon_check_alt2'></i>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<a class='btn btn-warning' href='admin.php?option=hangthuong'><i class='icon_blocked'></i>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div></td></form>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</tr>";
    } else {
Exemplo n.º 7
0
" method="post">
<div class="table-search">

<input type="text" id="search" placeholder="Type to search">
</div>
<!--<input type="submit" name="update" value="Update" /><input type="submit" name="delete" value="Delete" />-->
<table id="tablesorter-demo" class="tablesorter" cellspacing="0">
<thead>
<tr class="table-header"><th width="10"><input type="checkbox" name"all">  </th>
<th>Room_no</th>
<th>Name</th>
<th>Room Classification</th>
<th>Actions</th></tr></thead>
<tbody>
<?php 
    $numrows = count(get_rooms());
    // number of rows to show per page
    // find out total pages
    $totalpages = ceil($numrows / $rowsperpage);
    // get the current page or set a default
    if (isset($_GET['currentpage']) && is_numeric($_GET['currentpage'])) {
        // cast var as int
        $currentpage = (int) $_GET['currentpage'];
    } else {
        // default page num
        $currentpage = 1;
    }
    // end if
    // if current page is greater than total pages...
    if ($currentpage > $totalpages) {
        // set current page to last page
Exemplo n.º 8
0
														<th class="text-center"> Tình trạng</th>
														<th class="text-center"> Loại phòng</th>
														<th class="text-center"> Phương thức</th>
													</tr>
												</thead>
												<tbody>

													<?php 
$i = 1;
$status = "";
if (isset($_REQUEST['suaphong'])) {
    $phongId = $_REQUEST['suaphong'];
} else {
    $phongId = null;
}
$result_dm = get_rooms(1, 0);
while ($row_dm = mysql_fetch_array($result_dm, MYSQL_ASSOC)) {
    if ($row_dm['id'] == $phongId) {
        echo "<tr><form name='form_edit' method='POST'>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<td class='text-center'>{$i}</td>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<td class='text-center'><input type='text' name='label' value='{$row_dm['label']}'></td>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<td class='text-center'><input type='text' name='description' value='{$row_dm['description']}'></td>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<td class='text-center'>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<select name='chonstatus' class='form-control'>";
        if (isset($_REQUEST['chonstatus'])) {
            $chonstatus = $_REQUEST['chonstatus'];
        } else {
            $chonstatus = $row_dm[status];
        }
        if ($chonstatus == 1) {
            echo "<option value='1' selected='selected' >Đã thuê</option><option value='0'>Trống</option>";
        } else {
            echo "<option value='1' >Đã thuê</option><option value='0' selected='selected' >Trống</option>";
        }
        echo "\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</select>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<td class='text-center'><input type='text' name='name' value='{$row_dm['name']}' disabled></td>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<td class='text-center'>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class='btn-group'>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<button class='btn btn-info' type='submit' name='btn_save'><i class='icon_check_alt2'></i>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<a class='btn btn-warning' href='admin.php?option=caocap'><i class='icon_blocked'></i>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div></td></form>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</tr>";
    } else {