* */ /** * Class LetterBox : Contains all the specific functions of Maarch LetterBox * * @author Claire Figueras * @license GPL * @package Maarch LetterBox 2.3 * @version 2.0 */ class LetterBox extends dbquery { /** * * @access private * @var integer */ private $the_start; /** * Redefinition of the LetterBox object constructor */ function __construct() { // configure the sql argument order by if(isset($_GET['start'])) { $this->the_start = strip_tags($_GET['start']); } else { $this->the_start = 0; } } /** * Configure the sql argument order by * */ public function define_order() { // configure the sql argument order by $orderby = ""; if(isset($_GET['order'])) { if($_GET['order'] == "arrivdesc") { $orderby = "order by CREATION_DATE desc"; } elseif($_GET['order'] == "arrivasc") { $orderby = "order by CREATION_DATE asc"; } if($_GET['order'] == "datedesc") { $orderby = "order by CREATION_DATE desc"; } elseif($_GET['order'] == "dateasc") { $orderby = "order by CREATION_DATE asc"; } if($_GET['order'] == "typedesc") { $orderby = "order by TYPE_ID desc"; } elseif($_GET['order'] == "typeasc") { $orderby = "order by TYPE_ID asc"; } if($_GET['order'] == "limdesc") { $orderby = "order by CUSTOM_D2 desc"; } elseif($_GET['order'] == "limasc") { $orderby = "order by CUSTOM_D2 asc"; } if($_GET['order'] == "expdesc") { $orderby = "order by AUTHOR desc"; } elseif($_GET['order'] == "expasc") { $orderby = "order by AUTHOR asc"; } if($_GET['order'] == "statusdesc") { $orderby = "order by AUTHOR desc"; } elseif($_GET['order'] == "statusasc") { $orderby = "order by AUTHOR asc"; } if($_GET['order'] == "residdesc") { $orderby = "order by RES_ID desc"; } elseif($_GET['order'] == "residasc") { $orderby = "order by RES_ID asc"; } if($_GET['order'] == "objdesc") { $orderby = "order by DESCRIPTION desc"; } elseif($_GET['order'] == "objasc") { $orderby = "order by DESCRIPTION asc"; } if($_GET['order'] == "destdesc") { $orderby = "order by DEST_USER desc"; } elseif($_GET['order'] == "destasc") { $orderby = "order by DEST_USER asc"; } if($_GET['order'] == "limdesc") { $orderby = "order by CUSTOM_D2 desc"; } elseif($_GET['order'] == "limasc") { $orderby = "order by CUSTOM_D2 asc"; } if($_GET['order'] == "priodesc") { $orderby = "order by PRIORITY desc"; } elseif($_GET['order'] == "prioasc") { $orderby = "order by PRIORITY asc"; } if($_GET['order'] == "servdesc") { $orderby = "order by DESTINATION desc"; } elseif($_GET['order'] == "servasc") { $orderby = "order by DESTINATION asc"; } if($_GET['order'] == "socidesc") { $orderby = "order by SOCIETE desc"; } elseif($_GET['order'] == "sociasc") { $orderby = "order by SOCIETE asc"; } } return $orderby; } /** * Show the list of mail to validate * * @param array $listarr array which contains all the data to show * @param int $nb_total number of element to show * @param string $title list title * @param string $name page name */ public function validate_list($listarr, $nb_total, $title, $name) { $_SESSION['diff'] = array(); //$_SESSION['resultat'] = ""; $_SESSION['error'] = ''; // show the document list in result of the search $page_list1 = ""; $page_list2 = ""; //require_once("class_functions.php"); $func = new functions(); if(isset($_REQUEST['start'])) { $start = strip_tags($_REQUEST['start']); } else { $start = 0; } if(isset($_GET['order'])) { $orderby = strip_tags($_GET['order']); } else { $orderby = 0; } $link = "index.php?page=".$name; // define the defaults values $nb_show = $_SESSION['config']['nblinetoshow']; $nb_pages = ceil($nb_total/$nb_show); // if they are more than 1 page we do pagination with 2 forms if($nb_pages > 1) { $next_start = 0; $page_list1 = '

".$previous." ".$next."

"; } ?>

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

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

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

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

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

<? echo _DESC_SORT;?> <? echo _ASC_SORT;?>
dateformat($listarr[$theline]['CREATION_DATE']); } else { if("0000-00-00" == $listarr[$theline]['ARRIVEE'] || "00-00-0000" == $listarr[$theline]['ARRIVEE']) { echo $this->dateformat($listarr[$theline]['CREATION_DATE']); } else { echo $this->dateformat($listarr[$theline]['ARRIVEE']); } } ?> query("select SERVICE from ".$_SESSION['tablename']['services']." where ID = '".$listarr[$theline]['SERVICE_ID']."'"); $res3 = $this->fetch_object(); echo str_replace('\\', '',$res3->SERVICE); ?>


: A B C D E F G H I J K L M N O P Q R S T U V W X Y Z -

: A B C D E F G H I J K L M N O P Q R S T U V W X Y Z -

connect(); $this->query("select count(*) as total from ".$table_name." where ENABLED = 'Y' ".$where); $nb_total_1 = $this->fetch_object(); $nb_total = $nb_total_1->total; // define the defaults values $nb_pages = ceil($nb_total/$nb_show); $link = "index.php?page=".$page_name."&start=".$this->the_start."&order=".$this->orderby.$what; 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($this->the_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($this->the_start > 0) { $start_prev = $this->the_start - $nb_show; $previous = ''; } if($this->the_start <> $lastpage) { $start_next = $this->the_start + $nb_show; $next = ''; } $page_list1 = $page_list1.""; $page_list2 = $page_list2.""; if($previous <> '' || $next <> '') { if(empty($previous)) { $previous = " "; } if(empty($next)) { $next = " "; } $page_list1 .= $previous." ".$next.'

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

'; } } $this->query("select distinct ID from ".$table_name." where ENABLED = 'Y' ".$where." order by ID asc limit ".$this->the_start.",".$nb_show); echo '

'.$title.'

'; $this->servicelistletters(); echo $page_list1; ?> connect(); $color = "line1"; while($line = $this->fetch_object()) { if($color == ' class="col"') { $color = ''; } else { $color = ' class="col"'; } $db->query("select ID, SERVICE from ".$table_name." where ID ='".$line->ID."'"); $desc = ""; $line2 = $db->fetch_object(); $desc = $line2->SERVICE; ?> >
ID; ?>
clearserviceinfos(); } /** * Draw the departments list * * @param string $where sorting of the list (empty by default) * @param string $what first letter of the name (empty by default) */ public function emetlist($where = "",$what = "") { // draw the services list $func = new functions(); /* Configuration */ $title = _SHIPPER_LIST; $page_name = "emet"; $table_name = $_SESSION['tablename']['senders']; $res_table = $_SESSION['ressources'][0]['tablename']; $nb_show = $_SESSION['config']['nblinetoshow']; if(!empty($what)) { $what = "&what=".$what; } /***********************/ $this->connect(); $this->query("select count(*) as total from ".$table_name." where (1=1) ".$where); //$this->show(); $nb_total_1 = $this->fetch_object(); $nb_total = $nb_total_1->total; // define the defaults values $nb_pages = ceil($nb_total/$nb_show); $link = "index.php?page=".$page_name."&start=".$this->the_start."&order=".$this->orderby.$what; 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($this->the_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($this->the_start > 0) { $start_prev = $this->the_start - $nb_show; $previous = ''; } if($this->the_start <> $lastpage) { $start_next = $this->the_start + $nb_show; $next = ''; } $page_list1 = $page_list1.""; $page_list2 = $page_list2.""; if($previous <> '' || $next <> '') { if(empty($previous)) { $previous = " "; } if(empty($next)) { $next = " "; } $page_list1 .= $previous." ".$next.'

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

'; } } $this->query("select distinct ID from ".$table_name." where (1=1) ".$where." order by ID asc limit ".$this->the_start.",".$nb_show); echo '

'.$title.'

'; $this->emetlistletters(); echo $page_list1; ?> connect(); $color = "line1"; while($line = $this->fetch_object()) { if($color == ' class="col"') { $color = ''; } else { $color = ' class="col"'; } $db->query("select ID, LASTNAME, FIRSTNAME, SOCIETY from ".$table_name." where ID ='".$line->ID."'"); $desc = ""; $line2 = $db->fetch_object(); $name = $line2->LASTNAME; $prenom = $line2->FIRSTNAME; $societe = $line2->SOCIETY; ?> >
'));" >
clearemetinfos(); } /** * Load the data of the letterbox.xml file into session * */ public function xmltosessionletterbox() { $xmlbezons = simplexml_load_file('xml/letterbox.xml') ; $_SESSION['civilite'] = array(); //$_SESSION['emetteur'] = array(); $_SESSION['nature'] = array(); $_SESSION['quartiers'] = array(); $increment = 0; foreach($xmlbezons->CIVILITE as $CIVILITE) { foreach($CIVILITE-> CIV as $CIV) { $_SESSION['civilite'][$increment] = utf8_decode((string) $CIV); $increment++; } } $increment = 0; //foreach($xmlbezons->EMETTEUR as $EMETTEUR) //{ // foreach($EMETTEUR-> EME as $EME) // { // $_SESSION['emetteur'][$increment] = utf8_decode((string) $EME); // $increment++; // } //} // $increment = 0; foreach($xmlbezons->NATURE as $NATURE) { foreach($NATURE-> NAT as $NAT) { $_SESSION['nature'][$increment] = utf8_decode((string) $NAT); $increment++; } } $increment = 0; foreach($xmlbezons->QUARTIERS as $QUARTIERS) { foreach($QUARTIERS->QUA as $QUA) { $_SESSION['quartiers'][$increment] = utf8_decode((string) $QUA); $increment++; } } } /** * Load the rights on the departments in the database (used in the class_usergroups.php file) * */ public function load_group_service() { if(count($_SESSION['services_choisis']) > 0) { $where = " DESTINATION IN ( "; for($i=0; $i < count($_SESSION['services_choisis']); $i++) { $where .= " \'".trim($_SESSION['services_choisis'][$i])."\', "; } $where = ereg_replace(", $", " )", $where); } else { $where = " (1=-1) "; } $this->connect(); $this->query("DELETE FROM ".$_SESSION['tablename']['security'] ." where GROUP_ID = '".$_SESSION['m_admin']['groups']['GroupId']."'"); $this->query("INSERT INTO ".$_SESSION['tablename']['security']." VALUES ('".$_SESSION['m_admin']['groups']['GroupId']."', '".$_SESSION['ressources'][0]['tablename']."', '".$where."', '', 'N' , 'N')"); } /** * List of the mail process basket documents * * @param array $listarr contains the document index of the process basket * @param int $nb_total number of document * @param string $title title * @param string $name page name */ public function mail_process($listarr, $nb_total, $title, $name) { $_SESSION['diff'] = array(); $_SESSION['error'] = ''; // show the document list in result of the search $page_list1 = ""; $page_list2 = ""; $func = new functions(); if(isset($_REQUEST['start'])) { $start = strip_tags($_REQUEST['start']); } else { $start = 0; } if(isset($_GET['order'])) { $orderby = strip_tags($_GET['order']); } else { $orderby = 0; } $link = "index.php?page=".$name; // define the defaults values $nb_show = $_SESSION['config']['nblinetoshow']; $nb_pages = ceil($nb_total/$nb_show); // if they are more than 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."

"; } ?>

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

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

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

<? echo _DESC_SORT;?> <? echo _ASC_SORT;?>
<? echo _DESC_SORT;?> <? echo _ASC_SORT;?>
<? echo _TO_PROCESS;?> <?  echo _IN_PROGRESS;?> dateformat($listarr[$theline]['CREATION_DATE']); } else { if("0000-00-00" == $listarr[$theline]['ARRIVEE'] || "00-00-0000" == $listarr[$theline]['ARRIVEE']) { echo $this->dateformat($listarr[$theline]['CREATION_DATE']); } else { echo $this->dateformat($listarr[$theline]['ARRIVEE']); } } ?> show($listarr[$theline]['SOCIETE']);}else { echo $func->show($listarr[$theline]['OBJET']); } ?> show($listarr[$theline]['EMETTEUR']); ?>


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."

