-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbOffice - ticketsClosed.php
67 lines (61 loc) · 1.98 KB
/
bOffice - ticketsClosed.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<?php
require "bOffice - header.php";
include "bOffice - ticketsMenu.php";
$_SESSION["location"] = "bOffice - ticketsClosed.php"; //This session is used for the value of the "href" of the <a> balise named "Retour aux tickets" in the bOffice - ticket.php page.
?>
<table class="table table-striped">
<thead>
<tr>
<th>ID</th>
<th>Catégorie</th>
<th>Auteur</th>
<th>Titre</th>
<th>Auteur dernière MAJ</th>
<th>Mis à jour</th>
<th>Création</th>
<th>Statut</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
<?php
foreach ($tickets as $line => $ticket) { //Using the query from the ticketmenu.php it will show all tickets that are closed and definitily closed
if($ticket["state"] == 1 || $ticket["state"] == 2){
$query = $connect->prepare("SELECT member_lastname, member_firstname FROM ticket,member where :author_last_update = member_id");
$query->execute([
"author_last_update"=> $ticket["author_last_update"]
]);
$lastUpdate = $query->fetch(PDO::FETCH_ASSOC);
echo "<td>".$ticket["ticket_id"]."</td>";
echo "<td>".$ticket["category_name"]."</td>";
echo "<td>".$ticket["member_firstname"]." ".$ticket["member_lastname"]."</td>";
echo "<td>".$ticket["ticket_label"]."</td>";
echo "<td>".$lastUpdate["member_firstname"]." ".$lastUpdate["member_lastname"]."</td>";
echo "<td>".$ticket["last_update"]."</td>";
echo "<td>".$ticket["ticket_date"]."</td>";
echo "<td>";
switch ($ticket["state"]){
case 1:
echo "Fermé";
break;
case 2:
echo "Fermé définitivement";
break;
default:
echo "erreur";
}
echo "</td>";
?>
<td>
<form method="POST" action="bOffice - ticket.php?ticket_id=<?php echo $ticket["ticket_id"] ?>">
<button type="submit" class="btn openButton">Ouvrir</button>
</form>
</td>
<?php
}
echo "</tr>";
}
?>
</tbody>
</table>
<?php include "bOffice - footer.php" ?>