summaryrefslogtreecommitdiff
path: root/pdf/list_case_study_certificate.inc
diff options
context:
space:
mode:
authorSashi202019-02-27 13:20:08 +0530
committerSashi202019-02-27 13:20:08 +0530
commitbafb3b9680925abcc0a0d997cde37b7cb5c62b26 (patch)
tree52d146f7aa29deca45598519fde33588b3af1bd8 /pdf/list_case_study_certificate.inc
parenta9d20d02f3cb94dcaa662c8fa4ecd2cc5183bf41 (diff)
downloadcfd_case_study-bafb3b9680925abcc0a0d997cde37b7cb5c62b26.tar.gz
cfd_case_study-bafb3b9680925abcc0a0d997cde37b7cb5c62b26.tar.bz2
cfd_case_study-bafb3b9680925abcc0a0d997cde37b7cb5c62b26.zip
Made certificates available for case study project
Diffstat (limited to 'pdf/list_case_study_certificate.inc')
-rwxr-xr-xpdf/list_case_study_certificate.inc56
1 files changed, 56 insertions, 0 deletions
diff --git a/pdf/list_case_study_certificate.inc b/pdf/list_case_study_certificate.inc
new file mode 100755
index 0000000..d041966
--- /dev/null
+++ b/pdf/list_case_study_certificate.inc
@@ -0,0 +1,56 @@
+<?php
+function _list_case_study_certificates()
+{
+ global $user;
+ $query_id = db_query("SELECT id FROM case_study_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/case-study-project/proposal">Case Study Proposal</a></strong> or if you have already proposed then your Case Study 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 case_study_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', 'case-study-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 <a href="https://esim.fossee.in/case-study-project/proposal">Case Study Proposal</a></strong> or if you have already proposed then your Case Study is under reviewing process', 'status');
+ $page_content = "<span style='color:red;'> No certificate available </span>";
+ return $page_content;
+ }
+}