TICKETS GLPI Infra_Système_DK
query("SELECT count(*) as total, max(date_mod) as maxi, min(date_mod) as mini FROM glpi_tickets where id in (select tickets_id from glpi_groups_tickets where groups_id = 13) and id not in (select tickets_id from glpi_tickets_users where type = 2) and status < 6"); $r = mysqli_fetch_array($sql); $Nouveau = $r['total'];$d1=$r['mini'];$f1=$r['maxi'];
$sql = $conn->query("SELECT count(*) as total, max(date_mod) as maxi, min(date_mod) as mini FROM glpi_tickets where id in (select tickets_id from glpi_groups_tickets where groups_id = 13) and status = 2"); $r = mysqli_fetch_array($sql); $EnCours = $r['total'];$d2=$r['mini'];$f2=$r['maxi'];
$sql = $conn->query("SELECT count(*) as total, max(date_mod) as maxi, min(date_mod) as mini FROM glpi_tickets where id in (select tickets_id from glpi_groups_tickets where groups_id = 13) and status = 3"); $r = mysqli_fetch_array($sql); $Planifie = $r['total'];$d3=$r['mini'];$f3=$r['maxi'];
$sql = $conn->query("SELECT count(*) as total, max(date_mod) as maxi, min(date_mod) as mini FROM glpi_tickets where id in (select tickets_id from glpi_groups_tickets where groups_id = 13) and status = 4"); $r = mysqli_fetch_array($sql); $EnAttente = $r['total'];$d4=$r['mini'];$f4=$r['maxi'];
$sql = $conn->query("SELECT count(*) as total, max(date_mod) as maxi, min(date_mod) as mini FROM glpi_tickets where id in (select tickets_id from glpi_groups_tickets where groups_id = 13) and status = 5"); $r = mysqli_fetch_array($sql); $Resolu = $r['total'];$d5=$r['mini'];$f5=$r['maxi'];
$sql = $conn->query("SELECT count(*) as total, max(date_mod) as maxi, min(date_mod) as mini FROM glpi_tickets where id in (select tickets_id from glpi_groups_tickets where groups_id = 13) and status = 6"); $r = mysqli_fetch_array($sql); $Clos = $r['total'];$d6=$r['mini'];$f6=$r['maxi'];
$n0 = (mysqli_fetch_array($conn->query("SELECT count(*) as total FROM glpi_tickets where id in (select tickets_id from glpi_groups_tickets where groups_id = 13) and id not in (select tickets_id from glpi_tickets_users where type = 2) and status < 6 and DATEDIFF(now(),date_creation) <= 7")))['total'];
$n7 = (mysqli_fetch_array($conn->query("SELECT count(*) as total FROM glpi_tickets where id in (select tickets_id from glpi_groups_tickets where groups_id = 13) and id not in (select tickets_id from glpi_tickets_users where type = 2) and status < 6 and DATEDIFF(now(),date_creation) <= 30 and DATEDIFF(now(),date_creation) > 7")))['total'];
$n30 = (mysqli_fetch_array($conn->query("SELECT count(*) as total FROM glpi_tickets where id in (select tickets_id from glpi_groups_tickets where groups_id = 13) and id not in (select tickets_id from glpi_tickets_users where type = 2) and status < 6 and DATEDIFF(now(),date_creation) > 30")))['total'];
$ec0 = (mysqli_fetch_array($conn->query("SELECT count(*) as total FROM glpi_tickets where id in (select tickets_id from glpi_groups_tickets where groups_id = 13) and status = 2 and DATEDIFF(now(),date_creation) <= 7")))['total'];
$ec7 = (mysqli_fetch_array($conn->query("SELECT count(*) as total FROM glpi_tickets where id in (select tickets_id from glpi_groups_tickets where groups_id = 13) and status = 2 and DATEDIFF(now(),date_creation) <= 30 and DATEDIFF(now(),date_creation) > 7")))['total'];
$ec30 = (mysqli_fetch_array($conn->query("SELECT count(*) as total FROM glpi_tickets where id in (select tickets_id from glpi_groups_tickets where groups_id = 13) and status = 2 and DATEDIFF(now(),date_creation) > 30")))['total'];
$p0 = (mysqli_fetch_array($conn->query("SELECT count(*) as total FROM glpi_tickets where id in (select tickets_id from glpi_groups_tickets where groups_id = 13) and status = 3 and DATEDIFF(now(),date_creation) <= 7")))['total'];
$p7 = (mysqli_fetch_array($conn->query("SELECT count(*) as total FROM glpi_tickets where id in (select tickets_id from glpi_groups_tickets where groups_id = 13) and status = 3 and DATEDIFF(now(),date_creation) <= 30 and DATEDIFF(now(),date_creation) > 7")))['total'];
$p30 = (mysqli_fetch_array($conn->query("SELECT count(*) as total FROM glpi_tickets where id in (select tickets_id from glpi_groups_tickets where groups_id = 13) and status = 3 and DATEDIFF(now(),date_creation) > 30")))['total'];
$ea0 = (mysqli_fetch_array($conn->query("SELECT count(*) as total FROM glpi_tickets where id in (select tickets_id from glpi_groups_tickets where groups_id = 13) and status = 4 and DATEDIFF(now(),date_creation) <= 7")))['total'];
$ea7 = (mysqli_fetch_array($conn->query("SELECT count(*) as total FROM glpi_tickets where id in (select tickets_id from glpi_groups_tickets where groups_id = 13) and status = 4 and DATEDIFF(now(),date_creation) <= 30 and DATEDIFF(now(),date_creation) > 7")))['total'];
$ea30 = (mysqli_fetch_array($conn->query("SELECT count(*) as total FROM glpi_tickets where id in (select tickets_id from glpi_groups_tickets where groups_id = 13) and status = 4 and DATEDIFF(now(),date_creation) > 30")))['total'];
$sql = $conn->query(" SELECT count(*) as total, realname, firstname FROM glpi_tickets
left join glpi_tickets_users on glpi_tickets.id = glpi_tickets_users.tickets_id and glpi_tickets_users.type = 2
left join glpi_users on glpi_tickets_users.users_id = glpi_users.id
where glpi_tickets.id in (select tickets_id from glpi_groups_tickets where groups_id = 13)
and status in (2,3,4)
and glpi_tickets_users.users_id in (SELECT glpi_users.id FROM glpi_groups_users left join glpi_users on users_id = glpi_users.id where glpi_groups_users.groups_id = 13)
group by glpi_tickets_users.users_id, realname
order by total desc");
$repName='';$repTot='';
while($row = mysqli_fetch_array($sql)){
$repName .= $row['firstname'].' '.$row['realname'].',';
$repTot .= $row['total'].',';
}
$repName = substr($repName, 0, -1);
$repTot = substr($repTot, 0, -1);
$sql = $conn->query(" SELECT count(*) as total FROM glpi_tickets
where glpi_tickets.id in (select tickets_id from glpi_groups_tickets where groups_id = 13)
and status in(2,3,4)");
$r = mysqli_fetch_array($sql); $ec = $r['total'];
?>
Repartition acteurs (en cours + planifié + en attente)
';
echo '
';
echo '';
echo '
';
echo '
'.$nb[$i].'
';
echo '';
echo '
';
echo '
';
$ec -= $nb[$i];
$i++;
}
echo '
';
echo '
';
echo '';
echo '
';
echo '
'.$ec.'
';
echo '';
echo '
';
echo '
';
?>