"; } ?>

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

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

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

<? echo _DESC_SORT;?> <? echo _ASC_SORT;?>
<? echo _DESC_SORT;?> <? echo _ASC_SORT;?>
<? echo _TO_PROCESS;?> <?  echo _IN_PROGRESS;?>


clearserviceinfos(); } if( $mode <> "add" && empty($_SESSION['error'])) { $this->connect(); $this->query("select * from ".$_SESSION['tablename']['services']." where ID = '".$id."'"); if($this->nb_result() == 0) { $_SESSION['error'] = _DEPARTMENT.' '._ALREADY_EXISTS; $state = false; } else { $_SESSION['m_admin']['services'] = array(); $line = $this->fetch_object(); $_SESSION['m_admin']['services']['ID'] = $line->ID; $_SESSION['m_admin']['services']['LABEL'] = $line->SERVICE; $_SESSION['m_admin']['services']['VALIDATE'] = $line->ENABLED; $_SESSION['m_admin']['services']['listmodel'] = array(); $this->query("select SEQUENCE, USER_ID from ".$_SESSION['tablename']['listmodel']." where RES_TABLE = 'res_x' and ID = '".$_SESSION['m_admin']['services']['ID']."' order by SEQUENCE asc "); while($line = $this->fetch_object()) { $_SESSION['m_admin']['services']['listmodel'][$line->SEQUENCE -1]['USER_ID'] = $line->USER_ID; } for($i=0; $i < count($_SESSION['m_admin']['services']['listmodel']); $i++) { $this->query("SELECT FIRSTNAME, LASTNAME, DEPARTMENT, MAIL FROM ".$_SESSION['tablename']['users']." WHERE USER_ID='".$_SESSION['m_admin']['services']['listmodel'][ $i]['USER_ID']."'"); //$this->show(); $line = $this->fetch_object(); $_SESSION['m_admin']['services']['listmodel'][$i]['FIRSTNAME'] = $line->FIRSTNAME; $_SESSION['m_admin']['services']['listmodel'][$i]['LASTNAME'] = $line->LASTNAME; $_SESSION['m_admin']['services']['listmodel'][$i]['DEPARTMENT'] = $line->DEPARTMENT; $_SESSION['m_admin']['services']['listmodel'][$i]['MAIL'] = $line->MAIL; } } } ?>




"._DOCTYPE.' '._UNKOWN."



"; } else { ?>

"prop" && $mode <> "add") { echo $func->show($_SESSION['m_admin']['services']['ID']); ?> *

*

wash($_REQUEST['name'], "no", _THE_LASTNAME.' '); if(isset($_REQUEST['prenom']) && !empty($_REQUEST['prenom'])) { $_SESSION['m_admin']['emet']['PRENOM'] = $func->wash($_REQUEST['prenom'], "no", _THE_FIRSTNAME.' '); } $_SESSION['m_admin']['emet']['FONCTION'] = ''; if(isset($_REQUEST['fonction']) && !empty($_REQUEST['fonction'])) { $_SESSION['m_admin']['emet']['FONCTION'] = $func->wash($_REQUEST['fonction'], "no", _THE_FUNCTION.' '); } if ($_REQUEST['societe'] <> '') { $_SESSION['m_admin']['emet']['SOCIETE'] = $func->wash($_REQUEST['societe'], "no", _THE_SOCIETY." "); } else { $_SESSION['m_admin']['emet']['SOCIETE'] = ''; } if ($_REQUEST['street'] <> '') { $_SESSION['m_admin']['emet']['STREET'] = $func->wash($_REQUEST['street'], "no", _ADDRESS.' '); } else { $_SESSION['m_admin']['emet']['STREET'] = ''; } if ($_REQUEST['town'] <> '') { $_SESSION['m_admin']['emet']['TOWN'] = $func->wash($_REQUEST['town'], "no", _TOWN.' '); } else { $_SESSION['m_admin']['emet']['TOWN'] = ''; } if ($_REQUEST['cp'] <> '') { $_SESSION['m_admin']['emet']['CP'] = $func->wash($_REQUEST['cp'], "no", _POSTAL_CODE.' '); } else { $_SESSION['m_admin']['emet']['CP'] = ''; } if ($_REQUEST['phone'] <> '') { $_SESSION['m_admin']['emet']['PHONE'] = $func->wash($_REQUEST['phone'], "num", _PHONE." "); } else { $_SESSION['m_admin']['emet']['PHONE'] = ''; } if ($_REQUEST['mail'] <> '') { $_SESSION['m_admin']['emet']['MAIL'] = $func->wash($_REQUEST['mail'], "mail", _MAIL); } else { $_SESSION['m_admin']['emet']['MAIL'] = ''; } /* if ($_REQUEST['tocontact'] <> '') { $_SESSION['m_admin']['emet']['TOCONTACT'] = $func->wash($_REQUEST['tocontact'], "no", "Contact privilegi�"); } else { $_SESSION['m_admin']['emet']['TOCONTACT'] = ''; }*/ } /** * Add ou modify emett in the database * * @param string $mode up or add */ public function addupemet($mode) { // add ou modify users in the database $this->emetinfo($mode); if(!empty($_SESSION['error'])) { if($mode == "up") { if(!empty($_SESSION['m_admin']['emet']['ID'])) { header("location: index.php?page=emet_up&id=".$_SESSION['m_admin']['emet']['ID']); exit; } else { header("location: index.php?page=emet"); exit; } } if($mode == "add") { header("location: index.php?page=emet_add"); exit; } } else { $this->connect(); if($mode == "add") { $this->query("INSERT INTO `".$_SESSION['tablename']['senders']."` ( `ID` , LASTNAME , FIRSTNAME , SOCIETY, FUNCTION , STREET, TOWN, CP, PHONE, MAIL ) VALUES ( '', '".$_SESSION['m_admin']['emet']['NAME']."', '".$_SESSION['m_admin']['emet']['PRENOM']."', '".$_SESSION['m_admin']['emet']['SOCIETE']."', '".$_SESSION['m_admin']['emet']['FONCTION']."', '".$_SESSION['m_admin']['emet']['STREET']."', '".$_SESSION['m_admin']['emet']['TOWN']."', '".$_SESSION['m_admin']['emet']['CP']."', '".$_SESSION['m_admin']['emet']['PHONE']."', '".$_SESSION['m_admin']['emet']['MAIL']."' )"); $this->clearemetinfos(); $_SESSION['error'] = _SHIPPER_ADDED; header("location: index.php?page=emet"); exit; } elseif($mode == "up") { $this->query("update `".$_SESSION['tablename']['senders']."` set `LASTNAME` = '".$_SESSION['m_admin']['emet']['NAME']."', `FIRSTNAME` = '".$_SESSION['m_admin']['emet']['PRENOM']."', `FUNCTION` = '".$_SESSION['m_admin']['emet']['FONCTION']."', `SOCIETY` = '".$_SESSION['m_admin']['emet']['SOCIETE']."', `STREET` = '".$_SESSION['m_admin']['emet']['STREET']."', `TOWN` = '".$_SESSION['m_admin']['emet']['TOWN']."', `CP` = '".$_SESSION['m_admin']['emet']['CP']."' , `PHONE` = '".$_SESSION['m_admin']['emet']['PHONE']."', `MAIL` = '".$_SESSION['m_admin']['emet']['MAIL']."' where ID = '".$_SESSION['m_admin']['emet']['ID']."'"); $this->clearemetinfos(); $_SESSION['error'] = _SHIPPER_UPDATED; header("location: index.php?page=emet"); exit; } } } /** * Form to modify a emettor * * @param $string $mode up or add * @param int $id $id of the department to change */ public function formemet($mode,$id = "") { $func = new functions(); $state = true; if(!isset($_SESSION['m_admin']['emet'])) { $this->clearemetinfos(); } if( $mode <> "add" && empty($_SESSION['error'])) { $this->connect(); $this->query("select * from ".$_SESSION['tablename']['senders']." where ID = '".$id."'"); if($this->nb_result() == 0) { $_SESSION['error'] = _THE_SHIPPER.' '._ALREADY_EXISTS; $state = false; } else { $_SESSION['m_admin']['emet'] = array(); $line = $this->fetch_object(); $_SESSION['m_admin']['emet']['ID'] = $line->ID; $_SESSION['m_admin']['emet']['NAME'] = $line->LASTNAME; $_SESSION['m_admin']['emet']['PRENOM'] = $line->FIRSTNAME; $_SESSION['m_admin']['emet']['SOCIETE'] = $line->SOCIETE; $_SESSION['m_admin']['emet']['FONCTION'] = $line->FUNCTION; $_SESSION['m_admin']['emet']['STREET'] = $line->STREET; $_SESSION['m_admin']['emet']['TOWN'] = $line->TOWN; $_SESSION['m_admin']['emet']['CP'] = $line->CP; $_SESSION['m_admin']['emet']['PHONE'] = $line->PHONE; $_SESSION['m_admin']['emet']['MAIL'] = $line->MAIL; $_SESSION['m_admin']['emet']['TOCONTACT'] = $line->TOCONTACT; } } ?>




"._SHIPPER." "._UNKOWN."



"; } else { ?>

*

"; } $_SESSION['m_admin']['services']['LABEL'] = $func->wash($_REQUEST['label'], "no", _THE_WORDING); $_SESSION['m_admin']['services']['ID'] = $func->wash($_REQUEST['id'], "no", _ID); } /** * Update or insert trhe database with the department info */ public function upservices() { $this->servicesinfo(); if(!empty($_SESSION['error'])) { if($_REQUEST['mode'] == "up") { if(!empty($_SESSION['m_admin']['services']['ID'])) { header("location: index.php?page=service_up&id=".$_SESSION['m_admin']['services']['ID']); exit; } else { header("location: index.php?page=liste"); exit; } } elseif($_REQUEST['mode'] == "add" ) { header("location: index.php?page=service_add"); exit; } } else { $this->connect(); if( $_REQUEST['mode'] <> "add") { $this->query("update `".$_SESSION['tablename']['services']."` set `SERVICE` = '".addslashes($_SESSION['m_admin']['services']['LABEL'])."' , `ENABLED` = 'Y' where ID = '".$_SESSION['m_admin']['services']['ID']."'"); $this->query("Delete from ".$_SESSION['tablename']['listmodel']." where RES_TABLE ='res_x' and ID = '".$_SESSION['m_admin']['services']['ID']."'"); for($i=0; $i < count($_SESSION['m_admin']['services']['listmodel']);$i++) { $seq = $i+1; $this->query("insert into ".$_SESSION['tablename']['listmodel']." ( RES_TABLE , ID, SEQUENCE, USER_ID ) VALUES ('res_x', '".$_SESSION['m_admin']['services']['ID']."', ".$seq.", '".$_SESSION['m_admin']['services']['listmodel'][ $i]['USER_ID']."')"); } if($_REQUEST['mode'] == "up") { $_SESSION['error'] = _DEPARTMENT_MODIF; if($_SESSION['history']['servicesup'] == "true") { require("class_history.php"); $users = new history(); $users->add($_SESSION['tablename']['services'], $_SESSION['m_admin']['services']['ID'],"UP",_DEPARTMENT_MODIF." : ".$_SESSION['m_admin']['services']['LABEL']); } } $this->clearserviceinfos(); header("location: index.php?page=liste"); exit; } else { $this->query("select ID from `".$_SESSION['tablename']['services']."` where ID = '".$_SESSION['m_admin']['services']['ID']."'"); if($this->nb_result() > 0) { $_SESSION['error'] = _THE_DEPARTMENT.' '.$_SESSION['m_admin']['services']['ID'].' '._ALREADY_EXISTS; header("location: index.php?page=service_add&show=false"); exit; } else { require("class_history.php"); $users = new history(); if( $_REQUEST['mode'] == "add") { $this->query("INSERT INTO `".$_SESSION['tablename']['services']."` ( `ID` , `SERVICE`,`ENABLED` ) VALUES ('".$_SESSION['m_admin']['services']['ID']."', '".$_SESSION['m_admin']['services']['LABEL']."','Y')"); if($_SESSION['history']['servicesadd'] == "true") { $users->add($_SESSION['tablename']['services'], $_SESSION['m_admin']['services']['ID'],"ADD", _DEPARTMENT_ADDED." : ".$_SESSION['m_admin']['services']['LABEL']); } } $this->query("Delete from ".$_SESSION['tablename']['listmodel']." where RES_TABLE ='res_x' and ID = '".$_SESSION['m_admin']['services']['ID']."'"); for($i=0; $i < count($_SESSION['m_admin']['services']['listmodel']);$i++) { $seq = $i+1; $this->query("insert into ".$_SESSION['tablename']['listmodel']." ( RES_TABLE , ID, SEQUENCE, USER_ID ) VALUES ('res_x', '".$_SESSION['m_admin']['services']['ID']."', ".$seq.", '".$_SESSION['m_admin']['services']['listmodel'][ $i]['USER_ID']."')"); } $_SESSION['error'] = _DEPARTMENT_ADDED; } $_SESSION['error'] = ""; } if ($_REQUEST['mode'] == "add") { $url = "index.php?page=liste"; } $this->clearserviceinfos(); header("location: ".$url); exit; } } /** * List of the mail in copy * * @param array $listarr contains the document index of the mail in copy * @param int $nb_total number of document * @param string $title title * @param string $name page name */ public function list_copy_mail($listarr, $nb_total, $title,$name ) { $page_list1 = ""; $page_list2 = ""; $func = new functions(); if(isset($_REQUEST['start'])) { $start = strip_tags($_REQUEST['start']); } else { $start = 0; } if(isset($_GET['order'])) { $orderby = strip_tags($_GET['order']); } else { $orderby = 0; } $link = "index.php?page=".$name; // 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 = '

".$previous." ".$next."

"; } ?>

0) { echo ''; } ?> > 0) { echo ''; } echo "


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


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

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


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


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

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


<? echo _DESC_SORT; ?> <? echo _ASC_SORT; ?>
 
<? echo _TO_PROCESS;?> <? echo _IN_PROGRESS;?> <? echo _CLOSED;?> <? echo _ONGOING;?> dateformat($listarr[$theline]['CREATION_DATE']); } else { if("0000-00-00" == $listarr[$theline]['ARRIVEE'] || "00-00-0000" == $listarr[$theline]['ARRIVEE']) { echo $this->dateformat($listarr[$theline]['CREATION_DATE']); } else { echo $this->dateformat($listarr[$theline]['ARRIVEE']); } }?> show($listarr[$theline]['ID']); ?> show($listarr[$theline]['NOM']); ?> show($listarr[$theline]['OBJET']); ?> show($listarr[$theline]['DEST']); ?>  <? echo _DETAILS; ?>
"; echo "
"; } /** * List of the mail in the autorized departments * * @param array $listarr contains the document index * @param int $nb_total number of document * @param string $title title * @param string $name page name */ public function dep_mail_list($listarr, $nb_total, $title, $service, $status ) { $page_list1 = ""; $page_list2 = ""; $func = new functions(); if(isset($_REQUEST['start'])) { $start = strip_tags($_REQUEST['start']); } else { $start = 0; } if(isset($_GET['order'])) { $orderby = strip_tags($_GET['order']); } else { $orderby = 0; } $link = "dep_result.php"; // 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 $_SESSION['config']['applicationname']; ?>

