* */ /** * Class Search : Contains all the function to make a search and show the search results * * @author Claire Figueras * @license GPL * @package Maarch LetterBox 2.3 * @version 2.0 */ class search extends dbquery { /** * Mark with a color background the word you're searching in the detail of the row * * @param string $words * @param string $need * @return string $words */ private function thisword($words,$need) { // mark with a color background the word you're searching in the detail of the row $ar_need = explode(" ", $need); for($i = 0; $i > count($ar_need); $i++) { $words = str_replace($ar_need[$i],"".$ar_need[$i]."",$words); } return $words; } /** * Configure the SQL argument order by */ public function define_order() { // configure the sql argument order by $orderby = ""; if(isset($_GET['order'])) { if($_GET['order'] == "datedesc") { $orderby = "order by CREATION_DATE desc"; } elseif($_GET['order'] == "dateasc") { $orderby = "order by CREATION_DATE asc"; } if($_GET['order'] == "datestartdesc") { $orderby = "order by CUSTOM_D1 desc"; } elseif($_GET['order'] == "datestartasc") { $orderby = "order by CUSTOM_D1 asc"; } elseif($_GET['order'] == "titledesc") { $orderby = "order by TITLE desc"; } elseif($_GET['order'] == "titleasc") { $orderby = "order by TITLE asc"; } if($_GET['order'] == "refdesc") { $orderby = "order by IDENTIFIER desc"; } elseif($_GET['order'] == "refasc") { $orderby = "order by IDENTIFIER asc"; } if($_GET['order'] == "residdesc") { $orderby = "order by RES_ID desc"; } elseif($_GET['order'] == "residasc") { $orderby = "order by RES_ID asc"; } if($_GET['order'] == "typedesc") { $orderby = "order by TYPE_ID desc"; } elseif($_GET['order'] == "typeasc") { $orderby = "order by TYPE_ID asc"; } elseif($_GET['order'] == "statdesc") { $orderby = "order by STATUS desc"; } elseif($_GET['order'] == "statasc") { $orderby = "order by STATUS asc"; } elseif($_GET['order'] == "autdesc") { $orderby = "order by AUTHOR desc"; } elseif($_GET['order'] == "auttasc") { $orderby = "order by AUTHOR asc"; } elseif($_GET['order'] == "servdesc") { $orderby = "order by DESTINATION desc"; } elseif($_GET['order'] == "servasc") { $orderby = "order by DESTINATION asc"; } elseif($_GET['order'] == "destdesc") { $orderby = "order by DEST_USER desc"; } elseif($_GET['order'] == "destasc") { $orderby = "order by DEST_USER asc"; } elseif($_GET['order'] == "statdesc") { $orderby = "order by STATUS desc"; } elseif($_GET['order'] == "statasc") { $orderby = "order by STATUS asc"; } elseif($_GET['order'] == "priodesc") { $orderby = "order by PRIORITY desc"; } elseif($_GET['order'] == "prioasc") { $orderby = "order by PRIORITY asc"; } elseif($_GET['order'] == "descdesc") { $orderby = "order by DESCRIPTION desc"; } elseif($_GET['order'] == "descasc") { $orderby = "order by DESCRIPTION asc"; } elseif($_GET['order'] == "chronoasc") { $orderby = "order by IDENTIFIER asc"; } elseif($_GET['order'] == "chronodesc") { $orderby = "order by IDENTIFIER desc"; } elseif($_GET['order'] == "sociasc") { $orderby = "order by SOCIETE asc"; } elseif($_GET['order'] == "chronodesc") { $orderby = "order by SOCIETE desc"; } elseif($_GET['order'] == "giddesc") { $orderby = "order by GID_ID desc"; } elseif($_GET['order'] == "gidasc") { $orderby = "order by GID_ID asc"; } } return $orderby; } /** * Show the document list in result of the search * * @param array $listarr * @param integer $nb_total total number of documents * @param string $title * @param string $what search expression * @param string $name "search" by default */ public function list_doc($listarr, $nb_total, $title,$what,$name = "search") { // show the document list in result of the search $page_list1 = ""; $page_list2 = ""; $func = new functions(); if(isset($_GET['start'])) { $start = strip_tags($_GET['start']); } else { $start = 0; } if(isset($_GET['order'])) { $orderby = strip_tags($_GET['order']); } else { $orderby = 0; } if($name == "search" && empty($_SESSION['quicksearch'])) { $link = "index.php?page=".$name."&search=".$what; } else { $link = "index.php?page=".$name."&search=".$what; $link .= "&search=".$_SESSION['search']; for($i=0;$i"") { $link .="&select_shipper=".$_SESSION['search_shipper']; } if($_SESSION['societe_search']<>"") { $link .="&societe=".$_SESSION['societe_search']; } if($_SESSION['priority_search']<>"") { $link .="&priority=".$_SESSION['priority_search']; } if($_SESSION['numcourrier']<>"") { $link .="&numcourrier=".$_SESSION['numcourrier']; } if($_SESSION['numged']<>"") { $link .="&numged=".$_SESSION['numged']; } if($_SESSION['destinataire']<>"") { $link .="&destinataire=".$_SESSION['destinataire']; } if($_SESSION['objet']<>"") { $link .="&objet=".$_SESSION['objet']; } if($_SESSION['invoice_type']<>"") { $link .="&invoice_type=".$_SESSION['invoice_type']; } if($_SESSION['is_ingoing']<>"") { $link .="&is_ingoing=".$_SESSION['is_ingoing']; } if($_SESSION['enr_from']<>"") { $link .="&enr_from=".$_SESSION['enr_from']; } if($_SESSION['enr_to']<>"") { $link .="&enr_to=".$_SESSION['enr_to']; } if ($_SESSION['multifield_search']) { $link .="&multifield=".$_SESSION['multifield_search']; } if($_SESSION['doc_date_from']<>"") { $link .="&doc_date_from=".$_SESSION['doc_date_from']; } if($_SESSION['doc_date_to']<>"") { $link .="&doc_date_to=".$_SESSION['doc_date_to']; } if($_SESSION['date_start_from']<>"") { $link .="&date_start_from=".$_SESSION['date_start_from']; } if($_SESSION['date_start_to']<>"") { $link .="&date_start_to=".$_SESSION['date_start_to']; } if($_SESSION['trait_from']<>"") { $link .="&trait_from=".$_SESSION['trait_from']; } if($_SESSION['trait_to']<>"") { $link .="&trait_to=".$_SESSION['trait_to']; } /* if($_SESSION['status']<>"") { $link .="&status=".$_SESSION['status']; } */ if($_SESSION['search_sender'] <> "") { $link .="&select_sender=".$_SESSION['search_sender']; } if($_SESSION['invoice_type'] <> "") { $link .="&invoice_type=".$_SESSION['invoice_type']; } if($_SESSION['s_services_chosen'] <> "") { for ($isc = 0; $isc < count($_SESSION['s_services_chosen']); $isc++) { $link .= "&services_chosen[]=".$_SESSION['s_services_chosen'][$isc]; } } if($_SESSION['s_doctypes_chosen'] <> "") { for ($isc = 0; $isc < count($_SESSION['s_doctypes_chosen']); $isc++) { $link .= "&doctypes_chosen[]=".$_SESSION['s_doctypes_chosen'][$isc]; } } if($_SESSION['s_destinataire_chosen'] <> "") { for ($isc = 0; $isc < count($_SESSION['s_destinataire_chosen']); $isc++) { $link .= "&destinataire_chosen[]=".$_SESSION['s_destinataire_chosen'][$isc]; } } if($_SESSION['s_status_chosen'] <> "") { for ($isc = 0; $isc < count($_SESSION['s_status_chosen']); $isc++) { $link .= "&status_chosen[]=".$_SESSION['s_status_chosen'][$isc]; } } if($_SESSION['civilities_chosen'] <> "") { for ($isc = 0; $isc < count($_SESSION['civilities_chosen']); $isc++) { $link .= "&civilities_chosen[]=".$_SESSION['civilities_chosen'][$isc]; } } if($_SESSION['courrier_search']=="true") { $link .="&courrier=".$_SESSION['courrier_search']; } if($_SESSION['AR']=="true") { $link .="&AR=".$_SESSION['AR']; } if($_SESSION['fax']=="true") { $link .="&fax=".$_SESSION['fax']; } if($_SESSION['simple_mail']=="true") { $link .="&simple_mail=".$_SESSION['simple_mail']; } if($_SESSION['courriel']=="true") { $link .="&courriel=".$_SESSION['courriel']; } if($_SESSION['courriel_search']=="true") { $link .="&courriel_search=".$_SESSION['courriel_search']; } if($_SESSION['autre']=="true") { $link .="&autre=".$_SESSION['autre']; } if($_SESSION['direct']=="true") { $link .="&direct=".$_SESSION['direct']; } if($_SESSION['norep']=="true") { $link .="&norep=".$_SESSION['norep']; } if($_SESSION['copies']=="true") { $link .="&copies=".$_SESSION['copies']; } if($_SESSION['response']=="true") { $_SESSION['copies'] = "response"; $link .="&copies=".$_SESSION['copies']; } if($_SESSION['services']<>"") { $link .="&services=".$_SESSION['services']; } if($_SESSION['quartier']<>"") { $link .="&quartier=".$_SESSION['quartier']; } if($_SESSION['adr_quartier']<>"") { $link .="&adr_quartier=".$_SESSION['adr_quartier']; } if($_SESSION['num']<>"") { $link .="&num=".$_SESSION['num']; } if($_SESSION['rue']<>"") { $link .="&rue=".$_SESSION['rue']; } if($_SESSION['Cp']<>"") { $link .="&Cp=".$_SESSION['Cp']; } if($_SESSION['ville']<>"") { $link .="&ville=".$_SESSION['ville']; } if($_SESSION['search_gid_id']<>"") { $link .="&gid_id=".$_SESSION['search_gid_id']; } if($_SESSION['sender_firstname'] <>'') { $link .="&sender_firstname=".$_SESSION['sender_firstname']; } if($_SESSION['shipper_firstname'] <>'') { $link .="&shipper_firstname=".$_SESSION['shipper_firstname']; } if($_SESSION['sender_lastname'] <>'') { $link .="&sender_lastname=".$_SESSION['sender_lastname']; } if($_SESSION['shipper_lastname'] <>'') { $link .="&shipper_lastname=".$_SESSION['shipper_lastname']; } if($_SESSION['sender_society'] <>'') { $link .="&sender_society=".$_SESSION['sender_society']; } if($_SESSION['shipper_society'] <>'') { $link .="&shipper_society=".$_SESSION['shipper_society']; } if($_SESSION['shipper_function'] <>'') { $link .="&shipper_function=".$_SESSION['shipper_function']; } if($_SESSION['sender_function'] <>'') { $link .="&sender_function=".$_SESSION['sender_function']; } //---------------------- if($_SESSION['s_coll'] <>'') { $link .="&coll_chosen=".$_SESSION['s_coll']; } //$link .= "&imageField.x=19"; //$link .= "&imageField.y=18"; $_SESSION['last_link_for_search_adv'] = $link; } // define the defaults values $nb_show = $_SESSION['config']['nblinetoshow']; $nb_pages = ceil($nb_total/$nb_show); // if they are more 1 page we do pagination with 2 forms if($nb_pages > 1) { $next_start = 0; $page_list1 = '

'; $lastpage = 0; for($i = 0;$i <> $nb_pages; $i++) { $page_name = $i + 1; $the_line = $i + 1; if($start == $next_start) { $page_list1 .= ""; $page_list2 .= ""; } else { $page_list1 .= ""; $page_list2 .= ""; } $next_start = $next_start + $nb_show; $lastpage = $next_start; } $lastpage = $lastpage - $nb_show; $previous = ""; $next = ""; if($start > 0) { $start_prev = $start - $nb_show; $previous = "< "._PREVIOUS." "; } if($start <> $lastpage) { $start_next = $start + $nb_show; $next = " "._NEXT." >"; } $page_list1 = $page_list1."".$previous." ".$next."

"; $page_list2 = $page_list2."".$previous." ".$next."

"; } $this->connect(); ?>

>

<?php echo _DESC_SORT; ?> <?php echo _ASC_SORT; ?>

<?php echo _DESC_SORT; ?> <?php echo _ASC_SORT; ?>

<?php echo _DESC_SORT; ?> <?php echo _ASC_SORT; ?>

<?php echo _DESC_SORT; ?> <?php echo _ASC_SORT; ?>

<?php echo _DESC_SORT; ?> <?php echo _ASC_SORT; ?>

<?php echo _DESC_SORT; ?> <?php echo _ASC_SORT; ?>

<?php echo _DESC_SORT; ?> <?php echo _ASC_SORT; ?>

<?php echo _DESC_SORT; ?> <?php echo _ASC_SORT; ?>

<?php echo _DESC_SORT; ?> <?php echo _ASC_SORT; ?>
<?php echo _DESC_SORT; ?> <?php echo _ASC_SORT; ?>
E/S  
> <?php echo _TO_PROCESS;?> <?php echo _IN_PROGRESS;?> <?php echo _CLOSED;?> <?php echo _ONGOING;?> <?php echo _ONGOING;?> <?php echo _WAITINGDOC;?> <?php echo _RESPONSE;?> class="price">cut_string($func->show($this->thisword($listarr[$theline]['RES_ID'],$what)), 6); ?> >cut_string($func->show($this->thisword($listarr[$theline]['DESCRIPTION'],$what)),50); ?> class="title">show($this->thisword($listarr[$theline]['AUTHOR'],$what)); ?> >show($this->thisword($listarr[$theline]['DEST_USER'],$what)); ?> >query("select DESCRIPTION from ".$_SESSION['tablename']['doctypes']." where TYPE_ID = '".$listarr[$theline]['LIB_TYPE']."'"); $res = $this->fetch_object(); echo $func->show($res->DESCRIPTION,$what); // echo $func->show($this->thisword($listarr[$theline]['LIB_TYPE'],$what)); } else { echo $func->show($this->thisword($listarr[$theline]['GID_ID'],$what)); } ?> >dateformat($listarr[$theline]['CREATION_DATE']); } else { if("0000-00-00" == $listarr[$theline]['CUSTOM_D1']) { echo $this->dateformat($listarr[$theline]['CREATION_DATE']); } else { echo $this->dateformat($listarr[$theline]['CUSTOM_D1']); } } ?> >show($this->thisword($listarr[$theline]['SOCIETE'],$what)); } else { $this->query("select SERVICE from ".$_SESSION['tablename']['services']." where ID = '".$listarr[$theline]['DESTINATION']."'"); $res = $this->fetch_object(); echo str_replace('\\', '', $res->SERVICE); }?> >  <?php echo _DETAILS; ?>  <?php echo _DETAILS; ?>
"; echo "
"; if ($_SESSION['user']['export'] == true) { ?>
"; } /** * Show the document list in result of the search for an document id (indexation) * * @param array $listarr * @param integer $nb_total total number of documents * @param string $title * @param string $what search expression * @param string $name "search" by default * @param string $formActionPage the redirect page of form */ public function list_doc2($listarr, $nb_total, $title,$what,$name = "search", $find_folder, $formActionPage='') { // show the document list in result of the search $page_list1 = ""; $page_list2 = ""; $func = new functions(); if(isset($_GET['start'])) { $start = strip_tags($_GET['start']); } else { $start = 0; } if(isset($_GET['order'])) { $orderby = strip_tags($_GET['order']); } else { $orderby = 0; } //if($name == "search" && empty($_SESSION['quicksearch'])) if (!$_SESSION['config']) { $link = "search_doc_result.php?search=".$what; } else { $link = "search_doc_result.php?search=".$what; $link .= "&search=".$_SESSION['search']; for($i=0;$i"") { $link .="&emetteur=".$_SESSION['attach_doc']['emetteur_search']; } if($_SESSION['attach_doc']['numcourrier']<>"") { $link .="&numcourrier=".$_SESSION['attach_doc']['numcourrier']; } if($_SESSION['attach_doc']['numged']<>"") { $link .="&numged=".$_SESSION['attach_doc']['numged']; } if($_SESSION['attach_doc']['destinataire']<>"") { $link .="&destinataire=".$_SESSION['attach_doc']['destinataire']; } if($_SESSION['attach_doc']['objet']<>"") { $link .="&objet=".$_SESSION['attach_doc']['objet']; } if($_SESSION['attach_doc']['type']<>"") { $link .="&type=".$_SESSION['attach_doc']['type']; } if($_SESSION['attach_doc']['naturesend']<>"") { $link .="&naturesend=".$_SESSION['attach_doc']['naturesend']; } if($_SESSION['attach_doc']['enr_from']<>"") { $link .="&enr_from=".$_SESSION['attach_doc']['enr_from']; } if($_SESSION['attach_doc']['enr_to']<>"") { $link .="&enr_to=".$_SESSION['attach_doc']['enr_to']; } if($_SESSION['attach_doc']['trait_from']<>"") { $link .="&trait_from=".$_SESSION['attach_doc']['trait_from']; } if($_SESSION['trait_to']<>"") { $link .="&trait_to=".$_SESSION['trait_to']; } if($_SESSION['attach_doc']['status']<>"") { $link .="&status=".$_SESSION['attach_doc']['status']; } if ($_SESSION['multifield_search']) { $link .="&multifield=".$_SESSION['multifield_search']; } if($_SESSION['attach_doc']['services']<>"") { $link .="&services=".$_SESSION['attach_doc']['services']; } if($_SESSION['search_gid_id']<>"") { $link .="&gid_id=".$_SESSION['search_gid_id']; } //$link .= "&imageField.x=19"; //$link .= "&imageField.y=18"; } // define the defaults values $nb_show = $_SESSION['config']['nblinetoshow']; $nb_pages = ceil($nb_total/$nb_show); // if they are more 1 page we do pagination with 2 forms if($nb_pages > 1) { $next_start = 0; $page_list1 = '

'; $lastpage = 0; for($i = 0;$i <> $nb_pages; $i++) { $page_name = $i + 1; $the_line = $i + 1; if($start == $next_start) { $page_list1 .= ""; $page_list2 .= ""; } else { $page_list1 .= ""; $page_list2 .= ""; } $next_start = $next_start + $nb_show; $lastpage = $next_start; } $lastpage = $lastpage - $nb_show; $previous = ""; $next = ""; if($start > 0) { $start_prev = $start - $nb_show; $previous = "< "._PREVIOUS." "; } if($start <> $lastpage) { $start_next = $start + $nb_show; $next = " "._NEXT." >"; } $page_list1 = $page_list1."".$previous." ".$next."

"; $page_list2 = $page_list2."".$previous." ".$next."

"; } ?> <?php echo _MAIL_SEARCH;?>

>
  <?php echo _DESC_SORT; ?> <?php echo _ASC_SORT; ?> N° Chrono
<?php echo _DESC_SORT; ?> <?php echo _ASC_SORT; ?>

<?php echo _DESC_SORT; ?> <?php echo _ASC_SORT; ?>
<?php echo _DESC_SORT; ?> <?php echo _ASC_SORT; ?> <?php echo _DESC_SORT; ?> <?php echo _ASC_SORT; ?>
<?php echo _DESC_SORT; ?> <?php echo _ASC_SORT; ?>
<?php echo _DESC_SORT; ?> <?php echo _ASC_SORT; ?> <?php echo _DESC_SORT; ?> <?php echo _ASC_SORT; ?>  
<?php echo _TO_PROCESS;?> <?php echo _IN_PROGRESS;?> <?php echo _CLOSED;?> <?php echo _ONGOING;?> <?php echo _ONGOING;?> <?php echo _WAITINGDOC;?> <?php echo _ONGOING;?> show($this->thisword($listarr[$theline]['IDENTIFIER'],$what)); ?> show($this->thisword($listarr[$theline]['RES_ID'],$what)); ?> show($this->thisword($listarr[$theline]['AUTHOR'],$what)); ?> show($this->thisword($listarr[$theline]['DEST_USER'],$what)); ?> show($this->thisword($listarr[$theline]['DESCRIPTION'],$what)); ?> dateformat($listarr[$theline]['CREATION_DATE']); } else { if("0000-00-00" == $listarr[$theline]['CUSTOM_D1']) { echo $this->dateformat($listarr[$theline]['CREATION_DATE']); } else { echo $this->dateformat($listarr[$theline]['CUSTOM_D1']); } } ?> query("select SERVICE from ".$_SESSION['tablename']['services']." where ID = '".$listarr[$theline]['DESTINATION']."'"); $res = $this->fetch_object(); echo $res->SERVICE; ?> "._SHOW_MAIL.""; } elseif($listarr[$theline]['FORMAT'] == "PDF") { echo " "._SHOW_MAIL.""; } elseif($listarr[$theline]['FORMAT'] == "TXT") { echo " "._SHOW_MAIL.""; } elseif($listarr[$theline]['FORMAT'] == "WAV") { echo " "._SHOW_MAIL.""; } elseif($listarr[$theline]['FORMAT'] == "AVI" || $listarr[$theline]['FORMAT'] == "MPG" || $listarr[$theline]['FORMAT'] == "MPEG" || $listarr[$theline]['FORMAT'] == "MPE" || $listarr[$theline]['FORMAT'] == "QT" || $listarr[$theline]['FORMAT'] == "MOV") { echo " "._SHOW_MAIL.""; } elseif($listarr[$theline]['FORMAT'] == "JPG" || $listarr[$theline]['FORMAT'] == "JPEG" || $listarr[$theline]['FORMAT'] == "GIF" || $listarr[$theline]['FORMAT'] == "JPE" ) { echo " "._SHOW_MAIL.""; } elseif($listarr[$theline]['FORMAT'] == "XLS" || $listarr[$theline]['FORMAT'] == "CSV" ) { echo " "._SHOW_MAIL.""; } elseif($listarr[$theline]['FORMAT'] == "DOC" || $listarr[$theline]['FORMAT'] == "RTF") { echo " "._SHOW_MAIL.""; } elseif($listarr[$theline]['FORMAT'] == "PDFHQ") { echo " "._SHOW_MAIL.""; } else { echo " "; } ?>

"") { $link .="&select_shipper=".$_SESSION['search_shipper']; } if($_SESSION['societe_search']<>"") { $link .="&societe=".$_SESSION['societe_search']; } /*if($_SESSION['priority_search']<>"") { $link .="&priority=".$_SESSION['priority_search']; }*/ if($_SESSION['s_priority_chosen'] <> "") { for ($isc = 0; $isc < count($_SESSION['s_priority_chosen']); $ipc++) { $link .= "&priority_chosen[]=".$_SESSION['s_priority_chosen'][$ipc]; } } if($_SESSION['numcourrier']<>"") { $link .="&numcourrier=".$_SESSION['numcourrier']; } if($_SESSION['numged']<>"") { $link .="&numged=".$_SESSION['numged']; } if($_SESSION['destinataire']<>"") { $link .="&destinataire=".$_SESSION['destinataire']; } if($_SESSION['objet']<>"") { $link .="&objet=".$_SESSION['objet']; } if($_SESSION['invoice_type']<>"") { $link .="&invoice_type=".$_SESSION['invoice_type']; } if($_SESSION['is_ingoing']<>"") { $link .="&is_ingoing=".$_SESSION['is_ingoing']; } if($_SESSION['enr_from']<>"") { $link .="&enr_from=".$_SESSION['enr_from']; } if($_SESSION['enr_to']<>"") { $link .="&enr_to=".$_SESSION['enr_to']; } if ($_SESSION['multifield_search']) { $link .="&multifield=".$_SESSION['multifield_search']; } if($_SESSION['doc_date_from']<>"") { $link .="&doc_date_from=".$_SESSION['doc_date_from']; } if($_SESSION['doc_date_to']<>"") { $link .="&doc_date_to=".$_SESSION['doc_date_to']; } if($_SESSION['date_start_from']<>"") { $link .="&date_start_from=".$_SESSION['date_start_from']; } if($_SESSION['date_start_to']<>"") { $link .="&date_start_to=".$_SESSION['date_start_to']; } if($_SESSION['trait_from']<>"") { $link .="&trait_from=".$_SESSION['trait_from']; } if($_SESSION['trait_to']<>"") { $link .="&trait_to=".$_SESSION['trait_to']; } /* if($_SESSION['status']<>"") { $link .="&status=".$_SESSION['status']; } */ if($_SESSION['search_sender'] <> "") { $link .="&select_sender=".$_SESSION['search_sender']; } if($_SESSION['invoice_type'] <> "") { $link .="&invoice_type=".$_SESSION['invoice_type']; } if($_SESSION['s_services_chosen'] <> "") { for ($isc = 0; $isc < count($_SESSION['s_services_chosen']); $isc++) { $link .= "&services_chosen[]=".$_SESSION['s_services_chosen'][$isc]; } } if($_SESSION['s_doctypes_chosen'] <> "") { for ($isc = 0; $isc < count($_SESSION['s_doctypes_chosen']); $isc++) { $link .= "&doctypes_chosen[]=".$_SESSION['s_doctypes_chosen'][$isc]; } } if($_SESSION['s_destinataire_chosen'] <> "") { for ($isc = 0; $isc < count($_SESSION['s_destinataire_chosen']); $isc++) { $link .= "&destinataire_chosen[]=".$_SESSION['s_destinataire_chosen'][$isc]; } } if($_SESSION['s_status_chosen'] <> "") { for ($isc = 0; $isc < count($_SESSION['s_status_chosen']); $isc++) { $link .= "&status_chosen[]=".$_SESSION['s_status_chosen'][$isc]; } } if($_SESSION['civilities_chosen'] <> "") { for ($isc = 0; $isc < count($_SESSION['civilities_chosen']); $isc++) { $link .= "&civilities_chosen[]=".$_SESSION['civilities_chosen'][$isc]; } } if($_SESSION['courrier_search']=="true") { $link .="&courrier=".$_SESSION['courrier_search']; } if($_SESSION['AR']=="true") { $link .="&AR=".$_SESSION['AR']; } if($_SESSION['fax']=="true") { $link .="&fax=".$_SESSION['fax']; } if($_SESSION['simple_mail']=="true") { $link .="&simple_mail=".$_SESSION['simple_mail']; } if($_SESSION['courriel']=="true") { $link .="&courriel=".$_SESSION['courriel']; } if($_SESSION['courriel_search']=="true") { $link .="&courriel_search=".$_SESSION['courriel_search']; } if($_SESSION['autre']=="true") { $link .="&autre=".$_SESSION['autre']; } if($_SESSION['direct']=="true") { $link .="&direct=".$_SESSION['direct']; } if($_SESSION['norep']=="true") { $link .="&norep=".$_SESSION['norep']; } if($_SESSION['copies']=="true") { $link .="&copies=".$_SESSION['copies']; } if($_SESSION['services']<>"") { $link .="&services=".$_SESSION['services']; } if($_SESSION['quartier']<>"") { $link .="&quartier=".$_SESSION['quartier']; } if($_SESSION['num']<>"") { $link .="&num=".$_SESSION['num']; } if($_SESSION['rue']<>"") { $link .="&rue=".$_SESSION['rue']; } if($_SESSION['Cp']<>"") { $link .="&Cp=".$_SESSION['Cp']; } if($_SESSION['ville']<>"") { $link .="&ville=".$_SESSION['ville']; } if($_SESSION['search_gid_id']<>"") { $link .="&gid_id=".$_SESSION['search_gid_id']; } if($_SESSION['sender_firstname'] <>'') { $link .="&sender_firstname=".$_SESSION['sender_firstname']; } if($_SESSION['shipper_firstname'] <>'') { $link .="&shipper_firstname=".$_SESSION['shipper_firstname']; } if($_SESSION['sender_lastname'] <>'') { $link .="&sender_lastname=".$_SESSION['sender_lastname']; } if($_SESSION['shipper_lastname'] <>'') { $link .="&shipper_lastname=".$_SESSION['shipper_lastname']; } if($_SESSION['sender_society'] <>'') { $link .="&sender_society=".$_SESSION['sender_society']; } if($_SESSION['shipper_society'] <>'') { $link .="&shipper_society=".$_SESSION['shipper_society']; } if($_SESSION['shipper_function'] <>'') { $link .="&shipper_function=".$_SESSION['shipper_function']; } if($_SESSION['sender_function'] <>'') { $link .="&sender_function=".$_SESSION['sender_function']; } if($_SESSION['adr_num'] <>'') { $link .="&adr_num=".$_SESSION['adr_num']; } if($_SESSION['adr_rue'] <>'') { $link .="&adr_rue=".$_SESSION['adr_rue']; } if($_SESSION['adr_cp'] <>'') { $link .="&adr_cp=".$_SESSION['adr_cp']; } if($_SESSION['adr_commune'] <>'') { $link .="&adr_commune=".$_SESSION['adr_commune']; } if($_SESSION['adr_arrondissement'] <>'') { $link .="&adr_arrondissement=".$_SESSION['adr_arrondissement']; } if($_SESSION['adr_canton'] <>'') { $link .="&adr_canton=".$_SESSION['adr_canton']; } if($_SESSION['adr_epci'] <>'') { $link .="&adr_canton=".$_SESSION['edr_epci']; } //---------------------- if($_SESSION['s_coll'] <>'') { $link .="&coll_chosen=".$_SESSION['s_coll']; } //$link .= "&imageField.x=19"; //$link .= "&imageField.y=18"; $_SESSION['last_link_for_search_adv'] = $link; } // define the defaults values $nb_show = $_SESSION['config']['nblinetoshow']; $nb_pages = ceil($nb_total/$nb_show); // if they are more 1 page we do pagination with 2 forms if($nb_pages > 1) { $next_start = 0; $page_list1 = '

