diff options
-rwxr-xr-x | download.inc | 53 | ||||
-rwxr-xr-x[-rw-r--r--] | proposals_review_tab.inc | 2 |
2 files changed, 39 insertions, 16 deletions
diff --git a/download.inc b/download.inc index c33084d..790d45a 100755 --- a/download.inc +++ b/download.inc @@ -308,7 +308,7 @@ function dwsim_flowsheet_download_proposals() { $root_path = dwsim_flowsheet_path(); - $result = db_query("SELECT e.contributor_name as Contirbutor_Name, u.mail as Email_ID, e.project_title as Title, e.contact_no as Contact, e.university as University, from_unixtime(creation_date,'%d-%m-%Y') as creation, from_unixtime(approval_date,'%d-%m-%Y') as approval, from_unixtime(actual_completion_date,'%d-%m-%Y') as Year, e.approval_status as Status FROM dwsim_flowsheet_proposal as e JOIN users as u ON e.uid = u.uid WHERE e.approval_status=3 ORDER BY actual_completion_date DESC"); + $result = db_query("SELECT e.contributor_name as contirbutor_name, u.mail as email_id, e.project_title as title, e.contact_no as contact, e.university as university, from_unixtime(creation_date,'%d-%m-%Y') as creation, from_unixtime(approval_date,'%d-%m-%Y') as approval, from_unixtime(actual_completion_date,'%d-%m-%Y') as year, e.approval_status as status FROM dwsim_flowsheet_proposal as e JOIN users as u ON e.uid = u.uid ORDER BY actual_completion_date DESC"); //var_dump($result->rowCount());die(); //$all_proposals_q = $result->execute(); @@ -327,23 +327,46 @@ function dwsim_flowsheet_download_proposals() 'Status of the proposal' ); fputcsv($fp, $items); - while($row = $result->fetchObject()) { - if($row->Status == 3){ - $Status = "Completed"; - } - else{ - $Status = "Proposal In Progress"; - } + while($row = $result->fetchObject()) + { + $status = ''; + switch ($row->status) + { + case 0: + $status = 'Pending'; + break; + case 1: + $status = 'Approved'; + break; + case 2: + $status = 'Dis-approved'; + break; + case 3: + $status = 'Completed'; + break; + default: + $status = 'Unknown'; + break; + } //$row->status + if ($row->year == 0) + { + $year = "Not Completed"; + } //$row->year == 0 + else + { + $year = date('d-m-Y', $row->year); + } + $items = array( - $row->Contirbutor_Name, - $row->Email_ID, - $row->Title, - $row->University, - $row->Contact, + $row->contirbutor_name, + $row->email_id, + $row->title, + $row->university, + $row->contact, $row->creation, $row->approval, - $row->Year, - $Status + $row->year, + $status ); fputcsv($fp, $items); } diff --git a/proposals_review_tab.inc b/proposals_review_tab.inc index bccb440..7584a6e 100644..100755 --- a/proposals_review_tab.inc +++ b/proposals_review_tab.inc @@ -151,7 +151,7 @@ function _flowsheet_details_year_wise() $flowsheet_years = array( '0' => 'Please select...' ); - $result = db_query("SELECT from_unixtime(actual_completion_date, '%Y ') as Year from dwsim_flowsheet_proposal WHERE approval_status = 3"); + $result = db_query("SELECT from_unixtime(actual_completion_date, '%Y ') as Year from dwsim_flowsheet_proposal WHERE approval_status = 3 ORDER BY Year ASC"); /*$query = db_select('dwsim_flowsheet_proposal'); $query->fields('dwsim_flowsheet_proposal'); |