* @author Jimmy Cédric Ndoumba */ include("session.php"); if(file_exists($_SESSION['config']['lang'].'.php')) { include($_SESSION['config']['lang'].'.php'); } else { $_SESSION['error'] = "Language file missing...
"; } require_once("class_functions.php"); require_once("class_db.php"); require_once("class_letterbox.php"); //$_SESSION['origin'] = $_SESSION['current_basket']['page']; $func = new functions(); $courrier = new LetterBox(); $orderby = $courrier->define_order(); if(isset($_GET['start'])) { $start = $_GET['start']; } else { $start = 0; } if(isset($_GET['action']) && !empty($_GET['action']) ) { if($_GET['action'] == "RED" && count($_SESSION['chosen_doc']) > 0) { ?> 0) { ?> 'END' and STATUS <> 'ATT' and STATUS <> 'REP' and STATUS <> 'VAL') "; } elseif($_SESSION['tmpbasket']['status']== "in_progress") { $where .= " and STATUS ='COU' "; } elseif($_SESSION['tmpbasket']['status'] == "new") { $where .= " and STATUS = 'NEW' "; } elseif($_SESSION['tmpbasket']['status'] == "wait") { $where .= " and STATUS = 'WAI' "; } elseif($_SESSION['tmpbasket']['status'] == "fva") { $where .= " and STATUS = 'FVA' "; } elseif($_SESSION['tmpbasket']['status'] == "rjv") { $where .= " and STATUS = 'RJV' "; } elseif($_SESSION['tmpbasket']['status'] == "rjt") { $where .= " and STATUS = 'RJT' "; } elseif($_SESSION['tmpbasket']['status'] == "rjd") { $where .= " and STATUS = 'RJD' "; } elseif($_SESSION['tmpbasket']['status'] == "mep") { $where .= " and STATUS = 'MEP' "; } elseif($_SESSION['tmpbasket']['status'] == "late") { $datenow=date("Ymd"); $where .=" and ( CUSTOM_D2 is not null and '".$datenow."' > date(CUSTOM_D2) and STATUS <> 'END' and STATUS <> 'VAL' and STATUS <> 'DEL' and STATUS <> 'WAI' and STATUS <> 'RSV' and STATUS <> 'ATT' and STATUS <> 'MEP') "; } } $table = $_SESSION['current_basket']['table']; $db = new dbquery(); $db->connect(); $db->query("select count(*) as TOTAL from ".$table." where ".$_SESSION['current_basket']['clause'].' '.$where.$orderby); //$db->show(); $line = $db->fetch_object(); $total = $line->TOTAL; //$db->query("select SOCIETE, DESTINATION, DEST_USER, DESCRIPTION, RES_ID, TYPE_ID, IDENTIFIER, date(CREATION_DATE) as DATE1, AUTHOR, CUSTOM_T4, date(CUSTOM_D2) as DATE2, CUSTOM_T3, STATUS, PRIORITY from ".$table." where ".$_SESSION['current_basket']['clause']." ".$where.$orderby." limit ".$start.",".$_SESSION['config']['nblinetoshow']); $db->query("select SOCIETE, DESTINATION, DEST_USER, DESCRIPTION, RES_ID, TYPE_ID, IDENTIFIER, date(CREATION_DATE) as DATE1, AUTHOR, CUSTOM_T4, date(CUSTOM_D2) as DATE2, CUSTOM_T3, STATUS, PRIORITY, (SELECT COUNT(*) FROM ".$_SESSION['tablename']['notes']." WHERE ".$_SESSION['tablename']['notes'].".RECORD_ID = ".$table.".RES_ID) AS NBR_NOTE from ".$table." where ".$_SESSION['current_basket']['clause']." ".$where.$orderby." limit ".$start.",".$_SESSION['config']['nblinetoshow']); //$db->show(); die; if ($_SESSION['config']['corporate'] == "true" && $_SESSION['config']['replace_subject_by_society'] == "true") { $_SESSION['print_list']['current_request'] = " select RES_ID, PRIORITY, AUTHOR, SOCIETE, DEST_USER, date(CUSTOM_D2) as DATE2 from ".$table." where ".$_SESSION['current_basket']['clause']." ".$where.$orderby; } else { $_SESSION['print_list']['current_request'] = " select RES_ID, PRIORITY, AUTHOR, DESCRIPTION, DEST_USER, date(CUSTOM_D2) as DATE2 from ".$table." where ".$_SESSION['current_basket']['clause']." ".$where.$orderby; } $tab = array(); while($line = $db->fetch_object()) { $this_line = array( "OBJET" => $line->DESCRIPTION, "SOCIETE" => $line->SOCIETE, "ID" => $line->RES_ID, "TYPE" => $line->TYPE_ID, "IDENTIFIER" => $line->IDENTIFIER, "ARRIVEE" => $db->inverse_date($line->DATE1), "CIV" => $line->CUSTOM_T3, "NOM" => $line->AUTHOR, "PRENOM" => $line->CUSTOM_T4, "LIMITE" => $db->inverse_date($line->DATE2), "SERVICE" => $line->DESTINATION, "DEST" => $line->DEST_USER, "STATUS" => $line->STATUS, "PRIORITY" => $line->PRIORITY, "NBR" => $line->NBR_NOTE); $this_line["SOCIETE"] = $func->show($this_line["SOCIETE"],8); $this_line["OBJET"] = $func->show($this_line["OBJET"],10); $this_line["TYPE"] = $func->show($this_line["TYPE"],8); $this_line["PRIORITY"] = $func->show($_SESSION['priority'][$this_line["PRIORITY"]]['label'],8); $this_line["DEST"] = $func->show($this_line["DEST"],10); $this_line["NOM"] = $func->show($this_line["NOM"],8); $this_line["SERVICE"] = $func->show($this_line["SERVICE"],15); $tab[] = $this_line; } $label = $_SESSION['tmpbasket']['service']; for($i=0; $i < count($_SESSION['user']['services']); $i++) { if($_SESSION['user']['services'][$i]['ID'] == $_SESSION['tmpbasket']['service']) { $label = str_replace('\\', '',$_SESSION['user']['services'][$i]['LABEL']); } } $title = $label." (".$total." "._DOCUMENTS.")"; $courrier->dep_mail_list($tab, $total, $title, $service, $status); ?>