/
repairs.php
130 lines (97 loc) · 4.34 KB
/
repairs.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
<?php
ini_set('display_errors', 1); error_reporting(E_ALL);
if(!isset($_SESSION))
{
session_start();
}
require_once 'scripts/database.php';
$db = new Database();
$db->connectToDB();
$message = '';
if (($db->checkLoginStatus() == false)) {
header('Location: login.php');
}
if ($_POST) {
$repairbrand = $_POST['repairbrand'];
$repairmodel = $_POST['repairmodel'];
$repairtech = $_POST['repairtech'];
$repairIMEI = $_POST['repairIMEI'];
$cusname = $_POST['cusname'];
$cusphone = $_POST['cusphone'];
$cusemail = $_POST['cusemail'];
$repairloc = $_POST['repairloc'];
$message = $db->createRepair($repairbrand, $repairmodel, $repairtech, $repairIMEI, $cusname, $cusphone, $cusemail, $repairloc);
}
?>
<!DOCTYPE html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Repair Form for CelTel Wireless</title>
<link href="css/bootstrap.min.css" rel="stylesheet" media="screen">
<script type="text/javascript" src="js/jquery-1.11.3-jquery.min.js"></script>
<script type="text/javascript" src="js/validation.min.js"></script>
<link href="css/style.css" rel="stylesheet" type="text/css" media="screen">
<script type="text/javascript" src="js/script.js"></script>
</head>
<body>
<form class="form-repair" method="post" id="repair-form">
<h2 class="form-signin-heading">Enter Repair Info</h2>
<hr />
<div id="error">
<!-- error will be showen here ! -->
<?php echo isset($message) ? $message : null; ?>
</div>
<div class="form-group">
<input type="text" class="form-control" placeholder="Phone Brand" name="repairbrand" id="repairbrand" />
</div>
<div class="form-group">
<input type="text" class="form-control" placeholder="Phone Model" name="repairmodel" id="repairmodel" />
</div>
<div class="form-group">
<input type="text" class="form-control" placeholder="Technician Name" name="repairtech" id="repairtech" />
</div>
<div class="form-group">
<input type="number" class="form-control" placeholder="IMEI number" name="repairIMEI" id="repairtech" />
</div>
<div class="form-group">
<input type="text" class="form-control" placeholder="Customer Name" name="cusname" id="cusname" />
<!--<select class="" name="cusid">
<?php
$db = new Database();
$db->connectToDB();
foreach ($db->getCustomers() as $customer) {
print_r("<option value='".$customer['cusid'].'>'.$customer['cusname'].'</option>');
} ?>
</select>-->
</div>
<div class="form-group">
<input type="number" class="form-control" placeholder="Customer phone #" name="cusphone" id="cusphone" />
</div>
<div class="form-group">
<input type="email" class="form-control" placeholder="Customer Email Address" name="cusemail" id="cusemail" />
<span id="check-e"></span>
</div>
<div class="form-group">
<select name="repairloc">
<option value="">Locations</option>
<option value="pickering">Pickering</option>
<option value="whitby">Whitby</option>
</select>
</br>
</div>
<div class="form-group">
<hr>
<button type="submit" class="btn btn-default" name="btn-submit" id="btn-submit1">
<span class="glyphicon glyphicon-log-in"></span> Submit
</button>
<input type="button" value="View All Repairs" class="btn btn-default" id="btn-submit1" onClick="document.location.href='displayform.php'" />
<hr>
<input type="button" value="Logout" class="btn btn-default" id="btn-submit1" onClick="document.location.href='logout.php'" />
<hr>
<p2>Need something Translated?</p2><br>
<input type="button" value="Translate" class="btn btn-default" id="btn-submit1" onClick="document.location.href='googletranslate.php'" />
</form>
</div>
<script src="js/bootstrap.min.js"></script>
</body>
</html>