2006-08-30 10:29:10 +00:00
|
|
|
<?php // $Id$
|
2005-12-26 19:21:37 +00:00
|
|
|
|
2006-03-27 08:49:43 +00:00
|
|
|
/// Load libraries
|
2006-04-26 16:03:16 +00:00
|
|
|
require_once('../../config.php');
|
2008-02-11 10:05:06 +00:00
|
|
|
require_once('const.php');
|
2006-04-26 16:03:16 +00:00
|
|
|
require_once('locallib.php');
|
2008-02-11 10:05:06 +00:00
|
|
|
require_once('localfuncs.php');
|
2008-04-04 02:54:20 +00:00
|
|
|
require_once('authorizenet.class.php');
|
2005-12-26 19:21:37 +00:00
|
|
|
|
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-11-12 13:26:14 +00:00
|
|
|
/// Get course
|
2008-06-05 14:06:39 +00:00
|
|
|
if (! $course = $DB->get_record('course', array('id'=>$courseid))) {
|
2008-06-20 10:48:29 +00:00
|
|
|
print_error('invalidcourseid', '', '', $courseid);
|
2006-11-12 13:26:14 +00:00
|
|
|
}
|
|
|
|
|
2008-02-11 10:05:06 +00:00
|
|
|
/// Only SITE users can access to this page
|
2006-04-26 17:39:13 +00:00
|
|
|
require_login(); // Don't use $courseid! User may want to see old orders.
|
2006-11-03 12:09:00 +00:00
|
|
|
if (has_capability('moodle/legacy:guest', get_context_instance(CONTEXT_SYSTEM), $USER->id, false)) {
|
2008-05-14 05:56:10 +00:00
|
|
|
print_error('noguest');
|
2006-03-10 20:05:24 +00:00
|
|
|
}
|
2005-12-26 19:21:37 +00:00
|
|
|
|
2008-06-11 18:34:20 +00:00
|
|
|
/// Load strings. All strings should be defined here. locallib.php uses these strings.
|
2008-02-11 10:05:06 +00:00
|
|
|
$strs = get_strings(array('search','status','action','time','course','confirm','yes','no','cancel','all','none','error'));
|
2006-09-01 16:43:52 +00:00
|
|
|
$authstrs = get_strings(array('orderid','nameoncard','echeckfirslasttname','void','capture','refund','delete',
|
2008-02-11 10:05:06 +00:00
|
|
|
'allpendingorders','authcaptured','authorizedpendingcapture','capturedpendingsettle','settled',
|
|
|
|
'refunded','cancelled','expired','underreview','approvedreview','reviewfailed','tested','new',
|
2008-02-11 10:44:09 +00:00
|
|
|
'paymentmethod','methodcc','methodecheck', 'paymentmanagement', 'orderdetails', 'cclastfour', 'isbusinesschecking','shopper',
|
2008-02-11 10:05:06 +00:00
|
|
|
'transid','settlementdate','notsettled','amount','unenrolstudent'), 'enrol_authorize');
|
2005-12-26 19:21:37 +00:00
|
|
|
|
2008-06-11 18:34:20 +00:00
|
|
|
/// User wants to see all orders
|
2006-03-27 08:49:43 +00:00
|
|
|
if (empty($orderid)) {
|
2006-09-15 12:35:08 +00:00
|
|
|
authorize_print_orders($courseid, $userid);
|
2005-12-26 19:21:37 +00:00
|
|
|
}
|
2008-02-11 10:05:06 +00:00
|
|
|
else {
|
|
|
|
authorize_print_order($orderid);
|
|
|
|
}
|
2005-12-26 19:21:37 +00:00
|
|
|
?>
|