-
Notifications
You must be signed in to change notification settings - Fork 0
/
frmbuyPrice.php
200 lines (160 loc) · 9.82 KB
/
frmbuyPrice.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
<?php include 'header.php';?>
<?php
// Add new product to Produtct Tem
if(isset($_POST['btnSave'])){
$txtName = post('txtName');
$txtCode = post('txtCode');
$txtBuyPrice = post('txtBuyPrice');
$txtSalePrice = post('txtSalePrice');
$txtOtherCost = post('txtOtherCost');
$UpdateSaleprice=$db->query("UPDATE tbl_customerorderdetail SET SalePrice = ".$txtSalePrice."
WHERE ProductID = '".$getPrdBranchID."';");
$UpdateBuyPrice=$db->query("UPDATE tblproducts_buydetail SET BuyPrice=".$txtBuyPrice."
WHERE ProductID = '".$getPrdBranchID."'");
$UpdateProductsName=$db->query("UPDATE tblproducts SET ProductName=N'".$txtName."' WHERE ProductID = '".$getPrdBranchID."';");
if($UpdateProductsName){
cRedirect('Report_Saling.php');
}
}
?>
<body class="skin-blue">
<!-- header logo: style can be found in header.less -->
<?php include 'nav.php';?>
<!-- Left side column. contains the logo and sidebar -->
<?php include 'menu.php';?>
<!-- Right side column. Contains the navbar and content of the page -->
<aside class="right-side">
<!-- Content Header (Page header) -->
<section class="content-header">
<h1>
<small>Control panel</small>
</h1>
<ol class="breadcrumb">
<li><a href="#"><i class="fa fa-dashboard"></i> Home</a></li>
<li class="active">Dashboard</li>
</ol>
</section>
<!-- Main content -->
<div class="panel-body">
<div class="dataTable_wrapper">
<table class="table table-striped table-bordered table-hover" id="dataTables-example">
<thead>
<tr>
<th>Name</th>
<th>Code</th>
<th>BuyPrice</th>
<th>SalePrice</th>
<th class="">Action</th>
</tr>
</thead>
<tbody>
<form role="form" method="post" enctype="multipart/form-data">
<?php
echo'<tr class="even">
<td><input name="txtName" value="'.$getProductName.'" class="form-control" placeholder="Enter text" /></td>
<td><input name="txtCode" value="'.$getPrdBranchCode.'" class="form-control" placeholder="Enter text" /></td>
<td><input name="txtBuyPrice" onkeypress="return isNumberKey(event)" value="'.$getBuyprice.'" class="form-control" placeholder="Enter text" /></td>
<td><input name="txtSalePrice" onkeypress="return isNumberKey(event)" value="'.$getPrdBranchPrice.'" class="form-control" placeholder="Enter text" /></td>
<td class="center">
<input type="submit" name="btnSave" class="btn btn-primary" value="Save" />
</td>
</tr>';
?>
</form>
</tbody>
</table>
</div>
<!-- /.table-responsive -->
</div>
<!-- /.panel-body -->
<!-- New User -->
<div class="modal fade" id="NewUser" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button>
<h4 class="modal-title" id="exampleModalLabel">New message</h4>
</div>
<div class="modal-body">
<form role="form" method="post">
<!--<div class="form-group">
<label>Choose Branch</label>
<select class="form-control" name="cboBranch">
<?php
/* $select=$db->query("SELECT BranchID, BranchName FROM `tblbranch`;");
$rowselect=$db->dbCountRows($select);
if($rowselect>0){
while($row=$db->fetch($select)){
$BranchID = $row->BranchID;
$BranchName = $row->BranchName;
echo'<option value='.$BranchID.'>'.$BranchName.'</option>';
}
}*/
?>
</select>
</div>-->
<div class="form-group">
<label>Choose Category</label>
<select class="form-control" name="cboPrdCate">
<?php
$select=$db->query("SELECT ProductCategoryID, ProductCategoryName FROM `tblproductcategory`;");
$rowselect=$db->dbCountRows($select);
if($rowselect>0){
while($row=$db->fetch($select)){
$ProductCategoryID = $row->ProductCategoryID;
$ProductCategoryName = $row->ProductCategoryName;
echo'<option value='.$ProductCategoryID.'>'.$ProductCategoryName.'</option>';
}
}
?>
</select>
</div>
<div class="form-group">
<label>Product Name: </label>
<input name="txtprdname" class="form-control" placeholder="Enter text" required />
</div>
<div class="form-group">
<label>Products Code:</label>
<input name="txtcode" class="form-control" placeholder="Enter text" />
</div>
<div class="form-group">
<label>Products QTY:</label>
<input name="txtqty" class="form-control" placeholder="Enter text" />
</div>
<div class="form-group">
<label>Buy Price:</label>
<div class="input-group">
<span class="input-group-addon">$</span>
<input type="number" name="txtbuyprice" value="1" min="0" step="0.01" data-number-to-fixed="2" data-number-stepfactor="100" class="form-control currency" id="c2" />
</div>
</div>
<div class="form-group">
<label>Sale Price:</label>
<div class="input-group">
<span class="input-group-addon">$</span>
<input type="number" value="1" name="txtsaleprice" min="0" step="0.01" data-number-to-fixed="2" data-number-stepfactor="100" class="form-control currency" id="c2" />
</div>
</div>
<!--<div class="form-group">
<label>User Limit </label>
<label class="radio-inline">
<input type="radio" name="rdstatus" id="optionsRadiosInline1" value="1" checked>Active
</label>
<label class="radio-inline">
<input type="radio" name="rdstatus" id="optionsRadiosInline2" value="0">Suspend
</label>
</div>
-->
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
<input type="submit" name="btnAddNewPrd" class="btn btn-primary" value="Save" />
</div>
</form>
</div>
</div>
</div>
<!-- End New User -->
</aside><!-- /.right-side -->
</div><!-- ./wrapper -->
<!-- add new calendar event modal -->
<?php include 'footer.php';?>