Skip to content

Commit 9880f81

Browse files
llol
1 parent 6291b4c commit 9880f81

15 files changed

+391
-24
lines changed

genre.php

Whitespace-only changes.

images/men_banner.jpg

127 KB
Loading

index.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<head>
1111
<meta charset="utf-8">
1212
<link rel="stylesheet" href="style.css">
13-
<title>Sample Site</title>
13+
<title>VELASCA</title>
1414
</head>
1515

1616
<body>
@@ -101,17 +101,17 @@
101101
</div>
102102
<div class="bottom-content cont3">
103103
<div class="image-content">
104-
<a href="item.php"><span>Adidas</span></a>
104+
<a href="item.inc.php?p_id=adidas_kamanda"><span>Adidas KAMANDA</span></a>
105105
</div>
106106
</div>
107107
<div class="bottom-content cont4">
108108
<div class="image-content">
109-
<a href="item.php"><span>Nike Air X</span></a>
109+
<a href="item.inc.php?p_id=jordan_liftoff"><span>Jordan Lift Off</span></a>
110110
</div>
111111
</div>
112112
<div class="bottom-content cont5">
113113
<div class="image-content">
114-
<a href="item.php"><span>UnderArmour</span></a>
114+
<a href="item.php?p_id=ua_hovr"><span>UnderArmour HOVR</span></a>
115115
</div>
116116
</div>
117117

item.css

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
html {
2+
overflow-x: hidden;
3+
}
4+
5+
.wrap-inner,
6+
.reviews {
7+
display: block;
8+
}
9+
10+
.item-image {
11+
float: left;
12+
width: 50%;
13+
padding-bottom: 80px;
14+
}
15+
16+
.item-description {
17+
float: right;
18+
width: 45%;
19+
margin-right: 30px;
20+
}
21+
22+
.reviews {
23+
padding-top: 20px;
24+
width: 37%;
25+
margin: 0;
26+
margin-left: 80px;
27+
28+
position: relative;
29+
}
30+
31+
.footer {
32+
position: relative;
33+
bottom: 0;
34+
}
35+
36+
input[type="radio"]:checked {
37+
38+
background-color: pink;
39+
}

item.inc.php

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?php
2+
session_start();
3+
if(isset($_GET['p_id'])){
4+
5+
require 'db.inc.php';
6+
7+
$p_id = $_GET['p_id'];
8+
9+
$sql = 'SELECT * FROM items WHERE p_id="'.$p_id.'";';
10+
$result = mysqli_query($conn, $sql);
11+
12+
if(mysqli_num_rows($result)==0){
13+
header("Location: index.php?error=InvalidItemID");
14+
exit();
15+
}
16+
else{
17+
header("Location: item.php?p_id=".$p_id);
18+
}
19+
}
20+
21+
mysqli_close($conn);
22+
?>

item.php

