intval($id_agent)); $result = excuteQuery($qy, $values); $res = $result['stmt']; $ny = $res->rowCount(); if ($ny > 0) { while ($o = $res->fetchObject()) { array_push($user_profiles, $o->nom); } } return $user_profiles; } if(isset($_SESSION['auth']) && isset($_REQUEST['IDAGENCE']) && $GLOBALS["NOTIF_CONF"]["VIEWNOTIFSTATUS"] != "NONE"){ $dla = date('Y-m-d'); $values = array('id_agence4'=>intval($_REQUEST['IDAGENCE']),':supp' => 0); $prenomColumn = ($GLOBALS["BO_CONF"]["CONSEILLER"]["prenom"]) ? ", c.prenom" : ""; $dlgColumn = ($GLOBALS["BO_CONF"]["CONSEILLER"]["dlg"]) ? ", c.dlg" : ""; if($GLOBALS["BO_CONF"]["MOBILITY"]){ $profilsJoin = ' LEFT JOIN ca_agences a ON ca.id_agence = a.id_agence LEFT JOIN ca_conseillers c ON c.id_conseiller = ca.id_conseiller '; //$values[':id_agence4'] = intval($_REQUEST['IDAGENCE']); }else{ $profilsJoin = ''; } if($GLOBALS["BO_CONF"]["CONSEILLER"]["multiple_profiles"]){ $agenceFilter = ''; }else{ $agenceFilter = ($GLOBALS["BO_CONF"]["CONSEILLER"]["multiple_profiles"])?'':'AND ca.id_agence=:id_agence1'; $values[':id_agence1'] = intval($_REQUEST['IDAGENCE']); } $values[':inactif'] = 0; $temporaryColumn = ($GLOBALS["BO_CONF"]["MOBILITY"])?", ca.temporaire":""; $lastActiveColumn = ($GLOBALS["BO_CONF"]["MOBILITY"])?", ca.last_active":""; $lastActiveSecColumn = ($GLOBALS["BO_CONF"]["MOBILITY"])?", TIMESTAMPDIFF(SECOND,ca.last_active,now()) last_active_sec":""; $activeTodayColumn = ($GLOBALS["BO_CONF"]["MOBILITY"])?', IF(ca.last_active LIKE "'.$dla.'%",1,0) active_today':""; // if($GLOBALS["BO_CONF"]["MOBILITY"]){ // $whereActivity = " OR (ca.id_agence=:id_agence3)"; // $values[':id_agence3'] = intval($_REQUEST['IDAGENCE']); // }else{ // $whereActivity = ""; // } //($GLOBALS["BO_CONF"]["MOBILITY"])?" OR (TIMESTAMPDIFF(SECOND,ca.last_active,now())<=".$GLOBALS["PILE_CONF"]["KEEPALIVE"].")":""; $notificationsColumn = ($GLOBALS["BO_CONF"]["MOBILITY"])?", ca.receive_notifications":", c.receive_notifications"; $q = 'SELECT ca.id_conseiller, c.nom, p.nom AS profile'.$prenomColumn.', ca.status'.$notificationsColumn.', ca.id_agence, c.photo, c.inactif'.$temporaryColumn.$lastActiveColumn.$dlgColumn.$lastActiveSecColumn.$activeTodayColumn.' FROM ca_conseiller_agence ca '.$profilsJoin.' LEFT JOIN ca_profils p ON ca.id_profile = p.id_profil WHERE ca.id_agence = :id_agence4 AND c.supp=:supp '.$agenceFilter.' AND c.inactif=:inactif AND c.photo != "../photos/incognito.jpg" ORDER BY c.nom ASC'; $result = excuteQuery($q, $values); $res = $result['stmt']; $DATA .= ""; if($GLOBALS["BO_CONF"]["MOBILITY"]) $DATA .= ""; $DATA .= ($da || $GLOBALS["NOTIF_CONF"]["EDITNOTIFS"] == "ALL") ? "" : ""; $DATA .= ""; while($conseiller = $res->fetchObject()){ // $connected_once = ($conseiller->last_active_sec == null)?false:true; // $last_active = !empty($conseiller->last_active_sec)?$conseiller->last_active_sec:0; $active = $conseiller->active_today == 1 ? true : false;//($connected_once && isset($last_active)) && $last_active <= 10; $statusColor = $active ? 'blue' : 'red'; // Liste de profils conseiller $userProfilesList = array(); if($GLOBALS["BO_CONF"]["CONSEILLER"]["multiple_profiles"]) $userProfilesList = getUserProfiles($conseiller->id_conseiller); if(!($conseiller->temporaire && !$active)){ // do not show temporary agents that are not active if ($conseiller->status == -1){ $showBorne = $active; } else{ $showBorne = ($conseiller->status == 1) ? 0 : 1; } $borneColor = ($showBorne == 1) ? "green" : "red"; $agentProfile = ""; if(in_array($conseiller->profile,$userProfilesList)){ if($conseiller->profile == 'PRO'){ $agentProfile = " (Mobile)"; }else{ $agentProfile = " (".$conseiller->profile.")"; } } $nomCons = $conseiller->nom; $nomCons .= ($GLOBALS["BO_CONF"]["CONSEILLER"]["prenom"]) ? " ".$conseiller->prenom : ""; $disabled = ($GLOBALS["NOTIF_CONF"]["EDITNOTIFSTATUS"] != "ALL" && !$da) ? " disabled" : ""; $DATA .= ""; $DATA .= ""; $DATA .= ($GLOBALS["BO_CONF"]["MOBILITY"])?"":""; $DATA .= ($GLOBALS["BO_CONF"]["MOBILITY"])?"":""; $DATA .= ($GLOBALS["BO_CONF"]["MOBILITY"])?"":""; $DATA .= ($da || $GLOBALS["NOTIF_CONF"]["EDITNOTIFS"] == "ALL")?"":""; // $DATA .= ($da && $conseiller->id_agence == $_REQUEST['IDAGENCE'])?"":""; $DATA .= ""; } } $DATA .= "
ConnectéAffichage BorneAffichéNotifs
".$nomCons.$agentProfile."receive_notifications?"checked":"")." ".$disabled.">id_conseiller."')\">Modifier
"; } else{ $DATA = "Permission insuffisante!"; } echo $DATA; ?>