*/ session_name('LetterBox2'); session_start(); require_once("class_db.php"); require_once("class_letterbox.php"); 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) { ?> define_order(); if(empty($orderby)) { $orderby = " ORDER BY priority "; } $table = $_SESSION['current_basket']['table']; $user = $_SESSION['user']['UserId']; $db = new dbquery(); $db->connect(); $db->query("select count(*) as TOTAL from ".$table." where ".$_SESSION['current_basket']['clause'].' '.$orderby); $line = $db->fetch_object(); $total = $line->TOTAL; $db->query("select SOCIETE,DESCRIPTION, RES_ID, AUTHOR, TYPE_ID,date(CUSTOM_D1) as DATE1, date(CUSTOM_D2) as DATE2, date(CREATION_DATE) as DATE3, STATUS, PRIORITY, SOCIETE, AUTHOR, IS_INGOING from ".$table." where ".$_SESSION['current_basket']['clause'].' '.$orderby." limit ".$start.",".$_SESSION['config']['nblinetoshow']); if ($_SESSION['config']['corporate'] == "true") { $_SESSION['print_list']['current_request'] = "select RES_ID, AUTHOR, SOCIETE, date(CUSTOM_D1) as DATE1,date(CUSTOM_D2) as DATE2 , PRIORITY, STATUS from ".$table." where ".$_SESSION['current_basket']['clause'].' '.$orderby; } else { $_SESSION['print_list']['current_request'] = "select RES_ID, PRIORITY, date(CUSTOM_D1) as DATE1, DESCRIPTION, AUTHOR , date(CUSTOM_D2) as DATE2, STATUS from ".$table." where ".$_SESSION['current_basket']['clause'].' '.$orderby; } $tab = array(); while($line = $db->fetch_object()) { array_push($tab, array( "SOCIETE" => $line->SOCIETE, "OBJET" => $line->DESCRIPTION, "ID" => $line->RES_ID, "TYPE" => $line->TYPE_ID, "ARRIVEE" => $db->inverse_date($line->DATE1), "CREATION_DATE" => $db->inverse_date($line->DATE3), "EMETTEUR" => stripslashes($line->AUTHOR." ".$line->CUSTOM_T4), "STATUS"=> $line->STATUS, "LIMITE" => $db->inverse_date($line->DATE2), "PRIORITY" => $line->PRIORITY, "SOCIETE" => $line->SOCIETE, "IS_INGOING" => $line->IS_INGOING)); } if($total == 1) { $title = $_SESSION['current_basket']['label']." (".$total." document)"; } else { $title = $_SESSION['current_basket']['label']." (".$total." "._DOCUMENTS.")"; } $courrier->mail_process($tab, $total, $title, $_SESSION['current_basket']['page']); ?>