diff options
-rwxr-xr-x | pdf/cert_new.inc | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/pdf/cert_new.inc b/pdf/cert_new.inc index d16f425..5ea85db 100755 --- a/pdf/cert_new.inc +++ b/pdf/cert_new.inc @@ -7,14 +7,15 @@ function generate_pdf() global $user; $x = $user->uid; $proposal_id = arg(3); - $query2 = db_query("SELECT id FROM dwsim_flowsheet_proposal WHERE approval_status=3 AND uid= :uid", array( - ':uid' => $user->uid + $query3 = db_query("SELECT * FROM dwsim_flowsheet_proposal WHERE approval_status=3 AND uid= :uid AND id=:proposal_id", array( + ':uid' => $user->uid, + ':proposal_id'=>$proposal_id )); - $data2 = $query2->fetchObject(); - $query3 = db_query("SELECT * FROM dwsim_flowsheet_proposal WHERE approval_status=3 AND uid= :uid", array( + $data3 = $query3->fetchObject(); + /*$query3 = db_query("SELECT * FROM dwsim_flowsheet_proposal WHERE approval_status=3 AND uid= :uid", array( ':uid' => $user->uid )); - $data3 = $query3->fetchObject(); + $data3 = $query3->fetchObject();*/ if($data3){ if($data3->uid != $x){ drupal_set_message('Certificate is not available','error'); @@ -216,7 +217,7 @@ function generate_pdf() } //!feof($fp) fclose($fp); unlink($file); - drupal_goto('flowsheeting-project/certificates'); + drupal_goto('flowsheeting-project/certificate'); return; } function generateRandomString($length = 5) |