-
Notifications
You must be signed in to change notification settings - Fork 1
/
viewitems.php
executable file
·140 lines (130 loc) · 5.55 KB
/
viewitems.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
<?php
include_once 'header.php';
include_once 'headerfiles.php';
?>
<body class="skin-blue sidebar-collapse">
<div class="wrapper">
<?php
include_once 'navigation.php';
include_once 'sidebar.php';
?>
<div class="content-wrapper">
<!-- Content Header (Page header) -->
<section class="content-header">
<h1>
View/Edit Items
<small>View and Modify Stock in Hand</small>
</h1>
<ol class="breadcrumb">
<li><a href="#"><i class="fa fa-dashboard"></i> Home</a></li>
<li>Items</li>
<li class="active">View/Manage</li>
</ol>
</section>
<!-- Main content -->
<section class="content">
<div class="row">
<div class="col-md-12">
<div class="box box-primary">
<div class="box-header">
<h3 class="box-title with-border">Filter By:</h3>
</div>
<div class="box-body">
<div class="row">
<form class="myform" action="viewitems.php" method="GET">
<div class="col-md-4">
<div class="form-group">
<label>Godown/Venue</label>
<select name="godownid" class="focus form-control mandatory">
<option value="">Select</option>
<?php
$query="Select name,godownid from godowns order by name";
$result= queryMysql($query);
while($row=mysqli_fetch_array($result))
{
echo "<option value=$row[godownid]>$row[name]</option>";
}
?>
</select>
</div>
<div class="col-md-6">
<button class="btn btn-block btn-primary submit"><i class="fa fa-search"></i> Search</button>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="box box-primary">
<div class="box-body">
<table id="example1" class="table table-bordered table-striped">
<thead>
<tr>
<th>#</th>
<th>Item ID</th>
<th>Item Name</th>
<th>Item Type</th>
<th>Item Description</th>
<th>Godown/Venue</th>
<th>Business</th>
<th>Stock In Hand</th>
<th>Edit</th>
</tr>
</thead>
<tbody>
<?php
if(isset($_GET['godownid']))
{
$godownid=sanitizeString($_GET['godownid']);
$query="Select items.*, godowns.name as godownname from items join godowns on items.godownid=godowns.godownid where items.godownid=$godownid";
}
else
{
$query="Select items.*, godowns.name as godownname from items join godowns on items.godownid=godowns.godownid";
}
$result= queryMysql($query);
$count=1;
while($row= mysqli_fetch_array($result))
{
$itemid=id($row['itemid']);
$itemid="IT-".$itemid;
echo<<<_END
<tr>
<td>$count</td>
<td>$itemid</td>
<td>$row[name]</td>
<td>$row[itemtype]</td>
<td>$row[description]</td>
<td>$row[godownname]</td>
<td>$row[business]</td>
<td>$row[quantity]</td>
<td><a href="item.php?itemid=$row[itemid]">Edit</a></td>
</tr>
_END;
$count++;
}
?>
</tbody>
</table>
</div><!-- /.box-body -->
</div>
</div>
</div>
</section><!-- /.content -->
</div><!-- /.content-wrapper -->
<!-- Main Footer -->
<footer class="main-footer">
<!-- To the right -->
<div class="pull-right hidden-xs">
TMStock - The Makers Stock
</div>
<!-- Default to the left -->
<strong>Copyright © 2015 <a href="http://themakersweb.com">The Makers Web</a>.</strong> All rights reserved.
</footer>
</div><!-- ./wrapper -->
</body>
</html>