Пример #1
0
        foreach ($buildings as $building) {
            $rooms = $DB->get_records('bookingrooms_rooms', array('buildings_id' => $building->id));
            foreach ($rooms as $room) {
                $DB->delete_records('bookingrooms_reserves', array('rooms_id' => $room->id));
            }
            $DB->delete_records('bookingrooms_rooms', array('buildings_id' => $building->id));
        }
        $DB->delete_records('bookingrooms_buildings', array('campus_id' => $idcampus));
        $DB->delete_records('bookingrooms_campus', array('id' => $idcampus));
        $action = "view";
    } else {
        print_error("ERROR");
    }
}
if ($action == 'view') {
    $table = tables::getPlacesAdminRoom();
}
//View of the Actions
//**************************************************************************************************************************************************
if ($action == 'edit') {
    $o = '';
    $title = get_string('editcampus', 'local_bookingrooms');
    $PAGE->navbar->add(get_string('roomsreserve', 'local_bookingrooms'));
    $PAGE->navbar->add(get_string('adjustments', 'local_bookingrooms'));
    $PAGE->navbar->add(get_string('seeandmodplaces', 'local_bookingrooms'), 'campus.php');
    $PAGE->navbar->add($title, '');
    $PAGE->set_title($title);
    $PAGE->set_heading($title);
    $o .= $OUTPUT->header();
    $o .= $OUTPUT->heading(get_string('editcampus', 'local_bookingrooms'));
    if (isset($placename->name)) {