-
Notifications
You must be signed in to change notification settings - Fork 0
/
addInternalWO.php
48 lines (43 loc) · 935 Bytes
/
addInternalWO.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
<html>
<head>
<link rel="stylesheet" type="text/css" href="../css/styles.css">
</head>
<body class="Page">
<?php
session_start();
if ($_SESSION[admin_login] != TRUE)
{
header("Location:index.php");
exit;
}
?>
<h2>Work Order Details:</h2><br />
<form action="addInternalWO.php" method="post">
Branch ID<br />
<input type="text" name="Branch"><br /><br/>
<input class="button" type="submit" name="Submit" value="Submit">
</form>
<?php
include('connect.php');
session_start();
if (isset($_POST['Submit']))
{
$sql = "INSERT INTO INTERNAL VALUES ('$_SESSION[wONumber]',
'$_POST[Branch]')";
if ($conn->query($sql) === TRUE)
{
header("Location:adminHome.php");
exit;
}
else if (mysqli_errno($conn) == 1452)
{
echo "Please enter a valid branch ID";
}
else
{
echo $conn->error;
}
}
?>
</body>
</html>