>
  <? echo _DESC_SORT; ?> <? echo _ASC_SORT; ?> <? echo _DESC_SORT; ?> <? echo _ASC_SORT; ?> <? echo _DESC_SORT; ?> <? echo _ASC_SORT; ?> <? echo _DESC_SORT; ?> <? echo _ASC_SORT; ?> <? echo _DESC_SORT; ?> <? echo _ASC_SORT; ?> <? echo _DESC_SORT; ?> <? echo _ASC_SORT; ?> <? echo _DESC_SORT; ?> <? echo _ASC_SORT; ?>  
show($listarr[$theline]['ID']); ?> show($listarr[$theline]['NOM']); ?> show($listarr[$theline]['SOCIETE']);}else{echo $func->show($listarr[$theline]['OBJET']);} ?> show($listarr[$theline]['DEST']); ?> dateformat($listarr[$theline]['LIMITE']); ?>  <? echo _DETAILS; ?>


: A B C D E F G H I J K L M N O P Q R S T U V W X Y Z -

connect(); $this->query("select count(*) as total from ".$table_name." ".$where); $nb_total_1 = $this->fetch_object(); $nb_total = $nb_total_1->total; // define the defaults values $nb_pages = ceil($nb_total/$nb_show); $link = "index.php?page=".$page_name."&start=".$this->the_start."&order=".$this->orderby.$what; 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($this->the_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($this->the_start > 0) { $start_prev = $this->the_start - $nb_show; $previous = ''; } if($this->the_start <> $lastpage) { $start_next = $this->the_start + $nb_show; $next = ''; } $page_list1 = $page_list1.""; $page_list2 = $page_list2.""; if($previous <> '' || $next <> '') { if(empty($previous)) { $previous = " "; } if(empty($next)) { $next = " "; } $page_list1 .= $previous." ".$next.'

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

