*/
include("session.php");
require_once("class_functions.php");
require_once("class_db.php");
if(file_exists($_SESSION['config']['lang'].'.php'))
{
include($_SESSION['config']['lang'].'.php');
}
else
{
$_SESSION['error'] = "Language file missing...
";
}
$func = new functions();
$users = array();
$what = "A";
$where = "";
if(isset($_GET['what']) && !empty($_GET['what']))
{
$what = addslashes($func->wash($_GET['what'], "no", "", "no"));
if($_GET['service'] == "true")
{
if($what == "all")
{
$where = " order by DEPARTMENT, LastName ";
}
else
{
$where = "where DEPARTMENT like '".strtolower($what)."%' or DEPARTMENT like '".strtoupper($what)."%' order by DEPARTMENT, LastName ";
}
}
else
{
if($what == "all")
{
$where = " order by LastName ";
}
else
{
$where = "where LastName like '".strtolower($what)."%' or LastName like '".strtoupper($what)."%' order by LastName";
}
}
}
$db = new dbquery();
$db->connect();
$db->query("select USER_ID, FIRSTNAME, LASTNAME, DEPARTMENT, MAIL from ".$_SESSION['tablename']['users']." ".$where);
$i=1;
while($line = $db->fetch_object())
{
$users[$i] = array("ID" => $line->USER_ID, "PRENOM" => $line->FIRSTNAME, "NOM" => $line->LASTNAME, "DEP" => $line->DEPARTMENT, "MAIL" => $line->MAIL);
$i++;
}
$redirect_ind = "";
if($_GET['action'] == "choose" && !empty($_GET['ind']))
{
$redirect_ind = $_GET['ind'];
}
if($_POST['redirect'])
{
$table = 'res_x';
if($_SESSION['origin'] == "details")
{
$db->query("Update ".$table." set DEST_USER = '".$_POST['user']."' where RES_ID = ".$_SESSION['detail_id'] );
$db->query("UPDATE ".$_SESSION['tablename']['listinstance']." set USER_ID = '".$_POST['user']."', BY_USER_ID ='".$_SESSION['user']['UserId']."' where RES_TABLE = '".$table."' and RES_ID = ".$_SESSION['detail_id']." and SEQUENCE = 1");
if($_SESSION['history']['redirection'] == "true")
{
require_once("class_history.php");
$history = new history();
$history->add($table,$_SESSION['detail_id'],"RED",_LETTER_N.$_SESSION['detail_id']." ".strtolower(_REDIRECT_TO)." ".$_POST['user']." (".$_SESSION['courrier']['type_id'].")");
}
?>
query("Update ".$table." set DEST_USER = '".$_POST['user']."' where RES_ID = ".$_SESSION['courrier']['res_id'] );
$db->query("UPDATE ".$_SESSION['tablename']['listinstance']." set USER_ID = '".$_POST['user']."', BY_USER_ID = '".$_SESSION['user']['UserId']."' where RES_TABLE = '".$table."' and RES_ID = ".$_SESSION['detail_id']." and SEQUENCE = 1");
if($_SESSION['history']['redirection'] == "true")
{
require_once("class_history.php");
$history = new history();
$history->add($table,$_SESSION['courrier']['res_id'] ,"RED",_LETTER_N.$_SESSION['detail_id']." ".strtolower(_REDIRECT_TO)." ".$_POST['user']." (".$_SESSION['courrier']['type_id'].")");
}
?>
get_session_time_expire();
?>
: |
: |