From d5760603472a1a4f07acdda1ef44f8115a8bc269 Mon Sep 17 00:00:00 2001 From: Saketh1499 Date: Tue, 27 Jul 2021 10:13:41 +0530 Subject: Certificate generation --- pdf/list_lab_migration_certificate.inc | 56 ++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100755 pdf/list_lab_migration_certificate.inc (limited to 'pdf/list_lab_migration_certificate.inc') 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 @@ + $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('You need to propose a Lab Migration Proposal 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('You need to propose a Lab Migration Proposal or if you have already proposed then your Lab Migration is under reviewing process', 'status'); + $page_content = " No certificate available "; + return $page_content; + } +} -- cgit