$DB->update_record('bookingrooms_bookings', $bookings); $action = "see"; } } } // 'See' action implementation // Shows a table per page of all the room reservations that are active in decreasing order by date // with a link that allows you to add a comment or see, if exist, a comment if ($action == "see") { $max = 15; $page = optional_param('page', 0, PARAM_INT); //$bokkings = $DB->get_records('bookingrooms_bookings'); $bookings = $DB->get_records_sql('select * from {bookingrooms_bookings} where active = 1 order by date_bookings desc'); $count = count($bookings); $totalpages = ceil($count / $max); $table = tables::allbookingdata($reservas, $max, $page); } //view of the actions: see & comment $o = ''; $title = get_string('bookinghistory', 'local_bookingrooms'); $PAGE->navbar->add(get_string('roomsreserve', 'local_bookingrooms')); $PAGE->navbar->add(get_string('adjustments', 'local_bookingrooms')); $PAGE->navbar->add($title, 'bookinghistory.php'); if ($action == "see") { $PAGE->set_title($title); $PAGE->set_heading($title); $o .= $OUTPUT->header(); $o .= $OUTPUT->heading($title); $o .= "version 2013031400"; $o .= "<right><h4> " . get_string('totalbookings', 'local_bookingrooms') . " " . $count . " </h4></right>"; $o .= "<div class='no-overflow'>";