moodle/enrol/authorize/index.php

44 lines
1.6 KiB
PHP
Raw Normal View History

<?PHP // $Id$
2006-03-27 08:49:43 +00:00
/// Load libraries
2006-04-26 16:03:16 +00:00
require_once('../../config.php');
require_once('locallib.php');
2006-04-26 16:03:16 +00:00
/// Parameters
$orderid = optional_param('order', 0, PARAM_INT);
$courseid = optional_param('course', SITEID, PARAM_INT);
$userid = optional_param('user', 0, PARAM_INT);
2006-03-13 11:15:09 +00:00
2006-03-27 08:49:43 +00:00
/// Only site users can access to this page
require_login(); // Don't use $courseid! User may want to see old orders.
2006-04-26 16:03:16 +00:00
if (isguest()) {
error("Guests cannot use this page.");
}
2006-04-24 16:46:39 +00:00
/// Load strings. All strings should be defined here. locallib.php uses these strings.
$strs = get_strings(array('user','status','action','delete','time','course','confirm','yes','no','all','none','error'));
$authstrs = get_strings(array('paymentmanagement','orderid','void','capture','refund','delete',
'authcaptured','authorizedpendingcapture','capturedpendingsettle','capturedsettled',
'settled','refunded','cancelled','expired','tested','new',
'transid','settlementdate','notsettled','amount',
'howmuch','captureyes','unenrolstudent'), 'enrol_authorize');
2006-03-27 08:49:43 +00:00
/// Print header
2006-04-26 16:03:16 +00:00
if (!$course = get_record('course', 'id', $courseid)) {
error('Could not find that course');
}
2006-04-26 17:16:34 +00:00
print_header_simple("$authstrs->paymentmanagement", "", "<a href=\"index.php\">$authstrs->paymentmanagement</a>");
2006-03-27 08:49:43 +00:00
/// If orderid is empty, user wants to see all orders
if (empty($orderid)) {
2006-04-11 12:37:41 +00:00
authorize_print_orders();
2006-04-26 16:03:16 +00:00
} else {
2006-04-11 12:37:41 +00:00
authorize_print_order_details($orderid);
}
2006-03-27 08:49:43 +00:00
/// Print footer
print_footer();
?>