-
Notifications
You must be signed in to change notification settings - Fork 0
/
deptchoice.php
169 lines (144 loc) · 3.08 KB
/
deptchoice.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
<?php
require_once 'dbconfig.php';
if(isset($_POST['add'])) {
$pid = $_POST['pid'];
$pn = $_POST['pn'];
$pc = $_POST['pc'];
$pq = $_POST['pq'];
if($pid=="" || !is_numeric ($pid)) {
$errMSG = "Please Enter Valid Product ID";
}
else if($pn=="") {
$errMSG = "Please Enter Valid Product Name";
}
else if($pc=="" || !is_numeric ($pc)) {
$errMSG = "Please Enter Valid Product Cost";
}
else if($pq=="" || !is_numeric ($pq)) {
$errMSG = "Please Enter Valid Quantity Value";
}
else {
$stmt = $DB_con->prepare('INSERT INTO products(pid,pname,pcost,pqty) VALUES(:a, :b, :c, :d)');
$stmt->bindParam(':a',$pid);
$stmt->bindParam(':b',$pn);
$stmt->bindParam(':c',$pc);
$stmt->bindParam(':d',$pq);
if($stmt->execute())
{
$errMSG = "Your Product Details Are Added To Stock";
header("refresh:1;product_add.php");
}
else
{
$errMSG = "Unable To Add Product Details";
}
}
}
if(isset($_POST['clear'])) {
header("Location: product_add.php"); /* Redirect browser */
exit();
}
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Add Products</title>
<link rel="stylesheet" href="css/style.css" type="text/css">
</head>
<body>
<div id="background">
<div id="page">
<div id="header">
<div id="logo">
<a href="index.html"><img src="images/metrologo.png" alt="LOGO" height="112" width="250"></a>
</div>
<br>
<br>
<br>
<br>
<div id="navigation">
<ul>
<li class="selected">
<a href="product_add.php">Products</a>
</li>
<li>
<a href="index.html">Logout</a>
</li>
</ul>
</div>
<br>
<br>
<br>
<br>
<br>
<div id="navigation">
<ul>
<li>
<a href="groceries_add.php">groceries</a>
</li>
<li>
<a href="menfashion_add.php">men fashion</a>
</li>
<li>
<a href="womenfashion_add.php">women fashion</a>
</li>
<li>
<a href="kidsfashion_add.php">kids fashion</a>
</li>
<li>
<a href="household_add.php">household</a>
</li>
<li>
<a href="foodworld_add.php">food world</a>
</li>
<li>
<a href="kitchenneeds_add.php">kitchen needs</a>
</li>
</ul>
</div>
<br>
<br>
<br>
<br>
<br>
<div id="navigation">
<ul>
<li>
<a href="babycare_add.php">babycare</a>
</li>
<li>
<a href="milk_add.php"> milk & dairy</a>
</li>
<li>
<a href="education_add.php">education</a>
</li>
<li>
<a href="entertainment_add.php">entertainment</a>
</li>
<li>
<a href="sports_add.php">sports</a>
</li>
<li>
<a href="furnishing_add.php">furnishing</a>
</li>
<li>
<a href="healthcare_add.php">health care</a>
</li>
</ul>
</div>
</div>
<br>
<br>
<br>
<br>
<br>
</div>
<div id="footer">
<p>
© 2020 by Product Sales Management System. All Rights Reserved
</p>
</div>
</div>
</body>
</html>