diff --git a/administration/admin_registration.php b/administration/admin_registration.php new file mode 100644 index 0000000..20433c5 --- /dev/null +++ b/administration/admin_registration.php @@ -0,0 +1,129 @@ +alert('Admin registration successful. You can now log in.')"; + } else { + echo ""; + } + } else { + echo ""; + } + +} +?> + + + + + + + Admin Registration + + + +
+

Admin Registration

+

Register as Admin

+
+
+ + +
+
+ + +
+ +
+
+ + \ No newline at end of file diff --git a/administration/index.php b/administration/index.php new file mode 100644 index 0000000..238e2c3 --- /dev/null +++ b/administration/index.php @@ -0,0 +1,146 @@ + +alert('You have been successfully logged out.')"; + +} + + +?> + + + + + + Admin Dashboard + + + + + + + + + + + + + +
+ + +
+
+

Manage Details

+
+ + +
+
+
+ +

Admin

+
+ + +
+
+ +
+ +
+ +
+

© PY-Electronics

+
+ + + + + + + \ No newline at end of file diff --git a/administration/insert_categories.php b/administration/insert_categories.php new file mode 100644 index 0000000..ac12dde --- /dev/null +++ b/administration/insert_categories.php @@ -0,0 +1,41 @@ +0){ + echo""; + }else{ + $insert_query="insert into `categories` (category_title) values ('$category_title')"; + $result= mysqli_query($con,$insert_query); + if($result){ + echo""; + } + } +} +?> + +

Insert Categories

+ + +
+
+ + +
+ +
+ + +
+
\ No newline at end of file diff --git a/administration/insert_product.php b/administration/insert_product.php new file mode 100644 index 0000000..6a55f2b --- /dev/null +++ b/administration/insert_product.php @@ -0,0 +1,145 @@ +alert('Please fill all the available fields!')"; + exit(); + + }else{ + move_uploaded_file($tmp_image,"./product_images/$product_image"); + + //insert products + $insert_products="insert into `products` (product_title,description,product_keywords,category_id,product_image,product_price,date,status) values ('$product_title','$description','$product_keywords','$product_category','$product_image','$product_price',NOW(),'$product_status')"; + + $result_query=mysqli_query($con,$insert_products); + if($result_query){ + + echo ""; + + } + + } + + + + +} + +?> + + + + + + Insert Products - Admin Dashboard + + + + + + + + + + + + + +
+ +

Insert Products

+ + + +
+
+ + +
+ + + + +
+ + +
+ + + +
+ + +
+ + + +
+ +
+ + + +
+ + +
+ + + +
+ + +
+ + + +
+ +
+
+ +
+ + +S \ No newline at end of file diff --git a/administration/list_users.php b/administration/list_users.php new file mode 100644 index 0000000..3f83694 --- /dev/null +++ b/administration/list_users.php @@ -0,0 +1,103 @@ + + + + + + + + + List of Users + + + + +
+

List of Users

