} CmnFns::do_message_box($msg); } else { $resid = $_GET['id']; $action = $_GET['action']; $res = new Reservation($resid); $resource = new Resource(); $max_participants = $resource->get_property('max_participants', $res->get_machid()); // If the total number of users (minus the owner) already participating is less than the max, let this user participate if ($action == INVITE_DECLINE || ($max_participants == '' || count($res->participating_users) < $max_participants)) { $msg = '<h5>' . translate('Confirm reservation participation') . '</h5><br/>'; $word = $_GET['action'] == INVITE_ACCEPT ? 'Accept' : 'Decline'; $msg .= '<input type="submit" class="button" name="y" value="' . translate($word) . '"/>'; $msg .= ' '; $msg .= '<input type="submit" class="button" name="n" value="' . translate('Cancel') . '"/>'; if ($res->is_repeat()) { $msg .= '<br/><input type="checkbox" name="update_all" value="yes"/> ' . translate('Do for all reservations in the group?'); } echo '<form name="inv_mgmt" action="' . $_SERVER['PHP_SELF'] . '?' . $_SERVER['QUERY_STRING'] . '" method="post">'; CmnFns::do_message_box($msg); echo '</form>'; } else { CmnFns::do_error_box(translate('That reservation is at full capacity.'), '', false); } } } // End main table $t->endMain(); // Print HTML footer $t->printHTMLFooter();
/** * Prints a page notifiying the admin that the requirest failed. * It will also assign the data passed in to a session variable * so it can be reinserted into the form that it came from * @param string or array $msg message(s) to print to user * @param array $data array of data to post back into the form */ function print_fail($msg, $data = null) { if (!is_array($msg)) { $msg = array($msg); } if (!empty($data)) { $_SESSION['post'] = $data; } $t = new Template(translate('Update failed!')); $t->printHTMLHeader(); $t->printWelcome(); $t->startMain(); CmnFns::do_error_box(translate('There were problems processing your request.') . '<br /><br />' . '- ' . join('<br />- ', $msg) . '<br />' . '<br /><a href="' . $_SERVER['HTTP_REFERER'] . '">' . translate('Please go back and correct any errors.') . '</a>'); $t->endMain(); $t->printHTMLFooter(); die; }