Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 644600315c
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

executable file 111 lines (101 sloc) 5.015 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110
<?php // $Id$

enrolment_plugin_authorize::prevent_double_paid($course);
$formvars = array('password', 'ccaddress', 'cccity', 'ccstate', 'cccountry', 'cczip',
'ccfirstname', 'cclastname', 'cc', 'ccexpiremm', 'ccexpireyyyy', 'cctype', 'cvv');

foreach ($formvars as $var) {
if (!isset($form->$var)) {
$form->$var = '';
}
}

$curcost = enrolment_plugin_authorize::get_course_cost($course);
$userfirstname = empty($form->ccfirstname) ? $USER->firstname : $form->ccfirstname;
$userlastname = empty($form->cclastname) ? $USER->lastname : $form->cclastname;
$useraddress = empty($form->ccaddress) ? $USER->address : $form->ccaddress;
$usercity = empty($form->cccity) ? $USER->city : $form->cccity;
$usercountry = empty($form->cccountry) ? $USER->country : $form->cccountry;

?>

<p align="center"><?php if (!empty($this->ccerrors['header'])) { formerr($this->ccerrors['header']); } ?></p>

<div align="center">

<p><?php print_string("paymentrequired") ?></p>
<p><b><?php echo get_string("cost").": $curcost[currency] $curcost[cost]"; ?></b></p>
<p><?php print_string("paymentinstant") ?></p>

<form name="form" method="post" action="enrol.php" autocomplete="off">
<input type="hidden" name="id" value="<?php p($course->id) ?>" />
<table align="center" width="100%" border=0>
<tr>
  <td align="right"><?php print_string("ccno", "enrol_authorize") ?>: </td>
  <td align="left"><input type="text" name="cc" size="16" value="<?php p($form->cc) ?>" />
  <?php if (!empty($this->ccerrors['cc'])) { formerr($this->ccerrors['cc']); } ?></td>
</tr>
<tr>
  <td align="right"><?php print_string("nameoncard", "enrol_authorize") ?>: </td>
  <td align="left"><input type="text" name="ccfirstname" size="8" value="<?php p($userfirstname) ?>" />
  <input type="text" name="cclastname" size="8" value="<?php p($userlastname) ?>" />
  <?php if (!empty($this->ccerrors['ccfirstlast'])) { formerr($this->ccerrors['ccfirstlast']); } ?></td>
</tr>
<tr>
  <td align="right"><?php print_string("ccexpire", "enrol_authorize") ?>: </td>
  <td align="left"><?php
for ($i=1; $i<=12; $i++) {
$months[$i] = userdate(gmmktime(12,0,0,$i,1,2000), "%B");
}
choose_from_menu($months, 'ccexpiremm', $form->ccexpiremm);
$nowdate = getdate();
$nowyear = $nowdate["year"]-1;
for ($i=$nowyear; $i<=$nowyear+11; $i++) {
$years[$i] = $i;
}
choose_from_menu($years, 'ccexpireyyyy', $form->ccexpireyyyy);
if (!empty($this->ccerrors['ccexpire'])) { formerr($this->ccerrors['ccexpire']); }
?></td>
</tr>
<tr>
  <td align="right"><?php print_string("cctype", "enrol_authorize") ?>: </td>
  <td align="left"><?php
choose_from_menu(enrolment_plugin_authorize::get_list_of_creditcards(), 'cctype', $form->cctype);
if (!empty($this->ccerrors['cctype'])) { formerr($this->ccerrors['cctype']); }
?>
</td>
</tr>
<tr>
  <td align="right"><?php print_string("ccvv", "enrol_authorize") ?>: </td>
  <td align="left"><input type="text" name="cvv" size="4" maxlength="4" value="<?php p($form->cvv) ?>" />
  <?php helpbutton('', '', 'enrol_authorize', true, 'cvv', get_string('ccvvhelp', 'enrol_authorize')); ?>
  <?php if (!empty($this->ccerrors['cvv'])) { formerr($this->ccerrors['cvv']); } ?></td>
</tr>
<?php if (!empty($CFG->an_avs)) { /* Address Verification System */ ?>
<tr>
  <td align="right"><?php print_string("address") ?>: </td>
  <td align="left"><input type="text" name="ccaddress" size="32" value="<?php p($useraddress) ?>" />
  <?php if (!empty($this->ccerrors['ccaddress'])) { formerr($this->ccerrors['ccaddress']); } ?></td>
</tr>
<tr>
  <td align="right"><?php print_string("city") ?> / <?php print_string("state") ?>: </td>
  <td align="left"><input type="text" name="cccity" size="16" value="<?php p($usercity) ?>" /> /
  <input type="text" name="ccstate" size="2" maxlength="2" value="<?php p($form->ccstate) ?>" />
  <?php if (!empty($this->ccerrors['cccity'])) { formerr($this->ccerrors['cccity']); } ?></td>
</tr>
<tr>
  <td align="right"><?php print_string("country") ?>: </td>
  <td align="left"><?php choose_from_menu(get_list_of_countries(), "cccountry", $usercountry, get_string("selectacountry")."..."); ?>
  <?php if (!empty($this->ccerrors['cccountry'])) { formerr($this->ccerrors['cccountry']); } ?></td>
</tr>
<?php } else { /* not AVS */ ?>
<tr>
<td colspan="2">
  <input type="hidden" name="ccstate" value="" />
  <input type="hidden" name="ccaddress" value="<?php p($useraddress) ?>" />
  <input type="hidden" name="cccity" value="<?php p($usercity) ?>" />
  <input type="hidden" name="cccountry" value="<?php p($usercountry) ?>" />
</td>
</tr>
<?php } ?>
<tr>
  <td align="right"><?php print_string("zipcode", "enrol_authorize") ?>: </td>
  <td align="left"><input type="text" name="cczip" size="5" value="<?php p($form->cczip) ?>" />
  <?php if (!empty($this->ccerrors['cczip'])) { formerr($this->ccerrors['cczip']); } ?></td>
</tr>
</table>
<input type="submit" name="ccsubmit" value="<?php print_string("sendpaymentbutton", "enrol_authorize") ?>">
</form>

</div>
Something went wrong with that request. Please try again.