-
Notifications
You must be signed in to change notification settings - Fork 3
/
add-new-product.php
172 lines (108 loc) · 5.4 KB
/
add-new-product.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
<?php
session_start();
if(isset($_SESSION['username'])){
?>
<!DOCTYPE html>
<html lang="en">
<?php
include("header.php");
?>
<body>
<div class="container-scroller">
<!-- partial:partials/_navbar.html -->
<?php
require("navigation.php");
?>
<!-- partial -->
<div class="container-fluid page-body-wrapper">
<!-- partial:partials/_sidebar.html -->
<?php
include("sidebar.php");
?>
<!-- partial -->
<div class="main-panel">
<div class="content-wrapper">
<!-- Page Title Header Starts-->
<!-- Page Title Header Ends-->
<?php
//include("dashboard-grid.php");
//include("main-content.php");
?>
<div class="row">
<div class="col-md-12 d-flex align-items-stretch grid-margin">
<div class="row flex-grow">
<div class="col-12">
<div class="card">
<div class="card-body">
<h4 class="card-title">Default form</h4>
<p class="card-description"> Basic form layout </p>
<form action="save-product.php" method="post" class="forms-sample">
<div class="form-group">
<label for="exampleInputEmail1">product name</label>
<input type="text" class="form-control" name="product_name" id="exampleInputEmail1" placeholder="product name">
</div>
<div class="form-group">
<label for="exampleInputPassword1"> Select Product Categroy </label>
<select class="form-select form-select-lg mb-3" name="product_catid" aria-label=".form-select-lg example">
<?php
include("config.php");
if($link==true){
$query = "SELECT * FROM category";
$sql=mysqli_query($link,$query);
//var_dump($sql);
if(mysqli_num_rows($sql)>0){
$serial=0;
while( $rows=mysqli_fetch_assoc($sql)){
?>
<option value="<?php echo $rows['id'];?>"><?php echo $rows['name'];?></option>
<?php
}
}
}
?>
</select>
</div>
<div class="form-group">
<label for="exampleInputPassword1"> Select Product Brand </label>
<select class="form-select form-select-lg mb-3" name="product_brandid" aria-label=".form-select-lg example">
<!-- <option selected>Open this select menu</option> -->
<?php
if($link==true){
$queryb = "SELECT * FROM brand";
$sqlb=mysqli_query($link,$queryb);
//var_dump($sql);
if(mysqli_num_rows($sqlb)>0){
$serial=0;
while( $row=mysqli_fetch_assoc($sqlb)){
?>
<option value="<?php echo $row['id'];?>"><?php echo $row['name'];?></option>
<?php
}
}
}
?>
</select>
</div>
<div class="form-group">
<label for="exampleInputEmail1">product Price</label>
<input type="text" class="form-control" name="product_sellprice" id="exampleInputEmail1" placeholder="product name">
</div>
<button type="submit" class="btn btn-success mr-2">Submit</button>
<button class="btn btn-light">Cancel</button>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- content-wrapper ends -->
<!-- partial:partials/_footer.html -->
<?php
include("footer.php");
}
else{
header("location: login.php?msg=ai betach chor");
}
?>