-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9ae426d
commit 76d7469
Showing
19 changed files
with
1,089 additions
and
393 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
<script src="js/bootstrap.bundle.min.js"></script> | ||
<script src="js/popper.min.js"></script> | ||
<script src="js/jquery-3.2.1.min.js"></script> | ||
<script src="js/bootstrap.min.js"></script> | ||
<script src="js/slick.min.js"></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,176 @@ | ||
<?php | ||
require "bOffice - header.php"; | ||
|
||
if(isset($_GET["ticket_id"]) && !empty($_GET["ticket_id"])){ | ||
$connect = connectDB(); | ||
$query=$connect->prepare("SELECT category_name,member_lastname,member_firstname,ticket.* FROM ticket,member,t_category where ticket_id= :id AND member_id=member AND t_category = category_id"); | ||
$query->execute([ | ||
"id"=>$_GET["ticket_id"] | ||
]); | ||
$ticket = $query->fetch(PDO::FETCH_ASSOC); | ||
|
||
if(empty($ticket)){ | ||
$_SESSION["falseTicket"] = true; | ||
isset($_SESSION["location"])? Header("Location: ".$_SESSION["location"]) : Header("Location: bOffice - ticketsTodo.php"); | ||
} | ||
|
||
$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); | ||
?> | ||
<div class="row"> | ||
<div class="col-2"> | ||
<a href="<?php echo isset($_SESSION["location"])? $_SESSION["location"] : "ticketsToDo.php"; ?>"><button class="btn btn-info">Retour aux tickets</button></a> | ||
</div> | ||
<div class="col-md-3"> | ||
<div class="ticketInfo"> | ||
<table class="table"> | ||
<hr> | ||
<center><h6 style="margin-bottom: : 0px;">Informations du ticket</h6></center> | ||
<hr> | ||
|
||
<tr> | ||
<td>ID :</td> | ||
<td><?php echo $ticket["ticket_id"] ?></td> | ||
</tr> | ||
<tr> | ||
<td>Statut :</td> | ||
<td> | ||
<?php | ||
switch ($ticket["state"]){ | ||
case 0: | ||
echo "Ouvert"; | ||
break; | ||
|
||
case 1: | ||
echo "Fermé"; | ||
break; | ||
|
||
case 2: | ||
echo "Définitivement fermé"; | ||
break; | ||
|
||
default: | ||
echo "Erreur"; | ||
break; | ||
} | ||
?> | ||
</td> | ||
</tr> | ||
|
||
<tr> | ||
<td>Catégorie :</td> | ||
<td><?php echo $ticket["category_name"] ?></td> | ||
</tr> | ||
|
||
<tr> | ||
<td>Auteur :</td> | ||
<td><?php echo $ticket["member_firstname"]." ".$ticket["member_lastname"] ?></td> | ||
</tr> | ||
|
||
<tr> | ||
<td>Auteur dernière MAJ :</td> | ||
<td><?php echo $lastUpdate["member_firstname"]." ".$lastUpdate["member_lastname"] ?></td> | ||
</tr> | ||
|
||
<tr> | ||
<td>Dernière mise à jour :</td> | ||
<td><?php echo $ticket["last_update"] ?></td> | ||
</tr> | ||
|
||
<tr> | ||
<td>Date de création :</td> | ||
<td><?php echo $ticket["ticket_date"] ?></td> | ||
</tr> | ||
|
||
</table> | ||
</div> | ||
</div> | ||
|
||
<div class="col-md-4"> | ||
<hr> | ||
<center><h6>Titre : <?php echo $ticket["ticket_label"] ?></h6></center> | ||
<hr> | ||
<?php | ||
if(isset($_SESSION["ticketError"])){ | ||
foreach ($_SESSION["ticketError"] as $key => $value) { | ||
echo "<h5>".$ticketErrorBackOffice[$value]."</h5>"; | ||
} | ||
unset($_SESSION["ticketError"]); | ||
} | ||
?> | ||
<table class="table"> | ||
<tr> | ||
<td><?php echo $ticket["ticket_content"] ?></td> | ||
</tr> | ||
|
||
<tr> | ||
<td> | ||
<form method="POST" action="script/bOffice - updateTicket.php"> | ||
<input hidden name="ticketId" value=<?php echo $ticket["ticket_id"] ?>> | ||
<textarea name="updateTicket" class="form-control"></textarea> | ||
<button type="submit" class="btn btn-info">Répondre</button> | ||
</form> | ||
</td> | ||
</tr> | ||
</table> | ||
</div> | ||
|
||
<div class="col actions"> | ||
<div class="ticketInfo"> | ||
<hr> | ||
<center><h6>Actions</h6></center> | ||
<hr> | ||
<table class="table"> | ||
<tr> | ||
<div class="actionButton"> | ||
<td> | ||
<div class="row"> | ||
<div class="actionButton"> | ||
<form method="POST" action="script/bOffice - updateTicket.php"> | ||
<input hidden name=<?php | ||
echo ($ticket["state"] != 2)? ($ticket["state"] == 0 or $ticket["state"] == 3)? '"closeTicket"': '"reopenTicket"': ""; ?> value="<?php echo $ticket["ticket_id"] ?>"> | ||
<button type="submit" class="button btn" <?php echo ($ticket["state"] == 2)? "disabled":""; echo ">"; echo ($ticket["state"] == 0)? "Fermé":"Réouvrir" ?></button> | ||
</form> | ||
</div> | ||
<?php if($ticket["state"] == 0 && ($ticket["author_last_update"] != $ticket["member"])){ | ||
?> | ||
<div class="actionButton"> | ||
<form method="POST" action="script/bOffice - updateTicket.php"> | ||
<input hidden name="backToTreatment" value="<?php echo $ticket["ticket_id"] ?>"> | ||
<button type="submit" class="button btn">Remettre en traitement</button> | ||
</form> | ||
</div> | ||
<?php } ?> | ||
</td> | ||
</div> | ||
</tr> | ||
<?php | ||
if($ticket["state"] != 2){ | ||
?> | ||
<tr> | ||
<td> | ||
<form method="POST" action="script/bOffice - updateTicket.php"> | ||
<input hidden name="defCloseTicket" value="<?php echo $ticket["ticket_id"] ?>"> | ||
<button type="submit" class="btn btn-danger">Fermé definitivement</button> | ||
</form> | ||
</td> | ||
</tr> | ||
<?php | ||
} | ||
?> | ||
</table> | ||
</div> | ||
</div> | ||
</div> | ||
<?php | ||
} | ||
|
||
else{ | ||
$_SESSION["falseTicket"] = true; | ||
isset($_SESSION["location"])? Header("Location: ".$_SESSION["location"]):Header("location: bOffice - ticketsTodo.php"); | ||
} | ||
|
||
include "bOffice - footer.php"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
<?php | ||
require "bOffice - header.php"; | ||
include "bOffice - ticketsMenu.php"; | ||
|
||
$_SESSION["location"] = "bOffice - ticketsClosed.php"; | ||
?> | ||
|
||
<table class="table"> | ||
<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) { | ||
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" ?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<?php | ||
$navigation[$_SERVER["PHP_SELF"]] = 1; | ||
?> | ||
|
||
<div class="row"> | ||
<div class="col-4"></div> | ||
<div class="col-4"> | ||
<nav class="navbar"> | ||
<a href="bOffice - ticketsToDo.php" class="<?php echo (isset($navigation["/parisnow/bOffice - ticketsToDo.php"]))? "locationMenu": "" ?>"><button class="btn">A traiter</button></a> | ||
<a href="bOffice - ticketsOpen.php" class="<?php echo (isset($navigation["/parisnow/bOffice - ticketsOpen.php"]))? "locationMenu": "" ?>"><button class="btn">Tickets Ouverts</button></a> | ||
<a href="bOffice - ticketsClosed.php" class="<?php echo (isset($navigation["/parisnow/bOffice - ticketsClosed.php"]))? "locationMenu": "" ?>"><button class="btn">Tickets Fermés</button></a> | ||
</nav> | ||
</div> | ||
</div> | ||
|
||
<div class="row"> | ||
<div class="col research"> | ||
<form method="GET" class="form-inline"> | ||
<div class="actionButton"> | ||
<input type="text" class="form-control" id="searchId" placeholder="ID" name="ticket_id" value=""> | ||
</div> | ||
<div> | ||
<button type="submit" class="btn button">Search</button> | ||
</div> | ||
</form> | ||
</div> | ||
</div> | ||
<?php | ||
if(isset($_SESSION["falseTicket"])){ | ||
echo "<h3>Ce ticket n'existe pas</h3>"; | ||
unset($_SESSION["falseTicket"]); | ||
} | ||
|
||
if(isset($_GET["ticket_id"])){ | ||
$connect = connectDB(); | ||
$query = $connect->prepare("SELECT ticket_id,author_last_update, member_firstname, member_lastname,category_name,last_update,ticket_date,ticket_label,state,member FROM TICKET,MEMBER,T_CATEGORY where member = member_id AND category_id = t_category AND ticket_id= :ticket_id ORDER BY last_update DESC"); | ||
$query->execute([ | ||
"ticket_id"=>$_GET["ticket_id"] | ||
]); | ||
$tickets = $query->fetchAll(PDO::FETCH_ASSOC); | ||
} | ||
|
||
else{ | ||
$connect = connectDB(); | ||
$query = $connect->prepare("SELECT ticket_id,author_last_update, member_firstname, member_lastname,category_name,last_update,ticket_date,ticket_label,state,member FROM TICKET,MEMBER,T_CATEGORY where member = member_id AND category_id = t_category ORDER BY last_update DESC"); | ||
$query->execute(); | ||
$tickets = $query->fetchAll(PDO::FETCH_ASSOC); | ||
} ?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
<?php | ||
require "bOffice - header.php"; | ||
include "bOffice - ticketsMenu.php"; | ||
|
||
$_SESSION["location"] = "bOffice - ticketsOpen.php"; | ||
?> | ||
|
||
<table class='table'> | ||
<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>Actions</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<?php | ||
foreach ($tickets as $line => $ticket) { | ||
if($ticket["state"] == 0 && ($ticket["author_last_update"] != $ticket["member"])){ | ||
$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>"; | ||
?> | ||
<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" ?> |
Oops, something went wrong.