From 0eb99d537d4179c7c4211600b58adb59d97f0d61 Mon Sep 17 00:00:00 2001 From: Sashi20 Date: Wed, 7 Aug 2019 12:36:30 +0530 Subject: Enable link to download certificate --- pdf/list_pssp_certificate.inc | 56 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100755 pdf/list_pssp_certificate.inc (limited to 'pdf/list_pssp_certificate.inc') diff --git a/pdf/list_pssp_certificate.inc b/pdf/list_pssp_certificate.inc new file mode 100755 index 0000000..4475bdb --- /dev/null +++ b/pdf/list_pssp_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 < 1) { + drupal_set_message('You need to propose a Power System Simulation Proposal or if you have already proposed then your Flowsheet is under reviewing process', 'status'); + return ''; + } //$exist_id->id < 3 + else { + $search_rows = array(); + global $output; + $output = ''; + $query3 = db_query("SELECT id,project_title,contributor_name FROM om_pssp_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->project_title, + $search_data3->contributor_name, + l('Download Certificate', 'powersystems/pssp/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 OpenModelica Power System Simulation Proposal or if you have already proposed then your Flowsheet is under reviewing process', 'status'); + $page_content = " No certificate available "; + return $page_content; + } +} -- cgit From a7dbb1721bb47ba21f9cdd5fe2962516a45caa42 Mon Sep 17 00:00:00 2001 From: Sashi20 Date: Wed, 7 Aug 2019 18:10:23 +0530 Subject: Modify url displayed in error message --- pdf/list_pssp_certificate.inc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'pdf/list_pssp_certificate.inc') diff --git a/pdf/list_pssp_certificate.inc b/pdf/list_pssp_certificate.inc index 4475bdb..faa9406 100755 --- a/pdf/list_pssp_certificate.inc +++ b/pdf/list_pssp_certificate.inc @@ -10,7 +10,7 @@ function _list_pssp_certificates() if ($exist_id){ if ($exist_id->id) { if ($exist_id->id < 1) { - drupal_set_message('You need to propose a Power System Simulation Proposal or if you have already proposed then your Flowsheet is under reviewing process', 'status'); + drupal_set_message('You need to propose a Power System Simulation Proposal or if you have already proposed then your proposal is under reviewing process', 'status'); return ''; } //$exist_id->id < 3 else { @@ -49,7 +49,7 @@ function _list_pssp_certificates() } } //$exist_id->id else { - drupal_set_message('You need to propose a OpenModelica Power System Simulation Proposal or if you have already proposed then your Flowsheet is under reviewing process', 'status'); + drupal_set_message('You need to propose a OpenModelica Power System Simulation Proposal or if you have already proposed then your proposal is under reviewing process', 'status'); $page_content = " No certificate available "; return $page_content; } -- cgit