diff options
Diffstat (limited to 'proposals_review_tab.inc')
-rwxr-xr-x[-rw-r--r--] | proposals_review_tab.inc | 35 |
1 files changed, 30 insertions, 5 deletions
diff --git a/proposals_review_tab.inc b/proposals_review_tab.inc index fe74640..69bbcf9 100644..100755 --- a/proposals_review_tab.inc +++ b/proposals_review_tab.inc @@ -98,18 +98,21 @@ function dwsim_flowsheet_uploaded_tab() function dwsim_flowsheet_completed_tab_form($form, $form_state) { - + $options_first = _flowsheet_details_year_wise(); + $selected = isset($form_state['values']['howmany_select']) ? $form_state['values']['howmany_select'] : key($options_first); + $form = array(); $form['howmany_select'] = array( - '#title' => t('Sorting projects according to year:'), + '#title' => t('Sorting projects according to year:'), '#type' => 'select', - '#options' => array( + '#options' => _flowsheet_details_year_wise(), + /*'#options' => array( 'Please select...' => 'Please select...', '2017' => '2017', '2018' => '2018', '2019' => '2019', '2020' => '2020', - '2021' => '2021'), - //'#default_value' => 'Please select...', + '2021' => '2021'),*/ + '#default_value' => $selected, '#ajax' => array( 'callback' => 'ajax_example_autocheckboxes_callback', ), @@ -143,9 +146,31 @@ function ajax_example_autocheckboxes_callback($form, $form_state) } +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 ORDER BY Year ASC"); + + /*$query = db_select('dwsim_flowsheet_proposal'); + $query->fields('dwsim_flowsheet_proposal'); + $query->condition('from_unixtime(actual_completion_date)'); + $query->condition('approval_status', 3);*/ + //$query->orderBy('id', 'DESC'); + //$year_wise_list = $query->execute(); + while ($year_wise_list_data = $result->fetchObject()) + { + $flowsheet_years[$year_wise_list_data->Year] = $year_wise_list_data->Year; + } + return $flowsheet_years; + } + + function _flowsheet_details($flowsheet_proposal_id) { $output = ""; + //$output = "Click <a href='/flowsheeting-project/download-proposals-all'>here</a> to download the Proposals of the participants <br>"; $result = db_query("SELECT * from {dwsim_flowsheet_proposal} WHERE approval_status = 3 and from_unixtime(actual_completion_date, '%Y') = :year", array( ':year' => $flowsheet_proposal_id) |