summaryrefslogtreecommitdiff
path: root/pdf/list_mentor_certificates.inc
diff options
context:
space:
mode:
authorSaketh14992021-07-27 10:13:41 +0530
committerSaketh14992021-07-27 10:13:41 +0530
commitd5760603472a1a4f07acdda1ef44f8115a8bc269 (patch)
treeb836d6b1986bd99d55e86c1edd7dd6607c97852f /pdf/list_mentor_certificates.inc
parent21cfc2425884841b69969a6cddccd5201f053808 (diff)
downloadesim_lab_migration-d5760603472a1a4f07acdda1ef44f8115a8bc269.tar.gz
esim_lab_migration-d5760603472a1a4f07acdda1ef44f8115a8bc269.tar.bz2
esim_lab_migration-d5760603472a1a4f07acdda1ef44f8115a8bc269.zip
Certificate generation
Diffstat (limited to 'pdf/list_mentor_certificates.inc')
-rwxr-xr-xpdf/list_mentor_certificates.inc54
1 files changed, 54 insertions, 0 deletions
diff --git a/pdf/list_mentor_certificates.inc b/pdf/list_mentor_certificates.inc
new file mode 100755
index 0000000..1a818b3
--- /dev/null
+++ b/pdf/list_mentor_certificates.inc
@@ -0,0 +1,54 @@
+<?php
+function _list_lab_migration_custom_certificates()
+{
+ global $user;
+ $query_id = db_query("SELECT id FROM lab_migration_proposal WHERE approval_status=3");
+ $exist_id = $query_id->fetchObject();
+ if ($exist_id){
+ if ($exist_id->id) {
+ if ($exist_id->id < 3) {
+ drupal_set_message('<strong>There are no proposals with mentors</strong>', 'status');
+ return '';
+ } //$exist_id->id < 3
+ else {
+ $search_rows = array();
+ global $output;
+ $output = '';
+ $query3 = db_query("SELECT id,project_guide_name,project_title FROM lab_migration_proposal WHERE project_guide_name != '' AND approval_status=3");
+ $i = 1;
+ while ($search_data3 = $query3->fetchObject()) {
+ $search_rows[] = array(
+ $i,
+ $search_data3->project_title,
+ $search_data3->project_guide_name,
+ l('Download Certificate', 'circuit-simulation-project/certificates-custom/pdf/' . $search_data3->id)
+ );
+ $i++;
+ //$search_data3->id
+ } //$search_data3 = $query3->fetchObject()
+ if ($search_rows) {
+ $search_header = array(
+ 'No',
+ 'Project Title',
+ 'Project Guide Name',
+ 'Download Certificates'
+ );
+ $output = theme('table', array(
+ 'header' => $search_header,
+ 'rows' => $search_rows
+ ));
+ return $output;
+ } //$search_rows
+ else {
+ echo ("Error");
+ return '';
+ }
+ }
+ }
+ } //$exist_id->id
+ else {
+ drupal_set_message('<strong>There are no proposals with mentors</strong>', 'status');
+ $page_content = "<span style='color:red;'> No certificate available </span>";
+ return $page_content;
+ }
+}