Project Second Stage: Jewelry Website: Prepared by
Project Second Stage: Jewelry Website: Prepared by
Prepared by:
Supervisor:
Dr. Ahmed Mohammed Hassaballa Adam
• Foundation of Web Pages: HTML provides the basic structure of web pages by
defining elements such as headings, paragraphs, images, links, and forms.
• Universal Compatibility: It works on all browsers and devices, ensuring broad
accessibility.
• SEO Friendly: Properly structured HTML improves search engine rankings, making
it easier for users to find the website.
• Integration with Other Technologies: HTML seamlessly integrates with CSS,
JavaScript, and server-side languages like PHP to create dynamic and visually
appealing websites.
• Enhances Visual Appeal: CSS controls the design, layout, and aesthetics of a
website by applying styles such as colors, fonts, and spacing.
• Ensures Responsiveness: It allows websites to be fully responsive, adjusting
smoothly to different screen sizes and devices.
• Improves Performance: By separating styling from HTML, CSS reduces page load
times and enhances performance.
• Supports Animations & Effects: CSS enables the creation of animations and
transitions, enhancing user experience.
3. JavaScript (JS)
5. MySQL
Conclusion
• HTML & CSS provide the structure and styling for a website.
• JavaScript enhances interactivity and responsiveness.
• PHP processes data on the server and enables dynamic content.
• MySQL efficiently stores and manages all website data.
All proudest:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<link
href="https://fonts.googleapis.com/css2?family=Cedarville+Cursive&family=Playwrite+SK+G
uides&display=swap" rel="stylesheet">
</head>
<body>
<?php
session_start();
if(!isset($_SESSION["user_id"])){
header("location:login.php");
?>
<header>
<div id="header">
<ul>
<li><a href="index.php">Home</a></li>
<li><a href="category.php">Categories</a></li>
<li><a href="about.html">About</a></li>
<li><a href="allproducts.php">Shop</a></li>
<li><a href="contact.php">Contact</a></li>
</ul>
</nav>
</div>
</header>
<div class="product">
<?php
include("connect.php");
$result=$db->query($sql);
if($result->num_rows >0)
while($rows=$result->fetch_assoc())
{ ?>
<div class="product-box">
<br>
<br>
<br>
<br><br>
</form>
</div>
<?php }
else
echo"empty";
if(isset($_POST['add']))
$res1=$db->query($sql1);
if($res1->num_rows==0)
<h3>Success</h3>
<br>
<br>
<button onclick='closeAlertDialog()'>Ok</button>
</div> ";
else
<h3>Error</h3>
<br>
<br>
<button onclick='closeAlertDialog()'>Ok</button>
</div> ";
?>
</div>
<footer>
</footer>
<script src="js/script.js"></script>
</body>
<\html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<link
href="https://fonts.googleapis.com/css2?family=Cedarville+Cursive&family=Playwrite+SK+G
uides&display=swap" rel="stylesheet">
</head>
<body>
<?php
session_start();
if(!isset($_SESSION["user_id"])){
header("location:login.php");
?>
<header>
<div id="header">
<img src="images/logo.png" alt="logo">
<nav>
<ul>
<li><a href="index.php">Home</a></li>
<li><a href="category.php">Categories</a></li>
<li><a href="about.html">About</a></li>
<li><a href="allproducts.php">Shop</a></li>
<li><a href="contact.php">Contact</a></li>
</ul>
</nav>
</div>
</header>
<div class="product">
<?php
include("connect.php");
if(isset($_POST['inc']))
{$amount=$_POST['amount'] +1;
$res1=$db->query($sql1);
if(isset($_POST['dec']))
{$amount=$_POST['amount'];
$amount=$_POST['amount'] -1;
if(isset($_POST['remove']))
$res1=$db->query($sql1);
if($res1)
<h3>Success</h3>
<br>
<br>
<button onclick='closeAlertDialog()'>Ok</button>
</div> ";
else
<h3>Error</h3>
<br>
<p>Remove error</p>
<br>
<button onclick='closeAlertDialog()'>Ok</button>
</div> ";
$result=$db->query($sql);
$total=0;
$subtotal=0;
if($result->num_rows >0)
while($rows=$result->fetch_assoc())
$subtotal=$rows['price'] * $rows['quantity'];
$total +=$subtotal;
?>
<div class="product-box">
<br>
<br>
<br>
<div>
</div>
<br>
</form>
</div>
<?php }
else
echo"empty";
if(isset($_POST['order']))
{
$sql1="SELECT * from `order` WHERE `user_id`='{$_SESSION['user_id']}';";
$res1=$db->query($sql1);
if($res1->num_rows==0)
$res = $db->query($sql);
<h3>Success</h3>
<br>
<p>Order done</p>
<br>
<button onclick='closeAlertDialog()'>Ok</button>
</div> ";
else
<h3>Error</h3>
<br>
<p>Order error</p>
<br>
<button onclick='closeAlertDialog()'>Ok</button>
</div> ";
}
}
?>
</div>
<br>
<div id="order">
<br>
<br>
</form>
<br>
</div>
<br>
<footer>
</footer>
<script src="js/script.js"></script>
</body>
<\html>
DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<link
href="https://fonts.googleapis.com/css2?family=Cedarville+Cursive&family=Playwrite+SK+G
uides&display=swap" rel="stylesheet">
</head>
<body>
<header>
<div id="header">
<nav>
<ul>
<li><a href="index.php">Home</a></li>
<li><a href="category.php">Categories</a></li>
<li><a href="about.html">About</a></li>
<li><a href="allproducts.php">Shop</a></li>
<li><a href="contact.php">Contact</a></li>
</ul>
</nav>
</div>
</header>
<div class="category">
<?php
include("connect.php");
$sql="SELECT * FROM category;";
$result=$db->query($sql);
if($result->num_rows>0)
while($rows=$result->fetch_assoc())
{ ?>
<div class="category-box">
<br>
<br>
</div>
<?php }
else
echo"empty";
?>
</div>
<footer>
</footer>
<script src="js/script.js"></script>
</body>
<\html>
<?php
if(!$db){
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
</head>
<body>
<header>
<div id="header">
<ul>
<li><a href="index.php">Home</a></li>
<li><a href="category.php">Categories</a></li>
<li><a href="about.html">About</a></li>
<li><a href="allproducts.php">Shop</a></li>
<li><a href="contact.php">Contact</a></li>
</ul>
</nav>
</div>
</header>
<?php
include("connect.php");
if(isset($_POST['submit']))
$_POST['name'] = addslashes($_POST['name']);
$_POST['subject'] = addslashes($_POST['subject']);
$_POST['email'] = addslashes($_POST['email']);
$_POST['message'] = addslashes($_POST['message']);
$res = $db->query($sql);
<h3>Success</h3>
<br>
<p>Message send successfuly</p>
<br>
<button onclick='closeAlertDialog()'>Ok</button>
</div> ";
?>
<div class="contact">
<div class="contact-info">
<ul>
<li><img src="images/email.png">Email:
<br><span>[email protected]</span></li>
<li><img src="images/call.png">Call:<br><span>+9665323232</span></li>
</ul>
</div>
<div class="contact-form">
<br>
<br>
</form>
</div>
</div>
<footer>
</footer>
<script src="js/script.js"></script>
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<link
href="https://fonts.googleapis.com/css2?family=Cedarville+Cursive&family=Playwrite+SK+G
uides&display=swap" rel="stylesheet">
</head>
<body>
<?php
session_start();
if(!isset($_SESSION["user_id"])){
header("location:login.php");
?>
<header>
<a href="logout.php">Logout</a>
<div id="header">
<nav>
<ul>
<li><a href="category.php">Categories</a></li>
<li><a href="about.html">About</a></li>
<li><a href="allproducts.php">Shop</a></li>
<li><a href="contact.php">Contact</a></li>
</ul>
</nav>
</div>
<div id="intro">
<div>
<p>Crafted with precision, this exquisite piece combines the warmth of pure gold with
the delicate beauty of a natural pearl. A symbol of elegance and sophistication, it reflects
timeless charm, making it a perfect addition to any jewelry collection.</p>
</div>
<div>
</div>
</div>
</header>
<div class="gallery">
<div class="gallery-item">
</div>
<div class="gallery-item">
</div>
<div class="description">
<p>These elegant earrings blend the lustrous beauty of pearls with the timeless glow of
gold. Designed for sophistication and versatility, they add a touch of luxury to any look, perfect
for both special occasions and everyday elegance.</p>
<br>
<button id="showMoreButton">Show more</button>
</div>
</div>
<main>
<div class="store">
<div>
</div>
<div class="store-desc">
<br>
<br>
<img src="images/ring.png">
</div>
</div>
<div class="calculator">
<h3>Zakat Calculator</h3>
<br><br>
<br><br>
<br><br>
<div class="result">
<h3>Total Zakat Due</h3>
<br>
</form>
</div>
</div>
</main>
<?php
include("connect.php");
if(isset($_POST['gold']))
$_POST['weight'] = addslashes($_POST['weight']);
$res1=$db->query($sql1);
</script> ";
if(isset($_POST['silver']))
$res1=$db->query($sql1);
echo " <script>
</script> ";
?>
<footer>
</footer>
<script src="js/script.js"></script>
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
</head>
<body>
<?php
ob_start();
session_start();
if(isset($_SESSION["user_id"])){
header("location:index.php");
include("connect.php");
if(isset($_POST['login']))
$_POST['email'] = addslashes($_POST['email']);
$_POST['password'] = addslashes($_POST['password']);
$res = $db->query($sql);
if($res->num_rows>0)
$row = $res->fetch_assoc();
$_SESSION["user_id"] = $row["id"];
$_SESSION["user_name"] = $row["name"];
header("location:index.php");
else{
<h3>Error</h3>
<br>
<br>
<button onclick='closeAlertDialog()'>Ok</button>
</div> ";
}
?>
<div class="login">
<br>
<h1>Login</h1>
<br> <br>
<br>
<br><br>
</form>
</div>
<script src="js/script.js"></script>
</body>
</html>
<?php
session_start();
unset($_SESSION["user_id"]);
session_destroy();
header("location:login.php");
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<link
href="https://fonts.googleapis.com/css2?family=Cedarville+Cursive&family=Playwrite+SK+G
uides&display=swap" rel="stylesheet">
</head>
<body>
<?php
session_start();
if(!isset($_SESSION["user_id"])){
header("location:login.php");
?>
<header>
<div id="header">
<ul>
<li><a href="index.php">Home</a></li>
<li><a href="category.php">Categories</a></li>
<li><a href="about.html">About</a></li>
<li><a href="allproducts.php">Shop</a></li>
<li><a href="contact.php">Contact</a></li>
</ul>
</nav>
</div>
</header>
<div class="product">
<?php
include("connect.php");
$result=$db->query($sql);
if($result->num_rows >0)
while($rows=$result->fetch_assoc())
{ ?>
<div class="product-box">
<br>
<br>
<br>
<br><br>
</form>
</div>
<?php }
else
echo"empty";
if(isset($_POST['add']))
$res1=$db->query($sql1);
if($res1->num_rows==0)
$res = $db->query($sql);
echo "<div id='alert-dialog'>
<h3>Success</h3>
<br>
<br>
<button onclick='closeAlertDialog()'>Ok</button>
</div> ";
else
<h3>Error</h3>
<br>
<br>
<button onclick='closeAlertDialog()'>Ok</button>
</div> ";
?>
</div>
<footer>
</footer>
<script src="js/script.js"></script>
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<link
href="https://fonts.googleapis.com/css2?family=Cedarville+Cursive&family=Playwrite+SK+G
uides&display=swap" rel="stylesheet">
</head>
<body>
<?php
session_start();
if(!isset($_SESSION["user_id"])){
header("location:login.php");
?>
<header>
<div id="header">
<img src="images/logo.png" alt="logo">
<nav>
<ul>
<li><a href="index.php">Home</a></li>
<li><a href="category.php">Categories</a></li>
<li><a href="about.html">About</a></li>
<li><a href="allproducts.php">Shop</a></li>
<li><a href="contact.php">Contact</a></li>
</ul>
</nav>
</div>
</header>
<?php
include("connect.php");
$result=$db->query($sql);
if($result->num_rows >0)
$rows=$result->fetch_assoc();
?>
<div class="product-details">
<div class="product-image">
<br>
<div id="more-images">
</div>
</div>
<div class="product-info">
<br>
<br>
<p>
</p>
<br>
<p>
</p>
<br>
<p>
</p>
<br>
<p>
</p>
<br>
<div id="countity">
</div>
<br><br>
<div id="action">
</div>
</div>
<?php
else
echo"empty";
if(isset($_POST['add']))
$_POST['countity'] = addslashes($_POST['countity']);
$_POST['price'] = addslashes($_POST['price']);
$subtotal=$_POST['countity'] * $_POST['price'];
$sql1="SELECT * from order_items WHERE user_id='{$_SESSION['user_id']}' AND
product_id='{$_GET['id']}';";
$res1=$db->query($sql1);
if($res1->num_rows==0)
$res = $db->query($sql);
<h3>Success</h3>
<br>
<br>
<button onclick='closeAlertDialog()'>Ok</button>
</div> ";
else
<h3>Error</h3>
<br>
<br>
<button onclick='closeAlertDialog()'>Ok</button>
</div> ";
}
}
?>
</div>
</form>
<footer>
</footer>
<script src="js/script.js"></script>
</body>
</html>
var c = 1;
function decCountity() {
document.getElementById("amount").value = 1;
}else{
c -= 1;
document.getElementById("amount").value = c;
function incCountity() {
c+=1;
document.getElementById("amount").value =c;
function closeAlertDialog() {
document.getElementById("alert-dialog").style.display="none";
function calculateGoldZakat() {
function calculateSilverZakat() {
In the first phase, the project goals and features were defined, followed by the design of the
website interfaces. In this phase, the website will be developed using HTML, CSS,
JavaScript, and PHP. Then, a database will be created and linked to the website interfaces.
Through the XAMPP program and by accessing the phpMyAdmin control panel, we created
the database and tables as shown in the following image:
Website Implementation
Using programming languages HTML, CSS, JavaScript, and PHP, web pages were created
and linked to the database, as outlined below:
Database connection:
<?php
if (!$db) {
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>
<?php
ob_start();
session_start();
if (isset($_SESSION["user_id"])) {
header("location:index.php");
include("connect.php");
if (isset($_POST['login'])) {
$_POST['email'] = addslashes($_POST['email']);
$_POST['password'] = addslashes($_POST['password']);
$res = $db->query($sql);
if ($res->num_rows > 0) {
$row = $res->fetch_assoc();
$_SESSION["user_id"] = $row["id"];
$_SESSION["user_name"] = $row["name"];
header("location:index.php");
} else {
<h3>Error</h3>
<button onclick='closeAlertDialog()'>Ok</button>
</div>";
}
?>
<div class="login">
<h1>Login</h1>
</form>
</div>
<script src="js/script.js"></script>
</body>
</html>
Description: This code represents the login page where users enter their email
and password.
The Home page :
<?php
session_start();
if (!isset($_SESSION["user_id"])) {
header("location:login.php");
}
?>
<header>
<a id="cart" href="cart.php"><img src="images/shopping-cart.png"
alt="cart"></a>
<a href="logout.php">Logout</a>
<div id="header">
<img src="images/logo.png" alt="logo">
<nav>
<ul>
<li><a href="category.php">Categories</a></li>
<li><a href="about.html">About</a></li>
<li><a href="allproducts.php">Shop</a></li>
<li><a href="contact.php">Contact</a></li>
</ul>
</nav>
</div>
</header>
<main>
<div class="gallery">
<div class="gallery-item">
<img src="images/j2.jpg" alt="Earring 1">
</div>
<div class="gallery-item">
<img src="images/j2.jpg" alt="Earring 2">
</div>
</div>
</main>
<footer>
<p>© 2025 Jewelry Store</p>
</footer>
<script src="js/script.js"></script>
</body>
</html>
Description: This is the home page displaying categories and a shopping cart
link.
Zakat Calculator :
<div class="calculator">
<form action="index.php" class="form" method="post" name="form">
<h3>Zakat Calculator</h3>
<input type="number" id="weight" name="weight" placeholder="Enter
amount in grams">
<button type="submit" name="gold"
onclick="calculateGoldZakat()">Gold</button>
<button type="submit" name="silver"
onclick="calculateSilverZakat()">Silver</button>
<div class="result">
<h3>Total Zakat Due</h3>
<p id="result">00 $</p>
</div>
</form>
</div>
<div class="product">
<?php
include("connect.php");
if(isset($_POST['inc']))
{$amount=$_POST['amount'] +1;
}
if(isset($_POST['remove']))
{
if($res1)
{
while($rows=$result->fetch_assoc())
{
$subtotal=$rows['price'] * $rows['quantity'];
$total +=$subtotal;
?>
<div class="product-box">
<form action="cart.php" class="form" method = "post"name="f
orm">
<img src="images/<?php print
$rows['photo']?>" height="250"width="250">
<br>
<h3><?php print $rows['name']?></h3>
<br>
<h4><?php print $rows['price']?> SAR</h4>
<br>
<h4>total: <?php print $subtotal ?> SAR</h4>
<br>
<div>
<input type="submit" name="dec" value=" - ">
<input type="number" name="amount" id="amount" value="<
?php print $rows['quantity']?>">
<input type="submit" name="inc" value=" + ">
</div>
<br>
<input type="hidden" name="pid" value="<?php print
$rows['product_id']?>">
<button id="remove" type="submit"name="remove">Remove</
button>
</form>
</div>
<?php }
}
else
{
echo"empty";
}
if(isset($_POST['order']))
{
if($res1->num_rows==0)
{
$sql="INSERT INTO `order` (`id`, `order_date`,
`total_price`, `order_status`, `user_id`) VALUES (NULL,
CURRENT_TIMESTAMP, '150', 'done', '{$_SESSION['user_id']}');";
$res = $db->query($sql);
?>
</div>
<br>
<div id="order">
<form action="cart.php" class="form" method = "post"name="form"
>
<h3>Total Price: <?php print $total ?> $</h3>
<br>
<br>
<button id="order" type="submit"name="order">Order</but
ton>
</form>
<br>
</div>
Project Summary: Online Jewelry Store with Zakat Calculator
This project is an e-commerce website designed for selling jewelry, integrating a Zakat
calculator to help users calculate their Islamic Zakat obligations on gold and silver. The
website provides a seamless shopping experience with features such as user authentication,
product browsing, cart management, and order processing.
The project is developed using HTML, CSS, JavaScript, PHP, and MySQL.
The frontend ensures a visually appealing and responsive interface, while
the backend manages data processing and user interactions.
Key Features:
Conclusion
This Online Jewelry Store project successfully integrates e-commerce functionality with
a Zakat calculator, offering a unique experience for users interested in both purchasing
jewelry and calculating their Islamic obligations. The project utilizes a full-stack
development approach with PHP and MySQL for the backend and HTML, CSS, and
JavaScript for the frontend.
1. Database Connection (PHP & MySQL)
• Reference:
o PHP MySQL Database Connection - W3Schools
o PHP MySQLi Connection Guide - PHP.net
o PDO vs MySQLi - Official PHP Documentation
• Reference:
o PHP Login System with MySQL - W3Schools
o PHP Sessions - PHP.net
o Secure Login System using PHP & MySQL - TutorialsPoint
• Reference:
o HTML Basics - Mozilla Developer Network (MDN)
o CSS Guide - W3Schools
o JavaScript Tutorial - MDN
o Responsive Web Design with CSS - W3C
• Reference:
o PHP Form Handling - W3Schools
o PHP POST Method - PHP.net
o PHP Security: Protecting Against SQL Injection - OWASP
• Reference:
o Building a Shopping Cart with PHP - PHPGurukul
o E-commerce Order Management in PHP - GeeksforGeeks
• Reference:
o Simple PHP Calculator - Tutorial Republic
o Live Gold & Silver Prices API for Zakat Calculation - GoldAPI
o Islamic Zakat Calculation - Zakat Foundation