function student_search_search_form_submit

7.x student_search.module student_search_search_form_submit($form, $form_state)
6.x student_search.module student_search_search_form_submit($form, $form_state)

File

modules/student_search/student_search.module, line 963

Code

function student_search_search_form_submit($form, $form_state) {


  if (@$form_state ['values']['reset_btn'] != "") {
    unset($_SESSION ["student_search_for"]);
    unset($_SESSION ["last_student_selected"]);
    unset($_SESSION ["student_search_major_code"]);
    unset($_SESSION ["student_search_search_options"]);
    return;
  }


  // Special for the search options (checkboxes).  If none are checked, then
  // set it to _none=_none.  This fixes a bug where checking to see if it isset() was always failing.
  if (@$form_state ['values']['search_options'] == '') {
    $form_state ['values']['search_options'] = array('_none' => '_none');
  }


  // Save values in session for next time.  
  $_SESSION ["student_search_for"] = @$form_state ['values']['search_for'];
  $_SESSION ["student_search_major_code"] = @$form_state ['values']['major_code'];
  $_SESSION ["student_search_search_options"] = @$form_state ['values']['search_options'];

  fp_goto('student-search/search', 'did_search=true');

}