Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New Php files #16

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .idea/ecommerce1.iml

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

6 changes: 6 additions & 0 deletions .idea/misc.xml

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

8 changes: 8 additions & 0 deletions .idea/modules.xml

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

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.

4 changes: 4 additions & 0 deletions admin/assets/css/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -90,3 +90,7 @@ a, a:hover, a:focus {
color: #fff;
background: #6d7fcc;
}

#content {
width: 100%;
}
13 changes: 13 additions & 0 deletions admin/delete.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php
include ('functions/db_connect.php');
if(isset($_GET['delete']))
{
$id=$_GET['delete'];
echo $id;
$sql="DELETE FROM `products` WHERE pro_id=$id";

$run=mysqli_query($con,$sql);

header("refresh:1 ; URL=index.php?view_products");
}
?>
13 changes: 13 additions & 0 deletions admin/deletebrand.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php
include ('functions/db_connect.php');
if(isset($_GET['delete']))
{
$id=$_GET['delete'];
echo $id;
$sql="DELETE FROM `brands` WHERE brand_id=$id";

$run=mysqli_query($con,$sql);

header("refresh:1 ; URL=index.php?view_brands");
}
?>
13 changes: 13 additions & 0 deletions admin/deletecat.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php
include ('functions/db_connect.php');
if(isset($_GET['delete']))
{
$id=$_GET['delete'];
echo $id;
$sql="DELETE FROM `categories` WHERE cat_id=$id";

$run=mysqli_query($con,$sql);

header("refresh:1 ; URL=index.php?view_categories");
}
?>
13 changes: 13 additions & 0 deletions admin/deletecust.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php
include ('functions/db_connect.php');
if(isset($_GET['delete']))
{
$id=$_GET['delete'];
echo $id;
$sql="DELETE FROM `customers` WHERE cust_id=$id";

$run=mysqli_query($con,$sql);

header("refresh:1 ; URL=index.php?view_customers");
}
?>
13 changes: 13 additions & 0 deletions admin/deleteorder.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php
include ('functions/db_connect.php');
if(isset($_GET['delete']))
{
$id=$_GET['delete'];
echo $id;
$sql="DELETE FROM `cart` WHERE p_id=$id";

$run=mysqli_query($con,$sql);

header("refresh:1 ; URL=index.php?view_orders");
}
?>
83 changes: 83 additions & 0 deletions admin/edit.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
<?php
include ('functions/db_connect.php');
if(isset($_GET['edit']))
{
$id=$_GET['edit'];
$sql=mysqli_query($con,"select * from products where pro_id=$id");
$row=mysqli_fetch_array($sql);
}
?>

<!DOCTYPE html>
<html>
<head>
<title>Edit Product</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<style type="text/css">
table{
text-align: center;
}
input{
width: 500px;
}
</style>
</head>
<body>
<div class="table-responsive">
<form action="editu.php" method="POST">
<table class="table" >
<input type="hidden" name="id" value="<?php echo $row['pro_id']?>">
<tr>
<td colspan="2" align="center">
<h1>Edit Product</h1>
</td>
</tr>
<tr>
<td>
<label>Product Title</label>
</td>
<td>
<input type="text" name="pro_title" value="<?php echo $row['pro_title']?> " >
</td>
</tr>
<tr>
<td>
<label>Product Price</label>
</td>
<td>
<input type="text" name="pro_price" value="<?php echo $row['pro_price']?>">
</td>
</tr>
<tr>
<td>
<label>Product Description</label>
</td>
<td>
<input type="text" style="height: 200px;" name="pro_desc" value="<?php echo $row['pro_desc']?>" >
</td>
</tr>
<tr>
<td>
<label>Product Keyword</label>
</td>
<td>
<input type="text" name="pro_keywords" value="<?php echo $row['pro_keywords']?>">
</td>
</tr>

<tr>
<td colspan="2" align="center">
<input type="submit" value="Update">
</td>
</tr>
</table>
</form>

</div>
</body>
</html>

62 changes: 62 additions & 0 deletions admin/editbrand.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
<?php
include ('functions/db_connect.php');
if(isset($_GET['edit']))
{
$id=$_GET['edit'];
$sql=mysqli_query($con,"select * from brands where brand_id=$id");
$row=mysqli_fetch_array($sql);

}
?>

<!DOCTYPE html>
<html>
<head>
<title>Edit Product</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<style type="text/css">
table{
text-align: center;
}
input{
width: 500px;
}
body{
margin-top: 15%;
}
</style>
</head>
<body>
<div class="table-responsive">
<form action="editbrandu.php" method="POST">
<table class="table" >
<input type="hidden" name="id" value="<?php echo $row['brand_id']?>">
<tr>
<td colspan="2" align="center">
<h1>Edit Brand Name</h1>
</td>
</tr>
<tr>
<td>
<label>Brand Name </label>
</td>
<td>
<input type="text" name="brand_title" value="<?php echo $row['brand_title']?>" >
</td>
</tr>

<tr>
<td colspan="2" align="center">
<input type="submit" value="Update">
</td>
</tr>
</table>
</form>

</div>
</body>
</html>
13 changes: 13 additions & 0 deletions admin/editbrandu.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php
include ('functions/db_connect.php');
$brand_id=$_POST['id'];
$brand_title=$_POST['brand_title'];




$sql1="UPDATE `brands` SET `brand_title`='$brand_title' WHERE brand_id=$brand_id";
$run=mysqli_query($con,$sql1);
header("refresh:1 ; URL=index.php?view_brands");

?>
62 changes: 62 additions & 0 deletions admin/editcat.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
<?php
include ('functions/db_connect.php');
if(isset($_GET['edit']))
{
$id=$_GET['edit'];
$sql=mysqli_query($con,"select * from categories where cat_id=$id");
$row=mysqli_fetch_array($sql);

}
?>

<!DOCTYPE html>
<html>
<head>
<title>Edit Product</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<style type="text/css">
table{
text-align: center;
}
input{
width: 500px;
}
body{
margin-top: 15%;
}
</style>
</head>
<body>
<div class="table-responsive">
<form action="editcatu.php" method="POST">
<table class="table" >
<input type="hidden" name="id" value="<?php echo $row['cat_id']?>">
<tr>
<td colspan="2" align="center">
<h1>Edit Category Name</h1>
</td>
</tr>
<tr>
<td>
<label>Category Name </label>
</td>
<td>
<input type="text" name="cat_title" value="<?php echo $row['cat_title']?>" >
</td>
</tr>

<tr>
<td colspan="2" align="center">
<input type="submit" value="Update">
</td>
</tr>
</table>
</form>

</div>
</body>
</html>
13 changes: 13 additions & 0 deletions admin/editcatu.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php
include ('functions/db_connect.php');
$cat_id=$_POST['id'];
$cat_title=$_POST['cat_title'];




$sql1="UPDATE `categories` SET `cat_title`='$cat_title' WHERE cat_id=$cat_id";
$run=mysqli_query($con,$sql1);
header("refresh:1 ; URL=index.php?view_categories");

?>
Loading