Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
apex_micro_site
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Merge Requests
0
Merge Requests
0
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Ali Arshad
apex_micro_site
Commits
fc69a48d
Commit
fc69a48d
authored
Jan 21, 2018
by
Ali Arshad
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added payment gateway 50%
parent
b5f8d493
Pipeline
#196
passed with stage
in 0 seconds
Changes
8
Pipelines
1
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
215 additions
and
42 deletions
+215
-42
test.php
WWW_DATA/test.php
+8
-0
lms-setting.php
.../wp-content/plugins/apex_global_lms/admin/lms-setting.php
+155
-34
functions.php
WWW_DATA/wp-content/plugins/apex_global_lms/functions.php
+0
-0
template.php
WWW_DATA/wp-content/plugins/apex_global_lms/template.php
+1
-1
lms.css
...A/wp-content/plugins/apex_global_lms/template/css/lms.css
+6
-0
it-course.php
...wp-content/plugins/apex_global_lms/template/it-course.php
+1
-1
lms.js
...ATA/wp-content/plugins/apex_global_lms/template/js/lms.js
+37
-4
learner-detail.php
...ntent/plugins/apex_global_lms/template/learner-detail.php
+7
-2
No files found.
WWW_DATA/test.php
0 → 100644
View file @
fc69a48d
<?php
/**
* Created by PhpStorm.
* User: ali
* Date: 21/01/2018
* Time: 4:26 PM
*/
\ No newline at end of file
WWW_DATA/wp-content/plugins/apex_global_lms/admin/lms-setting.php
View file @
fc69a48d
<?php
add_action
(
'admin_menu'
,
'vq_lms_settings_page'
);
add_action
(
'admin_menu'
,
'vq_lms_settings_page'
);
add_action
(
'admin_init'
,
'vq_lms_settings_init'
);
add_action
(
'admin_init'
,
'vq_lms_payment_settings_init'
);
add_action
(
'admin_init'
,
'vq_lms_settings_init'
);
function
vq_lms_payment_settings_init
()
{
register_setting
(
'vq_lms_settings'
,
'vq_lms_payment_merchant_id'
);
register_setting
(
'vq_lms_settings'
,
'vq_lms_payment_merchant_name'
);
register_setting
(
'vq_lms_settings'
,
'vq_lms_payment_company_name'
);
register_setting
(
'vq_lms_settings'
,
'vq_lms_payment_merchant_key'
);
function
vq_lms_settings_init
()
{
register_setting
(
'vq_lms_settings'
,
'vq_lms_settings_options'
);
add_settings_section
(
'vq_lms_payment_settings_section'
,
'Payment Gateway Settings'
,
'vq_lms_general_settings_section_cb'
,
'vq_lms_settings'
);
add_settings_field
(
'vq_lms_payment_settings_merchant_id'
,
'Merchant ID'
,
'vq_lms_payment_settings_merchant_id'
,
'vq_lms_settings'
,
'vq_lms_payment_settings_section'
);
add_settings_field
(
'vq_lms_payment_merchant_name'
,
'Merchant Name'
,
'vq_lms_payment_merchant_name'
,
'vq_lms_settings'
,
'vq_lms_payment_settings_section'
);
add_settings_field
(
'vq_lms_payment_company_name'
,
'Company Name'
,
'vq_lms_payment_company_name'
,
'vq_lms_settings'
,
'vq_lms_payment_settings_section'
);
add_settings_field
(
'vq_lms_payment_merchant_key'
,
'Merchant Key'
,
'vq_lms_payment_merchant_key'
,
'vq_lms_settings'
,
'vq_lms_payment_settings_section'
);
}
function
vq_lms_general_settings_section_cb
()
{
echo
"Settings related to payment gateway."
;
}
function
vq_lms_payment_merchant_key
()
{
$merchant_key
=
get_option
(
'vq_lms_payment_merchant_key'
);
?>
<input
type=
"text"
name=
"vq_lms_payment_merchant_key"
value=
"
<?php
echo
$merchant_key
;
?>
"
/>
<p
class=
"description"
>
<?php
esc_html_e
(
'Specify Merchant Key of payment gateway.'
,
'vq_lms_settings'
);
?>
</p>
<?php
}
function
vq_lms_payment_company_name
()
{
$company_name
=
get_option
(
'vq_lms_payment_company_name'
);
?>
<input
type=
"text"
name=
"vq_lms_payment_company_name"
value=
"
<?php
echo
$company_name
;
?>
"
/>
<p
class=
"description"
>
<?php
esc_html_e
(
'Specify Company Name of payment gateway.'
,
'vq_lms_settings'
);
?>
</p>
<?php
}
function
vq_lms_payment_merchant_name
()
{
$merchant_name
=
get_option
(
'vq_lms_payment_merchant_name'
);
?>
<input
type=
"text"
name=
"vq_lms_payment_merchant_name"
value=
"
<?php
echo
$merchant_name
;
?>
"
/>
<p
class=
"description"
>
<?php
esc_html_e
(
'Specify Merchant Name of payment gateway.'
,
'vq_lms_settings'
);
?>
</p>
<?php
}
function
vq_lms_payment_settings_merchant_id
()
{
$merchant_id
=
get_option
(
'vq_lms_payment_merchant_id'
);
?>
<input
type=
"text"
name=
"vq_lms_payment_merchant_id"
value=
"
<?php
echo
$merchant_id
;
?>
"
/>
<p
class=
"description"
>
<?php
esc_html_e
(
'Specify Merchant ID of payment gateway.'
,
'vq_lms_settings'
);
?>
</p>
<?php
}
function
vq_lms_settings_init
()
{
register_setting
(
'vq_lms_settings'
,
'vq_lms_settings_options'
);
add_settings_section
(
'vq_lms_settings_section_developers'
,
...
...
@@ -78,59 +191,64 @@ function vq_lms_settings_init() {
);
}
function
vq_lms_settings_section_developers_cb
(
$args
)
{
function
vq_lms_settings_section_developers_cb
(
$args
)
{
}
function
vq_lms_settings_field_price_cb
(
$args
)
{
$options
=
get_option
(
'vq_lms_settings_options'
);
function
vq_lms_settings_field_price_cb
(
$args
)
{
$options
=
get_option
(
'vq_lms_settings_options'
);
?>
<input
type=
"text"
name=
"vq_lms_settings_options[
<?php
echo
esc_attr
(
$args
[
'label_for'
]
);
?>
]"
name=
"vq_lms_settings_options[
<?php
echo
esc_attr
(
$args
[
'label_for'
]
);
?>
]"
value=
"
<?php
echo
$options
[
$args
[
'label_for'
]];
?>
"
>
<p
class=
"description"
>
<?php
esc_html_e
(
'Your entered price will be listed as default price for all courses unless specified for each.'
,
'vq_lms_settings'
);
?>
<?php
esc_html_e
(
'Your entered price will be listed as default price for all courses unless specified for each.'
,
'vq_lms_settings'
);
?>
</p>
<?php
}
function
vq_lms_settings_field_currency_name_cb
(
$args
)
{
$options
=
get_option
(
'vq_lms_settings_options'
);
function
vq_lms_settings_field_currency_name_cb
(
$args
)
{
$options
=
get_option
(
'vq_lms_settings_options'
);
?>
<input
type=
"text"
name=
"vq_lms_settings_options[
<?php
echo
esc_attr
(
$args
[
'label_for'
]
);
?>
]"
name=
"vq_lms_settings_options[
<?php
echo
esc_attr
(
$args
[
'label_for'
]
);
?>
]"
value=
"
<?php
echo
$options
[
$args
[
'label_for'
]];
?>
"
>
<p
class=
"description"
>
<?php
esc_html_e
(
'Your entered currency will be used for whole LMS system listing.'
,
'vq_lms_settings'
);
?>
<?php
esc_html_e
(
'Your entered currency will be used for whole LMS system listing.'
,
'vq_lms_settings'
);
?>
</p>
<?php
}
function
vq_lms_settings_field_currency_symbol_cb
(
$args
)
{
$options
=
get_option
(
'vq_lms_settings_options'
);
function
vq_lms_settings_field_currency_symbol_cb
(
$args
)
{
$options
=
get_option
(
'vq_lms_settings_options'
);
?>
<input
type=
"text"
name=
"vq_lms_settings_options[
<?php
echo
esc_attr
(
$args
[
'label_for'
]
);
?>
]"
name=
"vq_lms_settings_options[
<?php
echo
esc_attr
(
$args
[
'label_for'
]
);
?>
]"
value=
"
<?php
echo
$options
[
$args
[
'label_for'
]];
?>
"
>
<p
class=
"description"
>
<?php
esc_html_e
(
'Enter Currency Symbol.'
,
'vq_lms_settings'
);
?>
<?php
esc_html_e
(
'Enter Currency Symbol.'
,
'vq_lms_settings'
);
?>
</p>
<?php
}
function
vq_lms_settings_field_video_cb
(
$args
)
{
function
vq_lms_settings_field_video_cb
(
$args
)
{
wp_enqueue_media
();
$options
=
get_option
(
'vq_lms_settings_options'
);
$options
=
get_option
(
'vq_lms_settings_options'
);
if
(
$options
[
$args
[
'label_for'
]])
{
if
(
$options
[
$args
[
'label_for'
]])
{
?>
<div
style=
"width: 200px;"
id=
"video_holder"
>
<video
id=
"vid"
src=
"
<?php
echo
$options
[
$args
[
'label_for'
]];
?>
"
>
...
...
@@ -152,20 +270,20 @@ function vq_lms_settings_field_video_cb($args) {
<input
type=
"hidden"
id=
"vq_lms_video_hidden"
name=
"vq_lms_settings_options[
<?php
echo
esc_attr
(
$args
[
'label_for'
]
);
?>
]"
name=
"vq_lms_settings_options[
<?php
echo
esc_attr
(
$args
[
'label_for'
]
);
?>
]"
value=
"
<?php
echo
$options
[
$args
[
'label_for'
]];
?>
"
>
<p
class=
"description"
>
<?php
esc_html_e
(
'video attachment to show.'
,
'vq_lms_settings'
);
?>
<?php
esc_html_e
(
'video attachment to show.'
,
'vq_lms_settings'
);
?>
</p>
<script>
var
mediaUploader
;
jQuery
(
"#vq_lms_remove_video"
).
on
(
'click'
,
function
()
{
jQuery
(
"#vq_lms_remove_video"
).
on
(
'click'
,
function
()
{
jQuery
(
"#vq_lms_video_hidden"
).
val
(
''
);
jQuery
(
"#vid"
).
attr
(
'src'
,
''
);
});
jQuery
(
'#vq_lms_video'
).
on
(
'click'
,
function
(
e
)
{
jQuery
(
'#vq_lms_video'
).
on
(
'click'
,
function
(
e
)
{
e
.
preventDefault
();
if
(
mediaUploader
)
{
mediaUploader
.
open
();
...
...
@@ -190,11 +308,13 @@ function vq_lms_settings_field_video_cb($args) {
<?php
}
function
vq_lms_settings_field_shortcode_cb
()
{
function
vq_lms_settings_field_shortcode_cb
()
{
echo
'[vq_short_banner bgClr="" btnBg="" txt="" txtClr="" btnClr="" btnLink="" btnTxt=""]'
;
}
function
vq_lms_settings_page
()
{
function
vq_lms_settings_page
()
{
add_submenu_page
(
'edit.php?post_type=vq_course'
,
'Test Page'
,
...
...
@@ -205,12 +325,13 @@ function vq_lms_settings_page() {
);
}
function
vq_lms_settings_page_html
()
{
if
(
!
current_user_can
(
'manage_options'
)
)
{
function
vq_lms_settings_page_html
()
{
if
(
!
current_user_can
(
'manage_options'
))
{
return
;
}
if
(
isset
(
$_GET
[
'settings-updated'
]
)
)
{
if
(
isset
(
$_GET
[
'settings-updated'
])
)
{
add_settings_error
(
'vq_lms_settings_messages'
,
'vq_lms_settings_message'
,
...
...
@@ -219,15 +340,15 @@ function vq_lms_settings_page_html() {
);
}
settings_errors
(
'vq_lms_settings_messages'
);
settings_errors
(
'vq_lms_settings_messages'
);
?>
<div
class=
"wrap"
>
<h1>
<?php
echo
esc_html
(
get_admin_page_title
()
);
?>
</h1>
<h1>
<?php
echo
esc_html
(
get_admin_page_title
()
);
?>
</h1>
<form
action=
"options.php"
method=
"post"
>
<?php
settings_fields
(
'vq_lms_settings'
);
do_settings_sections
(
'vq_lms_settings'
);
submit_button
(
'Save Settings'
);
settings_fields
(
'vq_lms_settings'
);
do_settings_sections
(
'vq_lms_settings'
);
submit_button
(
'Save Settings'
);
?>
</form>
</div>
...
...
WWW_DATA/wp-content/plugins/apex_global_lms/functions.php
View file @
fc69a48d
This diff is collapsed.
Click to expand it.
WWW_DATA/wp-content/plugins/apex_global_lms/template.php
View file @
fc69a48d
<?php
$lmsVersion
=
"0.
3
"
;
$lmsVersion
=
"0.
4
"
;
add_action
(
'wp_enqueue_scripts'
,
'enqueue_admin_css'
);
add_filter
(
'template_include'
,
'use_lms_template'
,
99
);
...
...
WWW_DATA/wp-content/plugins/apex_global_lms/template/css/lms.css
View file @
fc69a48d
...
...
@@ -665,3 +665,8 @@
overflow
:
hidden
;
text-overflow
:
ellipsis
;
}
.bootstrap-iso
.disabled
{
pointer-events
:
none
;
opacity
:
0.8
;
}
\ No newline at end of file
WWW_DATA/wp-content/plugins/apex_global_lms/template/it-course.php
View file @
fc69a48d
...
...
@@ -36,7 +36,7 @@ $courses = new WP_Query($args);
<?php
the_post_thumbnail
(
'thumbnail'
)
?>
</div>
<div
class=
"col-sm-6"
>
<div
class=
"course-heading"
>
<div
class=
"course-heading"
style=
"max-height: 105px; overflow: hidden;"
>
<h3>
<?php
the_title
();
?>
</h3>
<?php
the_content
();
?>
</div>
...
...
WWW_DATA/wp-content/plugins/apex_global_lms/template/js/lms.js
View file @
fc69a48d
...
...
@@ -49,7 +49,7 @@
courseLearner
[
course
.
id
].
forEach
(
function
(
learner
,
index
)
{
var
lmsSummerySingleElem
=
$
(
lmsSummerySingleLearner
);
lmsSummerySingleElem
.
find
(
".index"
).
html
(
index
+
1
);
lmsSummerySingleElem
.
find
(
".name"
).
html
(
learner
.
name
);
lmsSummerySingleElem
.
find
(
".name"
).
html
(
learner
.
f
name
);
lmsSummerySingleElem
.
find
(
".email"
).
html
(
learner
.
email
);
lmsSummerySingleElem
.
find
(
".phone"
).
html
(
learner
.
phone
);
lmsSummerySingleElem
.
find
(
".price"
).
html
(
course
.
cost
+
" "
+
lmsSettings
.
vq_lms_settings_field_currency_symbol
);
...
...
@@ -67,7 +67,7 @@
learners
.
forEach
(
function
(
item
,
index
)
{
var
learnerFormElement
=
$
(
learnerFormTemplate
);
learnerFormElement
.
find
(
".lmsIndex"
).
html
(
index
+
1
);
learnerFormElement
.
find
(
"input[name='
name']"
).
val
(
item
.
name
);
learnerFormElement
.
find
(
"input[name='
fname']"
).
val
(
item
.
f
name
);
learnerFormElement
.
find
(
"input[name='email']"
).
val
(
item
.
email
);
learnerFormElement
.
find
(
"input[name='confirmEmail']"
).
val
(
item
.
confirmEmail
);
learnerFormElement
.
find
(
"input[name='phone']"
).
val
(
item
.
phone
);
...
...
@@ -152,7 +152,7 @@
function
addEmptyLearner
()
{
var
lerner
=
{
name
:
""
,
f
name
:
""
,
email
:
""
,
confirmEmail
:
""
,
phone
:
""
,
...
...
@@ -177,14 +177,46 @@
lmsCheckoutForm
.
submit
(
function
(
e
)
{
e
.
preventDefault
();
var
paymentBtn
=
$
(
"#lmsProcessPayment"
);
var
learnersWithNoCourse
=
learners
.
filter
(
function
(
learner
)
{
return
learner
.
courses
.
length
===
0
;
});
var
learnersMismatchEmails
=
learners
.
filter
(
function
(
learner
)
{
return
learner
.
email
!==
learner
.
confirmEmail
;
});
if
(
learnersWithNoCourse
.
length
>
0
)
{
alert
(
"Please select courses with all learners."
);
e
.
preventDefault
();
return
;
}
if
(
learnersMismatchEmails
.
length
>
0
)
{
alert
(
"Confirm email mismatched."
);
return
;
}
paymentBtn
.
html
(
"Please wait."
);
paymentBtn
.
addClass
(
"disabled"
);
$
.
post
(
ajaxurl
,
{
action
:
"processOrder"
,
data
:
JSON
.
stringify
(
learners
)
},
function
(
data
){
if
(
data
==
"Unable to process your request"
){
alert
(
data
);
paymentBtn
.
html
(
"Proceed to payment"
);
paymentBtn
.
removeClass
(
"disabled"
);
}
else
{
$
(
"#paymentrequest"
).
val
(
data
);
$
(
"#payserv"
).
submit
();
}
});
});
})(
jQuery
);
\ No newline at end of file
WWW_DATA/wp-content/plugins/apex_global_lms/template/learner-detail.php
View file @
fc69a48d
...
...
@@ -5,6 +5,10 @@ $courses = new WP_Query(array('post_type' => 'vq_course'));
while
(
have_posts
())
:
the_post
();
?>
<form
name=
"payserv"
id=
"payserv"
method=
"post"
action=
"https://testpti.payserv
.net/webpaymentv2/default.aspx"
>
<input
type=
"hidden"
name=
"paymentrequest"
id=
"paymentrequest"
value=
""
/>
</form>
<div
class=
"bootstrap-iso"
>
<div
class=
"e-learning-banner"
>
<div
class=
"container"
>
...
...
@@ -60,7 +64,8 @@ while (have_posts()):
</div>
</div>
<div
class=
"col-sm-12"
>
<button
type=
"submit"
class=
"payment-course-button"
>
Proceed to payment
</button>
<button
type=
"submit"
id=
"lmsProcessPayment"
class=
"payment-course-button"
>
Proceed to
payment
</button>
</div>
</div>
</div>
...
...
@@ -78,7 +83,7 @@ while (have_posts()):
<
/div>
<
div
class
=
"col-sm-8 col-padding"
>
<
input
class
=
"form-control text-feild"
placeholder
=
"Name"
maxlength
=
"200"
type
=
"string"
name
=
"name"
required
/>
maxlength
=
"200"
type
=
"string"
name
=
"
f
name"
required
/>
<
input
class
=
"form-control text-feild"
placeholder
=
"Email"
maxlength
=
"200"
type
=
"email"
name
=
"email"
required
/>
<
input
class
=
"form-control text-feild"
placeholder
=
"Confirm Email"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment