-
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathpos.php
More file actions
84 lines (70 loc) · 2.49 KB
/
Copy pathpos.php
File metadata and controls
84 lines (70 loc) · 2.49 KB
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
<?php include 'include/head.php';?>
<?php include 'include/nav.php';?>
<?php
$notice="";
if (isset($_POST['safeIn']))
{
$filename = $_FILES['inPic']['name'];
move_uploaded_file($_FILES["inPic"]["tmp_name"], "photo/".$_FILES["inPic"]["name"]);
if ($con->query("insert into categories (name,pic) value ('$_POST[name]','$filename')")) {
$notice ="<div class='alert alert-success'>Successfully Saved</div>";
}
else
$notice ="<div class='alert alert-danger'>Not saved Error:".$con->error."</div>";
}
?>
<div class="container">
<?php echo $notice; ?>
<div class="row">
<div class="col-12 text-center">
<h3>Axcora Spectre</h3>
<p>Select item and create transaction</p>
</div>
<?php
$array = $con->query("select * from categories");
while ($row = $array->fetch_assoc())
{
$array2 = $con->query("select count(*) from inventeries where catId = '$row[id]'");
$row2 = $array2->fetch_assoc();
?>
<div class="col-md-12 col-3 text-center">
<a href="inventeries.php?catId=<?php echo $row['id'] ?>">
<img src="photo/<?php echo $row['pic'] ?>" width="100%" class='img-responsive rounded shadow'>
<br/>
<?php echo $row['name'] ?>
<!-- Stock : <?php echo $row2['count(*)']; ?> -->
</a>
</div>
<?php
}
?>
<div id="addIn" class="modal fade" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h4 class="modal-title">Add New Item</h4>
</div>
<div class="modal-body"> <form method="POST" enctype="multipart/form-data">
<div style="width: 77%;margin: auto;">
<div class="form-group">
<label for="some" class="col-form-label">Name</label>
<input type="text" name="inName" class="form-control" id="some" required>
</div>
<div class="form-group">
<label for="2" class="col-form-label">Image</label>
<input type="file" name="inPic" class="form-control" id="2" required>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
<button type="submit" class="btn btn-primary" name="safeIn">Save Inventory</button>
</div>
</form>
</div>
</div>
</div>
</div>
<?php include 'include/footer.php';?>