'; $lastpage = 0; for($i = 0;$i <> $nb_pages; $i++) { $page_name = $i + 1; $the_line = $i + 1; if($start == $next_start) { $page_list1 .= ""; $page_list2 .= ""; } else { $page_list1 .= ""; $page_list2 .= ""; } $next_start = $next_start + $nb_show; $lastpage = $next_start; } $lastpage = $lastpage - $nb_show; $previous = ""; $next = ""; if($start > 0) { $start_prev = $start - $nb_show; $previous = "< "._PREVIOUS." "; } if($start <> $lastpage) { $start_next = $start + $nb_show; $next = " "._NEXT." >"; } $page_list1 = $page_list1."".$previous." ".$next."

"; $page_list2 = $page_list2."".$previous." ".$next."

"; } $this->connect(); ?>

>

<?php echo _DESC_SORT; ?> <?php echo _ASC_SORT; ?>

<?php echo _DESC_SORT; ?> <?php echo _ASC_SORT; ?>

<?php echo _DESC_SORT; ?> <?php echo _ASC_SORT; ?>

<?php echo _DESC_SORT; ?> <?php echo _ASC_SORT; ?>

<?php echo _DESC_SORT; ?> <?php echo _ASC_SORT; ?>

<?php echo _DESC_SORT; ?> <?php echo _ASC_SORT; ?>
 
