-
Notifications
You must be signed in to change notification settings - Fork 0
/
newVendor.php
114 lines (108 loc) · 2.81 KB
/
newVendor.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
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="./demo/styles.css">
<title>New Vendor</title>
</head>
<body>
<div id="carbonForm">
<h1>New Vendor</h1>
<div class = "fieldContainer">
<div class = "formRow">
<div class = "label">
<label for = "vname">Name</label>
</div>
<div class = "field">
<input type = "text" id = "vname">
</div>
</div>
<div class = "formRow">
<div class = "label">
<label for = "vaddress">Address</label>
</div>
<div class = "field">
<input type = "text" id = "vaddress">
</div>
</div>
<div class = "formRow">
<div class = "label">
<label for = "vphone">Phone</label>
</div>
<div class = "field">
<input type = "text" id = "vphone">
</div>
</div>
<div class = "formRow">
<div class = "label">
<label for = "vemail">Email</label>
</div>
<div class = "field">
<input type = "text" id = "vemail">
</div>
</div>
<div class = "formRow">
<div class = "label">
<label for = "vwebsite">Website</label>
</div>
<div class = "field">
<input type = "text" id = "vwebsite">
</div>
</div>
<div class = "formRow">
<div class = "label">
<label for = "vcontact">Contact</label>
</div>
<div class = "field">
<input type = "text" id = "vcontact">
</div>
</div>
<div class = "formRow">
<div class = "label">
<label for = "vbom">BOM Type</label>
</div>
<div class = "field">
<select id = "vbom">
<option value = ""></option>
<option value = ".CSV">.CSV</option>
<option value = ".XML">.XML</option>
<option value = ".PDF">.PDF</option>
</select>
</div>
</div>
</div>
<div class = "signupButton">
<button type = "button" id = "submit" onclick = insertVendor()>Add New Vendor</button>
</div>
</div>
<h2 id="footer"><a href="./Vendor.php">Go Back To Vendor »</a></h2>
<script>
function insertVendor() {
var vname = document.getElementById('vname').value;
var vaddress = document.getElementById('vaddress').value;
var vphone = document.getElementById('vphone').value;
var vemail = document.getElementById('vemail').value;
var vwebsite = document.getElementById('vwebsite').value;
var vcontact = document.getElementById('vcontact').value;
var vbom = document.getElementById('vbom').value;
var req = new XMLHttpRequest();
req.onreadystatechange = function() {
if (req.readyState == 4 && req.status == 200)
{
req.responseText;
}
}
req.open("GET", "insertVendor.php?vname=" + vname
+ "&vaddress=" + vaddress
+ "&vphone=" + vphone
+ "&vemail=" + vemail
+ "&vwebsite=" + vwebsite
+ "&vcontact=" + vcontact
+ "&vbom=" + vbom
);
req.send();
alert("Added New Vendor Successfully");
location.replace("./Vendor.php");
}
</script>
</body>
</html>