-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathequipment_servicing.php
180 lines (163 loc) · 8.04 KB
/
equipment_servicing.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
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
<?php
include("connect.php");
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Equipment Servicing - Tech2Check</title>
<meta content="width=device-width, initial-scale=1.0" name="viewport">
<meta content="" name="keywords">
<meta content="" name="description">
<!-- Fav and touch icons -->
<link rel="shortcut icon" href="img/logo.png" type="image/png">
<link rel="apple-touch-icon-precomposed" sizes="114x114" href="img/icons/114x114.png">
<link rel="apple-touch-icon-precomposed" sizes="72x72" href="img/icons/72x72.png">
<link rel="apple-touch-icon-precomposed" href="img/icons/default.png">
<!-- Google Fonts -->
<link href="https://fonts.googleapis.com/css?family=Roboto:400,100,300,500,700,900" rel="stylesheet">
<!-- Bootstrap CSS File -->
<link href="lib/bootstrap/css/bootstrap.min.css" rel="stylesheet">
<!-- Libraries CSS Files -->
<link href="lib/font-awesome/css/font-awesome.min.css" rel="stylesheet">
<link href="lib/owlcarousel/owl.carousel.min.css" rel="stylesheet">
<link href="lib/owlcarousel/owl.theme.min.css" rel="stylesheet">
<link href="lib/owlcarousel/owl.transitions.min.css" rel="stylesheet">
<!-- Main Stylesheet File -->
<link href="css/style.css" rel="stylesheet">
</head>
<!-- ======== @Region: body ======== -->
<body>
<div id="background-wrapper" class="buildings" data-stellar-background-ratio="0.8">
<!-- ======== @Region: header ======== -->
<?php
include("navbar.php");
?>
</div>
<!-- ======== @Region: #content ======== -->
<div id="content" class="container">
<div class="row">
<div class="col-xs-12">
<h2 class="page-header">
<center>
Equipment Servicing
</center>
</h2>
</div>
</div>
<div class="row">
<div class="col-xs-12">
<p id="service_error" style=<?php echo isset($_SESSION['service_error']) ? "\"color:red;display:block;\"" : "\"display:none;\""; ?>><?php echo $_SESSION['service_error']; unset($_SESSION['service_error']); ?></p>
<p id="service_success" style=<?php echo isset($_SESSION['service_success']) ? "\"color:green;display:block;\"" : "\"display:none;\""; ?>><?php echo $_SESSION['service_success']; unset($_SESSION['service_success']); ?></p>
<div class ="col-xs-12">
<div class ="table-responsive" id="service-table">
<table class ="table table-hover table-striped">
<thead>
<tr>
<th>Serial #</th>
<th>Make</th>
<th>Model</th>
<th>Last Activity</th>
<th>Assigned</th>
<th>Update Status</th>
</tr>
</thead>
<tbody>
<?php
$statusList = "SELECT *
FROM equipment
JOIN equipment_status
ON equipment.status_id = equipment_status.status_id
JOIN model
ON equipment.model_id = model.model_id
JOIN make
ON model.make_id = make.make_id
WHERE equipment_status.status_id = '2'
ORDER BY equipment.last_activity_date DESC";
$getStatus = mysql_query($statusList);
while($row = mysql_fetch_array($getStatus)){
echo "<td>" . $row['serial_number'] . "</td>";
echo "<td>" . $row['make'] . "</td>";
echo "<td>" . $row['model'] . "</td>";
echo "<td>" . $row['last_activity_date'] . "</td>";
$userList = "SELECT *
FROM usernames
WHERE username_id = '{$row['username_id']}'";
$username = mysql_fetch_array(mysql_query($userList))['username'];
echo "<td>" . $username . "</td>";
echo "<td>" . "<button type='button' class='btn btn-default' data-toggle='modal' data-target='#modal_{$row['serial_number']}'><i class=\"fa fa-fw fa-angle-right\"></i></button>" . "</td>";
echo "</tr>";
?>
<form action="push/equipment_servicingpush.php" method="post">
<!-- Modal -->
<div class="modal fade" id="<?php echo "modal_{$row['serial_number']}"; ?>" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
<h3 class="modal-title" id="myModalLabel">Serial # <?php echo "{$row['serial_number']}"; ?></h3>
</div>
<div class="modal-body">
<div>
<label>Equipment: </label><?php echo " {$row['make']} {$row['model']}"; ?>
</div>
<div>
</br>
<label>Change Status</label>
<div class="form-group">
<label class="radio-inline"><input type="radio" id="status_id" name="status_id" value="2" checked="checked">Needs Repair</label>
<label class="radio-inline"><input type="radio" id="status_id" name="status_id" value="1">Good</label>
<label class="radio-inline"><input type="radio" id="status_id" name="status_id" value="3">Out of Service</label>
</div>
</div>
</br>
<div class="form-group">
<label for="message-text" class="control-label"> History</label>
</br>
<?php
echo nl2br("{$row['notes']}");
?>
</div>
<div class="form-group">
<label for="message-text" class="control-label">Comment </label>
<textarea class="form-control modal-textarea" type="text" id="notes" name="notes"></textarea>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
<button type="submit" class="btn btn-primary" id="btn_serial" name="btn_serial" value="<?php echo"{$row['serial_number']}"; ?>">Complete Service</button>
</div>
</div>
</div>
</div>
</form>
<?php } ?>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
<!-- ======== @Region: #footer ======== -->
<?php
include("footer.php");
?>
<!-- Required JavaScript Libraries -->
<script src="lib/jquery/jquery.min.js"></script>
<script src="lib/bootstrap/js/bootstrap.min.js"></script>
<script src="lib/owlcarousel/owl.carousel.min.js"></script>
<script src="lib/stellar/stellar.min.js"></script>
<script src="lib/waypoints/waypoints.min.js"></script>
<script src="lib/counterup/counterup.min.js"></script>
<script src="contactform/contactform.js"></script>
<script src="/Project/js/service.js"></script>
<!-- Template Specific Custom Javascript File -->
<script src="js/custom.js"></script>
<script src="/Project/js/freelancer.min.js"></script>
<script src="/Project/lib/jquery-easing/jquery.easing.min.js"></script>
<script src="js/checkout.js"></script>
<!--Contactform script -->
<script src="contactform/contactform.js"></script>
</body>
</html>