Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Tenzing
/
Tz Tools
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
18e04373
authored
2011-02-27 00:23:03 +0000
by
Chris Boden
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Course invoices
1 parent
e2066462
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
54 additions
and
1 deletions
com/UserManager/UserManager.php
com/UserManager/views/partials/edit_course.php
com/UserManager/UserManager.php
View file @
18e0437
...
...
@@ -760,12 +760,52 @@ class Actions {
}
public
static
function
wp_ajax_course_registration
()
{
public
static
function
wp_ajax_course_registration
()
{
// here
$user
=
new
User\Account
(
$_POST
[
'user_id'
]);
$course
=
new
Courses\Course
(
$_POST
[
'course_id'
]);
$enrolltype
=
$_POST
[
'enrolltype'
];
$amount
=
$course
->
$enrolltype
;
$user
->
registerForCourse
(
$_POST
[
'course_id'
],
(
boolean
)
isset
(
$_POST
[
'exam'
]),
$_POST
[
'enrolltype'
]);
$user
->
approveToCourse
(
$_POST
[
'course_id'
]);
$items
=
array
();
$items
[]
=
array
(
'post_id'
=>
$_POST
[
'course_id'
]
,
'cost'
=>
$amount
,
'discount_label'
=>
""
,
'discount_amount'
=>
0
,
'tax_label'
=>
""
,
'tax_rate'
=>
""
,
'tax_amount'
=>
"0.00"
,
'subtotal'
=>
$amount
,
'total'
=>
$amount
,
'description'
=>
$course
->
post_title
,
'extras'
=>
array
()
);
$invoice_data
=
Array
();
$invoice_data
[
'items'
]
=
$items
;
$invoice_data
[
'payment'
]
=
array
(
'total_cost'
=>
$amount
,
'total_discounts'
=>
""
,
'total_taxes'
=>
""
,
'subtotal'
=>
$amount
,
'total'
=>
$amount
,
'bt_address'
=>
""
,
'bt_address2'
=>
""
,
'bt_city'
=>
""
,
'bt_province'
=>
""
,
'bt_country'
=>
""
,
'bt_postal'
=>
""
,
'bt_card_holder'
=>
""
,
'bt_card_number'
=>
""
,
'bt_card_type'
=>
$_POST
[
'paid_by'
]
);
Invoice\create
(
$invoice_data
,
'course'
,
'Course Invoice'
,
$user
->
ID
,
'paid'
,
'publish'
,
0
);
die
(
json_encode
(
Array
(
'success'
=>
'true'
,
'refresh'
=>
'true'
)));
}
...
...
com/UserManager/views/partials/edit_course.php
View file @
18e0437
...
...
@@ -54,6 +54,19 @@
</div>
<div
class=
"dashboard-section"
style=
"margin-left:20px;margin-top:10px;"
>
<div
class=
"dashboard-section-title"
>
PAID BY
</div>
<div
class=
"dashboard-section-links"
></div>
<div
class=
"dashboard-section-content small"
>
<select
name=
"paid_by"
>
<option
value=
"visa"
>
Visa
</option>
<option
value=
"mc"
>
Mastercard
</option>
<option
value=
"amex"
>
American Express
</option>
<option
value=
"cheque"
>
Cheque
</option>
</select>
</div>
</div>
<div
class=
"dashboard-section"
style=
"margin-left:20px;margin-top:10px;"
>
<div
class=
"dashboard-section-title"
>
ENROLMENT TYPE
</div>
<div
class=
"dashboard-section-links"
></div>
<div
class=
"dashboard-section-content small"
>
...
...
Please
register
or
sign in
to post a comment