summaryrefslogtreecommitdiff
path: root/pdf/list_custom_model_certificate.inc
diff options
context:
space:
mode:
authorSashi202021-03-15 15:55:05 +0530
committerGitHub2021-03-15 15:55:05 +0530
commit44f5bb01da3bcd87c6fe94b8ee29012338087ccf (patch)
tree19fd982b557648aa999df551e8eaf354cc7aa3c3 /pdf/list_custom_model_certificate.inc
parente92f4e6edab823292a923c39bb4cce2e46488e6b (diff)
parentdc64743422ea56fc0614940cb17219549999eb0a (diff)
downloaddwsim_custom_model-44f5bb01da3bcd87c6fe94b8ee29012338087ccf.tar.gz
dwsim_custom_model-44f5bb01da3bcd87c6fe94b8ee29012338087ccf.tar.bz2
dwsim_custom_model-44f5bb01da3bcd87c6fe94b8ee29012338087ccf.zip
Merge pull request #8 from Saketh1499/development
Generating certificates for completed projects
Diffstat (limited to 'pdf/list_custom_model_certificate.inc')
-rwxr-xr-xpdf/list_custom_model_certificate.inc57
1 files changed, 57 insertions, 0 deletions
diff --git a/pdf/list_custom_model_certificate.inc b/pdf/list_custom_model_certificate.inc
new file mode 100755
index 0000000..eb735b3
--- /dev/null
+++ b/pdf/list_custom_model_certificate.inc
@@ -0,0 +1,57 @@
+<?php
+function _list_custom_model_certificates()
+{
+ global $user;
+ $query_id = db_query("SELECT id FROM custom_model_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 <a href="https://dwsim.fossee.in/custom-model/proposal">Custom Model Project</a></strong>. If you have already proposed then you Custom Model 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 custom_model_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', 'custom-model/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://dwsim.fossee.in/custom-model/proposal">Custom Model Project</a></strong>. If you have already proposed then you Custom Model is under reviewing process', 'status');
+ $page_content = "<span style='color:red;'> No certificate available </span>";
+ return $page_content;
+ }
+}
+
+