forked from omermaksutii/olux
-
Notifications
You must be signed in to change notification settings - Fork 1
/
divPageticket.php
158 lines (134 loc) · 4.44 KB
/
divPageticket.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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
<?php
ob_start();
session_start();
date_default_timezone_set('UTC');
include "includes/config.php";
if (!isset($_SESSION['sname']) and !isset($_SESSION['spass'])) {
header("location: ../");
exit();
}
$usrid = mysqli_real_escape_string($dbcon, $_SESSION['sname']);
?>
<style>
.ticket {
white-space: pre-wrap;
}
</style>
<div class="col-lg-12 grid-margin stretch-card">
<div class="card">
<div class="card-body">
<link rel="stylesheet" href="assets/tickets.css">
<?php
if (isset($_GET['id'])) {
$tid = mysqli_real_escape_string($dbcon, $_GET['id']);
$uid = mysqli_real_escape_string($dbcon, $_SESSION['sname']);
$s = mysqli_query($dbcon, "SELECT * FROM ticket WHERE id='$tid' AND uid='$uid'") or die();
$r = mysqli_fetch_assoc($s);
if (!empty($r)) {
$st = $r['status'];
switch ($st) {
case "0":
$st = "<font color='green'>Closed</font>";
break;
case "1":
$st = "<font color='red'>Pending</font>";
break;
case "2":
$st = "<font color='orange'>Replied</font>";
break;
}
echo '
<div class="form-group col-lg-5 ">
<div class="row-fluid sortable ui-sortable">
<div class="box span12">
<div class="card-body">
<div class="box-header" data-original-title="">
<h3 class="card-title">Title #' . htmlspecialchars($r['subject']) . '</h3>
</div>
<div class="box-content">';
echo $r['memo'];
?>
<br>
<?php
$tid = mysqli_real_escape_string($dbcon, $_GET['id']);
$s = mysqli_query($dbcon, "SELECT * FROM ticket WHERE id='$tid'");
$r = mysqli_fetch_assoc($s);
if ($r['status'] == "0") {
?>
<div class="well well-sm">
<strong>Closed Ticket</strong> <p>This ticket is closed and you can't reply to it </p>
</div>
<?php
} else {
?>
<form id="addReply">
<div class="input-group">
<textarea class="form-control custom-control" rows="3" name="Reply" style="resize:none"></textarea>
<span class="input-group-addon btn btn-primary" onclick="$(this).closest('form').submit();">Reply</span>
</div>
<?php
}
?>
<center>
</form>
<?php
$uid = mysqli_real_escape_string($dbcon, $_SESSION['sname']);
$qqwq = mysqli_query($dbcon, "UPDATE ticket SET seen='0' WHERE id='$tid'") or die();
?>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div> <br>
<div class="col-lg-7">
<div class="bs-component">
<div class="well well">
<ul>
<li>In order to refund ticket go to <b>Account</b> -> <b>My Orders</b> and choose the tool and click on <b>Report</b> button</li>
<li>Do not create double-tickets , create just one ticket and include all your problems then wait for your ticket to be replied</li>
</ul>
</div>
</div>
</div>
<?php
} else {
echo "
<div id='mainDiv'><blockquote>
<p>Ticket was not found or you don't have permission to access it </p>
<small>Go to your <cite>Tickets</cite> to see all your available tickets </small>
</blockquote></div>
";
}
} else {
echo "
<div id='mainDiv'><blockquote>
<p>Ticket was not found or you don't have permission to access it </p>
<small>Go to your <cite>Tickets</cite> to see all your available tickets </small>
</blockquote></div>
";
}
?>
<script>
g:xreply=0;
$("#addReply").submit(function() {
if(xreply==1){return false;}else{xreply=1;}
$.ajax({
type: "POST",
url: 'addReply<?php echo $tid; ?>.html',
data: $("#addReply").serialize(), // serializes the form's elements.
success: function(data)
{
if (data == 01) {
alert('Please enter a valid Reply');
xreply=0;
}
if (data != 01) {
pageDiv('ticket<?php echo $tid; ?>','Ticket #<?php echo $tid; ?> - Jerux SHOP','showTicket<?php echo $tid; ?>.html',1);
}
}
});
return false; // avoid to execute the actual submit of the form.
});
</script>