-
Notifications
You must be signed in to change notification settings - Fork 0
/
createTicket.php
63 lines (48 loc) · 1.92 KB
/
createTicket.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
<!-- Create a new ticket page. On this page a logged in client can create a new ticket -->
<?php
session_start();
/* If user is not authorized, redirect to login page*/
if(!isset($_SESSION['userId']) || $_SESSION['type'] != 'client'){
header('location:login.php');
}
if(isset($_POST['ticketSubmit'])){
if($_POST['messageContent'] == ""){
$errMsg = '</br>Please enter a description of your issue' ;
}
else{
/* Load the xml */
/* Get the current highest ticket id and add 1 */
/* Add new ticket element */
/* Add ticketid to ticket */
/* Add userId to ticket from session var */
/* Add category to ticket from form*/
/* Add status - set to be open */
/* Add child 'messages' */
/* Add child message with messageContent */
/* Save XML*/
/* Redirect to the listTickets page */
}
}
?>
<?php require_once 'views/header.php'?>
<main class = "homeContent">
<form name='createTicketForm' action="" method="POST">
<div>
<label for = "category">Subject: </label>
<select id = "category" name = "category">
<option value = "techSupport" selected="selected" >Technical Support</option>
<option value = "refunds">Refunds</option>
<option value = "inqueries">Inqueries</option>
<option value = "other">Other</option>
</select>
</div>
<div>
<label for = "messageContent">Your Message: </label>
<input id = "messageContent" type = "text" name = "message"/>
</div>
<?= isset($errMsg)? $errMsg : ''?>
<button type = "submit" name = "ticketSubmit" value = "submitted">Create Ticket</button>
</form>
</form>
</main>
<?php require_once 'views/footer.php' ?>