+88
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
<?php
2+
session_start();
3+
4+
if(isset($_GET['p_id'])){
5+
6+
require 'db.inc.php';
7+
8+
$p_id = $_GET['p_id'];
9+
10+
$sql = 'SELECT * FROM items WHERE p_id="'.$p_id.'";';
11+
$result = mysqli_query($conn, $sql);
12+
13+
$row = mysqli_fetch_array($result);
14+
15+
$p_company = $row['p_company'];
16+
$p_product = $row['p_product'];
17+
$p_rating = $row['p_rating'];
18+
$p_price = $row['p_price'];
19+
$p_discount = $row['p_discount'];
20+
$p_size = explode(",",$row['p_size']);
21+
$p_details = $row['p_details'];
22+
$p_material = $row['p_material'];
23+
$p_specification = $row['p_specification'];
24+
}
25+
else{
26+
header("Location: index.php");
27+
}
28+
29+
?>
30+
<html>
31+
<title><?php echo $p_product?></title>
32+
<head>
33+
<link rel="stylesheet" href="style.css">
34+
<link rel="stylesheet" href="login_style.css">
35+
<link rel="stylesheet" href="item.css">
36+
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.7.2/css/all.css" integrity="sha384-fnmOCqbTlWIlj8LyTjo7mOUStjsKC4pOpQbqyi7RrhN7udi9RwhKkMHpvLbHG9Sr" crossorigin="anonymous">
37+
</head>
38+
<body>
39+
<?php
40+
include 'navbar.php'
41+
?>
42+
<div class="wrap" style="padding:20px">
43+
<div class="wrap-inner">
44+
<div class="item-image">
45+
<?php echo '<img src="images/Shoes/Men/'.$_GET['p_id'].'.jpg" style="margin-left:80px;width:500px;height:500px;align=center">'; ?>
46+
</div>
47+
<form class="item-description">
48+
<h2><?php echo $p_company; ?></h2>
49+
<h3 style="line-height: 3px;"><?php echo $p_product; ?></h3>
50+
<span style="border: 1px solid black; padding: 5px;"><?php echo $p_rating ."<i class='fas fa-star' style='color:darkorange'></i> Rating"; ?></span> <br> <hr>
51+
<h2><?php echo "$".$p_price." (".$p_discount."% OFF)"; ?></h2>
52+
<h5>Additional tax may apply; charged at checkout</h5>
53+
<h4>SELECT SIZE</h4>
54+
<span>
55+
<?php
56+
foreach( $p_size as $size){
57+
echo '<input type="radio" name="size" value='.$size.'>'.$size.' ';
58+
}
59+
?>
60+
</span>
61+
<br> <br>
62+
<button type="submit">ADD TO CART <i class="fas fa-shopping-bag"></i></button>
63+
<h5>This item cannot be returned</h5>
64+
<hr>
65+
<h3>PRODUCT DETAILS</h3>
66+
<span style="width: 100px;"><?php echo $p_details; ?></span>
67+
<h4>MATERIAL</h4>
68+
<span><?php echo $p_material; ?></span>
69+
<h4>SPECIFICATION</h4>
70+
<span><?php echo $p_specification; ?></span>
71+
72+
</form>
73+
<div class="reviews">
74+
<h1>REVIEWS</h1>
75+
Lorem, ipsum dolor sit amet consectetur adipisicing elit. Adipisci beatae debitis voluptatum vero id nesciunt tenetur culpa officia molestias possimus ipsum quod voluptas ducimus laborum magnam corporis, repellat molestiae blanditiis.
76+
</div>
77+
</div>
78+
<br> <br> <br>
79+
80+
81+
</div>
82+
<?php
83+
include 'footer.php'?>
84+
85+
</body>
86+
</html>
87+
88+
<link href="https://fonts.googleapis.com/css?family=Cedarville+Cursive|Karla|Bad+Script|Handlee" rel="stylesheet">

list.php

+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
<?php
2+
3+
session_start();
4+
5+
?>
6+
7+
<!DOCTYPE html>
8+
<html lang="en" dir="ltr">
9+
10+
<head>
11+
<meta charset="utf-8">
12+
<link rel="stylesheet" href="login_style.css">
13+
<link rel="stylesheet" href="style_list.css">
14+
<title>VELASCA</title>
15+
</head>
16+
17+
<body>
18+
<div id="wrapper" >
19+
<style>
20+
nav{
21+
position: fixed;
22+
}
23+
nav #logo{
24+
color: black;
25+
}
26+
</style>
27+
<?php
28+
include 'navbar.php'
29+
?>
30+
31+
<div class="top-banner" style="margin-top:120px">
32+
<img src="images/men_banner.jpg" style="width:100%" alt="">
33+
</div>
34+
35+
Lorem ipsum dolor sit, amet consectetur adipisicing elit. Eius obcaecati totam quasi harum fugit reiciendis earum beatae ipsam, dolor nobis nam accusantium esse, quaerat quam reprehenderit, autem rerum vel iusto?
36+
Lorem ipsum dolor sit amet consectetur adipisicing elit. Quas deleniti ad officia vel repellendus, velit aut, voluptate adipisci incidunt tempora ipsa suscipit. Aliquid, temporibus perspiciatis totam dolorem velit deleniti illo!
37+
Lorem ipsum dolor sit amet consectetur adipisicing elit. Iure deserunt, doloribus quibusdam sequi magnam pariatur id dolorem praesentium blanditiis perferendis alias libero ipsa incidunt porro sapiente maxime repudiandae magni aperiam.
38+
Lorem ipsum dolor sit amet consectetur, adipisicing elit. Laboriosam totam dolorem aspernatur delectus qui eum eveniet eos praesentium. Ducimus animi officia voluptate debitis sed modi consectetur aliquam. Corporis, cupiditate beatae?
39+
40+
41+
<br>
42+
<br>
43+
<br>
44+
<br>
45+
<?php
46+
include 'footer.php'
47+
?>
48+
49+
</div>
50+
51+
52+
</body>
53+
<script src="https://code.jquery.com/jquery-3.3.1.js" integrity="sha256-2Kok7MbOyxpgUVvAk/HJ2jigOSYS2auK4Pfzbm7uH60="
54+
crossorigin="anonymous"></script>
55+
<script src="list_script.js"></script>
56+
<link href="https://fonts.googleapis.com/css?family=Cedarville+Cursive|Karla|Bad+Script|Handlee" rel="stylesheet">
57+
58+
</html>

