Professional Documents
Culture Documents
Codewithdhiru
Codewithdhiru
Chapter 1.Introduction
This is the Social Media website to build network and
connection that can people search other peoples through online around the
world and make connection.
Social media facilitates the sharing of ideas and information through virtual
networks. From Facebook and Instagram to Twitter and YouTube, social
media covers a broad universe of apps and platforms that allow users to
share content, interact online, and build communities. More than 4.7 billion
people use social media, equal to roughly 60% of the world’s population.1
Today, social media messaging apps and platforms are the most
commonly used sites worldwide. In early 2023, 94.8% of users accessed
chat and messaging apps and websites, followed closely by social
platforms, at 94.6% of users. Search engine sites were next, with 81.8% of
users accessing them.
1.1Background:
1.2Objective:
Primary objective of any system is to make connection is the
basic goal of our system.
It is easy to use and it is user friendly.
To provide better Graphical User Interface.
1.3.2 Scope:
I certainly think there is scope for improvement; the owners need
to do a little extra to ensure customers come back again . They’ll
again and again visit our website to search people and I am sure
that they’ll get best results from our website because we are giving
them best security and good facilities.
1.3.3 Applicability:
This website will be used mainly for online shopping.
This website will also be used buy or view products.
They’ll get best discount.
They can get refund also.
It’s having many payment options.
PHP:
PHP is a recursive acronym for "PHP: Hypertext Preprocessor".
PHP is a server side scripting language that is embedded in HTML. It is used to
manage dynamic content, databases, session tracking, even build entire e-commerce
sites.
It is integrated with a number of popular databases, including MySQL, PostgreSQL,
Oracle, Sybase, Informix, and Microsoft SQL Server.
PHP is pleasingly zippy in its execution, especially when compiled as an Apache
module on the Unix side. The MySQL server, once started, executes even very
complex queries with huge result sets in record-setting time.
PHP supports a large number of major protocols such as POP3, IMAP, and LDAP.
PHP4 added support for Java and distributed object architectures (COM and
CORBA), making n-tier development a possibility for the first time.
PHP is forgiving: PHP language tries to be as forgiving as possible.
PHP Syntax is C-Like.
PHP performs system functions, i.e. from files on a system it can create, open, read,
write, and close them.
PHP can handle forms, i.e. gather data from files, save data to a file, through email
you can send data, return data to the user.
You add, delete, modify elements within your database through PHP.
Access cookies variables and set cookies.
Using PHP, you can restrict users to access some pages of your website.
It can encrypt data.
Giant Chart:
Pert Chart:
total.
7 Place Request Custom Order full Order Customer
order for er fill Confirmation /Admin
order
8 Delivery Manage Admin Delivery Product Admin
for order. deliver of product delivered.
y
9 Feedback Review Custom Feedback Feedback Admin
is er is given successful
given. by
customer.
3.6.2. ER Model:
1. Admin Table:
Column Name Data Type Constraints
ID Int Primary Key. Not Null
Username NVarchar (40) Not Null
Password NVarchar (40) Not Null
2. Customer Table:
Column Name Data Types Constraints
ID Int Primary Key. Not Null
Username NVarchar (40) Not Null
Password NVarchar (40) Not Null
Name NVarchar (40) Not Null
Email NVarchar (40) Not Null
Address NVarchar (100) Not Null
Contact NVarchar (40) Unique
3. Product Table:
Column Name Data Type Constraints
Product_Id Int Primary Key. Not Null
Product_Name NVarchar (40) Not Null
Product_Price NVarchar (40) Not Null
Description NVarchar (40) Not Null
5. Order Table:
Column Name Data Types Constraints
ID Int Primary Key. Not Null
Product_Name NVarchar (40) Not Null
Price Int Not Null
7. Review Table:
Column Name Data Types Constraints
Customer_ID Int Unique
Product_Name NVarchar (40) Not Null
Suggestion NVarchar (200) Not Null
Rating Int Not Null
8. Stock Table:
Column Name Data Types Constraints
Stock_ID Int Primary Key. Not Null
Name NVarchar (40) Not Null
Quantity Int Not Null
Registration form:
Login Page:
Payment page:
- Authorization: Admin provides the facility to provide the registration to the users which can
be a Members / Customers.
- Authentication: Only the registered users i.e, t can be customers / Member who are allowed
to login and access the site for using it. For login purpose the user have to give the username
and password and from database they will be authenticated
- Information Integrity: The information that is being provided by the user are not leaked to
any of the outside person. The information of all the products / system will be changed by the
admin only no user can change it.
- Detection: The password of the user and admin and alphanumeric password and there Is
also an option of changing the password even for the admin so that a single password cannot
stay for long
Login Page
Description:
This is where the admin can login to the website
Registration Page
Dashboard/Home Page
Product Report
Description: Here the admin can Edit, Delete or Update the products.
Product Details
Description: From here user can add the product to the cart.
Login Page:
<?php require_once('header.php'); ?>
<!-- fetching row banner login -->
<?php
$statement = $pdo->prepare("SELECT * FROM tbl_settings WHERE id=1");
$statement->execute();
$result = $statement->fetchAll(PDO::FETCH_ASSOC);
foreach ($result as $row) {
$banner_login = $row['banner_login'];
}
?>
<!-- login form -->
<?php
if(isset($_POST['form1'])) {
if(empty($_POST['cust_email']) || empty($_POST['cust_password'])) {
$error_message = LANG_VALUE_132.'<br>';
} else {
$cust_email = strip_tags($_POST['cust_email']);
$cust_password = strip_tags($_POST['cust_password']);
if($total==0) {
$error_message .= LANG_VALUE_133.'<br>';
} else {
//using MD5 form
if( $row_password != md5($cust_password) ) {
$error_message .= LANG_VALUE_139.'<br>';
} else {
if($cust_status == 0) {
$error_message .= LANG_VALUE_148.'<br>';
} else {
$_SESSION['customer'] = $row;
header("location: ".BASE_URL."dashboard.php");
}
}
}
}
}
?>
<div class="page">
<div class="container">
<div class="row">
<div class="col-md-12">
<div class="user-content">
<form action="" method="post">
<?php $csrf->echoInputField(); ?>
<div class="row">
<div class="col-md-4"></div>
<div class="col-md-4">
<?php
if($error_message != '') {
echo "<div class='error' style='padding:
10px;background:#f1f1f1;margin-bottom:20px;'>".$error_message."</div>";
}
if($success_message != '') {
echo "<div class='success' style='padding:
10px;background:#f1f1f1;margin-bottom:20px;'>".$success_message."</div>";
}
?>
<div class="form-group">
Registration Page:
<?php require_once('header.php'); ?>
<?php
$statement = $pdo->prepare("SELECT * FROM tbl_settings WHERE id=1");
$statement->execute();
$result = $statement->fetchAll(PDO::FETCH_ASSOC);
foreach ($result as $row) {
$banner_registration = $row['banner_registration'];
}
?>
<?php
if (isset($_POST['form1'])) {
$valid = 1;
if(empty($_POST['cust_name'])) {
$valid = 0;
$error_message .= LANG_VALUE_123."<br>";
}
if(empty($_POST['cust_email'])) {
$valid = 0;
$error_message .= LANG_VALUE_131."<br>";
} else {
if (filter_var($_POST['cust_email'], FILTER_VALIDATE_EMAIL) ===
false) {
$valid = 0;
$error_message .= LANG_VALUE_134."<br>";
} else {
$statement = $pdo->prepare("SELECT * FROM tbl_customer WHERE
cust_email=?");
$statement->execute(array($_POST['cust_email']));
$total = $statement->rowCount();
if($total) {
$valid = 0;
$error_message .= LANG_VALUE_147."<br>";
}
}
}
if(empty($_POST['cust_phone'])) {
$valid = 0;
$error_message .= LANG_VALUE_124."<br>";
}
if(empty($_POST['cust_address'])) {
$valid = 0;
$error_message .= LANG_VALUE_125."<br>";
}
if(empty($_POST['cust_country'])) {
$valid = 0;
$error_message .= LANG_VALUE_126."<br>";
}
if(empty($_POST['cust_city'])) {
$valid = 0;
$error_message .= LANG_VALUE_127."<br>";
}
if(empty($_POST['cust_state'])) {
$valid = 0;
$error_message .= LANG_VALUE_128."<br>";
}
if(empty($_POST['cust_zip'])) {
$valid = 0;
$error_message .= LANG_VALUE_129."<br>";
}
if($valid == 1) {
$token = md5(time());
$cust_datetime = date('Y-m-d h:i:s');
$cust_timestamp = time();
strip_tags($_POST['cust_cname']),
strip_tags($_POST['cust_email']),
strip_tags($_POST['cust_phone']),
strip_tags($_POST['cust_country']),
strip_tags($_POST['cust_address']),
strip_tags($_POST['cust_city']),
strip_tags($_POST['cust_state']),
strip_tags($_POST['cust_zip']),
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
md5($_POST['cust_password']),
$token,
$cust_datetime,
$cust_timestamp,
0
));
<a href="'.$verify_link.'">'.$verify_link.'</a>';
unset($_POST['cust_name']);
unset($_POST['cust_cname']);
unset($_POST['cust_email']);
unset($_POST['cust_phone']);
unset($_POST['cust_address']);
unset($_POST['cust_city']);
unset($_POST['cust_state']);
unset($_POST['cust_zip']);
$success_message = LANG_VALUE_152;
}
}
?>
<div class="page">
<div class="container">
<div class="row">
<div class="col-md-12">
<div class="user-content">
if($error_message != '') {
echo "<div class='error' style='padding:
10px;background:#f1f1f1;margin-bottom:20px;'>".$error_message."</div>";
}
if($success_message != '') {
echo "<div class='success' style='padding:
10px;background:#f1f1f1;margin-bottom:20px;'>".$success_message."</div>";
}
?>
Products Page:
<?php require_once('header.php'); ?>
<?php
if(!isset($_REQUEST['id'])) {
header('location: index.php');
exit;
} else {
// Check the id is valid or not
$statement = $pdo->prepare("SELECT * FROM tbl_product WHERE
p_id=?");
$statement->execute(array($_REQUEST['id']));
$total = $statement->rowCount();
$result = $statement->fetchAll(PDO::FETCH_ASSOC);
if( $total == 0 ) {
header('location: index.php');
exit;
}
}
foreach($result as $row) {
$p_name = $row['p_name'];
$p_old_price = $row['p_old_price'];
$p_current_price = $row['p_current_price'];
$p_qty = $row['p_qty'];
$p_featured_photo = $row['p_featured_photo'];
$p_description = $row['p_description'];
$p_short_description = $row['p_short_description'];
$p_feature = $row['p_feature'];
$p_condition = $row['p_condition'];
$p_return_policy = $row['p_return_policy'];
$p_total_view = $row['p_total_view'];
$p_is_featured = $row['p_is_featured'];
$p_is_active = $row['p_is_active'];
$ecat_id = $row['ecat_id'];
}
t2.mcat_id,
t2.mcat_name,
t2.tcat_id,
t3.tcat_id,
t3.tcat_name
FROM tbl_end_category t1
JOIN tbl_mid_category t2
ON t1.mcat_id = t2.mcat_id
JOIN tbl_top_category t3
ON t2.tcat_id = t3.tcat_id
WHERE t1.ecat_id=?");
$statement->execute(array($ecat_id));
$total = $statement->rowCount();
$result = $statement->fetchAll(PDO::FETCH_ASSOC);
foreach ($result as $row) {
$ecat_name = $row['ecat_name'];
$mcat_id = $row['mcat_id'];
$mcat_name = $row['mcat_name'];
$tcat_id = $row['tcat_id'];
$tcat_name = $row['tcat_name'];
}
$p_total_view = $p_total_view + 1;
$statement->execute(array($_REQUEST['id']));
$result = $statement->fetchAll(PDO::FETCH_ASSOC);
foreach ($result as $row) {
$color[] = $row['color_id'];
}
if(isset($_POST['form_review'])) {
$statement = $pdo->prepare("SELECT * FROM tbl_rating WHERE p_id=?
AND cust_id=?");
$statement->execute(array($_REQUEST['id'],$_SESSION['customer']
['cust_id']));
$total = $statement->rowCount();
if($total) {
$error_message = LANG_VALUE_68;
} else {
$statement = $pdo->prepare("INSERT INTO tbl_rating
(p_id,cust_id,comment,rating) VALUES (?,?,?,?)");
$statement->execute(array($_REQUEST['id'],$_SESSION['customer']
['cust_id'],$_POST['comment'],$_POST['rating']));
$success_message = LANG_VALUE_163;
}
}
if(isset($_POST['form_add_to_cart'])) {
$i=0;
foreach($_SESSION['cart_p_id'] as $key => $value)
{
$i++;
$arr_cart_p_id[$i] = $value;
}
$i=0;
foreach($_SESSION['cart_size_id'] as $key => $value)
{
$i++;
$arr_cart_size_id[$i] = $value;
}
$i=0;
foreach($_SESSION['cart_color_id'] as $key => $value)
{
$i++;
$arr_cart_color_id[$i] = $value;
}
$added = 0;
if(!isset($_POST['size_id'])) {
$size_id = 0;
} else {
$size_id = $_POST['size_id'];
}
if(!isset($_POST['color_id'])) {
$color_id = 0;
} else {
$color_id = $_POST['color_id'];
}
for($i=1;$i<=count($arr_cart_p_id);$i++) {
if( ($arr_cart_p_id[$i]==$_REQUEST['id']) &&
($arr_cart_size_id[$i]==$size_id) && ($arr_cart_color_id[$i]==$color_id) ) {
$added = 1;
break;
}
}
if($added == 1) {
$error_message1 = 'This product is already added to the shopping cart.';
} else {
$i=0;
foreach($_SESSION['cart_p_id'] as $key => $res)
{
$i++;
}
$new_key = $i+1;
if(isset($_POST['size_id'])) {
$size_id = $_POST['size_id'];
$size_id = 0;
$size_name = '';
}
if(isset($_POST['color_id'])) {
$color_id = $_POST['color_id'];
$statement = $pdo->prepare("SELECT * FROM tbl_color WHERE
color_id=?");
$statement->execute(array($color_id));
$result = $statement->fetchAll(PDO::FETCH_ASSOC);
foreach ($result as $row) {
$color_name = $row['color_name'];
}
} else {
$color_id = 0;
$color_name = '';
}
$_SESSION['cart_p_id'][$new_key] = $_REQUEST['id'];
$_SESSION['cart_size_id'][$new_key] = $size_id;
$_SESSION['cart_size_name'][$new_key] = $size_name;
$_SESSION['cart_color_id'][$new_key] = $color_id;
$_SESSION['cart_color_name'][$new_key] = $color_name;
$_SESSION['cart_p_qty'][$new_key] = $_POST['p_qty'];
$_SESSION['cart_p_current_price'][$new_key] =
$_POST['p_current_price'];
$_SESSION['cart_p_name'][$new_key] = $_POST['p_name'];
$_SESSION['cart_p_featured_photo'][$new_key] =
$_POST['p_featured_photo'];
if(isset($_POST['size_id'])) {
$size_id = $_POST['size_id'];
$_SESSION['cart_p_id'][1] = $_REQUEST['id'];
$_SESSION['cart_size_id'][1] = $size_id;
$_SESSION['cart_size_name'][1] = $size_name;
$_SESSION['cart_color_id'][1] = $color_id;
$_SESSION['cart_color_name'][1] = $color_name;
$_SESSION['cart_p_qty'][1] = $_POST['p_qty'];
$_SESSION['cart_p_current_price'][1] = $_POST['p_current_price'];
$_SESSION['cart_p_name'][1] = $_POST['p_name'];
$_SESSION['cart_p_featured_photo'][1] = $_POST['p_featured_photo'];
<?php
if($error_message1 != '') {
echo "<script>alert('".$error_message1."')</script>";
}
if($success_message1 != '') {
echo "<script>alert('".$success_message1."')</script>";
header('location: product.php?id='.$_REQUEST['id']);
}
?>
<div class="page">
<div class="container">
<div class="row">
<div class="col-md-12">
<div class="breadcrumb mb_30">
<ul>
<li><a href="<?php echo BASE_URL; ?>">Home</a></li>
<li>></li>
<li><a href="<?php echo BASE_URL.'product-category.php?
id='.$tcat_id.'&type=top-category' ?>"><?php echo $tcat_name; ?></a></li>
<li>></li>
<li><a href="<?php echo BASE_URL.'product-category.php?
id='.$mcat_id.'&type=mid-category' ?>"><?php echo $mcat_name; ?></a></li>
<li>></li>
<li><a href="<?php echo BASE_URL.'product-category.php?
id='.$ecat_id.'&type=end-category' ?>"><?php echo $ecat_name; ?></a></li>
<li>></li>
<li><?php echo $p_name; ?></li>
</ul>
</div>
<div class="product">
<div class="row">
<div class="col-md-5">
<ul class="prod-slider">
<li style="background-image: url(assets/uploads/<?php
echo $p_featured_photo; ?>);">
<a class="popup" href="assets/uploads/<?php echo
$p_featured_photo; ?>"></a>
</li>
<?php
echo '';
}
elseif($avg_rating == 1.5) {
echo '
<i class="fa fa-star"></i>
<i class="fa fa-star-half-o"></i>
<i class="fa fa-star-o"></i>
<i class="fa fa-star-o"></i>
<i class="fa fa-star-o"></i>
';
}
elseif($avg_rating == 2.5) {
echo '
<i class="fa fa-star"></i>
<i class="fa fa-star"></i>
<i class="fa fa-star-half-o"></i>
<i class="fa fa-star-o"></i>
<i class="fa fa-star-o"></i>
';
}
elseif($avg_rating == 3.5) {
echo '
<i class="fa fa-star"></i>
<i class="fa fa-star"></i>
<i class="fa fa-star"></i>
<i class="fa fa-star-half-o"></i>
<i class="fa fa-star-o"></i>
';
}
elseif($avg_rating == 4.5) {
echo '
<i class="fa fa-star"></i>
<i class="fa fa-star"></i>
<i class="fa fa-star"></i>
<i class="fa fa-star"></i>
<i class="fa fa-star-half-o"></i>
';
}
else {
for($i=1;$i<=5;$i++) {
?>
<?php if($i>$avg_rating): ?>
<i class="fa fa-star-o"></i>
</div>
</div>
<div class="p-price">
<span style="font-size:14px;"><?php echo
LANG_VALUE_54; ?></span><br>
<span>
<?php if($p_old_price!=''): ?>
<del><?php echo LANG_VALUE_1; ?><?php echo
$p_old_price; ?></del>
<?php endif; ?>
<?php echo LANG_VALUE_1; ?><?php echo
$p_current_price; ?>
</span>
</div>
<input type="hidden" name="p_current_price" value="<?php
echo $p_current_price; ?>">
<input type="hidden" name="p_name" value="<?php echo
$p_name; ?>">
<input type="hidden" name="p_featured_photo" value="<?
php echo $p_featured_photo; ?>">
<div class="p-quantity">
<?php echo LANG_VALUE_55; ?> <br>
<input type="number" class="input-text qty" step="1"
min="1" max="" name="p_qty" value="1" title="Qty" size="4" pattern="[0-
9]*" inputmode="numeric">
</div>
<div class="btn-cart btn-cart1">
<input type="submit" value="<?php echo
LANG_VALUE_154; ?>" name="form_add_to_cart">
</div>
</form>
<div class="share">
<?php echo LANG_VALUE_58; ?> <br>
<div class="sharethis-inline-share-buttons"></div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<!-- Nav tabs -->
<ul class="nav nav-tabs" role="tablist">
<li role="presentation" class="active"><a
href="#description" aria-controls="description" role="tab" data-
toggle="tab"><?php echo LANG_VALUE_59; ?></a></li>
<li role="presentation"><a href="#feature" aria-
controls="feature" role="tab" data-toggle="tab"><?php echo
LANG_VALUE_60; ?></a></li>
<li role="presentation"><a href="#condition" aria-
controls="condition" role="tab" data-toggle="tab"><?php echo
LANG_VALUE_61; ?></a></li>
<li role="presentation"><a href="#return_policy" aria-
controls="return_policy" role="tab" data-toggle="tab"><?php echo
LANG_VALUE_62; ?></a></li>
<!-- <li role="presentation"><a href="#review" aria-
controls="review" role="tab" data-toggle="tab"><?php echo
LANG_VALUE_63; ?></a></li> -->
</ul>
<p>
<?php
if($p_description == '') {
echo LANG_VALUE_70;
} else {
echo $p_description;
}
?>
</p>
</div>
<div role="tabpanel" class="tab-pane" id="feature"
style="margin-top: -30px;">
<p>
<?php
if($p_feature == '') {
echo LANG_VALUE_71;
} else {
echo $p_feature;
}
?>
</p>
</div>
<div role="tabpanel" class="tab-pane" id="condition"
style="margin-top: -30px;">
<p>
<?php
if($p_condition == '') {
echo LANG_VALUE_72;
} else {
echo $p_condition;
}
?>
</p>
</div>
<div role="tabpanel" class="tab-pane" id="return_policy"
style="margin-top: -30px;">
<p>
<?php
if($p_return_policy == '') {
echo LANG_VALUE_73;
} else {
echo $p_return_policy;
}
?>
</p>
</div>
<div role="tabpanel" class="tab-pane" id="review"
style="margin-top: -30px;">
<div class="review-form">
<?php
$statement = $pdo->prepare("SELECT *
FROM tbl_rating t1
JOIN tbl_customer t2
ON t1.cust_id = t2.cust_id
WHERE t1.p_id=?");
$statement->execute(array($_REQUEST['id']));
$total = $statement->rowCount();
?>
<h2><?php echo LANG_VALUE_63; ?> (<?php echo
$total; ?>)</h2>
<?php
if($total) {
$j=0;
$result = $statement-
>fetchAll(PDO::FETCH_ASSOC);
foreach ($result as $row) {
$j++;
?>
<div class="mb_10"><b><u><?php echo
LANG_VALUE_64; ?> <?php echo $j; ?></u></b></div>
<table class="table table-bordered">
<tr>
<th style="width:170px;"><?php echo
LANG_VALUE_75; ?></th>
<td><?php echo $row['cust_name']; ?></td>
</tr>
<tr>
<th><?php echo LANG_VALUE_76;
?></th>
<td><?php echo $row['comment']; ?></td>
</tr>
<tr>
<th><?php echo LANG_VALUE_78;
?></th>
<td>
<div class="rating">
<?php
for($i=1;$i<=5;$i++) {
?>
<?php if($i>$row['rating']): ?>
<i class="fa fa-star-o"></i>
<?php else: ?>
<i class="fa fa-star"></i>
<?php endif; ?>
<?php
}
?>
</div>
</td>
</tr>
</table>
<?php
}
} else {
echo LANG_VALUE_74;
}
?>
<h2><?php echo LANG_VALUE_65; ?></h2>
<?php
if($error_message != '') {
echo "<script>alert('".$error_message."')</script>";
}
if($success_message != '') {
echo
"<script>alert('".$success_message."')</script>";
}
?>
<?php if(isset($_SESSION['customer'])): ?>
<?php
$statement = $pdo->prepare("SELECT *
FROM tbl_rating
WHERE p_id=? AND cust_id=?");
$statement->execute(array($_REQUEST['id'],
$_SESSION['customer']['cust_id']));
$total = $statement->rowCount();
?>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="product-carousel">
<?php
$statement = $pdo->prepare("SELECT * FROM tbl_product
WHERE ecat_id=? AND p_id!=?");
$statement->execute(array($ecat_id,$_REQUEST['id']));
$result = $statement->fetchAll(PDO::FETCH_ASSOC);
foreach ($result as $row) {
?>
<div class="item">
<div class="thumb">
<div class="photo"
style="background-image:url(assets/uploads/<?php echo
$row['p_featured_photo']; ?>);"></div>
<div class="overlay"></div>
</div>
<div class="text">
<h3><a href="product.php?id=<?php echo $row['p_id']; ?
>"><?php echo $row['p_name']; ?></a></h3>
<h4>
<?php echo LANG_VALUE_1; ?><?php echo
$row['p_current_price']; ?>
<?php if($row['p_old_price'] != ''): ?>
<del>
';
}
elseif($avg_rating == 3.5) {
echo '
<i class="fa fa-star"></i>
<i class="fa fa-star"></i>
<i class="fa fa-star"></i>
<i class="fa fa-star-half-o"></i>
<i class="fa fa-star-o"></i>
';
}
elseif($avg_rating == 4.5) {
echo '
<i class="fa fa-star"></i>
<i class="fa fa-star"></i>
<i class="fa fa-star"></i>
<i class="fa fa-star"></i>
<i class="fa fa-star-half-o"></i>
';
}
else {
for($i=1;$i<=5;$i++) {
?>
<?php if($i>$avg_rating): ?>
<i class="fa fa-star-o"></i>
<?php else: ?>
<i class="fa fa-star"></i>
<?php endif; ?>
<?php
}
}
?>
</div>
<p><a href="product.php?id=<?php echo $row['p_id']; ?
>"><?php echo LANG_VALUE_154; ?></a></p>
</div>
</div>
<?php
}
?>
</div>
</div>
</div>
</div>
</div>
Dashboard Page:
<?php require_once('header.php'); ?>
<?php
// Check if the customer is logged in or not
if(!isset($_SESSION['customer'])) {
header('location: '.BASE_URL.'logout.php');
exit;
} else {
// If customer is logged in, but admin make him inactive, then force logout
this user.
$statement = $pdo->prepare("SELECT * FROM tbl_customer WHERE
cust_id=? AND cust_status=?");
$statement->execute(array($_SESSION['customer']['cust_id'],0));
$total = $statement->rowCount();
if($total) {
header('location: '.BASE_URL.'logout.php');
exit;
}
}
?>
<div class="page">
<div class="container">
<div class="row">
<div class="col-md-12">
<?php require_once('customer-sidebar.php'); ?>
</div>
<div class="col-md-12">
<div class="user-content">
<h3 class="text-center">
<?php echo LANG_VALUE_90; ?>
</h3>
</div>
</div>
</div>
</div>
</div>
Cart Page:
<?php require_once('header.php'); ?>
<?php
$statement = $pdo->prepare("SELECT * FROM tbl_settings WHERE id=1");
$statement->execute();
$result = $statement->fetchAll(PDO::FETCH_ASSOC);
foreach ($result as $row) {
$banner_cart = $row['banner_cart'];
}
?>
<?php
$error_message = '';
if(isset($_POST['form1'])) {
$i = 0;
$statement = $pdo->prepare("SELECT * FROM tbl_product");
$statement->execute();
$result = $statement->fetchAll(PDO::FETCH_ASSOC);
foreach ($result as $row) {
$i++;
$table_product_id[$i] = $row['p_id'];
$table_quantity[$i] = $row['p_qty'];
}
$i=0;
foreach($_POST['product_id'] as $val) {
$i++;
$arr1[$i] = $val;
}
$i=0;
foreach($_POST['quantity'] as $val) {
$i++;
$arr2[$i] = $val;
}
$i=0;
foreach($_POST['product_name'] as $val) {
$i++;
$arr3[$i] = $val;
}
$allow_update = 1;
for($i=1;$i<=count($arr1);$i++) {
for($j=1;$j<=count($table_product_id);$j++) {
if($arr1[$i] == $table_product_id[$j]) {
$temp_index = $j;
break;
}
}
if($table_quantity[$temp_index] < $arr2[$i]) {
$allow_update = 0;
$error_message .= '"'.$arr2[$i].'" items are not available for "'.
$arr3[$i].'"\n';
} else {
$_SESSION['cart_p_qty'][$i] = $arr2[$i];
}
}
$error_message .= '\nOther items quantity are updated successfully!';
?>
<?php if($allow_update == 0): ?>
<script>alert('<?php echo $error_message; ?>');</script>
<?php else: ?>
<script>alert('All Items Quantity Update is Successful!');</script>
<?php endif; ?>
<?php
}
?>
<div class="page">
<div class="container">
<div class="row">
<div class="col-md-12">
<div class="cart">
<table class="table table-responsive table-hover table-bordered">
<tr>
<th><?php echo '#' ?></th>
<th><?php echo LANG_VALUE_8; ?></th>
<th><?php echo LANG_VALUE_47; ?></th>
<th><?php echo LANG_VALUE_157; ?></th>
<th><?php echo LANG_VALUE_158; ?></th>
<th><?php echo LANG_VALUE_159; ?></th>
<th><?php echo LANG_VALUE_55; ?></th>
<th class="text-right"><?php echo LANG_VALUE_82;
?></th>
<th class="text-center" style="width: 100px;"><?php echo
LANG_VALUE_83; ?></th>
</tr>
<?php
$table_total_price = 0;
$i=0;
foreach($_SESSION['cart_p_id'] as $key => $value)
{
$i++;
$arr_cart_p_id[$i] = $value;
}
$i=0;
foreach($_SESSION['cart_size_id'] as $key => $value)
{
$i++;
$arr_cart_size_id[$i] = $value;
}
$i=0;
foreach($_SESSION['cart_size_name'] as $key => $value)
{
$i++;
$arr_cart_size_name[$i] = $value;
}
$i=0;
foreach($_SESSION['cart_color_id'] as $key => $value)
{
$i++;
$arr_cart_color_id[$i] = $value;
}
$i=0;
foreach($_SESSION['cart_color_name'] as $key => $value)
{
$i++;
$arr_cart_color_name[$i] = $value;
}
$i=0;
foreach($_SESSION['cart_p_qty'] as $key => $value)
{
$i++;
$arr_cart_p_qty[$i] = $value;
}
$i=0;
foreach($_SESSION['cart_p_current_price'] as $key => $value)
{
$i++;
$arr_cart_p_current_price[$i] = $value;
}
$i=0;
foreach($_SESSION['cart_p_name'] as $key => $value)
{
$i++;
$arr_cart_p_name[$i] = $value;
}
$i=0;
foreach($_SESSION['cart_p_featured_photo'] as $key =>
$value)
{
$i++;
$arr_cart_p_featured_photo[$i] = $value;
}
?>
<?php for($i=1;$i<=count($arr_cart_p_id);$i++): ?>
<tr>
<td><?php echo $i; ?></td>
<td>
<div class="cart-buttons">
<ul>
<li><input type="submit" value="<?php echo
LANG_VALUE_20; ?>" class="btn btn-primary" name="form1"></li>
<li><a href="index.php" class="btn btn-primary"><?php echo
LANG_VALUE_85; ?></a></li>
<li><a href="checkout.php" class="btn btn-primary"><?php
echo LANG_VALUE_23; ?></a></li>
</ul>
</div>
</form>
<?php endif; ?>
</div>
</div>
</div>
</div>
<?php
$statement = $pdo->prepare("SELECT * FROM tbl_settings WHERE id=1");
$statement->execute();
$result = $statement->fetchAll(PDO::FETCH_ASSOC);
<?php
if(isset($_POST['form1'])) {
$valid = 1;
if(empty($_POST['cust_email'])) {
$valid = 0;
$error_message .= LANG_VALUE_131."\\n";
} else {
if (filter_var($_POST['cust_email'], FILTER_VALIDATE_EMAIL) ===
false) {
$valid = 0;
$error_message .= LANG_VALUE_134."\\n";
} else {
$statement = $pdo->prepare("SELECT * FROM tbl_customer WHERE
cust_email=?");
$statement->execute(array($_POST['cust_email']));
$total = $statement->rowCount();
if(!$total) {
$valid = 0;
$error_message .= LANG_VALUE_135."\\n";
}
}
}
if($valid == 1) {
$token = md5(rand());
$now = time();
$success_message = $forget_password_message;
}
}
?>
<div class="page">
<div class="container">
<div class="row">
<div class="col-md-12">
<div class="user-content">
<?php
if($error_message != '') {
echo "<script>alert('".$error_message."')</script>";
}
if($success_message != '') {
echo "<script>alert('".$success_message."')</script>";
}
?>
<form action="" method="post">
<?php $csrf->echoInputField(); ?>
<div class="row">
<div class="col-md-4"></div>
<div class="col-md-4">
<div class="form-group">
<label for=""><?php echo LANG_VALUE_94; ?>
*</label>
<input type="email" class="form-control"
name="cust_email">
</div>
<div class="form-group">
<label for=""></label>
<input type="submit" class="btn btn-primary" value="<?
php echo LANG_VALUE_4; ?>" name="form1">
</div>
<a href="login.php" style="color:#e4144d;"><?php echo
LANG_VALUE_12; ?></a>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
This also means it’s the first chance for full security and reliability testing because
those tests can’t be conducted in a lab or stage environment.
Beta tests can either be open or closed. In an open test, anyone can use
the product and is usually presented with some messaging that the product is in
beta and given a method for submitting feedback.
01 & Valid
Password Username
& Click &
Login Password
Button
Verify To verify Enter Error Desig Hig
Logi Userna username Numeric message n h
n me Character the
in Name username
02
text can only
field& fill consist
other alphabetic
fields & al.
click any
of the
respected
button.
User Verify Enter any Error Design High
Mobile alphanumeri message
01
No. cal value . please
enter only
Enter Less
digits. Design High
than 10
digits Error
message
please
enter a
valid
mobile
no.
User Validate To verify all Leave any Error Desig Hig
02 Fields the fields are field message n h
filed empty. The data is
Required
Chapter 6
Admin Report:
User Report:
Chapter 7: Conclusions
7.1 Conclusion:
The E-Commerce website that named FitZone is successfully
designed and developed of fulfilling the necessary requirements, as
identified in the requirement analysis phase, such as the system is
very much user friendly, form level validation and field level
validation are performing very efficiently. Working on this project
was a good and enriching experience. The making of these software
made me realize the importance of planning and design n software
development. The concept of peer review helped me to rectify the
problems as and when they occurred. It also helped me to get some
valuable feedback and suggestions that were later integrated in to the
project by me. Developing this project has helped me gain good
experience on real time development procedures.
References:
PHP
-www.wikipedia.com
-www.w3schools.com
-www.youtube.com
-www.stackoverflow.com
Diagrams:
-www.diagrams.net