-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathaddVendor.php
220 lines (215 loc) · 7.58 KB
/
addVendor.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
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
<?php
session_start();
if(!(isset($_SESSION['name'])))
header('Location:index.php');
include './connection/connection.php';
?>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="css/bootstrap.min.css">
<link rel="stylesheet" href="css/font-awesome.min.css">
<link rel="stylesheet" href="css/styleOld.css">
<title>Add Vendor</title>
</head>
<style type="text/css">
.schselect select{
border: 2px solid #0069D9;
color: #0069D9;
}
.schselect select:focus{
border: 2px solid #0069D9;
color: #0069D9;
}
.schselect select option{
background: #fff;
color: #0069D9;
}
.concont{
display: grid;
height: 100vh;
width: 100vw;
grid-template-rows: auto 1fr;
}
.conbar{
display: grid;
grid-template-columns: repeat(5,auto);
justify-content: center;
}
.concontent-item{
display:grid;
grid-template-columns:1fr 1fr;
}
.concontent-item-enter{
display: grid;
grid-template-columns:1fr minmax(250px,auto) 1fr;
grid-template-rows: 1fr minmax(250px,auto) 1fr;
}
.concontent-item-enter-data{
display: grid;
grid-template-rows: repeat(5, auto);
grid-column: 2/3;
grid-row: 2/3;
}
.vendorMain{
display:grid;
grid-template-columns:1fr minmax(275px,auto) 1fr;
grid-template-rows:1fr minmax(200px,auto) 1fr;
}
.vendorDisplay{
display:grid;
grid-column:2/3;
grid-row:2/3;
}
.consubb{
height: 38px;
}
</style>
<body>
<!-- Navbar Start -->
<nav class="navbar navbar-expand-lg navbar-dark bg-dark">
<a class="navbar-brand head" href="stockReceive.php?inventory=all">Store Management (STC)</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNavAltMarkup" aria-controls="navbarNavAltMarkup"
aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="navbar-collapse collapse" id="navbarNavAltMarkup">
<div class="navbar-nav ml-auto">
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true"
aria-expanded="false">
Stock Entry
</a>
<div class="dropdown-menu" aria-labelledby="navbarDropdown">
<a class="dropdown-item" href="stockReceive.php?inventory=all">Stock Receive</a>
<a class="dropdown-item " href="stockIssue.php?inventory=all">Stock Issue</a>
</div>
</li>
<!-- <li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true"
aria-expanded="false">
View Stock
</a>
<div class="dropdown-menu" aria-labelledby="navbarDropdown">
<a class="dropdown-item" href="viewReceived.php">Stock Received</a>
<a class="dropdown-item" href="#">Stock Issued</a>
<div class="dropdown-divider"></div>
<a class="dropdown-item" href="#">All Stock</a>
</div>
</li>
</li> -->
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle bg-primary" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true"
aria-expanded="false">
Add New
</a>
<div class="dropdown-menu" aria-labelledby="navbarDropdown">
<a class="dropdown-item" href="addDepartment.php">Department</a>
<a class="dropdown-item" href="addItem.php">Item</a>
<a class="dropdown-item" href="addScheme.php">Scheme</a>
<div class="dropdown-divider"></div>
<a class="dropdown-item bg-primary" href="#">Vendor</a>
</div>
</li>
<a class="nav-item nav-link" href="viewReceived.php">View Bills</a>
<a class="nav-item nav-link" href="help.html">Help</a>
<a class="nav-item nav-link" href="destroy.php">LogOut</a>
</div>
</div>
</nav>
<!-- navbar ends -->
<br>
<br>
<br>
<div class="concontent-item">
<div class="concontent-item-enter">
<div class="concontent-item-enter-data">
<!-- vendor adding form starts -->
<form method="POST">
<legend>Vendor Insert</legend>
<div class="form-group">
<label for="items">Vendor's Name</label>
<input type="text" onchange="upperCase(this)" class="form-control" id="items" name="name" placeholder="Enter Vendor name" >
</div>
<div class="form-group">
<label for="items">Vendor's Deal Purpose</label>
<input type="text" onchange="upperCase(this)" class="form-control" id="items" name="deal" placeholder="Vendor Dealing Purpose" >
</div>
<div class="form-group">
<label for="items">GST Number</label>
<input type="text" onchange="upperCase(this)" class="form-control" id="items" name="gstNumber" placeholder="Vendor GST Number" >
</div>
<div class="form-group">
<label for="items">Vendor's Address</label>
<textarea onchange="upperCase(this)" class="form-control" id="items" name="address" placeholder="Enter Address here" >
</textarea>
</div>
<button type="submit" class="btn btn-primary consubb" name="vendor" onclick="return inventoryValidation()">Submit</button>
</form>
<!-- vendor adding form ends -->
<?php
if(isset($_POST['vendor'])){
$vendorName= $_POST['name'];
$vendorDeal= $_POST['deal'];
$gstNumber= $_POST['gstNumber'];
$vendorAddress = $_POST['address'];
$vendorInsert = "INSERT INTO vendor VALUE('','$vendorName','$gstNumber','$vendorDeal','$vendorAddress')";
$vendorInsertQuery = mysqli_query($conn,$vendorInsert);
if($vendorInsertQuery){
echo '<script>alert("Vendor is added")</script>';
// echo '<script>confirm("Do you want to add more vendor?")</script>';
}
else{
echo '<script>alert("Vendor is not added !")</script>';
}
}
?>
</div>
</div>
<div class="vendorMain">
<div class="vendorDisplay">
<h5>Available Vendors </h5>
<div class="form-group">
<label for="vendor">Vendor's list</label>
<select class="custom-select" size="8" name="itemcate" id="vendor">
<?php
$getVendor= "SELECT * FROM vendor";
$getVendorQuery = mysqli_query($conn,$getVendor);
while($getVendorInfo = mysqli_fetch_array($getVendorQuery)){
echo ' <option value="' .$getVendorInfo[1].'">'.$getVendorInfo[1].'</option> ';
}
?>
</select>
</div>
</div>
</div>
</div>
</div>
<script type="text/javascript">
function upperCase(valueN){
var a=valueN.value.toUpperCase();
valueN.value=a;
}
function inventoryValidation(){
if(document.itemForm.itemname.value == ""){
alert('Please select Category!');
return false;
}
if(document.itemForm.itemunit.value == ""){
alert('Please select Unit!');
return false;
}
if(document.itemForm.itemcate.value == ""){
alert('Please select Inventory!');
return false;
}
}
</script>
</body>
</html>
<!-- jQuery first, then Popper.js, then Bootstrap JS -->
<script src="js/jquery-3.3.1.slim.min.js"></script>
<script src="js/popper.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<!-- end of javascript files -->