summaryrefslogtreecommitdiff
path: root/pdf/list_flowsheet_certificate.inc
diff options
context:
space:
mode:
authorPrashant S2017-10-31 15:16:55 +0530
committerGitHub2017-10-31 15:16:55 +0530
commit90a57117bda3f6035042d24da3d400b66c6b010e (patch)
treef3497e8d06120fcfb41dd5cbd1ee6e30fc5b8306 /pdf/list_flowsheet_certificate.inc
parentdbcdb5525b5307a2668b32cbed318d554dc8ee3d (diff)
parentac973c330462705fd7150808c66ff65fece7bc3f (diff)
downloadesim_circuit_simulation_project_module-master.tar.gz
esim_circuit_simulation_project_module-master.tar.bz2
esim_circuit_simulation_project_module-master.zip
Merge pull request #2 from Sashi20/drupal_7.xHEADmaster
Drupal 7.x
Diffstat (limited to 'pdf/list_flowsheet_certificate.inc')
-rwxr-xr-xpdf/list_flowsheet_certificate.inc55
1 files changed, 55 insertions, 0 deletions
diff --git a/pdf/list_flowsheet_certificate.inc b/pdf/list_flowsheet_certificate.inc
new file mode 100755
index 0000000..41da56f
--- /dev/null
+++ b/pdf/list_flowsheet_certificate.inc
@@ -0,0 +1,55 @@
+<?php
+function _list_flowsheet_certificates()
+{
+ global $user;
+ $query_id = db_query("SELECT id FROM dwsim_flowsheet_proposal WHERE approval_status=3 AND uid= :uid", array(
+ ':uid' => $user->uid
+ ));
+ $exist_id = $query_id->fetchObject();
+ if ($exist_id){
+ if ($exist_id->id) {
+ if ($exist_id->id < 3) {
+ drupal_set_message('<strong>You need to propose a flowsheet <a href="http://dwsim.fossee.in/flowsheeting-project/proposal">Flowsheet Proposal</a></strong> 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 dwsim_flowsheet_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', 'flowsheeting-project/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 flowsheet <a href="http://dwsim.fossee.in/flowsheeting-project/proposal">Flowsheet Proposal</a></strong> or if you have already proposed then your flowsheet is under reviewing process', 'status');
+ $page_content = "<span style='color:red;'> No certificate available </span>";
+ return $page_content;
+ }
+}