diff options
author | Sashi20 | 2019-09-25 14:51:15 +0530 |
---|---|---|
committer | GitHub | 2019-09-25 14:51:15 +0530 |
commit | 66b1ce4c97e63924108f8d32fe879e9d00f36f82 (patch) | |
tree | 6837361738e4495a3bae10a670b0e6cee23c728e /pdf/list_pssp_certificate.inc | |
parent | e15cba53d7ee02f69d18ce40f460505d11102227 (diff) | |
parent | d4d9b75c2b78362eb05a6fbd288acc855ec3ec0b (diff) | |
download | om_pssp-66b1ce4c97e63924108f8d32fe879e9d00f36f82.tar.gz om_pssp-66b1ce4c97e63924108f8d32fe879e9d00f36f82.tar.bz2 om_pssp-66b1ce4c97e63924108f8d32fe879e9d00f36f82.zip |
Merge pull request #10 from Sashi20/master
Interface to download certificate, download abstract file in status interface
Diffstat (limited to 'pdf/list_pssp_certificate.inc')
-rwxr-xr-x | pdf/list_pssp_certificate.inc | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/pdf/list_pssp_certificate.inc b/pdf/list_pssp_certificate.inc new file mode 100755 index 0000000..faa9406 --- /dev/null +++ b/pdf/list_pssp_certificate.inc @@ -0,0 +1,56 @@ +<?php +function _list_pssp_certificates() +{ + global $user; + $query_id = db_query("SELECT id FROM om_pssp_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 < 1) { + drupal_set_message('<strong>You need to propose a <a href="https://om.fossee.in/powersystems/pssp/proposal">Power System Simulation Proposal</a></strong> or if you have already proposed then your proposal 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('<strong>You need to propose a <a href="https://om.fossee.in/powersystems/pssp/proposal">OpenModelica Power System Simulation Proposal</a></strong> or if you have already proposed then your proposal is under reviewing process', 'status'); + $page_content = "<span style='color:red;'> No certificate available </span>"; + return $page_content; + } +} |