Source for file deletedbookings.php
Documentation is available at deletedbookings.php
* View a list of deleted bookings for an instrument over a given time period
* @author Stuart Prescott
* @copyright Copyright Stuart Prescott
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
* path (bumblebee root)/inc/actions/deletedbookings.php
/** Load ancillary functions */
require_once 'inc/typeinfo.php';
require_once 'inc/formslib/anchortablelist.php';
/** date manipulation routines */
require_once 'inc/date.php';
require_once 'inc/bb/daterange.php';
require_once 'inc/actions/actionaction.php';
* View a list of deleted bookings for an instrument over a given time period
* @param BumblebeeAuth $auth Authorisation object
* @param array $pdata extra state data from the call path
if (! isset
($this->PD['instrid'])
||
$this->PD['instrid'] <
1
||
$this->PD['instrid'] ==
'') {
$daterange =
new DateRange('daterange', T_('Select date range'),
T_('Enter the dates over which you want to report deleted bookings'));
$daterange->update($this->PD);
$daterange->checkValid();
if ($daterange->newObject) {
echo
$daterange->display($this->PD);
echo
"<br /><br /><a href='".
makeURL('deletedbookings').
"'>"
.
T_('Return to instrument list').
"</a>";
echo
"<br /><br /><a href='".
makeURL('deletedbookings', array('instrid'=>
$this->PD['instrid'])).
"'>".
T_('Choose different dates').
"</a>";
/* function mungeInputData() {
foreach ($_POST as $k => $v) {
if (isset($this->PDATA[1]) && $this->PDATA[1] !== '') {
$this->PD['instrid'] = $this->PDATA[1];
* Select which instrument the listing should be generated for
$instrselect->connectDB('instruments',
array('id', 'name', 'longname')
$instrselect->hrefbase =
makeURL('deletedbookings', array('instrid'=>
'__id__'));;
$instrselect->setFormat('id', '%s', array('name'), ' %50.50s', array('longname'));
echo
$instrselect->display();
* Display the deleted bookings
$start =
$daterange->getStart();
$stop =
$daterange->getStop();
$instrument =
$this->PD['instrid'];
$bookings->setTableHeadings(array(T_('Date'), T_('Duration'), T_('User'), T_('Log Entry')));
$bookings->deleted =
true;
$bookings->connectDB('bookings',
array('bookings.id', 'username', 'bookwhen', 'duration','log'),
'bookwhen >= '.
qw($start->dateTimeString())
.
' AND bookwhen < ' .
qw($stop->dateTimeString())
.
' AND instrument = '.
qw($instrument),
array('users'=>
'userid=users.id'));
$bookings->hrefbase =
makeURL('view', array('bookid'=>
'__id__', 'instrid'=>
$instrument));
$bookings->setFormat('id', '%s', array('bookwhen'),
echo
$bookings->display();
} // class ActionDeletedBookings
Documentation generated on Tue, 06 Mar 2007 10:01:22 +0000 by phpDocumentor 1.3.0