+
+ + + 0) { + echo ' + + + + + '; + + while ($row = mysqli_fetch_assoc($result)) { + echo ' + + + + '; + } + + echo '
UsernameEmailRegistration Date
' . $row['username'] . '' . $row['email'] . '' . $row['registration_date'] . '
'; + } else { + echo 'No users found.'; + } + ?> + + diff --git a/administration/login_admin.php b/administration/login_admin.php new file mode 100644 index 0000000..24b7d16 --- /dev/null +++ b/administration/login_admin.php @@ -0,0 +1,122 @@ +alert('Login successful. You are now logged in as an admin.')"; + echo ""; + } else { + echo ""; + } + } else { + echo ""; + } +} +?> + + + + + + + + Admin Login + + + +
+

Admin Login

+

Log In

+
+
+ + +
+
+ + +
+ +
+
+ + diff --git a/administration/logout_admin.php b/administration/logout_admin.php new file mode 100644 index 0000000..262a9aa --- /dev/null +++ b/administration/logout_admin.php @@ -0,0 +1,11 @@ + diff --git a/administration/product_images/Ultra22S.jpg b/administration/product_images/Ultra22S.jpg new file mode 100644 index 0000000..c0b6a06 Binary files /dev/null and b/administration/product_images/Ultra22S.jpg differ diff --git a/administration/product_images/iphone11.jpg b/administration/product_images/iphone11.jpg new file mode 100644 index 0000000..2453a7b Binary files /dev/null and b/administration/product_images/iphone11.jpg differ diff --git a/administration/product_images/iphone12.jpeg b/administration/product_images/iphone12.jpeg new file mode 100644 index 0000000..08131cd Binary files /dev/null and b/administration/product_images/iphone12.jpeg differ diff --git a/administration/product_images/iphone12pro.jpg b/administration/product_images/iphone12pro.jpg new file mode 100644 index 0000000..3103b67 Binary files /dev/null and b/administration/product_images/iphone12pro.jpg differ diff --git a/administration/product_images/iphone13promax.jpg b/administration/product_images/iphone13promax.jpg new file mode 100644 index 0000000..47d790f Binary files /dev/null and b/administration/product_images/iphone13promax.jpg differ diff --git a/administration/product_images/iphone14.jpg b/administration/product_images/iphone14.jpg new file mode 100644 index 0000000..6f2ead5 Binary files /dev/null and b/administration/product_images/iphone14.jpg differ diff --git a/administration/product_images/iphone14.webp b/administration/product_images/iphone14.webp new file mode 100644 index 0000000..d81dd97 Binary files /dev/null and b/administration/product_images/iphone14.webp differ diff --git a/administration/product_images/iphone14promax.jpg b/administration/product_images/iphone14promax.jpg new file mode 100644 index 0000000..4d572ec Binary files /dev/null and b/administration/product_images/iphone14promax.jpg differ diff --git a/administration/product_images/iphone15img.jpg b/administration/product_images/iphone15img.jpg new file mode 100644 index 0000000..3933063 Binary files /dev/null and b/administration/product_images/iphone15img.jpg differ diff --git a/administration/product_images/iphone15pro.jpg b/administration/product_images/iphone15pro.jpg new file mode 100644 index 0000000..d3a4337 Binary files /dev/null and b/administration/product_images/iphone15pro.jpg differ diff --git a/administration/product_images/iphone15promax1.webp b/administration/product_images/iphone15promax1.webp new file mode 100644 index 0000000..d81dd97 Binary files /dev/null and b/administration/product_images/iphone15promax1.webp differ diff --git a/administration/view_categories.php b/administration/view_categories.php new file mode 100644 index 0000000..f672632 --- /dev/null +++ b/administration/view_categories.php @@ -0,0 +1,99 @@ + + + + + + + List of Categories + + + +
+

List of Categories

+
+ + 0) { + echo ' + + + + + '; + + while ($row = mysqli_fetch_assoc($result)) { + echo ' + + + + '; + } + + echo '
Category IdCategory Title
' . $row['category_id'] . '' . $row['category_title'] . '
'; + } else { + echo 'No categories found.'; + } + ?> + + \ No newline at end of file diff --git a/administration/view_contacted_users.php b/administration/view_contacted_users.php new file mode 100644 index 0000000..a8ff402 --- /dev/null +++ b/administration/view_contacted_users.php @@ -0,0 +1,99 @@ + + + + + + + + Admin Dashboard - View Contact Data + + + + + + +
+ + +

Contacted User Information

+ + 0) { + echo ""; + echo " + + "; + while ($row = mysqli_fetch_assoc($result_query)) { + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + } + echo "
NameEmailMessageSubmission Date & Time
" . $row['name'] . "" . $row['email'] . "" . $row['message'] . "" . $row['submission_date'] . "
"; + } else { + echo "

No contact form data available.

"; + } + ?> + + +
+ + diff --git a/cart.php b/cart.php new file mode 100644 index 0000000..4f41705 --- /dev/null +++ b/cart.php @@ -0,0 +1,271 @@ +alert('Login successful. You are now logged in.')"; + echo ""; + } else { + echo ""; + } + } else { + echo ""; + } +} +?> + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Product TitleProduct ImageQuantityTotal PriceRemoveOperations
+ + + + +
+ +
+

Subtotal:

+ Continue Shopping + + + + +
+
+
+ + + window.open('cart.php','_self')"; + } + } + } +} +echo $remove_item= remove_cart_item(); + + + ?> + + +
+ + + + + + + +
+

© PY- Electronics.

+
+ + + + + + + + + + \ No newline at end of file diff --git a/contact.php b/contact.php new file mode 100644 index 0000000..38f94ef --- /dev/null +++ b/contact.php @@ -0,0 +1,244 @@ + + + + + + + + PY-Electronics + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
+ + +

PY-Electronics

+ +
+ + + +
+

Contact Information

+

Feel free to reach out to us with any questions or inquiries:

+
    +
  • Email: contact@pyelectronics.com
  • +
  • Phone: (123) 456-7890
  • +
  • Address: 123 Electronics Road, Mumbai, Maharashtra, India
  • +
+ + +

Contact Form

+
+ +
+ + +
+ + +
+ alert('Your message has been successfully submitted. We will get back to you soon.');"; + } else { + echo ""; + } + mysqli_stmt_close($stmt); + } else { + echo ""; + } +} +?> + + + + + + +
+
+ + + + + + + +
+

© PY-Electronics- All Rights Reserved.

+
+
+ + + + + + \ No newline at end of file diff --git a/functions/functions.php b/functions/functions.php new file mode 100644 index 0000000..41421df --- /dev/null +++ b/functions/functions.php @@ -0,0 +1,237 @@ + Sorry! No Stock available for this category"; + echo "

:-(

"; + + } + + // $row=mysqli_fetch_assoc($result_query); + // echo $row['product_title']; + while($row=mysqli_fetch_assoc($result_query)){ + + $product_id=$row['product_id']; + $product_title=$row['product_title']; + $description=$row['description']; + // $product_keywords=$row['product_keywords']; + $category_id=$row['category_id']; + $product_image=$row['product_image']; + $product_price=$row['product_price']; + + echo "
+
+ $product_title +
+
$product_title
+

$description

+

Price: $$product_price

+ Add to cart + View more +
+
+
"; + + + } +} + +} + +//searching function +function search_product() { + global $con; + + // Check if 'search_data_product' is set in the URL + if (isset($_GET['search_data_product'])) { + // Get the search keyword + $search_data_value = $_GET['search_data_product']; + + $search_query = "SELECT * FROM `products` WHERE product_keywords LIKE '%$search_data_value%'"; + $result_query = mysqli_query($con, $search_query); + $num_of_rows = mysqli_num_rows($result_query); + + if ($num_of_rows == 0) { + echo "

Sorry! No results match your search. No products found!

"; + } else { + while ($row = mysqli_fetch_assoc($result_query)) { + $product_id = $row['product_id']; + $product_title = $row['product_title']; + $description = $row['description']; + $category_id = $row['category_id']; + $product_image = $row['product_image']; + $product_price = $row['product_price']; + + echo "
+
+ $product_title +
+
$product_title
+

$description

+

Price: $$product_price

+ Add to cart + View more +
+
+
"; + } + } + } +} + + +function getproducts(){ + + global $con; + + //condition to check isset or not + + if(!isset($_GET['category'])){ + + $select_query="Select * from `products` order by rand() LIMIT 0,9"; //0 to 9 is limit of products on one page + $result_query=mysqli_query($con,$select_query); + // $row=mysqli_fetch_assoc($result_query); + // echo $row['product_title']; + while($row=mysqli_fetch_assoc($result_query)){ + + $product_id=$row['product_id']; + $product_title=$row['product_title']; + $description=$row['description']; + $product_keywords=$row['product_keywords']; + $category_id=$row['category_id']; + $product_image=$row['product_image']; + $product_price=$row['product_price']; + + echo "
+
+ $product_title +
+
$product_title
+

$description

+

Price: $$product_price

+ Add to cart +
+
+
"; + // We can remove "View more" as we will not have other pictures to view more + + } +} + +} +function getcategories(){ + + global $con; + + $select_categories = "Select * from `categories`"; + + $result_categories = mysqli_query($con,$select_categories); + + while($row_data = mysqli_fetch_assoc($result_categories)){ + + $category_title = $row_data['category_title']; + $category_id = $row_data['category_id']; + // echo $category_title; + echo " "; + } + +} +//get ip address function + +function getIPAddress() { + //whether ip is from the share internet + if(!empty($_SERVER['HTTP_CLIENT_IP'])) { + $ip = $_SERVER['HTTP_CLIENT_IP']; + } + //whether ip is from the proxy + elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) { + $ip = $_SERVER['HTTP_X_FORWARDED_FOR']; + } + //whether ip is from the remote address + else{ + $ip = $_SERVER['REMOTE_ADDR']; + } + return $ip; + } +function cart(){ + if(isset($_GET['add_to_cart'])){ + global $con; + $get_ip_add = getIPAddress(); + $get_product_id=$_GET['add_to_cart']; + + $select_query="Select * from `cart_details` where ip_address='$get_ip_add' and + product_id='$get_product_id'"; + $result_query=mysqli_query($con,$select_query); + $num_of_rows=mysqli_num_rows($result_query); + if($num_of_rows>0){ + echo ""; + echo""; + }else{ + $insert_query="insert into `cart_details` (product_id,ip_address, + quantity) values($get_product_id, '$get_ip_add',0)"; + $result_query=mysqli_query($con,$insert_query); + echo ""; + echo""; + } + } + } + //funxtion to get cart items quantity + function cart_item(){ + if(isset($_GET['add_to_cart'])){ + global $con; + $get_ip_add = getIPAddress(); + $select_query="Select * from `cart_details` where ip_address='$get_ip_add'"; + $result_query=mysqli_query($con,$select_query); + $count_cart_items=mysqli_num_rows($result_query); + }else{ + global $con; + $get_ip_add = getIPAddress(); + $select_query="Select * from `cart_details` where ip_address='$get_ip_add'"; + $result_query=mysqli_query($con,$select_query); + $count_cart_items=mysqli_num_rows($result_query); + } + echo $count_cart_items; + } + + + + //function totat cart price + function total_cart_price(){ + global $con; + $get_ip_add = getIPAddress(); + $total_price=0; + $cart_query="Select * from `cart_details` where ip_address= '$get_ip_add'"; + $result= mysqli_query($con,$cart_query); + while($row=mysqli_fetch_array($result)){ + $product_id=$row['product_id']; + $select_products="Select * from `products` where product_id='$product_id'"; + $result_products=mysqli_query($con,$select_products); + while($row_product_price=mysqli_fetch_array($result_products)){ + $product_price=array($row_product_price['product_price']); + $product_values=array_sum($product_price); + $total_price+=$product_values; + } + } + echo $total_price; + } + +?> \ No newline at end of file diff --git a/images/e-commerce_logo.jpg b/images/e-commerce-logo.jpg similarity index 100% rename from images/e-commerce_logo.jpg rename to images/e-commerce-logo.jpg diff --git a/images/iphone11.jpg b/images/iphone11.jpg new file mode 100644 index 0000000..2453a7b Binary files /dev/null and b/images/iphone11.jpg differ diff --git a/images/iphone12.jpeg b/images/iphone12.jpeg new file mode 100644 index 0000000..08131cd Binary files /dev/null and b/images/iphone12.jpeg differ diff --git a/images/iphone12pro.jpg b/images/iphone12pro.jpg new file mode 100644 index 0000000..3103b67 Binary files /dev/null and b/images/iphone12pro.jpg differ diff --git a/images/iphone13promax.jpg b/images/iphone13promax.jpg new file mode 100644 index 0000000..47d790f Binary files /dev/null and b/images/iphone13promax.jpg differ diff --git a/images/iphone14.jpg b/images/iphone14.jpg new file mode 100644 index 0000000..6f2ead5 Binary files /dev/null and b/images/iphone14.jpg differ diff --git a/images/iphone14.webp b/images/iphone14.webp new file mode 100644 index 0000000..d81dd97 Binary files /dev/null and b/images/iphone14.webp differ diff --git a/images/iphone14promax.jpg b/images/iphone14promax.jpg new file mode 100644 index 0000000..4d572ec Binary files /dev/null and b/images/iphone14promax.jpg differ diff --git a/images/iphone15img.jpg b/images/iphone15img.jpg new file mode 100644 index 0000000..3933063 Binary files /dev/null and b/images/iphone15img.jpg differ diff --git a/images/iphone15pro.jpg b/images/iphone15pro.jpg new file mode 100644 index 0000000..d3a4337 Binary files /dev/null and b/images/iphone15pro.jpg differ diff --git a/images/iphone15promax1.webp b/images/iphone15promax1.webp new file mode 100644 index 0000000..d81dd97 Binary files /dev/null and b/images/iphone15promax1.webp differ diff --git a/includes/connect.php b/includes/connect.php new file mode 100644 index 0000000..0505e7d --- /dev/null +++ b/includes/connect.php @@ -0,0 +1,8 @@ + \ No newline at end of file diff --git a/index.php b/index.php index e995d01..b755517 100644 --- a/index.php +++ b/index.php @@ -1,3 +1,17 @@ + +alert('You have been successfully logged out.')"; + +} + +include('includes/connect.php'); +include('functions/functions.php'); + + +?> @@ -18,52 +32,122 @@ - -
-
- + -
-

© PYElectronics- All Rights Reserved.

+ +
+ + + + + + +
+ +
+ + +
+
+ + + + +
+ +
+
- - + +
+

© PYElectronics- All Rights Reserved.

+
+ + + +
+ + + diff --git a/login.php b/login.php new file mode 100644 index 0000000..6f28a0d --- /dev/null +++ b/login.php @@ -0,0 +1,142 @@ +alert('Login successful. You are now logged in.')"; + echo ""; + } else { + echo ""; + } + } else { + echo ""; + } +} +?> + + + + + + User Login + + + +
+

PY-Electronics

+

Log In

+
+
+ + +
+
+ + +
+ +
+

Don't have an account? Create Account

+
+ + \ No newline at end of file diff --git a/logout.php b/logout.php new file mode 100644 index 0000000..615e35a --- /dev/null +++ b/logout.php @@ -0,0 +1,10 @@ + diff --git a/registration.php b/registration.php new file mode 100644 index 0000000..c02adba --- /dev/null +++ b/registration.php @@ -0,0 +1,168 @@ +alert('Your password and confirm password do not match.')"; + } else { + $checkEmailQuery = "SELECT * FROM users WHERE email='$email'"; + $result = mysqli_query($con, $checkEmailQuery); + + if (mysqli_num_rows($result) > 0) { + echo ""; + } else { + // Modified INSERT query to exclude 'confirm_password' + $insertQuery = "INSERT INTO users (username, email, password) VALUES ('$username', '$email', '$hashedPassword')"; + if (mysqli_query($con, $insertQuery)) { + echo ""; + echo ""; + } else { + echo ""; + } + } + } +} + +?> + + + + + + + User Registration + + + + +
+

+ PY-Electronics +

+ +

+ Registration +

+ +
+
+ + +
+ +
+ + +
+ +
+ + +
+ + +
+ + +
+ + + +
+
+ + diff --git a/search_product.php b/search_product.php new file mode 100644 index 0000000..bbe772e --- /dev/null +++ b/search_product.php @@ -0,0 +1,147 @@ + + + + + + + + + PY-Electronics + + + + + + + + + + + + + + +
+ + + + + + + + + + + + +
+ + + +
+ +
+ + + +
+
+ + + + + +
+ + +
+ + + + +
+ + + + + +
+

© PY-Electronics

+
+ + + +
+ + + + + + \ No newline at end of file diff --git a/styles.css b/styles.css new file mode 100644 index 0000000..9f2bc08 --- /dev/null +++ b/styles.css @@ -0,0 +1,46 @@ +* { + margin: 0; + padding: 0; + box-sizing: border-box; + } + + .card-img-top { + width: 100%; + height: 200px; + object-fit: contain; + } + + .admin-image { + width: 80px; + object-fit: contain; + } + +/* styles.css */ +.my-button{ + background-color: #007bff; + border: none; + padding: 10px; + border-radius: 5px; + display: inline-block; + text-align: center; +} + +.my-button a { + text-decoration: none; + color: white; +} + +/* styles.css */ +.my-button { + background-color: #007bff; + border: none; + padding: 10px; + border-radius: 5px; + display: inline-block; + text-align: center; +} + +.my-button a { + text-decoration: none; + color: white; +}