<?php echo _TO_PROCESS;?> <?php echo _IN_PROGRESS;?> <?php echo _CLOSED;?> <?php echo _ONGOING;?> <?php echo _ONGOING;?> <?php echo _WAITINGDOC;?> <?php echo $listarr[$theline]['STATUS'];?> cut_string($func->show($this->thisword($listarr[$theline]['RELATION'],$what)), 6); ?> cut_string($func->show($this->thisword($listarr[$theline]['DESCRIPTION'],$what)),50); ?> show($this->thisword($listarr[$theline]['AUTHOR'],$what)); ?> show($this->thisword($listarr[$theline]['DEST_USER'],$what)); ?> dateformat($listarr[$theline]['CREATION_DATE']); ?> show($this->thisword($listarr[$theline]['SOCIETE'],$what)); } else { $this->query("select SERVICE from ".$_SESSION['tablename']['services']." where ID = '".$listarr[$theline]['DESTINATION']."'"); $res = $this->fetch_object(); echo str_replace('\\', '', $res->SERVICE); }?>  <?php echo _DETAILS; ?>
"; echo "
"; if ($_SESSION['user']['export'] == true && $_SESSION['courriel_search'] <> "true") { ?>
"; } public function send_criteria_data($param) { /*list_criteres = Array ("num_courrier" => Array (label => "reference courrier', parametres => Array ( ...), type => "text", ), "date courrier" => array*/ //$this->show_array($param); $options_criteria_list = ''; $json_tab = ''; foreach($param as $key => $value) { $json_tab .= "'".$key."' : {"; //echo 'key '.$key."
val "; //$this->show_array($value); $options_criteria_list .= ''; $json_tab .= $this->json_line($key,$value['type'],$value['param']); $json_tab .= '} ,'; } //die; $json_tab = preg_replace("/,$/", '', $json_tab); $tab = array($options_criteria_list, $json_tab ); return $tab; } public function search_reference($relation_id) { $this->query("SELECT IDENTIFIER FROM res_x WHERE res_id = ".$relation_id); $res = $this->fetch_object(); $ref = $res->IDENTIFIER; return($ref); } /* This function deletes the session * * */ public function reset() { $_SESSION['meta_search']= null; $_SESSION['search_shipper'] = null; $_SESSION['societe_search'] = null; $_SESSION['s_priority_chosen'] = array(); $_SESSION['numcourrier'] = null; $_SESSION['numged'] = null; $_SESSION['destinataire'] = null; $_SESSION['objet'] = null; $_SESSION['invoice_type'] = null; $_SESSION['is_ingoing'] = null; $_SESSION['enr_from'] = null; $_SESSION['enr_to'] = null; $_SESSION['multifield_search'] = null; $_SESSION['doc_date_from'] = null; $_SESSION['doc_date_to'] = null; $_SESSION['date_start_from'] = null; $_SESSION['date_start_to'] = null; $_SESSION['trait_from'] = null; $_SESSION['trait_to'] = null; $_SESSION['status'] = null; $_SESSION['search_sender'] = null; $_SESSION['invoice_type'] = null; $_SESSION['s_services_chosen'] = array(); $_SESSION['s_doctypes_chosen'] = array(); $_SESSION['s_destinataire_chosen'] = array(); $_SESSION['s_status_chosen'] = array(); $_SESSION['civilities_chosen'] = array(); $_SESSION['courrier_search'] = null; $_SESSION['AR'] = null; $_SESSION['fax'] = null; $_SESSION['simple_mail'] = null; $_SESSION['courriel'] = null; $_SESSION['courriel_search'] = null; $_SESSION['autre'] = null; $_SESSION['direct'] = null; $_SESSION['norep'] = null; $_SESSION['copies'] = null; $_SESSION['services'] = null; $_SESSION['quartier'] = null; $_SESSION['num'] = null; $_SESSION['rue'] = null; $_SESSION['Cp'] = null; $_SESSION['ville'] = null; $_SESSION['search_gid_id'] = null; $_SESSION['sender_firstname'] = null; $_SESSION['shipper_firstname'] = null; $_SESSION['sender_lastname'] = null; $_SESSION['shipper_lastname'] = null; $_SESSION['sender_society'] = null; $_SESSION['shipper_society'] = null; $_SESSION['shipper_function'] = null; $_SESSION['sender_function'] = null; $_SESSION['adr_num'] = null; $_SESSION['adr_rue'] = null; $_SESSION['adr_cp'] = null; $_SESSION['adr_commune'] = null; $_SESSION['adr_arrondissement'] = null; $_SESSION['adr_canton'] = null; $_SESSION['edr_epci'] = null; $_SESSION['s_coll'] = null; } private function json_line($id, $field_type, $param) { $str = ''; $init = "'label' : '".addslashes($param['field_label'])."', 'value' :'"; $end = "'"; //$hidden = ''; if($field_type == 'input_text') { $str = $init.''.$end; } elseif($field_type == 'date_range') { $str = $init.addslashes(_SINCE).' : '.addslashes(_CALENDAR).'' .addslashes(_FOR).' : '.addslashes(_CALENDAR).''; $str .= ''.$end; } elseif($field_type == 'select_simple') { $str = $init.''; $str .= ''.$end; } elseif($field_type == 'select_multiple') { $str .= ''.$param['label_title'].' :'; $str .= ''; $str .= ''; $str .= ''; $str .= "
"._SELECT_ALL.''; $str .= ''; $str .= ''; $str .= '
'; $str .= '
'; $str .= ''; $str .= ''; $str .= ''; $str .= "
"._SELECT_ALL.''; $str .= ''; $str .= ''; $str = addslashes($str); $str = $init.''.$str.'
'.$end; } elseif($field_type == 'checkbox') { $str = $init.''; $tmp_ids = ''; for($i=0; $i < count($param['checkbox_data']);$i=$i+2) { $tmp_ids .= $param['checkbox_data'][$i]['ID'].','; $str .= ''; if(isset($param['checkbox_data'][$i+1]['ID'])) { $tmp_ids .= $param['checkbox_data'][$i+1]['ID'].','; $str .= ''; $str .= ''; } else { $str .= ''; } $str .= ''; } $tmp_ids = preg_replace('/,$/', '', $tmp_ids ); $str .= '
'.addslashes($param['checkbox_data'][$i]['LABEL']).''.addslashes($param['checkbox_data'][$i+1]['LABEL']).''.addslashes($param['checkbox_data'][$i]['LABEL']).'
'; $str .= ''.$end; } elseif($field_type == 'address') { if($_SESSION['config']['borough'] == "true"){ $str = $init.''; $str .= ''; $str .= ''; $str .= ''; $str .= ''; $str .= ''; $str .= ''; $str .= ''; $str .= ''; $str .= ''; $str .= ''; $str .= ''; $str .= ''; $str .= ''; $str .= ''; $str .= ''; $str .= ''; $str .= ''; if(isset($param['address_data']['DISTRICTS'])) { $str .= ''; $str .= ''; $str .= ''; } $str .= '
'.$param['address_data']['NUM']['LABEL'].''.$param['address_data']['ROAD']['LABEL'].'
'.$param['address_data']['CP']['LABEL'].''.$param['address_data']['COMMUNE']['LABEL'].'
'.$param['address_data']['BOROUGH']['LABEL'].''.$param['address_data']['CANTON']['LABEL'].'
'.$param['address_data']['EPCI']['LABEL'].''.$param['address_data']['EPCI_TYPE']['LABEL'].'
'.$param['address_data']['DISTRICTS']['LABEL'].''; $str .= ''; $str .= '
'.$end; } else{ $str = $init.''; $str .= ''; $str .= ''; $str .= ''; $str .= ''; $str .= ''; $str .= ''; $str .= ''; $str .= ''; $str .= ''; if(isset($param['address_data']['DISTRICTS'])) { $str .= ''; $str .= ''; $str .= ''; } $str .= '
'.$param['address_data']['NUM']['LABEL'].''.$param['address_data']['ROAD']['LABEL'].'
'.$param['address_data']['CP']['LABEL'].''.$param['address_data']['CITY']['LABEL'].'
'.$param['address_data']['DISTRICTS']['LABEL'].''; $str .= ''; $str .= '
'.$end; } } elseif($field_type == 'courriel') { $str = $init.''; $str .= ''; $str .= ''; $str .= ''; $str .= ''; $str .= ''; $str .= ''; $str .= ''; $str .= ''; $str .= ''; $str .= '
'.$param['courriel_data']['TO']['LABEL'].''.$param['courriel_data']['OBJECT']['LABEL'].'
'.$param['courriel_data']['MESSAGE']['LABEL'].'
'.$end; } elseif($field_type == 'simple_list_or_input_text') { // td open in the showing function (js) $str .= ''; $str .= ''; $str .= ''; $str .= ''; $str .= ''; // td close in the showing function (js) $str = addslashes($str); $str = $init.$str.$end; } elseif($field_type == 'inputs_in_2_col') { $str = $init.''; $tmp = ""; for($i=0; $i'; if ($i%2 == 1 && $i!=0) // impair { echo '' ; } else { if($i+1 == count($params['input_ids'])) { echo ''; } } } $tmp = preg_replace(',$', '', $tmp); $str .= '
 
'; $str .= ''.$end; } elseif($field_type == 'select_or_other_data') { // td open in the showing function (js) $str .= ''; $str .= ''; $str .= ''; $str .= ''; $str .= ''; $str .= ''; $str .= ''; $str .= '
'; $str .= ''; $str .= '
'; $str .= ''; $str .= ''; $str .= '
'; // td close in the showing function (js) $str = addslashes($str); $str = $init.$str.$end; } else { } return $str; } } ?>