Skip to content
6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

63 changes: 53 additions & 10 deletions admin/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,28 +33,39 @@
</a>
</li>
<li>
<a href="index.php?insert_category">Insert New Category</a>
<a href="index.php?insert_category">
<i class="fas fa-plus"></i> Insert New Category
</a>
</li>
<li>
<a href="index.php?view_categories">View All Categories</a>
<a href="index.php?view_categories">
<i class="fas fa-band-aid"></i> View All Categories
</a>
</li>
<li>
<a href="index.php?insert_brand">Insert New Brand</a>
<a href="index.php?insert_brand">
<i class="fas fa-plus"></i> Insert New Brand
</a>
</li>
<li>
<a href="index.php?view_brands">View All Brands</a>
<a href="index.php?view_brands">
<i class="fas fa-toolbox"></i> View All Brands</a>
</li>
<li>
<a href="index.php?view_customers">View Customers</a>
<a href="index.php?view_customers">
<i class="fa fa-user-tie"></i> View Customers</a>
</li>
<li>
<a href="index.php?view_orders">View Orders</a>
<a href="index.php?view_orders">
<i class="fa fa-shopping-bag"></i> View Orders</a>
</li>
<li>
<a href="index.php?view_payments">View Payments</a>
<a href="index.php?view_payments">
<i class="fa fa-credit-card"></i> View Payments</a>
</li>
<li>
<a href="logout.php">Admin logout</a>
<a href="logout.php">
<i class="fa fa-sign-out-alt"></i> Admin logout</a>
</li>
</ul>
</nav>
Expand All @@ -71,15 +82,47 @@
if(isset($_GET['insert_product'])){
include ('insert_product.php');
}
else if(isset($_GET['view_products'])){
include ('view_products.php');
}
else if(isset($_GET['edit_pro'])){
include ('edit_pro.php');
}
else if(isset($_GET['del_pro'])){
include ('del_pro.php');
}
else if(isset($_GET['view_categories'])){
include ('view_categories.php');
}
else if(isset($_GET['view_customers'])){
include ('view_customers.php');
else if(isset($_GET['insert_category'])){
include ('insert_category.php');
}
else if(isset($_GET['edit_cat'])){
include ('edit_cat.php');
}
else if(isset($_GET['del_cat'])){
include ('del_cat.php');
}
else if(isset($_GET['view_brands'])) {
include('view_brands.php');
}
else if(isset($_GET['insert_brand'])) {
include('insert_brand.php');
}
else if(isset($_GET['edit_brand'])) {
include('edit_brand.php');
}
else if(isset($_GET['del_brand'])) {
include('del_brand.php');
}
else if(isset($_GET['view_customers'])){
include ('view_customers.php');
}
else if(isset($_GET['del_customer'])){
include ('del_customer.php');
}


?>
</div>
</div>
Expand Down
50 changes: 38 additions & 12 deletions admin/view_brands.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,38 @@
<h1> Brands </h1>
<ul class="list-group">
<?php
$get_brands = "select * from brands";
$run_brands = mysqli_query($con, $get_brands);
while ($row_brands= mysqli_fetch_array($run_brands)){
$brand_id = $row_brands['brand_id'];
$brand_title = $row_brands['brand_title'];
echo "<li class='list-group-item'>$brand_title</li>";
}
?>
</ul>
<div class="row">
<div class="col-sm-12">
<h1>Brands</h1>
<table class="table table-striped">
<thead>
<tr>
<th scope="col">#</th>
<th scope="col">Name</th>
<th scope="col">Actions</th>
</tr>
</thead>
<tbody>
<?php
$get_brands = "select * from brands";
$run_brands = mysqli_query($con, $get_brands);
$i=0;
while ($row_brands= mysqli_fetch_array($run_brands)){
$brand_id = $row_brands['brand_id'];
$brand_title = $row_brands['brand_title'];
?>
<tr>
<th scope="row"><?php echo ++$i; ?></th>
<td><?php echo $brand_title; ?></td>
<td><a href="index.php?edit_brand=<?php echo $brand_id?>" class="btn btn-primary">
<i class="fa fa-edit"></i> Edit
</a>
<a href="index.php?del_brand=<?php echo $brand_id?>" class="btn btn-danger">
<i class="fa fa-trash-alt"></i> Delete
</a>
</td>
</tr>
<?php
}
?>
</tbody>
</table>
</div>
</div>
50 changes: 38 additions & 12 deletions admin/view_categories.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,38 @@
<h1> Categories </h1>
<ul class="list-group">
<?php
$get_cats = "select * from categories";
$run_cats = mysqli_query($con, $get_cats);
while ($row_cats= mysqli_fetch_array($run_cats)){
$cat_id = $row_cats['cat_id'];
$cat_title = $row_cats['cat_title'];
echo "<li class='list-group-item'>$cat_title</li>";
}
?>
</ul>
<div class="row">
<div class="col-sm-12">
<h1>Categories</h1>
<table class="table table-striped">
<thead>
<tr>
<th scope="col">#</th>
<th scope="col">Name</th>
<th scope="col">Actions</th>
</tr>
</thead>
<tbody>
<?php
$get_cats = "select * from categories";
$run_cats = mysqli_query($con, $get_cats);
$i=0;
while ($row_cats= mysqli_fetch_array($run_cats)){
$cat_id = $row_cats['cat_id'];
$cat_title = $row_cats['cat_title'];
?>
<tr>
<th scope="row"><?php echo ++$i; ?></th>
<td><?php echo $cat_title; ?></td>
<td><a href="index.php?edit_cat=<?php echo $cat_id?>" class="btn btn-primary">
<i class="fa fa-edit"></i> Edit
</a>
<a href="index.php?del_cat=<?php echo $cat_id?>" class="btn btn-danger">
<i class="fa fa-trash-alt"></i> Delete
</a>
</td>
</tr>
<?php
}
?>
</tbody>
</table>
</div>
</div>
82 changes: 44 additions & 38 deletions admin/view_customers.php
Original file line number Diff line number Diff line change
@@ -1,41 +1,47 @@
<h1>Customers</h1>
<table class="table table-bordered">
<div class="table responsive">
<thead>
<div class="row">
<div class="col-sm-12">
<h1>Customers</h1>
<table class="table table-striped">
<thead>
<tr>
<th> Name</th>
<th>Email</th>
<th>Country</th>
<th>City</th>
<th>Contact</th>
<th>Address</th>
<th>Image</th>
<th scope="col">#</th>
<th scope="col">Name</th>
<th scope="col">Email</th>
<th scope="col">Image</th>
<th scope="col">Actions</th>
</tr>
</thead>
<tbody>
<?php
$get_cats = "select * from customers";
$run_cats = mysqli_query($con, $get_cats);
while($row_cats= mysqli_fetch_array($run_cats)) {
$cust_id= $row_cats['cust_id'];
$cust_name = $row_cats['cust_name'];
$cust_email = $row_cats['cust_email'];
$cust_country = $row_cats['cust_country'];
$cust_city = $row_cats['cust_city'];
$cust_contact = $row_cats['cust_contact'];
$cust_address = $row_cats['cust_address'];
$image = $row_cats['cust_image'];
echo "<tr>
<td>$cust_name</td>
<td>$cust_email</td>
<td>$cust_country</td>
<td>$cust_city</td>
<td>$cust_contact</td>
<td>$cust_address</td>
<td><img src='../customer/customer_images/$image' width='50px' height='50px'></td>
</tr>";
}
?>
</tbody>
</thead>
<tbody>
<?php
$get_cust = "select * from customers";
$run_cust = mysqli_query($con,$get_cust);
$count_cust = mysqli_num_rows($run_cust);
if($count_cust==0){
echo "<h2> No Customer found </h2>";
}
else {
$i = 0;
while ($row_cust = mysqli_fetch_array($run_cust)) {
$cust_id = $row_cust['cust_id'];
$cust_name = $row_cust['cust_name'];
$cust_email = $row_cust['cust_email'];
$cust_image = $row_cust['cust_image'];
?>
<tr>
<th scope="row"><?php echo ++$i; ?></th>
<td><?php echo $cust_name; ?></td>
<td><?php echo $cust_email; ?></td>
<td><img class="img-thumbnail" src='../customer/customer_images/<?php echo $cust_image;?>' width='80' height='80'></td>
<td><a href="index.php?del_customer=<?php echo $cust_id?>" class="btn btn-danger">
<i class="fa fa-trash-alt"></i> Delete
</a>
</td>
</tr>
<?php
}
}
?>
</tbody>
</table>
</div>
</table>
</div>
52 changes: 52 additions & 0 deletions admin/view_products.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
<div class="row">
<div class="col-sm-12">
<h1>Products</h1>
<table class="table table-striped">
<thead>
<tr>
<th scope="col">#</th>
<th scope="col">Title</th>
<th scope="col">Image</th>
<th scope="col">Price</th>
<th scope="col">Actions</th>
</tr>
</thead>
<tbody>
<?php
$get_pro = "select * from products";
$run_pro = mysqli_query($con,$get_pro);
$count_pro = mysqli_num_rows($run_pro);
if($count_pro==0){
echo "<h2> No Product found in selected criteria </h2>";
}
else {
$i = 0;
while ($row_pro = mysqli_fetch_array($run_pro)) {
$pro_id = $row_pro['pro_id'];
$pro_cat = $row_pro['pro_cat'];
$pro_brand = $row_pro['pro_brand'];
$pro_title = $row_pro['pro_title'];
$pro_price = $row_pro['pro_price'];
$pro_image = $row_pro['pro_image'];
?>
<tr>
<th scope="row"><?php echo ++$i; ?></th>
<td><?php echo $pro_title; ?></td>
<td><img class="img-thumbnail" src='product_images/<?php echo $pro_image;?>' width='80' height='80'></td>
<td><?php echo $pro_price; ?>/-</td>
<td><a href="index.php?edit_pro=<?php echo $pro_id?>" class="btn btn-primary">
<i class="fa fa-edit"></i> Edit
</a>
<a href="index.php?del_pro=<?php echo $pro_id?>" class="btn btn-danger">
<i class="fa fa-trash-alt"></i> Delete
</a>
</td>
</tr>
<?php
}
}
?>
</tbody>
</table>
</div>
</div>