session_name('LetterBox2');
session_start();
require_once("class_functions.php");
require("class_db.php");
require_once("test_page.php");
$_SESSION['req_type'] = "qualif";
if(file_exists($_SESSION['config']['lang'].'.php'))
{
include($_SESSION['config']['lang'].'.php');
}
else
{
$_SESSION['error'] = "Language file missing...
";
}
$_SESSION['courrier'] = array();
if(!isset($_SESSION['courrier']["is_ingoing"]) || $_SESSION['courrier']["is_ingoing"] <> FALSE )
{
$_SESSION['courrier']["is_ingoing"]= TRUE ;
}
if(!isset($_SESSION['courrier']["new_folder"]) || $_SESSION['courrier']["new_folder"] <> FALSE )
{
$_SESSION['courrier']["new_folder"]= TRUE;
}
$_SESSION['courrier']['res_id'] = trim($_GET['id']);
//$_SESSION['courrier']["is_ingoing"]= TRUE;
//$_SESSION['courrier']['new_folder'] = TRUE;
$_SESSION["popup_suite"] = false;
if(!isset($_SESSION['user']['UserId']) || empty($_SESSION['user']['UserId']))
{
header("location: reopen.php");
}
$function = new functions();
$function->start_page_stat();
$function->configPosition("qualif.php");
$time = $function->get_session_time_expire();
$db = new dbquery();
$db->connect();
$db->query("select status from ".$_SESSION['ressources'][0]['tablename']." where res_id = ".$_SESSION['courrier']['res_id'] );
$res = $db->fetch_object();
if($res->status == 'RSV')
{
$db->query("update ".$_SESSION['tablename']['param']." set value = '".strtotime("+1 hour")."' where key1 = '".$_SESSION['ressources'][0]['tablename']."' and key2 = '".$_SESSION['courrier']['res_id']."' and id = 'affaire_reservee'");
//$db->show();
}
else
{
$db->query("update ". $_SESSION['ressources'][0]['tablename']." set status = 'RSV', dest_user = '".$_SESSION['user']['UserId']."' where res_id = ".$_SESSION['courrier']['res_id'] );
//$db->show();
$db->query("insert into ".$_SESSION['tablename']['param']." (key1, key2, id, value) values ( '".$_SESSION['ressources'][0]['tablename']."', '".$_SESSION['courrier']['res_id']."', 'affaire_reservee', '".strtotime("+1 hour")."')");
// $db->show();
}
?>
|