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 
 }
function format_branches()
{
    $raw_branches = get_branches();
    $branches = "<option value=''>Select Branch</option>";
    foreach ($raw_branches as $value) {
        $branches .= "<option value='" . esc_attr($value['id']) . "'>" . esc_html($value['branch']) . "</option>";
    }
    echo $branches;
}
Beispiel #3
0
$result = array();
$connection = oci_connect($db_user, $db_password, $db_host, 'AL32UTF8');
if (!$connection) {
    oci_close($connection);
    print_r(oci_error());
    die("dasdas");
} else {
    switch ($action) {
        case "getNodeTypes":
            get_node_types();
            break;
        case "getPylonsByPowerLineId":
            get_pylons_by_power_line_id($postdata);
            break;
        case "getBranches":
            get_branches($postdata);
            break;
        case "addNode":
            add_node($postdata);
            break;
        case "editNode":
            edit_node($postdata);
            break;
        case "getConnectionNodesByBaseNodeId":
            get_connection_nodes_by_base_node_id($postdata);
            break;
        case "addConnectionNode":
            add_connection_node($postdata);
            break;
        case "deleteConnectionNode":
            delete_connection_node($postdata);