list_script.js

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
$(window).on('scroll', function () {
2+
if ($(window).scrollTop()) {
3+
$('nav').addClass('black');
4+
5+
} else {
6+
$('nav').removeClass('black');
7+
}
8+
})

login.inc.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828
header("Location: index.php");
2929
}else{
30-
header("Location: login.php?error=Invalid Username and Password ".$row['password']." ".password_hash($pass, PASSWORD_DEFAULT));
30+
header("Location: login.php?error=Invalid Username and Password ");
3131
exit();
3232
}
3333

login.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
<title>Login</title>
1414
<link rel="stylesheet" href="style.css">
1515
<link rel="stylesheet" href="login_style.css">
16+
<script src="https://www.google.com/reCAPTCHA/api.js?render=6LcRBpgUAAAAAEVyMG8-AVu-oe3x1c1gUeoWa7h8"></script>
1617

1718
<body>
1819
<div id="wrapper">
@@ -34,7 +35,8 @@
3435
?>
3536

3637
<input type="text" name="uname" placeholder="Username" required> <br>
37-
<input type="password" name="pass" id="" placeholder="Password" required> <br> <br> <br> <br>
38+
<input type="password" name="pass" id="" placeholder="Password" required> <br>
39+
<div class="g-reCAPTCHA" data-sitekey="your_site_key"></div> <br> <br> <br> <br>
3840
<button type="submit" name="submit-login">Log In</button>
3941
<p style="font-weight: 400;">New to VELASCA? <a style="color:#ff3399; text-decoration: none;" href="signup.php">Create
4042
Account</a></p>

navbar.php

+17-18
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
<nav>
21

2+
<nav>
33
<style>
44

55

@@ -54,24 +54,23 @@
5454
<div id="logo">VELASCA</div>
5555
<ul>
5656
<li><a href="index.php">HOME</a></li>
57-
<li><a href="genre.php?=men">Men</a></li>
58-
<li><a href="genre.php?=women">WOMEN</a></li>
57+
<li><a href="list.php?=men">Men</a></li>
58+
<li><a href="list.php?=women">WOMEN</a></li>
5959
<li><a href="genre.php?=kids">KIDS</a></li>
6060
<div class="dropdown">
61-
<?php
62-
if(isset($_SESSION['user'])){
63-
echo '<li><a class="active" href="profile.php" class="dropbtn" id="dropbtn">'.$_SESSION['user'].'</a></li>' ;
64-
echo '<div class="dropdown-content">';
65-
echo '<a href="#">Cart</a>';
66-
echo '<a href="profile.php">Profile</a>';
67-
echo '<a href="logout.inc.php">Logout</a>';
68-
echo '</div>';
69-
}
70-
else{
71-
echo '<li><a class="active" href="login.php">Login</a></li>' ;
72-
}
73-
?>
74-
61+
<?php
62+
if(isset($_SESSION['user'])){
63+
echo '<li><a class="active" href="profile.php" class="dropbtn" id="dropbtn">'.$_SESSION['user'].'</a></li>' ;
64+
echo '<div class="dropdown-content">';
65+
echo '<a href="#">Cart</a>';
66+
echo '<a href="profile.php">Profile</a>';
67+
echo '<a href="logout.inc.php">Logout</a>';
68+
echo '</div>';
69+
}
70+
else{
71+
echo '<li><a class="active" href="login.php">Login</a></li>' ;
72+
}
73+
?>
74+
</div>
7575
</ul>
76-
</div>
7776
</nav>

0 commit comments

Comments
 (0)