Skip to content

Commit

Permalink
Update mysql query for report_ticket_by_client.php
Browse files Browse the repository at this point in the history
Fix empty report
  • Loading branch information
ThaMunsta authored Sep 20, 2024
1 parent 547f928 commit 2898084
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions report_ticket_by_client.php
Original file line number Diff line number Diff line change
Expand Up @@ -130,17 +130,17 @@ function secondsToTime($inputSeconds) {
$ticket_resolved_count = intval($row['ticket_resolved_count']);

// Breakdown tickets for each priority - Low
$sql_low_ticket_count = mysqli_query($mysqli, "SELECT COUNT(ticket_id) AS low_ticket_count FROM TICKETS WHERE YEAR(ticket_created_at) = $year AND ticket_client_id = $client_id AND ticket_priority = 'Low'");
$sql_low_ticket_count = mysqli_query($mysqli, "SELECT COUNT(ticket_id) AS low_ticket_count FROM tickets WHERE YEAR(ticket_created_at) = $year AND ticket_client_id = $client_id AND ticket_priority = 'Low'");
$row = mysqli_fetch_array($sql_low_ticket_count);
$low_ticket_count = intval($row['low_ticket_count']);

// Breakdown tickets for each priority - Low
$sql_med_ticket_count = mysqli_query($mysqli, "SELECT COUNT(ticket_id) AS med_ticket_count FROM TICKETS WHERE YEAR(ticket_created_at) = $year AND ticket_client_id = $client_id AND ticket_priority = 'Medium'");
$sql_med_ticket_count = mysqli_query($mysqli, "SELECT COUNT(ticket_id) AS med_ticket_count FROM tickets WHERE YEAR(ticket_created_at) = $year AND ticket_client_id = $client_id AND ticket_priority = 'Medium'");
$row = mysqli_fetch_array($sql_med_ticket_count);
$med_ticket_count = intval($row['med_ticket_count']);

// Breakdown tickets for each priority - Low
$sql_high_ticket_count = mysqli_query($mysqli, "SELECT COUNT(ticket_id) AS high_ticket_count FROM TICKETS WHERE YEAR(ticket_created_at) = $year AND ticket_client_id = $client_id AND ticket_priority = 'High'");
$sql_high_ticket_count = mysqli_query($mysqli, "SELECT COUNT(ticket_id) AS high_ticket_count FROM tickets WHERE YEAR(ticket_created_at) = $year AND ticket_client_id = $client_id AND ticket_priority = 'High'");
$row = mysqli_fetch_array($sql_high_ticket_count);
$high_ticket_count = intval($row['high_ticket_count']);

Expand Down

0 comments on commit 2898084

Please sign in to comment.