'ferpa_waiver/view', 'title' => t('FERPA Waiver Info'), 'description' => t('FERPA Waiver Information'), 'type' => MENU_NORMAL_ITEM, 'callback' => 'ferpa_waiver_page', 'access' => user_access('view FERPA info') ); } return $items; } /** * Implementation of hook_perm(). */ function ferpa_waiver_perm() { return array('view FERPA info'); } /** * Get my data from the DB. */ function ferpa_waiver_detail() { if (user_access('view FERPA info')) { $dbConnect = mssql_connect_estab($conn); $pid = ldap_pbu_id_get_id(); $sql = "select a.address_line_3 as contact_person, a.address_line_1 as address_line_1, a.address_line_2 as address_line_2, a.city as city, a.state as state, a.zip_code as zipcode, a.email_address as email_address, a.evening_phone as evening_phone, a.day_phone as day_phone, a.main_fax as main_fax from addressschedule a where a.people_org_code_id= 'P{$pid}' and a.address_type LIKE 'FRP%' and a.status='A'"; $result = mssql_query($sql); if(!mssql_num_rows($result)) { drupal_set_message(t('ERROR: No FERPA File on File for you.'), 'error'); } else { $content .= theme('ferpa_waiver_detail', $result); //mssql_close($conn); } return $content; } } /** * Page to support the form */ function ferpa_waiver_page() { $output .= t('
This is my data
'); $output .= drupal_get_form('ferpa_waiver_search_form'); return $output; } /** * Implemetation of form API * */ function ferpa_waiver_search_form() { $form['studentname'] = array( '#title' = t('Student'), '#type' => 'textfield', '#description' => t('Enter a student name to search'), ); return $form; } /** * Form actions go here. */ function ferpa_waiver_search_form_submit($form, $form_values) { $dbConnect = mssql_connect_estab($conn); $sqlS = "SELECT p.last_name, p.first_name, p.people_id FROM people p WHERE p.last_name='{$form_values['studentname']}' or p.first_name='{$form_values['studentname']}'"; $resultS = mssql_query($sqlS); if(!mssql_num_rows($resultS) OR empty($resultS)) { $output = '