diff --git a/.idea/ecommerce1.iml b/.idea/ecommerce1.iml new file mode 100644 index 0000000..c956989 --- /dev/null +++ b/.idea/ecommerce1.iml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..28a804d --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..0f60086 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/admin/assets/css/custom.css b/admin/assets/css/custom.css index f4a9140..e7e57f6 100644 --- a/admin/assets/css/custom.css +++ b/admin/assets/css/custom.css @@ -90,3 +90,7 @@ a, a:hover, a:focus { color: #fff; background: #6d7fcc; } + +#content { + width: 100%; +} \ No newline at end of file diff --git a/admin/delete.php b/admin/delete.php new file mode 100644 index 0000000..6cff131 --- /dev/null +++ b/admin/delete.php @@ -0,0 +1,13 @@ + \ No newline at end of file diff --git a/admin/deletebrand.php b/admin/deletebrand.php new file mode 100644 index 0000000..56330a5 --- /dev/null +++ b/admin/deletebrand.php @@ -0,0 +1,13 @@ + \ No newline at end of file diff --git a/admin/deletecat.php b/admin/deletecat.php new file mode 100644 index 0000000..0240ea2 --- /dev/null +++ b/admin/deletecat.php @@ -0,0 +1,13 @@ + \ No newline at end of file diff --git a/admin/deletecust.php b/admin/deletecust.php new file mode 100644 index 0000000..d51fdc8 --- /dev/null +++ b/admin/deletecust.php @@ -0,0 +1,13 @@ + \ No newline at end of file diff --git a/admin/deleteorder.php b/admin/deleteorder.php new file mode 100644 index 0000000..6f99954 --- /dev/null +++ b/admin/deleteorder.php @@ -0,0 +1,13 @@ + \ No newline at end of file diff --git a/admin/edit.php b/admin/edit.php new file mode 100644 index 0000000..0abf53e --- /dev/null +++ b/admin/edit.php @@ -0,0 +1,83 @@ + + + + + + Edit Product + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+

Edit Product

+
+ + + +
+ + + +
+ + + +
+ + + +
+ +
+
+ +
+ + + diff --git a/admin/editbrand.php b/admin/editbrand.php new file mode 100644 index 0000000..2890c73 --- /dev/null +++ b/admin/editbrand.php @@ -0,0 +1,62 @@ + + + + + + Edit Product + + + + + + + + +
+
+ + + + + + + + + + + + + +
+

Edit Brand Name

+
+ + + +
+ +
+
+ +
+ + \ No newline at end of file diff --git a/admin/editbrandu.php b/admin/editbrandu.php new file mode 100644 index 0000000..cf52f5d --- /dev/null +++ b/admin/editbrandu.php @@ -0,0 +1,13 @@ + \ No newline at end of file diff --git a/admin/editcat.php b/admin/editcat.php new file mode 100644 index 0000000..0382eb3 --- /dev/null +++ b/admin/editcat.php @@ -0,0 +1,62 @@ + + + + + + Edit Product + + + + + + + + +
+
+ + + + + + + + + + + + + +
+

Edit Category Name

+
+ + + +
+ +
+
+ +
+ + \ No newline at end of file diff --git a/admin/editcatu.php b/admin/editcatu.php new file mode 100644 index 0000000..2ebfdc1 --- /dev/null +++ b/admin/editcatu.php @@ -0,0 +1,13 @@ + \ No newline at end of file diff --git a/admin/editcust.php b/admin/editcust.php new file mode 100644 index 0000000..04fc10d --- /dev/null +++ b/admin/editcust.php @@ -0,0 +1,109 @@ + + + + + + Edit Product + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

Edit Customers

+
+ + + +
+ + + +
+ + + +
+ + + +
+ + + +
+ + + +
+ + + +
+ +
+
+ +
+ + \ No newline at end of file diff --git a/admin/editcustu.php b/admin/editcustu.php new file mode 100644 index 0000000..8b1868d --- /dev/null +++ b/admin/editcustu.php @@ -0,0 +1,19 @@ + \ No newline at end of file diff --git a/admin/editu.php b/admin/editu.php new file mode 100644 index 0000000..fdc5d67 --- /dev/null +++ b/admin/editu.php @@ -0,0 +1,16 @@ + \ No newline at end of file diff --git a/admin/functions/db_connect.php b/admin/functions/db_connect.php new file mode 100644 index 0000000..df8ceac --- /dev/null +++ b/admin/functions/db_connect.php @@ -0,0 +1,4 @@ + $cat_title "; + } +} + +//getting Brands +function getBrands(){ + global $con; + $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 "
  • $brand_title
  • "; + } +} + +function getPro($flag = ''){ + global $con; + $get_pro = ""; + if(!isset($_GET['cat']) && !isset($_GET['brand']) && !isset($_GET['search'])) { + if($flag == 'all_products') + $get_pro = "select * from products"; + else + $get_pro = "select * from products order by RAND() limit 0,6"; + } else if(isset($_GET['cat'])){ + $pro_cat_id = $_GET['cat']; + $get_pro = "select * from products where pro_cat = '$pro_cat_id'"; + } else if(isset($_GET['brand'])){ + $pro_brand_id = $_GET['brand']; + $get_pro = "select * from products where pro_brand = '$pro_brand_id'"; + } else if(isset($_GET['search'])){ + $search_query = $_GET['user_query']; + $get_pro = "select * from products where pro_keywords like '%$search_query%'"; + } + $run_pro = mysqli_query($con,$get_pro); + $count_pro = mysqli_num_rows($run_pro); + if($count_pro==0){ + echo "

    No Product found in selected criteria

    "; + } + 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']; + echo " +
    +

    $pro_title

    + +

    Rs $pro_price/-

    + Details + +
    + "; + } +} +//getting the user IP address +function getIp() { + $ip = $_SERVER['REMOTE_ADDR']; + + if (!empty($_SERVER['HTTP_CLIENT_IP'])) { + $ip = $_SERVER['HTTP_CLIENT_IP']; + } elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) { + $ip = $_SERVER['HTTP_X_FORWARDED_FOR']; + } + return $ip; +} +//creating the shopping cart +function cart(){ + if(isset($_GET['add_cart'])){ + global $con; + $ip = getIp(); + $pro_id = $_GET['add_cart']; + $check_pro = "select * from cart where ip_add = '$ip' AND p_id='$pro_id '"; + $run_check = mysqli_query($con,$check_pro); + if(mysqli_num_rows($run_check)>0){ + echo ""; + } else { + $insert_pro = "insert into cart (p_id, ip_add) VALUES + ('$pro_id','$ip')"; + $run_pro = mysqli_query($con,$insert_pro); + if($run_pro) + header('location:'.$_SERVER['PHP_SELF']); + } + } +} +//getting the total added items. +function total_items(){ + global $con; + $ip = getIp(); + $get_items = "select * from cart where ip_add='$ip'"; + $run_items = mysqli_query($con,$get_items); + $count_items = 0; + while($row = mysqli_fetch_array($run_items)) + $count_items += $row['qty']; + echo $count_items; +} +//getting the total price of the items in the cart +function total_price(){ + global $con; + $ip = getIp(); + $total = 0; + $sel_price = "select * from cart where ip_add = '$ip'"; + $run_price = mysqli_query($con,$sel_price); + while($cart_row = mysqli_fetch_array($run_price)){ + $pro_id = $cart_row['p_id']; + $pro_qty = $cart_row['qty']; + $pro_price = "select * from products where pro_id = '$pro_id'"; + $run_pro_price = mysqli_query($con, $pro_price); + while ($pro_row = mysqli_fetch_array($run_pro_price)){ + $pro_price = $pro_row['pro_price']; + $pro_price_all_items = $pro_price * $pro_qty; + $total += $pro_price_all_items; + } + } + echo 'Rs '.$total.'/-'; +} diff --git a/admin/index.php b/admin/index.php index 29e7a82..94f7bf3 100644 --- a/admin/index.php +++ b/admin/index.php @@ -1,3 +1,9 @@ + + @@ -10,6 +16,13 @@ E-commerce Admin Panel + Admin Panel +
    @@ -62,6 +75,35 @@
    +
    + +
    diff --git a/admin/insert_brand.php b/admin/insert_brand.php new file mode 100644 index 0000000..9d70967 --- /dev/null +++ b/admin/insert_brand.php @@ -0,0 +1,25 @@ +
    +
    + + + + + + + + + + + + +
    +

    Add New brand

    +
    + + + +
    + +
    +
    +
    \ No newline at end of file diff --git a/admin/insert_category.php b/admin/insert_category.php new file mode 100644 index 0000000..07cc4a0 --- /dev/null +++ b/admin/insert_category.php @@ -0,0 +1,25 @@ +
    +
    + + + + + + + + + + + + +
    +

    Add New Category

    +
    + + + +
    + +
    +
    +
    \ No newline at end of file diff --git a/admin/insert_product.php b/admin/insert_product.php index 344fcb6..8f54467 100644 --- a/admin/insert_product.php +++ b/admin/insert_product.php @@ -1,82 +1,83 @@ - - - - Inserting Product - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    Insert New Product here

    Product Title:
    Product Category: - -
    Product Brand: - -
    Product Image:
    Product Price:
    Product Description:
    Product Keywords:
    - +
    +
    + +
    +

    Insert New Product

    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +l
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    +
    + +
    +
    - - - +
    +
    \ No newline at end of file diff --git a/admin/insertbrand.php b/admin/insertbrand.php new file mode 100644 index 0000000..32815e9 --- /dev/null +++ b/admin/insertbrand.php @@ -0,0 +1,9 @@ + \ No newline at end of file diff --git a/admin/insertcat.php b/admin/insertcat.php new file mode 100644 index 0000000..4e5d224 --- /dev/null +++ b/admin/insertcat.php @@ -0,0 +1,9 @@ + \ No newline at end of file diff --git a/admin/view_brands.php b/admin/view_brands.php new file mode 100644 index 0000000..a719087 --- /dev/null +++ b/admin/view_brands.php @@ -0,0 +1,20 @@ +

    Brands

    + \ No newline at end of file diff --git a/admin/view_categories.php b/admin/view_categories.php new file mode 100644 index 0000000..ef1052d --- /dev/null +++ b/admin/view_categories.php @@ -0,0 +1,23 @@ +

    Categories

    + diff --git a/admin/view_customers.php b/admin/view_customers.php new file mode 100644 index 0000000..67c81eb --- /dev/null +++ b/admin/view_customers.php @@ -0,0 +1,53 @@ +

    Customers

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + "; + } + ?> + + +
    NameEmailCountryCityContactAddressImageDeleteEdit
    $cust_name$cust_email$cust_country$cust_city$cust_contact$cust_address + + + + + + + +
    \ No newline at end of file diff --git a/admin/view_orders.php b/admin/view_orders.php new file mode 100644 index 0000000..0197877 --- /dev/null +++ b/admin/view_orders.php @@ -0,0 +1,51 @@ +
    +

    Orders

    + + + + + + + + + + + + + + + + + + + + + + + +
    IpProductQuantitySingle Unit PriceTotal PriceDelete

    + +
    + +
    Sub Total:
    +
    \ No newline at end of file diff --git a/admin/view_products.php b/admin/view_products.php new file mode 100644 index 0000000..88947fc --- /dev/null +++ b/admin/view_products.php @@ -0,0 +1,46 @@ +
    +
    +
    + +
    Product Title
    +
    Product Price
    +
    Product Description
    +
    Product Image
    +
    Delete Product
    +
    Edit Product
    + +
    + + + + + + + + + + + + + + + +
    + "; + } + ?> + + +
    + + +