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
8c47c0a1
Commit
8c47c0a1
authored
Apr 03, 2018
by
jenkins
Browse files
Options
Browse Files
Download
Plain Diff
Merge Request accepted by jenkins build success
parents
c5cf41c6
7ad5f4fd
Pipeline
#435
failed with stage
in 0 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
51 additions
and
13 deletions
+51
-13
download-now.php
...content/plugins/apex_global_lms/template/download-now.php
+51
-13
No files found.
WWW_DATA/wp-content/plugins/apex_global_lms/template/download-now.php
View file @
8c47c0a1
<?php
<?php
function
set_html_content_type
(){
return
'text/html'
;
}
if
(
'POST'
===
$_SERVER
[
'REQUEST_METHOD'
]
&&
isset
(
$_POST
[
'download_submit'
]
)
&&
$_POST
[
'post_action'
]
===
'download-all'
)
{
if
(
'POST'
===
$_SERVER
[
'REQUEST_METHOD'
]
&&
isset
(
$_POST
[
'download_submit'
]
)
&&
$_POST
[
'post_action'
]
===
'download-all'
)
{
$fname
=
$_POST
[
'dl_firstName'
];
$fname
=
$_POST
[
'dl_firstName'
];
$lname
=
$_POST
[
'dl_lastName'
];
$lname
=
$_POST
[
'dl_lastName'
];
...
@@ -18,12 +22,24 @@ if ( 'POST' === $_SERVER['REQUEST_METHOD'] && isset( $_POST['download_submit'] )
...
@@ -18,12 +22,24 @@ if ( 'POST' === $_SERVER['REQUEST_METHOD'] && isset( $_POST['download_submit'] )
$postContent
.=
'<strong>Job Title: '
.
$jobTitle
.
'</strong><br>'
;
$postContent
.=
'<strong>Job Title: '
.
$jobTitle
.
'</strong><br>'
;
$postContent
.=
'<strong>Country: '
.
$country
.
'</strong><br>'
;
$postContent
.=
'<strong>Country: '
.
$country
.
'</strong><br>'
;
$courseName
=
array
();
$courseName
=
array
();
foreach
(
$dlCourses
as
$course
)
{
$courses
=
new
WP_Query
(
array
(
'post_type'
=>
'vq_course'
)
);
while
(
$courses
->
have_posts
()
)
{
$courses
->
the_post
();
foreach
(
$dlCourses
as
$catx
)
{
if
(
$course
==
get_the_ID
()
)
{
$courseName
[]
=
get_the_title
();
$course_cat
=
get_terms
(
array
(
'taxonomy'
=>
'vq_course_taxonomy'
,
'parent'
=>
0
,
'hide_empty'
=>
false
,
));
foreach
(
$course_cat
as
$cat
){
$id_cat
=
$cat
->
term_id
;
if
(
$catx
==
$id_cat
)
{
$courseName
[]
=
$cat
->
name
;
}
}
}
}
}
}
...
@@ -35,6 +51,15 @@ if ( 'POST' === $_SERVER['REQUEST_METHOD'] && isset( $_POST['download_submit'] )
...
@@ -35,6 +51,15 @@ if ( 'POST' === $_SERVER['REQUEST_METHOD'] && isset( $_POST['download_submit'] )
'post_content'
=>
$postContent
'post_content'
=>
$postContent
);
);
$to
=
$_POST
[
'dl_email'
];
$subject
=
"Download Confirmation"
;
$body
=
''
;
$body
.=
$postContent
;
add_filter
(
'wp_mail_content_type'
,
'set_html_content_type'
);
wp_mail
(
$to
,
$subject
,
$body
);
remove_filter
(
'wp_mail_content_type'
,
'set_html_content_type'
);
$pid
=
wp_insert_post
(
$newDownloadRequest
);
$pid
=
wp_insert_post
(
$newDownloadRequest
);
update_post_meta
(
$pid
,
'dl_firstName'
,
$fname
);
update_post_meta
(
$pid
,
'dl_firstName'
,
$fname
);
...
@@ -54,7 +79,13 @@ get_header();
...
@@ -54,7 +79,13 @@ get_header();
$page
=
get_page_by_path
(
'download-all'
);
$page
=
get_page_by_path
(
'download-all'
);
$settings
=
$options
=
get_option
(
'vq_lms_settings_options'
);
$settings
=
$options
=
get_option
(
'vq_lms_settings_options'
);
$video
=
$settings
[
'vq_lms_settings_field_video'
];
$video
=
$settings
[
'vq_lms_settings_field_video'
];
$courses
=
new
WP_Query
(
array
(
'post_type'
=>
'vq_course'
)
);
//$courses = new WP_Query( array( 'post_type' => 'vq_course' ) );
$course_cats
=
get_terms
(
array
(
'taxonomy'
=>
'vq_course_taxonomy'
,
'parent'
=>
0
,
'hide_empty'
=>
false
,
));
$selected_id
=
isset
(
$_GET
[
'course'
]
)
?
$_GET
[
'course'
]
:
-
1
;
$selected_id
=
isset
(
$_GET
[
'course'
]
)
?
$_GET
[
'course'
]
:
-
1
;
?>
?>
...
@@ -360,16 +391,23 @@ $selected_id = isset( $_GET['course'] ) ? $_GET['course'] : - 1;
...
@@ -360,16 +391,23 @@ $selected_id = isset( $_GET['course'] ) ? $_GET['course'] : - 1;
</div>
</div>
<div
class=
"col-md-12 form-group"
>
<div
class=
"col-md-12 form-group"
>
<select
class=
"form-control chosen-select"
name=
"dl_course[]"
multiple
<select
class=
"form-control chosen-select"
name=
"dl_course[]"
multiple
data-placeholder=
"Select Courses"
id=
"dl_crs"
required
>
data-placeholder=
"Select Course
Categorie
s"
id=
"dl_crs"
required
>
<?php
<?php
while
(
$courses
->
have_posts
()
)
{
$courses
->
the_post
();
foreach
(
$course_cats
as
$term
)
{
$meta
=
''
;
$idx
=
$term
->
term_id
;
$meta
=
get_term_meta
(
$idx
,
'vq_course_ct_tax_redirect'
,
true
);
if
(
!
empty
(
$meta
)){
?>
?>
<option
value=
"
<?php
the_ID
();
?>
"
<?php
if
(
get_the_ID
()
==
$selected_id
)
{
<option
value=
"
<?php
echo
$term
->
term_id
;
?>
"
<?php
if
(
$term
->
term_id
==
$selected_id
)
{
echo
' selected'
;
echo
' selected'
;
}
?>
>
<?php
the_title
()
;
?>
</option>
}
?>
>
<?php
echo
$term
->
name
;
?>
</option>
<?php
<?php
}
}
}
$page
=
get_page_by_path
(
'download-all'
);
$page
=
get_page_by_path
(
'download-all'
);
?>
?>
</select>
</select>
...
...
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