diff options
author | prashant | 2015-03-27 17:27:37 +0530 |
---|---|---|
committer | prashant | 2015-03-27 17:27:37 +0530 |
commit | 80213cecf41ede861bffbf1370185d20d672ceba (patch) | |
tree | d4a63d10dc4e907c35c8b708d9d66ba430b88368 /pdf/temp.inc | |
download | DWSIM_textbook_companion-80213cecf41ede861bffbf1370185d20d672ceba.tar.gz DWSIM_textbook_companion-80213cecf41ede861bffbf1370185d20d672ceba.tar.bz2 DWSIM_textbook_companion-80213cecf41ede861bffbf1370185d20d672ceba.zip |
initial commit
Diffstat (limited to 'pdf/temp.inc')
-rwxr-xr-x | pdf/temp.inc | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/pdf/temp.inc b/pdf/temp.inc new file mode 100755 index 0000000..4e46946 --- /dev/null +++ b/pdf/temp.inc @@ -0,0 +1,58 @@ +$pending_rows = array(); + $pending_q = db_query("SELECT * FROM {textbook_companion_proposal} WHERE proposal_status = 0 ORDER BY id DESC"); + while ($pending_data = db_fetch_object($pending_q)) + { + $pending_rows[$pending_data->id] = array(date('d-m-Y', $pending_data->creation_date), l($pending_data->full_name, 'user/' . $pending_data->uid), date('d-m-Y', $pending_data->completion_date), l('Approve', 'manage_proposal/approve/' . $pending_data->id) . ' | ' . l('Edit', 'manage_proposal/edit/' . $pending_data->id)); + } + + + + /* check if there are any pending proposals */ + if (!$pending_rows) + { + drupal_set_message(t('There are no pending proposals.'), 'status'); + return ''; + } + + + $pending_header = array('Date of Submission', 'Contributor Name', 'Date of Completion', 'Action'); + $output = theme_table($pending_header, $pending_rows); + return $output; + + + + + + + +global $user; + $uid1 = $user->uid; + + $query2 = db_query("SELECT * FROM {textbook_companion_proposal} WHERE proposal_status=3 AND uid=".$user->uid); + $data2 = db_fetch_object($query2); + if($data2->id) + { + $search_rows = array(); + $output = ''; + $query3 = db_query("SELECT * FROM textbook_companion_preference WHERE approval_status=1 AND proposal_id=".$data2->id); + + while ($search_data3 = db_fetch_object($query3)) + { + $search_rows[] = array($search_data3->id,$search_data3->proposal_id,$search_data3->book, l('Download Certificate', 'certificate/generate_pdf'.$search_data3->proposal_id)); + } + if ($search_rows) + { + $search_header = array('Id', 'Proposal Id', 'Book Name', 'Download Certificates'); + $output .= theme_table($search_header, $search_rows); + } + else + { + echo("Error"); + } + return $output; + } + else + { + echo("Book Still Under Review"); + }; + |