* @author Claire Figueras */ require("test_page.php"); require_once("class_db.php"); require_once("class_search.php"); if(!isset($_SESSION['where'])) { $_SESSION['where'] = array(); } if(!isset($_SESSION['format'])) { $_SESSION['format'] = array(); } $_SESSION['tablechoice'] = ""; $_SESSION['search'] = ""; $func = new functions(); $conn = new dbquery(); $conn->connect(); $search_obj = new search(); // load saved queries for the current user in an array $conn->query("select query_id, query_name from ".$_SESSION['tablename']['saved_queries']." where user_id = '".$_SESSION['user']['UserId']."'"); $queries = array(); while($res = $conn->fetch_object()) { array_push($queries, array('ID'=>$res->query_id, 'LABEL' => $res->query_name)); } $conn->query("select USER_ID, FIRSTNAME, LASTNAME, STATUS from ".$_SESSION['tablename']['users']." where ENABLED = 'Y' AND STATUS <> 'DEL' order by LASTNAME asc"); $users_list = array(); while($res = $conn->fetch_object()) { array_push($users_list, array('ID' => $res->USER_ID, 'NOM' => $res->LASTNAME, 'PRENOM' => $res->FIRSTNAME, 'STATUT' => $res->STATUS)); } //Check if web brower is ie_6 or not if (ereg("MSIE 6.0", $_SERVER["HTTP_USER_AGENT"])) { $browser_ie = 'true'; $class_for_form = 'form'; $hr = '
'; $size = ''; } elseif(eregi('msie', $_SERVER["HTTP_USER_AGENT"]) && !eregi('opera', $HTTP_USER_AGENT) ) { $browser_ie = 'true'; $class_for_form = 'forms'; $hr = ''; $size = ''; } else { $browser_ie = 'false'; $class_for_form = 'forms'; $hr = ''; $size = ''; // $size = 'style="width:40px;"'; } // building of the parameters array used to pre-load the category list and the search elements $param = array(); if($_SESSION['config']['corporate'] == "false") { //Address $arr_tmp = array(); for($i=0; $i < count($_SESSION['quartiers']); $i++) { array_push($arr_tmp, array('VALUE' => $_SESSION['quartiers'][$i], 'LABEL' => $_SESSION['quartiers'][$i])); } $arr_tmp3 = array('NUM' => array('LABEL' => _NUM, 'ID' => 'num'), 'ROAD' => array('LABEL' => _ROAD, 'ID' => 'rue'), 'CP' => array('LABEL' => _POSTAL_CODE, 'ID' => 'Cp'), 'CITY' => array('LABEL' => _CITY, 'ID' => 'ville'), 'DISTRICTS' => array('LABEL' => _DISTRICTS, 'ID' => 'quartier', 'default_label' =>addslashes( _CHOOSE_DISTRICT), 'options' => $arr_tmp) ); $arr_tmp2 = array('label' => _ADDRESS, 'type' => 'address', 'param' => array('field_label' => _ADDRESS, 'address_data' => $arr_tmp3)); $param['adress'] = $arr_tmp2; } // civility $arr_tmp = array(); for($i=0; $i < count($_SESSION['civilite']); $i++) { array_push($arr_tmp, array('VALUE' => $_SESSION['civilite'][$i], 'LABEL' => $_SESSION['civilite'][$i])); } $arr_tmp2 = array('label' => _CIVILITIES, 'type' => 'select_multiple', 'param' => array('field_label' => _CIVILITY, 'label_title' => _CHOOSE_CIVILITY_SEARCH_TITLE, 'id' => 'civ','options' => $arr_tmp)); $param['civilities'] = $arr_tmp2; //ingoing $arr_tmp = array(array('VALUE'=> 'inout', 'LABEL' =>_INGOING." "._AND." "._ONGOING), array('VALUE'=> 'in', 'LABEL' =>_INGOING), array('VALUE'=> 'out', 'LABEL' =>_ONGOING)); $arr_tmp2 = array('label' => _MAIL2, 'type' => 'select_simple', 'param' => array('field_label' => _MAIL2,'default_label' => '', 'options' => $arr_tmp)); $param['is_ingoing'] = $arr_tmp2; //Coming date $arr_tmp2 = array('label' => _DATE_START, 'type' => 'date_range', 'param' => array('field_label' => _DATE_START, 'id1' => 'date_start_from', 'id2' =>'date_start_to')); $param['date_start'] = $arr_tmp2; //Loaded date $arr_tmp2 = array('label' => _REG_DATE, 'type' => 'date_range', 'param' => array('field_label' => _REG_DATE, 'id1' => 'enr_from', 'id2' =>'enr_to')); $param['enr'] = $arr_tmp2; //Process date $arr_tmp2 = array('label' => _PROCESS_DATE, 'type' => 'date_range', 'param' => array('field_label' => _PROCESS_DATE, 'id1' => 'trait_from', 'id2' =>'trait_to')); $param['trait'] = $arr_tmp2; //Document date $arr_tmp2 = array('label' => _DOC_DATE, 'type' => 'date_range', 'param' => array('field_label' => _DOC_DATE, 'id1' => 'doc_date_from', 'id2' =>'doc_date_to')); $param['doc_date'] = $arr_tmp2; //Process limit date $arr_tmp2 = array('label' => _LIMIT_DATE_PROCESS, 'type' => 'date_range', 'param' => array('field_label' => _LIMIT_DATE_PROCESS, 'id1' => 'lim_date_from', 'id2' =>'lim_date_to')); $param['lim_date'] = $arr_tmp2; //destinataire /*$arr_tmp = array(); for($i=0; $i < count($users_list); $i++) { array_push($arr_tmp, array('VALUE' => $users_list[$i]['ID'], 'LABEL' => $users_list[$i]['NOM']." ".$users_list[$i]['PRENOM'])); } $arr_tmp2 = array('label' => _PROCESS_RECEIPT, 'type' => 'select_simple', 'param' => array('field_label' => _PROCESS_RECEIPT,'default_label' => addslashes(_CHOOSE_RECEIPT), 'options' => $arr_tmp)); $param['destinataire'] = $arr_tmp2; */ $arr_tmp = array(); for($i=0; $i < count($users_list); $i++) { array_push($arr_tmp, array('VALUE' => $users_list[$i]['ID'], 'LABEL' => $users_list[$i]['NOM']." ".$users_list[$i]['PRENOM'])); } $arr_tmp2 = array('label' => _PROCESS_RECEIPT, 'type' => 'select_multiple', 'param' => array('field_label' => _PROCESS_RECEIPT, 'label_title' => _CHOOSE_RECIPIENT_SEARCH_TITLE, 'id' => 'destinataire','options' => $arr_tmp)); $param['destinataire'] = $arr_tmp2; //shipper $arr_tmp = array(); for($i=0; $i < count($_SESSION['emetteur']); $i++) { array_push($arr_tmp, array('VALUE' => $_SESSION['emetteur'][$i]['NOM'], 'LABEL' => $_SESSION['emetteur'][$i]['NOM'])); } $arr_tmp3 = array(); array_push($arr_tmp3, array('ID' => 'shipper_lastname', 'LABEL' => _LASTNAME)); array_push($arr_tmp3, array('ID' => 'shipper_firstname', 'LABEL' => _FIRSTNAME)); array_push($arr_tmp3, array('ID' => 'shipper_society', 'LABEL' => _SOCIETY)); array_push($arr_tmp3, array('ID' => 'shipper_function', 'LABEL' => _FUNCTION)); $arr_tmp2 = array('label' => _SHIPPER, 'type' => 'select_or_other_data', 'param' => array('field_label' => _SHIPPER, 'default_label_select' => _CHOOSE_SHIPPER, 'id' => 'shipper', 'label_define_option' =>_DEFINE_SHIPPER, 'options' => $arr_tmp, 'input_ids' => $arr_tmp3)); $param['shipper'] = $arr_tmp2; //sender $arr_tmp = array(); for($i=0; $i < count($_SESSION['sender']); $i++) { array_push($arr_tmp, array('VALUE' => $_SESSION['sender'][$i]['NOM'], 'LABEL' => $_SESSION['sender'][$i]['NOM'])); } $arr_tmp3 = array(); array_push($arr_tmp3, array('ID' => 'sender_lastname', 'LABEL' => _LASTNAME)); array_push($arr_tmp3, array('ID' => 'sender_firstname', 'LABEL' => _FIRSTNAME)); array_push($arr_tmp3, array('ID' => 'sender_society', 'LABEL' => _SOCIETY)); array_push($arr_tmp3, array('ID' => 'sender_function', 'LABEL' => _FUNCTION)); $arr_tmp2 = array('label' => _SENDER, 'type' => 'select_or_other_data', 'param' => array('field_label' => _SENDER, 'default_label_select' => _CHOOSE_SENDER, 'id' => 'sender', 'label_define_option' =>_DEFINE_SENDER, 'options' => $arr_tmp, 'input_ids' => $arr_tmp3)); $param['sender'] = $arr_tmp2; if($_SESSION['config']['corporate'] == "true") { //Address $arr_tmp = array(); for($i=0; $i < count($_SESSION['quartiers']); $i++) { array_push($arr_tmp, array('VALUE' => $_SESSION['quartiers'][$i], 'LABEL' => $_SESSION['quartiers'][$i])); } $arr_tmp3 = array('NUM' => array('LABEL' => _NUM, 'ID' => 'num'), 'ROAD' => array('LABEL' => _CHRONO_DEP_VALUE, 'ID' => 'rue'), 'CP' => array('LABEL' => _CHRONO_START_VALUE, 'ID' => 'Cp'),'CITY' => array('LABEL' => _START_END_DATE, 'ID' => 'ville')); $arr_tmp2 = array('label' => _COMP_DATA, 'type' => 'address', 'param' => array('field_label' => _COMP_DATA, 'address_data' => $arr_tmp3)); $param['adress'] = $arr_tmp2; } //invoice_type $arr_tmp = array(); for($i=0; $i < count($_SESSION['nature']); $i++) { array_push($arr_tmp, array('VALUE' => $_SESSION['nature'][$i], 'LABEL' => $_SESSION['nature'][$i])); } $arr_tmp2 = array('label' => _INVOICE_TYPE, 'type' => 'select_simple', 'param' => array('field_label' => _INVOICE_TYPE,'default_label' => addslashes(_CHOOSE_INVOICE_TYPE), 'options' => $arr_tmp)); $param['invoice_type'] = $arr_tmp2; //priority $arr_tmp = array(array('VALUE'=> '1', 'LABEL' =>_HIGH), array('VALUE'=> '2', 'LABEL' =>_NORMAL), array('VALUE'=> '3', 'LABEL' =>_LOW)); $arr_tmp2 = array('label' => _PRIORITY, 'type' => 'select_simple', 'param' => array('field_label' => _MAIL_PRIORITY,'default_label' => addslashes(_CHOOSE_PRIORITY), 'options' => $arr_tmp)); $param['priority'] = $arr_tmp2; //identifier $arr_tmp2 = array('label' => _MAIL_IDENTIFIER, 'type' => 'input_text', 'param' => array('field_label' => _MAIL_IDENTIFIER, 'other' => $size)); $param['numcourrier'] = $arr_tmp2; //annotations $arr_tmp2 = array('label' => _NOTES, 'type' => 'input_text', 'param' => array('field_label' => _NOTES, 'other' => $size)); $param['doc_notes'] = $arr_tmp2; //notes $arr_tmp2 = array('label' => _PROCESS_NOTES, 'type' => 'input_text', 'param' => array('field_label' => _PROCESS_NOTES, 'other' => $size)); $param['process_notes'] = $arr_tmp2; //destination (department) $arr_tmp = array(); for($i=0; $i < count($_SESSION['user']['services']); $i++) { array_push($arr_tmp, array('VALUE' => $_SESSION['user']['services'][$i]['ID'], 'LABEL' => $_SESSION['user']['services'][$i]['LABEL'])); } $arr_tmp2 = array('label' => _DESTINATION_SEARCH, 'type' => 'select_multiple', 'param' => array('field_label' => _DESTINATION_SEARCH, 'label_title' => _CHOOSE_ENTITES_SEARCH_TITLE, 'id' => 'services','options' => $arr_tmp)); $param['destination_mu'] = $arr_tmp2; //status $arr_tmp = array(array('VALUE'=> 'NEW', 'LABEL' =>_TO_PROCESS), array('VALUE'=> 'COU', 'LABEL' =>_IN_PROGRESS), array('VALUE'=> 'REL1', 'LABEL' =>_FIRST_WARNING), array('VALUE'=> 'REL2', 'LABEL' =>_SECOND_WARNING), array('VALUE'=> 'LATE', 'LABEL' =>_LATE), array('VALUE'=> 'END', 'LABEL' =>_CLOSED)); if ($_SESSION['config']['action_waitingdoc'] == "true") { array_push($arr_tmp, array('VALUE'=> 'WAI', 'LABEL' =>_WAITINGDOC)); } $arr_tmp2 = array('label' => _STATUS_PLUR, 'type' => 'select_multiple', 'param' => array('field_label' => _STATUS,'label_title' => _CHOOSE_STATUS_SEARCH_TITLE,'id' => 'status', 'options' => $arr_tmp)); $param['status'] = $arr_tmp2; //coll if($_SESSION['config']['collectivities'] == "true") { include_once($_SESSION['config']['includedir']."/addon_collectivities.php"); $arr_tmp2 = load_search_form_entity(); $param['coll'] = $arr_tmp2; } //doc_type $conn->query("select type_id, description from ".$_SESSION['tablename']['doctypes']." where enabled = 'Y' order by description asc"); $arr_tmp = array(); while ($res=$conn->fetch_object()) { array_push($arr_tmp, array('VALUE' => $res->type_id, 'LABEL' => $res->description)); } $arr_tmp2 = array('label' => _DOCTYPES, 'type' => 'select_multiple', 'param' => array('field_label' => _DOCTYPE,'label_title' => _CHOOSE_DOCTYPES_SEARCH_TITLE, 'id' => 'doctypes', 'options' => $arr_tmp)); $param['doctype'] = $arr_tmp2; //Answers types $arr_tmp = array(array('ID' => 'simple_mail','VALUE'=> 'true', 'LABEL' =>_SIMPLE_MAIL),array('ID' => 'AR','VALUE'=> 'true', 'LABEL' =>_REGISTERED_MAIL),array('ID' => 'fax','VALUE'=> 'true', 'LABEL' =>_FAX),array('ID' => 'courriel','VALUE'=> 'true', 'LABEL' =>_MAIL) ,array('ID' => 'direct','VALUE'=> 'true', 'LABEL' =>_DIRECT_CONTACT),array('ID' => 'autre','VALUE'=> 'true', 'LABEL' =>_OTHER),array('ID' => 'norep','VALUE'=> 'true', 'LABEL' =>_NO_ANSWER)); $arr_tmp2 = array('label' => _ANSWER_TYPE, 'type' => 'checkbox', 'param' => array('field_label' => _ANSWER_TYPE, 'checkbox_data' => $arr_tmp)); $param['answer_type'] = $arr_tmp2; $tab = $search_obj->send_criteria_data($param); //$conn->show_array($param); //$conn->show_array($tab); // criteria list options $src_tab = $tab[0]; ?>

0) {?>

/>
/>
/>
/>