include("session.php");
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)
{
?>
}
elseif($_GET['action'] == "DEL" && count($_SESSION['chosen_doc']) > 0)
{
?>
}
}
$_SESSION['origin'] = 'basket';
$courrier = new LetterBox();
$orderby = $courrier->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 res_id, destination, status, date(creation_date) as date, dest_user from ".$table." where ".$_SESSION['current_basket']['clause'].' '.$orderby." limit ".$start.",".$_SESSION['config']['nblinetoshow']);
$_SESSION['print_list']['current_request'] = "select res_id, destination, status, creation_date from ".$table." where ".$_SESSION['current_basket']['clause'].' '.$orderby;
$tab = array();
while($line = $db->fetch_object())
{
$status = $courrier->test_reserved_time($line->res_id, $table, $line->status);
if($status == 'ATT')
{
$user = '';
}
else
{
$user = $line->dest_user;
}
array_push($tab, array( "DESTINATION" => $line->destination, "ID" => $line->res_id, "CREATION_DATE" => $db->inverse_date($line->date), "STATUS" => $status , "USER" => $user));
}
if($total == 1)
{
$title = $_SESSION['current_basket']['label']." (".$total." document)";
}
else
{
$title = $_SESSION['current_basket']['label']." (".$total." "._DOCUMENTS.")";
}
$courrier->qualif_list($tab, $total, $title, $_SESSION['current_basket']['page']);
?>