diff options
author | Sashi20 | 2021-08-10 16:25:28 +0530 |
---|---|---|
committer | GitHub | 2021-08-10 16:25:28 +0530 |
commit | e549abedacf81fecdaf7fe5c2dff95b4fb437cae (patch) | |
tree | e99fa42cd83b454c53501a9539970460c27bd156 /pdf/list_lab_migration_certificate.inc | |
parent | 21cfc2425884841b69969a6cddccd5201f053808 (diff) | |
parent | 2ea5fde67291c53e48cdd081d4e572defcf6a4cf (diff) | |
download | esim_lab_migration-e549abedacf81fecdaf7fe5c2dff95b4fb437cae.tar.gz esim_lab_migration-e549abedacf81fecdaf7fe5c2dff95b4fb437cae.tar.bz2 esim_lab_migration-e549abedacf81fecdaf7fe5c2dff95b4fb437cae.zip |
Merge pull request #1 from Saketh1499/developement
Certificate generation
Diffstat (limited to 'pdf/list_lab_migration_certificate.inc')
-rwxr-xr-x | pdf/list_lab_migration_certificate.inc | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/pdf/list_lab_migration_certificate.inc b/pdf/list_lab_migration_certificate.inc new file mode 100755 index 0000000..e9d2cce --- /dev/null +++ b/pdf/list_lab_migration_certificate.inc @@ -0,0 +1,56 @@ +<?php +function _list_lab_migration_certificates() +{ + global $user; + $query_id = db_query("SELECT id FROM lab_migration_proposal WHERE approval_status=3 AND uid= :uid", array( + ':uid' => $user->uid + )); + $exist_id = $query_id->fetchObject(); + //var_dump($exist_id->id);die; + if ($exist_id){ + if ($exist_id->id) { + if ($exist_id->id < 2) { + drupal_set_message('<strong>You need to propose a <a href="https://esim.fossee.in/lab-migration-project/proposal">Lab Migration Proposal</a></strong> or if you have already proposed then your Lab Migration is under reviewing process', 'status'); + return ''; + } //$exist_id->id < 3 + else { + $search_rows = array(); + global $output; + $output = ''; + $query3 = db_query("SELECT id,lab_title,name FROM lab_migration_proposal WHERE approval_status=3 AND uid= :uid", array( + ':uid' => $user->uid + )); + while ($search_data3 = $query3->fetchObject()) { + if ($search_data3->id) { + $search_rows[] = array( + $search_data3->lab_title, + $search_data3->name, + l('Download Certificate', 'lab_migration/certificates/generate-pdf/' . $search_data3->id) + ); + } //$search_data3->id + } //$search_data3 = $query3->fetchObject() + if ($search_rows) { + $search_header = array( + 'Project Title', + 'Contributor 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>You need to propose a <a href="https://esim.fossee.in/lab-migration-project/proposal">Lab Migration Proposal</a></strong> or if you have already proposed then your Lab Migration is under reviewing process', 'status'); + $page_content = "<span style='color:red;'> No certificate available </span>"; + return $page_content; + } +} |