'; } } $this->query("select distinct ID from ".$table_name." ".$where." order by ID asc limit ".$this->the_start.",".$nb_show); echo '

'.$title.'

'; $this->modelslistletters(); echo $page_list1; ?> connect(); $color = "line1"; while($line = $this->fetch_object()) { if($color == ' class="col"') { $color = ''; } else { $color = ' class="col"'; } $db->query("select ID, LABEL, COMMENT from ".$table_name." where ID ='".$line->ID."'"); $desc = ""; $line2 = $db->fetch_object(); $desc = $line2->LABEL; $comment = $line2->COMMENT; ?> >
ID; ?> '));" >
clearmodelinfos(); $_SESSION['services'] = array(); $this->query("select ID, SERVICE from ".$_SESSION['tablename']['services']." where ENABLED = 'Y'"); while($line = $this->fetch_object()) { array_push($_SESSION['services'], array("ID"=>$line->ID, "LABEL" => $line->SERVICE)); } $_SESSION['chosen_services'] = array(); } /** * Clear the session variables of the model administration * */ private function clearmodelinfos() { // clear the session variable for the models $_SESSION['m_admin']['model'] = array(); $_SESSION['m_admin']['model']['ID'] = ""; $_SESSION['m_admin']['model']['LABEL'] = ""; $_SESSION['m_admin']['model']['COMMENT'] = ""; $_SESSION['m_admin']['model']['DATE'] = ""; $_SESSION['m_admin']['model']['CONTENT'] = ""; $_SESSION['m_admin']['model']['SERVICES'] = array(); } /** * Form to add or modify a model * * @param string $mode up or add * @param string $id identifier of the model to modify */ public function formmodel($mode,$id = "") { $func = new functions(); $state = true; if(!isset($_SESSION['m_admin']['model'])) { $this->clearmodelinfos(); } if( $mode <> "add" && empty($_SESSION['error'])) { $this->connect(); $this->query("select * from ".$_SESSION['tablename']['models']." where ID = '".$id."'"); if($this->nb_result() == 0) { $_SESSION['error'] = _MODEL.' '._UNKNOWN; $state = false; } else { $_SESSION['m_admin']['model'] = array(); $line = $this->fetch_object(); $_SESSION['m_admin']['model']['ID'] = $line->ID; $_SESSION['m_admin']['model']['LABEL'] = trim($line->LABEL); $_SESSION['m_admin']['model']['COMMENT'] = trim($line->COMMENT); $_SESSION['m_admin']['model']['DATE'] = $line->CREATION_DATE; $_SESSION['m_admin']['model']['CONTENT'] = stripslashes($line->CONTENT); //$_SESSION['m_admin']['model']['CONTENT'] = str_replace("\'", "'",$line->CONTENT); //$_SESSION['m_admin']['model']['CONTENT'] = str_replace('\"', '"' ,$line->CONTENT); //$_SESSION['m_admin']['model']['CONTENT'] = $line->CONTENT; $_SESSION['m_admin']['model']['SERVICES'] = array(); $this->query("select s.ID, s.SERVICE from ".$_SESSION['tablename']['model_service']." ms, ".$_SESSION['tablename']['services']." s where ms.ID_MODEL = ".$_SESSION['m_admin']['model']['ID']." and s.ID = ms.ID_SERVICE"); //$this->show(); while($res = $this->fetch_object()) { array_push($_SESSION['m_admin']['model']['SERVICES'] , array('ID' =>$res->ID, 'LABEL' => $res->SERVICE)); } } } ?>

*

"; } $allowedTags='

'; $allowedTags.='

      • '; if($_REQUEST['model_content']!='') { $_SESSION['m_admin']['model']['CONTENT'] = strip_tags(addslashes(trim($_REQUEST['model_content'])),$allowedTags); } else { $_SESSION['m_admin']['model']['CONTENT'] = ''; //$_SESSION['error'] .= _MODEL_EMPTY.".
        "; } $_SESSION['m_admin']['model']['LABEL'] = $func->wash($_REQUEST['model_name'], "no", _THE_WORDING); $_SESSION['m_admin']['model']['LABEL'] = trim(stripslashes($_SESSION['m_admin']['model']['LABEL'])); $_SESSION['m_admin']['model']['COMMENT'] = ""; if(!empty($_REQUEST['model_comment']) && isset($_REQUEST['model_comment'])) { $_SESSION['m_admin']['model']['COMMENT'] = trim(stripslashes($_REQUEST['model_comment'])); } if($_REQUEST['mode'] == "up") { $_SESSION['m_admin']['model']['ID'] = $func->wash($_REQUEST['model_id'], "no", _ID); } //if(count($_SESSION['m_admin']['model']['SERVICES']) < 1) //{ // $_SESSION['error'] .= _ATTACH_MODEL_TO_DEP.".
        "; //} } /** * Update the database with the model data * */ public function upmodel() { $this->modelinfo(); if(!empty($_SESSION['error'])) { if($_REQUEST['mode'] == "up") { if(!empty($_SESSION['m_admin']['model']['ID'])) { header("location: index.php?page=model_up&id=".$_SESSION['m_admin']['label']['ID']); exit; } else { header("location: index.php?page=models"); exit; } } elseif($_REQUEST['mode'] == "add" ) { header("location: index.php?page=model_add"); exit; } } else { $this->connect(); if( $_REQUEST['mode'] <> "add") { $this->query("update `".$_SESSION['tablename']['models']."` set LABEL = '".addslashes($_SESSION['m_admin']['model']['LABEL'])."' , COMMENT = '".addslashes($_SESSION['m_admin']['model']['COMMENT'])."', CONTENT = '".$_SESSION['m_admin']['model']['CONTENT']."' where ID = '".$_SESSION['m_admin']['model']['ID']."'"); $this->query("Delete from ".$_SESSION['tablename']['model_service']." where ID_MODEL = '".$_SESSION['m_admin']['model']['ID']."'"); for($i=0; $i < count($_SESSION['m_admin']['model']['SERVICES']);$i++) { $this->query("insert into ".$_SESSION['tablename']['model_service']." ( ID_SERVICE, ID_MODEL ) VALUES ( '".$_SESSION['m_admin']['model']['SERVICES'][$i]['ID']."', ".$_SESSION['m_admin']['model']['ID'].")"); } if($_REQUEST['mode'] == "up") { $_SESSION['error'] = _MODEL_MODIFICATION; if($_SESSION['history']['modelsup'] == "true") { require("class_history.php"); $users = new history(); $users->add($_SESSION['tablename']['models'], $_SESSION['m_admin']['model']['ID'],"UP",_MODEL_MODIFICATION." : ".$_SESSION['m_admin']['model']['LABEL']); } } $this->clearmodelinfos(); header("location: index.php?page=models"); exit; } else { $this->query("select LABEL from ".$_SESSION['tablename']['models']." where LABEL = '".addslashes($_SESSION['m_admin']['model']['LABEL'])."'"); if($this->nb_result() > 0) { $_SESSION['error'] = _THE_MODEL.' '.$_SESSION['m_admin']['model']['LABEL'].' '._ALREADY_EXISTS; header("location: index.php?page=model_add"); exit; } else { require("class_history.php"); $users = new history(); if( $_REQUEST['mode'] == "add") { $this->query("INSERT INTO ".$_SESSION['tablename']['models']." ( LABEL, CREATION_DATE, COMMENT, CONTENT ) VALUES ( '".addslashes($_SESSION['m_admin']['model']['LABEL'])."', now(),'".addslashes($_SESSION['m_admin']['model']['COMMENT'])."', '".$_SESSION['m_admin']['model']['CONTENT']."')"); $this->query("select ID from ".$_SESSION['tablename']['models']." where LABEL = '".addslashes($_SESSION['m_admin']['model']['LABEL'])."' and COMMENT = '".addslashes($_SESSION['m_admin']['model']['COMMENT'])."' and CONTENT = '".$_SESSION['m_admin']['model']['CONTENT']."'"); $res = $this->fetch_object(); $_SESSION['m_admin']['model']['ID'] = $res->ID; if($_SESSION['history']['modelsadd'] == "true") { $users->add($_SESSION['tablename']['models'], $_SESSION['m_admin']['model']['ID'],"ADD", _MODEL_ADDED." : ".$_SESSION['m_admin']['model']['LABEL']); } } // $this->query("Delete from ".$_SESSION['tablename']['model_service']." where ID = ".$_SESSION['m_admin']['model']['ID']); for($i=0; $i < count($_SESSION['m_admin']['model']['SERVICES']);$i++) { $this->query("insert into ".$_SESSION['tablename']['model_service']." (ID_MODEL, ID_SERVICE ) VALUES (".$_SESSION['m_admin']['model']['ID'].", '".$_SESSION['m_admin']['model']['SERVICES'][$i]['ID']."' )"); } $_SESSION['error'] = _MODEL_ADDED; } $_SESSION['error'] = ""; } if ($_REQUEST['mode'] == "add") { $url = "index.php?page=models"; } $this->clearmodelinfos(); header("location: ".$url); exit; } } /** * replace the defined fields in the instance of the model * * @param string $content model content */ public function fields_replace($content) { $content = str_replace("[CIV_EMETTEUR]", $_SESSION['courrier']['civ'], $content); $content = str_replace("[NOM_EMETTEUR]", $_SESSION['courrier']['author'], $content); $content = str_replace("[PRENOM_EMETTEUR]", $_SESSION['courrier']['prenom'], $content); $content = str_replace("[SOCIETE_EMETTEUR]", $_SESSION['courrier']['societe'], $content); $content = str_replace("[OBJET]", $_SESSION['courrier']['description'], $content); $content = str_replace("[TYPE]", $_SESSION['courrier']['type_id'], $content); $content = str_replace("[DATE_LIM]", $_SESSION['courrier']['date_limite'], $content); $content = str_replace("[DATE_ARRIVEE]", $_SESSION['courrier']['date_arrivee'], $content); $content = str_replace("[NATURE]", $_SESSION['courrier']['nature'], $content); $this->query("select SERVICE from ".$_SESSION['tablename']['services']." where ID = '".$_SESSION['courrier']['service']."'"); $res = $this->fetch_object(); $content = str_replace("[SERVICE]", $res->SERVICE, $content); $content = str_replace("[NEW_EMETTEUR]", $_SESSION['user']['FirstName'].' '.$_SESSION['user']['LastName'], $content); $content = str_replace("[PHONE_EMETTEUR]", $_SESSION['user']['Phone'], $content); $content = str_replace("[MAIL_EMETTEUR]", $_SESSION['user']['Mail'], $content); $content = str_replace("[DEP_EMETTEUR]", $_SESSION['user']['department'], $content); $content = str_replace("[REP_COURRIER_SIMPLE]", $_SESSION['courrier']['rep_courrier_simple'], $content); $content = str_replace("[REP_DIRECT]", $_SESSION['courrier']['rep_direct'], $content); $content = str_replace("[REP_MAIL]", $_SESSION['courrier']['rep_mail'], $content); $content = str_replace("[REP_AR]", $_SESSION['courrier']['rep_AR'], $content); $content = str_replace("[REP_FAX]", $_SESSION['courrier']['rep_fax'], $content); $content = str_replace("[REP_AUTRE]", $_SESSION['courrier']['rep_autre'], $content); $content = str_replace("[NOTES_TRAIT]", $_SESSION['courrier']['notes'], $content); $content = str_replace("[QUALITE]", $_SESSION['courrier']['qualite'], $content); $content = str_replace("[NUM_RUE]", $_SESSION['courrier']['num_rue'], $content); $content = str_replace("[RUE]", $_SESSION['courrier']['rue'], $content); $content = str_replace("[VILLE]", $_SESSION['courrier']['ville'], $content); $content = str_replace("[CODE_POSTAL]", $_SESSION['courrier']['code'], $content); $content = str_replace("[DATE_TODAY]", date("d-m-Y"), $content); return $content; } /** * delete a model in the database * * @param string $id model identifier */ public function delmodel($id) { if(!empty($_SESSION['error'])) { header("location: index.php?page=models"); exit; } else { $this->connect(); $this->query("select ID, LABEL from ".$_SESSION['tablename']['models']." where ID = ".$id); if($this->nb_result() == 0) { $_SESSION['error'] = _MODEL.' '._UNKNOWN; header("location: index.php?page=models"); exit; } else { $res = $this->fetch_object(); $label = $res->LABEL; $this->query("delete from ".$_SESSION['tablename']['models']." where ID = ".$id); $this->query("delete from ".$_SESSION['tablename']['model_service']." where ID_MODEL = ".$id); if($_SESSION['history']['modelsdel']) { require("class_history.php"); $users = new history(); $users->add($_SESSION['tablename']['models'], $id,"DEL",_MODEL_DELETION." : ".$label); } $_SESSION['error'] = _DELETED_MODEL; header("location: index.php?page=models"); exit; } } } /** * delete a model in the database * * @param string $id model identifier */ public function delemet($id) { if(!empty($_SESSION['error'])) { header("location: index.php?page=emet"); exit; } else { $this->connect(); $this->query("select ID from ".$_SESSION['tablename']['senders']." where ID = ".$id); if($this->nb_result() == 0) { $_SESSION['error'] = _SHIPPER.' '._UNKNOWN; header("location: index.php?page=emet"); exit; } else { $res = $this->fetch_object(); $label = $res->LABEL; $this->query("delete from ".$_SESSION['tablename']['senders']." where ID = ".$id); $_SESSION['error'] = _SHIPPER." ".strtolower(_DELETED); header("location: index.php?page=emet"); exit; } } } /** * List of the out mail basket * * @param array $listarr contains the document index of the out basket * @param int $nb_total number of document * @param string $title title * @param string $name page name */ public function mail_out($listarr, $nb_total, $title, $name) { $_SESSION['diff'] = array(); $_SESSION['error'] = ''; // show the document list in result of the search $page_list1 = ""; $page_list2 = ""; $func = new functions(); if(isset($_REQUEST['start'])) { $start = strip_tags($_REQUEST['start']); } else { $start = 0; } if(isset($_GET['order'])) { $orderby = strip_tags($_GET['order']); } else { $orderby = 0; } $link = "index.php?page=".$name; // define the defaults values $nb_show = $_SESSION['config']['nblinetoshow']; $nb_pages = ceil($nb_total/$nb_show); // if they are more than 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."

        "; } ?>

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

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

        <? echo _DESC_SORT;?> <? echo _ASC_SORT;?>
           
         <? echo _DETAILS; ?> "; ?>

        query("select * from ".$_SESSION['tablename']['listinstance']." where res_id = ".$res_id); if($this->nb_result() < 1) { $this->query("insert into ".$_SESSION['tablename']['listinstance']." values ('res_x', ".$res_id.", 1, '".$user_id."')"); $this->show(); } else { $this->query("update ".$_SESSION['tablename']['listinstance']." set user_id = '".$user_id."' where res_id = ".$res_id." and res_table = 'res_x' and sequence = 1"); $this->show(); } //exit(); } /** * delete a note in the database * * @param string $id note identifier */ public function delnote($id, $resid) { if(!empty($_SESSION['error'])) { ?> connect(); $this->query("select ID from ".$_SESSION['tablename']['notes']." where ID = ".$id." and USER_ID = '".$_SESSION['user']['UserId']."'"); if($this->nb_result() == 0) { $_SESSION['error'] = _CANT_DELETE_NOTE; header("location: index.php?page=details&id=".$resid); exit; } else { $res = $this->fetch_object(); $label = $res->LABEL; $this->query("delete from ".$_SESSION['tablename']['notes']." where ID = ".$id); //Mise � jour de l'historique if($_SESSION['history']['notesdel']) { require_once("class_history.php"); $hist = new history(); $hist->add($_SESSION['tablechoice'], $resid ,"DEL", _DELETION_NOTE); } header("location: notes_courrier.php?id=".$resid); exit; } } } } ?>