*/ require_once("class_functions.php"); require_once("class_db.php"); require_once("class_diffusion.php"); include("session.php"); if(file_exists($_SESSION['config']['lang'].'.php')) { include($_SESSION['config']['lang'].'.php'); } else { $_SESSION['error'] = "Language file missing..."; } $funct= new functions(); $res_id = $_SESSION['courrier']['res_id']; $func = new functions(); $_SESSION["rediriger"]=false; $con = new dbquery(); $con->connect(); if( !isset($_SESSION["diffusion"]) ) { $_SESSION["diffusion"] = new diffusion($con,$_SESSION['user']['UserId'],$_SESSION['user']['delete_copy_rights'],$_SESSION['config']['modifycopylist'], $_SESSION['config']['redirect_list'],$_SESSION['config']['tag100_for_copy']); $_SESSION["diffusion"]->load_from_db("res_x",$res_id); } if( count($_GET) == 0 && count($_POST) == 0) { //NO POST NO GET } if($_GET['cancel']) { $_SESSION["diffusion"]->reload(); ?> $value) $_SESSION["diffusion"]->set_mailaction_user($key,$value); } if( isset($_GET['mail_actions_services']) ) { foreach( $_GET['mail_actions_services'] as $key => $value) $_SESSION["diffusion"]->set_mailaction_service($key,$value); } ?> 0) { $user_access = "and department in ("; for($t=0; $twash($_GET['what_users'], "no", "", "no")); $where .= " AND (u.LASTNAME like '%".strtolower($what_users)."%' OR u.LASTNAME like '%".strtoupper($what_users)."%' OR u.FIRSTNAME like '%".strtolower($what_users)."%' OR u.FIRSTNAME like '%".strtoupper($what_users)."%') "; $orderby = " ORDER BY u.LASTNAME asc, u.FIRSTNAME asc,s.SERVICE asc"; } if(isset($_GET['what_services']) && !empty($_GET['what_services']) ) { $what_services = addslashes($func->wash($_GET['what_services'], "no", "", "no")); $where .= " AND (s.SERVICE like '%".strtolower($what_services)."%' OR s.SERVICE like '%".strtoupper($what_services)."%')"; $orderby = " ORDER BY s.SERVICE asc, u.LASTNAME asc, u.FIRSTNAME asc"; } if(!empty($where)) { if($_SESSION['config']['show_only_elu_in_mailing_list'] == 'true') $where .= "AND u.ELU = 'Y' "; $db = new dbquery(); $db->connect(); $db->query("select u.USER_ID, u.FIRSTNAME, u.LASTNAME, u.DEPARTMENT, u.MAIL, s.SERVICE FROM ".$_SESSION['tablename']['users']." u, ".$_SESSION['tablename']['services']." s WHERE u.DEPARTMENT = s.ID and STATUS <> 'DEL' AND u.ENABLED = 'Y' ".$user_access." ".$where.$orderby); while($line = $db->fetch_object()) { array_push($users, array("ID" => $line->USER_ID, "PRENOM" => $line->FIRSTNAME, "NOM" => $line->LASTNAME, "DEP_ID" => $line->DEPARTMENT, "MAIL" => $line->MAIL, "DEP" =>$line->SERVICE)); $services[$line->DEPARTMENT] = $line->SERVICE; } } else { $users = array(); $services = array(); } $id = ""; $desc =""; //print_r($users); if(isset($_GET['action']) && $_GET['action'] == "add_user" ) { if( isset($_GET['id']) ) $_SESSION["diffusion"]->add_copy_user($_GET['id']); } else if(isset($_GET['action']) && $_GET['action'] == "add_service" ) { if( isset($_GET['id']) ) $_SESSION["diffusion"]->add_copy_service($_GET['id']); } else if(isset($_GET['action']) && $_GET['action'] == "remove_user" ) { //$rang = $_GET['rang']; if( isset($_GET['id']) ) $_SESSION["diffusion"]->delete_user($_GET['id']); } else if(isset($_GET['action']) && $_GET['action'] == "remove_service" ) { //$rang = $_GET['rang']; if( isset($_GET['id']) ) $_SESSION["diffusion"]->delete_service($_GET['id']); } $func = new functions(); $time = $func->get_session_time_expire(); ?> / /> /> show(); ?> get_diffusion(); foreach( array_slice($_SESSION["diffusion"]->get_diffusion(),1) as $key_diff => $diffusion ) { if($color == ' class="col"') { $color = ''; } else { $color = ' class="col"'; } if( isset($diffusion["USER"]) ) { ?> > $value) { if( is_array($value) ) { ?> > can_delete_user($key_diff) ) { ?> > $value) { if( is_array($value) ) { ?> > can_delete_service($key_diff) ) { ?> > can_add_user($users[$j]['ID']) ) { ?> $d_serv ) { if($color == ' class="col"') { $color = ''; } else { $color = ' class="col"'; } ?> > can_add_service($k_serv) ) { ?> get_diffusion(),1) as $key_diff => $diffusion ) { if($color == ' class="col"') { $color = ''; } else { $color = ' class="col"'; } if( isset($diffusion["USER"]) ) { ?> > $value) { if( is_array($value) ) { ?> > can_delete_user($key_diff) ) { ?> > $value) { if( is_array($value) ) { ?> > can_delete_service($key_diff) ) { ?>