DECLARATION
I hereby certify that the work which is being presented in this project entitled “Website Library Management System” in partial fulfillment of the requirement for the award of the degree of Master of Computer Applications (MCA), submitted in the Department of Computer Science and Applications of Institute Of Management & Technology, Faridabad, is an authentic record of my work carried out during my project training, under the supervision & guidance of Mr. Naween Prabhakar (Software Developer).
I have not submitted the matter embodied in this project for the award of any other degree or diploma.
Date-
Place: Faridabad Amit singh
CERTIFICATE OF COMPANY
CERTIFICATE OF COLLEGE
ACKNOWLEDGEMENT
Submission of this project report gives me an opportunity to convey my gratitude to all those who have helped me to reach a stage where I have immense confidence to launch my career in the competitive world of information Technology
I take this opportunity to express my deep and sincere gratitude to Mr. Naween Prabhakar, Next Dimension Technology Pvt Ltd. Who have been kind enough to spare his valuable time.
It would not have been possible to see through the undertaken projects without the guidance of Dr. R.C. Verma, Head of Department of Computer Science and other staff members of the Department. It was purely on the basis of their experience and knowledge that I was able to clear all the theoretical and technical hurdles during the development phases of this work.
I would like to thank Ms. Urvija Raina (Internal guide) for her help and cooperation and for remaining interactive with me during the reviews of my projects for the various designs and performance issues.
I would also like to thank my friends and fellow trainees for their support and cooperation for completion of this project.
Amit Singh
TABLE OF CONTENTS
PREFACE………………………………………………………………………………………………………………….... Page No.
COMPANY PROFILE……………………………………………….....……………………………………………....
HARDWARE AND SOFTWARE REQUIREMENTS……………………………………………………………
HARDWARE ENVIRONMENT……………………………………….…………………………………………….....
SOFTWARE ENVIRONMENT…………………………………………………………………………………………..
SOFTWARE SPECIFICATION…………………………………………………………………………………………...
SOFTWARE TOOLS…………………………………….………………………………………………………………..
FRONT END…………………..………………………………………….………………………………………………......
BACK END……………………………………………………………….………………………………………………........
PROJECT OBJECTIVE………………………………………………..……………………………………………….....
PROJECT INTRODUCTION…………………………………………………………………………………………….
(SOFTWARE DEVELOPMENT LIFE CYCLE)
REQUIREMENT SPECIFICATIONS………………………………………………………………………………….
FEASIBILITY STUDY………………………………………………………………………………………………………
SYSTEM ANALYSIS……………………………………………………..……………………………………………….
METHODOLOGY AND MODEL………………….………………………………………………………………….
SYSTEM DESIGN………………………………………………………………………………………………………….
MODULES…………………………………………………………………………………………………………………..
E-R DIAGRAM…………………………………………………………………………………………………………….
DATA FLOW DIAGRAM……………………………………………………………………………………………….
DATA BASE DESIGN……………………………………………………………………………………………………
SCREENSHOTS……………………………………………………………………………………………………………
CODING……………………………………………………………………………………………………………………..
TESTING…………………………………………………………………………………………………………………….
IMPLEMENTATION…………………………………………………………………………………………………….
MAINTENANCE………………...…………………..…………………………………………………………………..
LIMITATIONS……………………………………………………………………………………………………………..
FUTURE SCOPE…………………………………………………………………………………………………………..
CONCLUSION…………………..………………………………………………………………………………………..
BIBLIOGRAPHY………………………………………………………………………………………………………….
CHAPTER 1
INTRODUCTION
1.1 Project Detail
The purpose of this application are as follows :
• The software is for automation of library. • It provides following facilities to
Operator :
• Can enter details related to a particular book. • Can provide membership to members.
Admin :
• Can read and write information about any member. • Can update, create, delete the record of membership as per requirement and implementation plants
1.2 Objective of proposed system
The project aims and objectives that will be achieved after completion of this project are discussed in this subchapter. The aims and objectives are as follows:
Online book issue
Request column for librarian for providing new books
A separate column for digital library
Student login page where student can find books issued by him/her and date of return.
A search column to search availability of books
A teacher login page where teacher can add any events being organized in the college and important suggestions regarding books.
Online notice board about the workshop.
1.3 Proposed Architecture of System
1.3.1 ER-DIAGRAM:-
It is clear that the physical objects from the previous section
– the member, books, library – correspond to entities in the Entity-Relationship model, and the operations to be done on those entities – holds, checkouts, and so on – correspond to relationships. However, a good design will minimize redundancy and attempt to store all the required information in as small a space as possible.
Fig. 1.1 ER Diagram
3.2 DFD
A FLOW DIAGRAM FOR TEACHER LOGIN
After entering to the home page of the website , teacher can choose the TEACHER LOGIN option where they are asked to enter username & password , and if he/she is a valid user then a teacher login page will be displayed.
1.5 Scope
This application can be easily implemented under various situations. We can add new features as and when we require. Reusability is possible as and when require in this application. There is flexibility in all the modules.
1.5 Feasibility of Study
An important outcome of the preliminary investigation is the determination that system requested is feasible. In our case, System will allow basic transactions online for customers and administrators for which data will be stored in database. Records in DB will be used for authentication, and all other operations. Further there are three aspects in the feasibility study portion of the preliminary investigation.
1.5.1 Economic Feasibility
Are there sufficient benefits in creating the system to make the costs acceptable? Or, are the costs of not creating the system so great that it is advisable to undertake the project? These are the important questions to be answered in economic feasibility. Proposed system will not face any economic constraints it will be developed by students only. And it will help to automate manual processing, which will save time and money. This will provide economic benefits.
1.5.2 Safety Feasibility
Will the system be used if it is developed and implemented? Will there be resistance from users that will undermine the possible application benefits? When we look from this perspective, we don’t see any risk in implementing and making it operational. This project will help everyone, as it is planned to be more reliable, maintainable, affordable and producible.
1.5.3 Technical Feasibility
Can the work for the project be done with current equipment, existing software technology and available personnel? These are the questions which needs to be answered to check Technical feasibility. Project will be developed using Java-JEE and back end as my SQL which will store details related to this project. There are basic requirement of hardware to run this application. This application will be web application so this application can be accessed by using any device like (Personal Computers, Laptop and with some hand held devices) provided they are on same network.
1.5.4 Financial Feasibility
This study discusses that about sales forecast of the business it also states the financial plan we need before we operate our business. In financial plan, outline what are the important assumption in our business, how much the start-up cost to setup the business and also who are the sources of funds and how to use it.
CHAPTER-2
2. System Analysis
2.1 User Interface:
2.1.2 Hardware Interface:
Hardware interfaces exist in many of the components, such as the various buses, storage devices other I/O devices. A hardware interface is described by the mechanical, electrical and logical signals at the interface and the protocol for sequencing them. A standard interface, such as SCSI, decouples the design and introduction of computing hardware, such as I/O devices, from the design and introduction of other components of a computing system, thereby allowing users and manufacturer great flexibility in the implementation of computing systems.] Hardware interfaces can be parallel with several electrical connections carrying parts of the data simultaneously, or serial where data are sent one bit at a time.
2.1.2 Software Interface:
A software interface may refer to a wide range of different types of interface at different "levels": an operating system may interface with pieces of hardware. Applications or programs running on the operating system may need to interact via streams, and in object oriented programs, objects within an application may need to interact via methods.
2.2 Hardware Requirements
Processor – Dual Core
Hard Disk – 50 GB
Memory – 1GB RAM
Mouse – Any Standard
Keyboard – Any Standard
2.3 Software Requirements
OS: Windows/Unix/Linux
Database: MySQL
IDE: NetBeans
Server: Tomcat Server
Language: PHP,HTML
Front end: Browser with support for Javascript
2.4 Introduction of Tools:
HTML
CSS
Jquery
Java script
PHP
Bootstrap
MYSQL
CHAPTER-3
3. SYSTEM DESIGN
In this chapter, we will discuss and analyze about the developing process of Library Management System including software requirement specification (SRS) and comparison between existing and proposed system . The functional and non functional requirements are included in SRS part to provide complete description and overview of system requirement before the developing process is carried out. Besides that, existing vs proposed provides a view of how the proposed system will be more efficient than the existing one.
2.1 SOFTWARE REQUIREMENT SPECIFICATION
2.1.1 GENERAL DESCRIPTION
PRODUCT DESCRIPTION:
Library Management System is a computerized system which helps user(librarian) to manage the library daily activity in electronic format. It reduces the risk of paper work such as file lost, file damaged and time consuming. It can help user to manage the transaction or record more effectively and time-saving.
PROBLEM STATEMENT:
The problem occurred before having computerized system includes:
File lost
When computerized system is not implemented file is always lost because of human environment.Some times due to some human error there may be a loss of records.
File damaged When a computerized system is not there file is always lost due to some accdent like spilling of water by some member on file accidentally.
Difficult to search record
When there is no computerized system there is always a difficulty in searching of records if the records are large in number .
Space consuming
After the number of records become large the space for physical storage of file and records also increases if no computerized system is implemented.
Cost consuming
As there is no computerized system the to add each record paper will be needed which will increase the cost for the management of library.
2.1.2 SYSTEM OBJECTIVES
Improvement in control and performance
The system is developed to cope up with the current issues and problems of library
.The system can add user, validate user and is also bug free.
Save cost
After computerized system is implemented less human force will be required to maintain the library thus reducing the overall cost.
Save time
Librarian is able to search record by using few clicks of mouse and few search keywords thus saving his valuable time.
Option of online Notice board
Librarian will be able to provide a detailed description of workshops going in the college as well as in nearby colleges
2.1.3 SYSTEM REQUIREMENTS
2.1.3.1 NON FUNCTIONAL REQUIREMENTS
Product Requirements
EFFICIENCY REQUIREMENT
When a library management system will be implemented librarian and user will easily acess library as searching and book transaction will be very faster .
RELIABILITY REQUIREMENT
The system should accurately performs member registration ,member validation , report generation, book transaction and search
USABILITY REQUIREMENT
The system is designed for a user friendly environment so that student and staff of library can perform the various tasks easily and in an effective way.
ORGANIZATIONAL REQUIREMENT
IMPLEMENTATION REQUIREMNTS
In implementing whole system it uses html in front end with php as server side scripting language which will be used for database connectivity and the backend ie the database part is developed using mysql.
2.1.3.2 FUNCTIONAL REQUIREMENTS
1. NORMAL USER
1.1 USER LOGIN
Description of feature
This feature used by the user to login into system. They are required to enter user id and password before they are allowed to enter the system .The user id and password will be verified and if invalid id is there user is allowed to not enter the system.
Functional requirements
-user id is provided when they register
-The system must only allow user with valid id and password to enter the system
-The system performs authorization process which decides what user level can acess to.
-The user must be able to logout after they finished using system.
1.2 REGISTER NEW USER
Description of feature
This feature can be performed by all users to register new user to create account.
Functional requirements
-System must be able to verify information
-System must be able to delete information if information is wrong
1.3 REGISTER BOOK
Description of feature
This feature allows to add new books to the library
1.4 Functional requirements
-System must be able to verify information
-System must be able to enter number of copies into table.
1.5.SEARCH BOOK
DESCRIPTION OF FEATURE
This feature is found in book maintenance part . we can search book based on book id , book name , publication or by author name.
Functional requirements
System must be able to search the database based on select search type
System must be able to filter book based on keyword enterd
System must be able to show the filtered book in table view
1.5 ISSUE BOOKS AND RETURN BOOKS
DESCRIPTION OF FEATURE
This feature allows to issue and return books and also view reports of book issued.
-System must be able to enter issue information in database.
-System must be able to update number of books.
- System must be able to search if book is available or not before issuing
books
-System should be able to enter issue and return date information
1.6 EVENT ADDITION
DESCRIPTION OF FEATURE
This feature allows teacher and student to add information about various workshops being conducted in college and colleges nearby.
Functional requirements
-System should be able to add detailed information about events .
-System should be able to display information on notice board available in the homepage of site
2.1.4 SOFTWARE AND HARDWARE REQUIREMENTS
This section describes the software and hardware requirements of the system 2.1.4.1 SOFTWARE REQUIREMENTS
Operating system- Windows 7 is used as the operating system as it is stable and supports more features and is more user friendly
Database MYSQL-MYSQL is used as database as it easy to maintain and retrieve records by simple queries which are in English language which are easy to understand and easy to write.
Development tools and Programming language- HTML is used to write the whole code and develop webpages with css, java script for styling work and php for sever side scripting.
2.1.4.2 HARDWARE REQUIREMENTS
Intel core i5 2nd generation is used as a processor because it is fast than other processors an provide reliable and stable and we can run our pc for longtime. By using this processor we can keep on developing our project without any worries.
Ram 1 gb is used as it will provide fast reading and writing capabilities and will in turn support in processing.
2.2 EXISTING VS PROPOSED SYSTEM
Existing system does not have any facility of teachers login or student login where as proposed system will have a facility of student login as well as teacher’s login
Existing system does not have a facility of online reservation of books whereas proposed system has a facility of online reservation of books
Existing system does not have any facility of online notice board where description of workshops happening in our college as well as nearby colleges is being provided.
Existing system does not has any option of lectures notes uploaded by teachers whereas proposed system will have this facility
Existing system does not have any facility to generate student reports as well book issue reports whereas proposed system provides librarian with a tool to generate reports
Existing system does not has any facility for book request and sugeestions where as in proposed system after logging in to their accounts student can request books as well as provide suggestions to improve.
2.3 SOFTWARE TOOLS USED
The whole Project is divided in two parts the front end and the back end.
2.3.1 Front end
The front end is designed using of html , Php ,css, Java script
HTML- HTML or Hyper Text Markup Language is the main markup language for creating web pages and other information that can be displayed in a web browser.HTML is written in the form of HTML elements consisting of tags enclosed in angle brackets (like <html>), within the web page content. HTML tags most commonly come in pairs like <h1> and </h1>, although some tags represent empty elements and so are unpaired, for example <img>. The first tag in a pair is the start tag, and the second tag is the end tag (they are also called opening tags and closing tags). In between these tags web designers can add text, further tags, comments and other types of text-based content. The purpose of a web browser is to read HTML documents and compose them into visible or audible web pages. The browser does not display the HTML tags, but uses the tags to interpret the content of the page.HTML elements form the building blocks of all websites. HTML allows images and objects to be embedded and can be used to create interactive forms. It provides a means to create structured documents by denoting structural semantics for text such as headings, paragraphs, lists, links, quotes and other items. It can embed scripts written in languages such as JavaScript which affect the behavior of HTML web pages.
CSS- Cascading Style Sheets (CSS) is a style sheet language used for describing the look and formatting of a document written in a markup language. While most often used to style web pages and interfaces written in HTML and XHTML, the language can be applied to any kind
JAVA SCRIPT- JavaScript (JS) is a dynamic computer programming language. It is most commonly used as part of web browsers, whose implementations allow client-side scripts to interact with the user, control the browser, communicate asynchronously, and alter the document content that is displayed. It is also being used in server-side programming, game development and the creation of desktop and mobile applications. JavaScript is a prototype-based scripting language with dynamic typing and has first-class functions. Its syntax was influenced by C. JavaScript copies many names and naming conventions from Java, but the two languages are otherwise unrelated and have very different semantics. The key design principles within JavaScript are taken from
the Self and Scheme programming languages. It is a multi-paradigm language, supporting object-oriented, imperative,
and functional programming styles. The application of JavaScript to use outside of web pages—for example, in PDF documents, site-specific browsers, and desktop widgets—is also significant. Newer and faster JavaScript VMs and platforms built upon them (notably Node.js) have also increased the popularity of JavaScript for server-side web applications. On the client side, JavaScript was traditionally implemented an interpreted language but just-in-time compilation is now performed by recent (post-2012) browsers.
PHP- PHP is a server-side scripting language designed for web development but also used as a general-purpose programming language. PHP is now installed on more than 244 million websites and 2.1 million web servers. Originally created by Rasmus Lerdorf in 1995, the reference implementation of PHP is now produced by The PHP Group. While PHP originally stood for Personal Home Page, it now stands for PHP: Hypertext Preprocessor, a recursive backronym.PHP code is interpreted by a web server with a PHP processor module, which generates the resulting web page: PHP commands can be embedded directly into an HTML source document rather than calling an external file to process data. It has also evolved to include a command-line interface capability and can be used
in standalone graphical applications. PHP is free software released under the PHP License. PHP can be deployed on most web servers and also as a standalone shell on almost every operating system and platform, free of charge.
2.3.2 BACK END:
MYSQL- MySQL ("My S-Q-L", officially, but also called "My Sequel") is (as of July 2013) the world's second most widely used open-source relational database management system (RDBMS). It is named after co-founder Michael Widenius daughter, My. The SQL phrase stands for Structured Query Language. The MySQL development project has made its source code available under the terms of the GNU General Public License, as well as under a variety
of proprietary agreements. MySQL was owned and sponsored by a single for-profit firm, the Swedish company MySQL AB, now owned by Oracle Corporation
.MySQL is a popular choice of database for use in web applications, and is a central component of the widely used LAMP open source web application software stack (and other 'AMP' stacks). LAMP is an acronym for "Linux, Apache, MySQL, Perl/PHP/Python." Free-software-open source projects that require a full-featured database management system often use MySQL. For commercial use, several paid editions are available, and offer additional functionality. Applications which use MySQL.
3.2 System Modules:
3.2.1 Module Description
3.2.2 Login:-
This module has a drop down list box from where we have to select ADMIN or USER. The ADMIN has all the rights in the software, including updating the status of his site. The other fields in the login are user name and password. If the username and password are correct, then it is directed to the next page.
3.2.3 Admin Module:-
Admin module is mainly for the owner of the system. This module performs the work of the regular checking process. Everyone needs current information about anything. So, this module is responsible for updating the information continuously if any, in the system so that one can find timely information. But the main function of this module is to handle security of this system. Different types of authentication and authorization process is performed for this purpose. This module is also responsible for advertisement bid. Any organizations that are eager for advertisement can contact us for their ad. This module handles the entire task related to advertisement like specifying and allocating the space and related cost.
3.2.4 User Module:-
User page module is for front page of this system. It is the main page of the system in which all the links of this system are kept. Now the main thing is how to make the home page interactive and user friendly so that there should not be any problem for the user. This is the task of the system administrator to make the home page Interactive.
3.2.5 Sign UP:-
This module is for the users who do not have their account. Here the user is allowed to create an account to login. The account creation is done by filling the registration form with user details such as name, phone, email etc.
3.2.6 Product:-
This module has information regarding the mobiles such as its name, model, colour, price information, its features, etc. The ADMIN has the authority to Add, Delete, Update etc. The USER can only view the Mobile, add to cart only those in the stock etc.
3.2.7 Search:-
This module helps the customer to ease His search based on his budget or interest. The search can be done on different categories like jewellery model name, model number, colour, price etc.
3.2.8 Cart:-
User can select any number of jewellery and add to the cart. He can also remove from the cart if he dislikes it later.
3.2.9 Payment:-
This module describes the payment by the customer. The payment information can include information like the model purchased, quality, mode of payment etc.
3.2.10 Stocks:-
This gives the details regarding the products available for sale.
3.3 Database Design
3.3.1 Data Dictionary
A data dictionary, or Metadata Repository, as defined in the IBM Dictionary of Computing, is a "centralized repository of information about data such as meaning, relationships to other data, origin, usage, and format. The term can have one of several closely related meanings pertaining to databases and database management systems (DBMS):
A document describing a database or collection of databases.
An integral component of a DBMS that is required to determine its structure.
A piece of middleware that extends or supplants the native data dictionary of a DBMS.
The terms data dictionary and data repository indicate a more general software utility than a catalogue. A catalogue is closely coupled with the DBMS software. It provides the information stored in it to the user and the DBA, but it is mainly accessed by the various software modules of the DBMS itself, such as DDL and DML compilers, the query optimizer, the transaction processor, report generators, and the constraint enforcer. On the other hand, a data dictionary is a data structure that stores metadata, i.e., (structured) data about information. The software package for a stand-alone data dictionary or data repository may interact with the software modules of the DBMS, but it is mainly used by the designers, users and administrators of a computer system for information resource management. These systems maintain information on system hardware and software configuration, documentation, application and users as well as other information relevant to system administration.
If a data dictionary system is used only by the designers, users, and administrators and not by the DBMS Software, it is called a passive data dictionary. Otherwise, it is called inactive data dictionary or data dictionary. When a passive data dictionary is updated, it is done so manually and independently from any changes to a DBMS (database) structure. With an active data dictionary, the dictionary is updated first and changes occur in the DBMS automatically as a result.
Table 3.3.1 Database Table
Name
Description
id
Identification Of User, Admin, and Jewellery Id of the product
email
Mail Address of User
mmenu_id
Main menu id of the product
Mmenu_name
Menu name of the category of the product
Submenu_name
Name of the product link to the main menu
Checkout
Check for the buy the product
Checked on
Date and time of buy the product by user
3.3.2 Database
It includes admin and Sales Executive. Basically in this table we can store .The information about products, Categories, Sub Categories and also information about the users.
Fig no 3.3.2
3.3.3 Admin
This module is used to store the information and details of users. Basically in this table we can store information about the users like Id, Name, Surname, Username, and Address.
Table 3.3.3 User
Column Name
Type
Size
Description
id
Int
10
Id of the user /P.K
Name
Varchar
50
Name of the user
Surname
Varchar
20
User surname
Username
Varchar
30
User UserName
Password
Varchar
10
User Password
Email
Varchar
10
User EmailId
3.3.4 Cart
This module is used to keep the information about cart. We can store the information about product like id, jewel_id, quantity and customer_id etc.
Figno.3.3.4
3.3.5 Jewellery
In this table the information about the item sold is to be stored. The table contains the information like Transaction id, Item name, Selling price, Quantity, Amount, Date, Username Customer id etc.
Fig no.3.3.5
3.3.6 Main Menu
Fig no.3.3.6
3.3.7 Sub Menu
Fig no.3.3.7
3.3.8 New User
Fig no.3.3.8
3.3.9 Web Content
Fig no.3.3.8
3.4 Form Design, Outputs
3.4.1. Home page
Home page is the main page of the website .This page is tell about the information and look and feel of the website .This page is very important to make attractive. This page include all the features and functions of that website.
Fig no.3.4.1
3.4.2 RANDOM
Fig no. 3.4.2
3.4.3 Admin
Fig no. 3.4.3
3.4.4 About
fig no.3.4.4
3.4.5 book table
Fig no.3.4.5
3.4.6 book borrow:
Fig no.3.4.6
3.4.7 return book:
Fig no.3.4.7
3.4.8 Search:
Fig no 3.4.8
3.4.9 Member:
.
Fig no3.4.9
3.4.10 database:
.
Fig no.3.4.10
3.4.11 Book table DB
Fig no 3.2.11
3.4.11 Borrow table DB:
3.4.11 Borrow table DB:
Lostbook table:
Member table:
User table :
CAPTER-4
TESTING & TEST RESULTS
4.1 Objective of Testing
The main reason to software testing is to find out defects which will cause an error to the users. Suppose any application which we are using in our smartphone which is not working properly, it can lead to many problems. Objectives of Software Testing are as follows:
Example: Suppose you purchased a car, now you are going to drive a car on the highway and that time you realized that car’s brakes are not working. You can imagine what will happen with you! Software testing is a process with intending to find defects. Basically, software testing is done by a software testing
4.2 Steps in Testing
The Software Testing Life Cycle (STLC) includes a number of steps that have been completed in sequence. Even though some of these steps can vary, in general the main sequence of steps are the following:
Requirement Analysis
Planning the test
Developing the test case
Setting up the test environment
Executing the test
End of test, or closing the test cycle
We can look at each of these steps in more detail.
4.3 Level of Testing
Software testing levels are: the different stages of the software development life cycle where testing is conducted. There are four levels of software testing:
Fig no.4.3
4.3.1 Unit Testing:
A level of the software testing process where individual units of software are tested. Purpose is to validate that each unit of the software performs as designed.
4.3.2 Integration Testing:
A level of software testing process where individual units are combined and tested as a group. The purpose of this level of testing is to expose faults in the interaction between integrated units.
4.3.3 System Testing:
A level of the software testing process where a complete, integrated system is tested. The Purpose of the test is to evaluate the system’s compliance with the specified requirements.
4.3.4 Acceptance Testing:
A level of software testing process where a system is tested for acceptability. The purpose of this is to evaluate the system’s compliance with the business requirements and assess whether it is acceptable for delivery.
CHAPTER-5
5. SYSTEM IMPLEMENTATION
5.1 System Coding Connection
<?php
date_default_timezone_set("Asia/Muscat");
session_start();
if (isset($_SESSION['user_id']))
{
$userid = $_SESSION['user_id'];
}
if (isset($_SESSION['username']))
{
$User = $_SESSION['username'];
}
else
{
$User = "";
$userid = "";
echo "<script>alert('Login First')</script>";
echo "<script>window.location.href='index-1.php';</script>";
}
$today = date("l, d F, Y");
?>
<!DOCTYPE html>
<html>
<head>
<title>ITEMS BOUGHT</title>
<link rel="stylesheet" type="text/css" href="adminstyle.css">
</head>
<body>
<table align="right">
<tr>
<td>
<script Language="Javascript">
function printit()
{
if (window.print)
{
window.print() ;
}
else
{
var WebBrowser = '<OBJECT ID="WebBrowser1" WIDTH=0 HEIGHT=0 CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></OBJECT>';
document.body.insertAdjacentHTML('beforeEnd', WebBrowser);
WebBrowser1.ExecWB(6, 2);//Use a 1 vs. a 2 for a prompting dialog box WebBrowser1.outerHTML = "";
}
}
</script>
<script Language="Javascript">
var NS = (navigator.appName == "Netscape");
var VERSION = parseInt(navigator.appVersion);
if (VERSION > 3)
{
document.write('<form> <input type=button value="Print this Page" name="Print" onClick="printit()"> </form>');
}
</script>
</td>
<td>
<form><input type="button" value="Close" onClick="JavaScript:window.close()" /></form>
<!--<form><input type="button" value="Close" onClick="window.location.href='default.php'" /></form>-->
</td>
</tr>
</table>
<p align="center"><img src="image/logo.png" /></p>
<p align="center"><b><u>ALL ITEMS BOUGHT</u></b></p>
<?php
include("includes/mysqli_connection.php");
$sql = "SELECT * FROM users WHERE user_id = $userid";
$query = (mysqli_query($db_conx,$sql));
while($row = mysqli_fetch_array($query, MYSQLI_ASSOC))
{
$user_id = $row['user_id'];
$name = $row['name'];
$surname = $row['surname'];
$uname = $row['username'];
$pass = $row['password'];
$email = $row['email'];
$address = $row['address'];
$tel = $row['tel'];
$type = $row['ac_type'];
$status = $row['user_status'];
}
?>
<p align="left"><b> DATE : <?php echo $today;?></b></p>
<table border="0" width="auto">
<tr>
<td width="100%" colspan="3"></td>
</tr>
<tr>
<td width="25%"><strong>Name</strong></td>
<td width="3%"><b>:</b></td>
<td width="auto"><?php echo strtoupper($surname); ?> <?php echo strtoupper($name); ?></td>
</tr>
<tr>
<td width="25%"><strong>Email</strong></td>
<td width="3%"><b>:</b></td>
<td width="auto"><?php echo $email; ?></td>
</tr>
<tr>
<td width="25%"><strong>Billing Address</strong></td>
<td width="3%"><b>:</b></td>
<td width="auto"><?php echo $address; ?></td>
</tr>
<tr>
<td width="25%"><strong>Telephone</strong></td>
<td width="3%"><b>:</b></td>
<td width="auto"><?php echo $tel; ?></td>
</tr>
</table>
<br />
<?php
include("includes/mysqli_connection.php");
$sql = "SELECT COUNT(*) FROM cart , jewellery, users WHERE cart.cust_id = $userid AND users.user_id = $userid AND cart.checkout = 'y' AND jewellery.id = cart.jewel_id";
$query = (mysqli_query($db_conx,$sql));
$row = mysqli_fetch_row($query);
// Here we have the total row count
$rows = $row[0];
$countrows = $rows;
$selectproducts = "SELECT * FROM cart , jewellery, users WHERE cart.cust_id = $userid AND users.user_id = $userid AND cart.checkout = 'y' AND jewellery.id = cart.jewel_id";
$query = mysqli_query($db_conx, $selectproducts);
$list = "";
$src = "Photos/";
if($rows == 0)
{
echo "<script>alert('Nothing Bought Yet!')</script>";
//echo "<script>window.close();</script>";
}
else
{
echo "<table align='center' cellspacing='1' cellpadding='0' width='80%'>
<tr><td colspan='7'><hr></td></tr>
<th align='center' bgcolor='e6e6e6'>DATE</th>
<th align='center' bgcolor='e6e6e6'>TRANSACTION CODE</th>
<th align='center' bgcolor='e6e6e6'>JEWEL ID</th>
<th align='center' bgcolor='e6e6e6'>PRODUCT</th>
<th align='center' bgcolor='e6e6e6'>QUANTITY</th>
<th align='center' bgcolor='e6e6e6'>PRICE</th>
<th align='center' bgcolor='e6e6e6'>AMOUNT</th>";
for($loop = 0; $loop < $countrows; $loop++)
{
while($row = mysqli_fetch_array($query, MYSQLI_ASSOC))
{
$id = $row['id'];
$jewelid = $row['jewel_id'];
$qty = $row['qty'];
$userid = $row['cust_id'];
$checkout = $row['checkout'];
$added = $row['added'];
$checked = $row['checkedon'];
$trans = $row['trans'];
$date = date("Y-m-d H:i:s");
$prodname = $row['prodname'];
$path = $row['path'];
$category = $row['category'];
$price = $row['price'];
$desc = $row['descr'];
$width="150px";
$height="150px";
$user_id = $row['user_id'];
$name = $row['name'];
$surname = $row['surname'];
$uname = $row['username'];
$pass = $row['password'];
$email = $row['email'];
$address = $row['address'];
$tel = $row['tel'];
$type = $row['ac_type'];
$status = $row['user_status'];
$amount = ($qty * $price);
$amount = round($amount);
if (round($amount*10) == $amount*10 && round($amount)!=$amount) $amount = "$amount"."0"; //to avoid prices like 17.5 - write 17.50 instead
{
if (round($amount) == $amount) //add .00
{
$amount = "$amount".".00";
}
}
$list ="<tr align='center'><td>" . $checked . "</td><td>" . $trans . "</td><td>" . $jewelid . "</td><td>" . $prodname . "</td><td>" . $qty . "</td>";
$list .= "<td>" . $price . "</td><td>" . $amount . "</td></tr>";
echo $list;
}
}
}
?>
<tr>
<td colspan="7"><hr></td>
</tr>
</table>
<?php mysqli_close($db_conx); ?>
<br />
<center>
<p><b>THANK YOU FOR CHOSING BB JEWELLERY<b></p>
</center>
</body>
</html>
Login Admin
<html>
<head>
<title> Admin Login </title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<style>
h1{
color:brown;
}
.frm{
width:500px;
//border:solid 2px brown;
//border-radius:50px;
margin-top:20px;
height:auto;
margin-left:120px;
}
td{
font-family:arial;
font-weight:bold;
color:brown;
width:250px;
}
.form-control{
width:200px;
margin-bottom:3px;
}
body{
background: url(../image/back.jpg) repeat left top;
opicity:0.5
}
.form-control{
width:200px;
margin-bottom:10px;
}
</style>
</head>
<body>
<center><br>
<a href="../index-1.php"><img src="../image/jewelleryshop.jpg" width=100px height=50px title="BB Jewellery Logo" alt="Our Logo"></a>
<!--<a href="../index-1.php">home Page</a>-->
<form name = "adminform" class="frm" action="loginadmin.php" method="POST">
<br><br><br><br><br><br>
<table align="center" border="0">
<tr>
<td>user Name</td>
<td><b><input type="text" class="form-control" name="uname" ></b></td>
</tr>
<tr>
<td>Password</td>
<td><b><input type="password" class="form-control" name="pass" ></b></td>
</tr>
</table>
<table align="center">
<td><input type="submit" style="margin-left:150px" class="btn btn-success" value="submit" ></td>
</table>
</center>
</form>
</html>
<?php
if(!isset($_POST["uname"]) || !isset($_POST["pass"]))
{
//echo "hello";
}
else
{
$uname=$_POST['uname'];
$Password=$_POST['pass'];
$con=mysql_connect("localhost","root",NULL) or die("Some Problem While Connectinng");
$db=mysql_selectdb("bbjewels",$con) or die(mysql_error());
$query="select username,password from users where username ='".$uname."' and password='".$Password."' ";
//echo $query;
$result=mysql_query($query) or die(mysql_error());
if(mysql_num_rows($result)==1)
{
//$_SESSION["uname"]= $uname;
header("Location:admin_menu.html");
}
else
{
echo "<center><font color=red><strong>Some Problem in User ID or Password</strong></font></center>";
return;
}
}
?>
Checkout
<?php
session_start();
if (isset($_SESSION['user_id']))
{
$userid = $_SESSION['user_id'];
echo "userid: " . $userid;
}
else
{
$userid = "";
}
?>
<?php
$_SESSION['code'] = rand();
$code = $_SESSION['code'];
echo "<br />Code: " . $code;
?>
<?php
// User is already logged in. Redirect them somewhere useful.
if (isset($_SESSION['username']))
{
$User = $_SESSION['username'];
}
else
{
$User = "";
}
?>
<!-- Head1 Part Start-->
<?php include("head1.html");?>
<!-- Head1 Part End-->
<!-- Top Part Start-->
<?php
if($User != "")
{
include("top_links2.php");
}
else
{
include("top_links.php");
}
?>
<!-- Top Part End-->
<!-- Main Div Tag Start-->
<div id="wrapper">
<!-- Header Part Start-->
<?php
if($User != "")
{
include("header2.php");
}
else
{
include("header.php");
}
?>
<!-- Header Part Start-->
<!-- Middle Part Start-->
<!-- Section Start-->
<?php include("section.html"); ?>
<!--Section End-->
<!--Middle Part End-->
<!--Random Featured Product Start-->
<div class="box mb0" id="checkout">
<div class="box-heading-1"><span>CHECKOUT</span></div>
<div class="box-content-1">
<div class="box-product-1" >
<?php
include("includes/mysqli_connection.php");
$sql = "SELECT COUNT(*) FROM cart WHERE cust_id = $userid AND checkout = 'n'";
$query = (mysqli_query($db_conx,$sql));
$row = mysqli_fetch_row($query);
// Here we have the total row count
$rows = $row[0];
$countrows = $rows;
$totalquantity = 0;
$subtotal = 0;
$totalamount = 0;
$vat1 = 0;
$delivery = 500;
$selectproducts = "SELECT * FROM cart , jewellery, users WHERE cart.cust_id = $userid AND users.user_id = $userid AND cart.checkout = 'n' AND jewellery.id = cart.jewel_id";
$query = mysqli_query($db_conx, $selectproducts);
$list = "";
$src = "Photos/";
if($rows == 0)
{
echo "<script>alert('Buy an Item First!')</script>";
echo "<script>window.location.href='index-1.php';</script>";
}
else
{
echo "<center><b><u>ITEMS IN YOUR CART</u></b></center><br />";
echo "<table align='center' border='1' cellspacing='1' cellpadding='0' width='50%'>
<th align='center' bgcolor='e6e6e6'>JEWEL ID</th><th align='center' bgcolor='e6e6e6''>PRODUCT</th>
<th align='center' bgcolor='e6e6e6''>QUANTITY</th><th align='center' bgcolor='e6e6e6''>PRICE</th>
<th align='center' bgcolor='e6e6e6''>AMOUNT</th>";
for($loop = 0; $loop < $countrows; $loop++)
{
while($row = mysqli_fetch_array($query, MYSQLI_ASSOC))
{
$jewelid = $row['jewel_id'];
$qty = $row['qty'];
$userid = $row['cust_id'];
$checkout = $row['checkout'];
$added = $row['added'];
$checked = $row['checkedon'];
//$row['trans'] = $code;
$trans = $row['trans'];
$prodname = $row['prodname'];
$path = $row['path'];
$category = $row['category'];
$price = $row['price'];
$desc = $row['descr'];
$width="150px";
$height="150px";
$user_id = $row['user_id'];
$name = $row['name'];
$surname = $row['surname'];
$uname = $row['username'];
$pass = $row['password'];
$email = $row['email'];
$address = $row['address'];
$tel = $row['tel'];
$type = $row['ac_type'];
$status = $row['user_status'];
$amount = ($qty * $price);
$totalquantity = $totalquantity + $qty;
$subtotal = $subtotal + $amount;
$vat1 = round(0.15 * $subtotal);
$totalamount = ($subtotal + $vat1 + $delivery);
$amount = round($amount);
if (round($amount*10) == $amount*10 && round($amount)!=$amount) $amount = "$amount"."0"; //to avoid prices like 17.5 - write 17.50 instead
{
if (round($amount) == $amount) //add .00
{
$amount = "$amount".".00";
}
}
$list ="<tr align='center'><td>" . $jewelid . "</td><td>" . $prodname . "</td><td>" . $qty . "</td>";
$list .= "<td>" . $price . "</td><td>" . $amount . "</tr>";
echo $list;
}
}
echo "</table></center><br />";
}
?>
<script type="text/javascript">
<!-- Begin
function resetform()
{
document.forms[0].elements[6]=="";
}
function submitForms()
{
if (isCard())
if (confirm("\n You are about to submit this form. \n\nPress Ok to submit. Cancel to abort."))
{
alert(document.forms[0].elements[2].value + " " + document.forms[0].elements[1].value +"\n\n\nYour Checkout form has been sent successfully. \n\n\nThank you!");
return true;
}
else
{
alert("You have chosen to abort the checkout.");
return false;
}
else
return false;
}
function isCard()
{
T = document.forms[0].elements[6].value;
if(T == "")
{
alert("Credit Card cannot be blank")
document.forms[0].elements[6].focus();
return false;
}
else
{
if(T == 0)
{
alert("Credit Card cannot be less or equal to zero");
document.forms[0].elements[6].focus();
return false;
}
else
{
if(T.length<14)
{
alert("Credit Card Number must be 14 digits");
document.forms[0].elements[6].focus();
return false;
}
else
{
if(T.indexOf(".")==1)
{
alert("Credit Card cannot contain dot sign");
document.forms[0].elements[6].focus();
return false;
}
return true;
}
}
}
}
// End -->
</script>
<table border="1" align="center" width="300px">
<tr align="center">
<td width="150px"><b>Total Quantity</b></td><td width="150px"><?php echo $totalquantity;?></td>
</tr>
<tr align="center">
<td width="150px"><b>Total Items</b></td><td width="150px"><?php echo $rows;?></td>
</tr>
<tr align="center">
<td><b>Sub Total</b></td><td><?php echo $subtotal;?></td>
</tr>
<tr align="center">
<td><b>GST (18%)</b></td><td><?php echo $vat1;?></td>
</tr>
<tr align="center">
<td><b>Delivery Cost</b></td><td><?php echo $delivery;?></td>
</tr>
<tr align="center">
<td><b>Total Amount</b></td><td><?php echo $totalamount;?></td>
</tr>
</table>
<br />
<p align="center"><b>CHECKOUT FORM</b></p>
<table border="0" cellpadding="1" cellspacing="0" width="80%" align="center">
<tr>
<td colspan="5" height="96">
<form name="formCheckout" method="post" action="confirmcheckout.php" onSubmit="return submitForms()">
<table width="400" align="center" border="0">
<tr>
<td bgColor="c6d3ce">
<table width="400" border="0">
<tr bgColor="dee7e7">
<td width="165"><strong>ID</strong></td>
<td><input type="text" name="Userid" size="8" value="<?php echo $user_id;?>" disabled="TRUE" /></td>
</tr>
<tr bgColor="dee7e7">
<td width="165"><strong>Name</strong></td>
<td><b><input type="text" size="25" name="Name" value="<?php echo strtoupper($name); ?>" disabled="TRUE" /></b></td>
</tr>
<tr bgColor="e7efef">
<td><strong>Surname</strong></td>
<td><b><input type="text" size="25" name="Surname" value="<?php echo strtoupper($surname); ?>" disabled="TRUE" /></b></td>
</tr>
<tr bgColor="e7efef">
<td><strong>Email</strong></td>
<td><b><input type="text" size="30" name="Email" value="<?php echo $email; ?>" disabled="TRUE" /></b></td>
</tr>
<tr bgColor="dee7e7">
<td><strong>Billing Address</strong></td>
<td><b><textarea rows="3" name="Address" cols="20" disabled="TRUE"><?php echo $address; ?></textarea></b></td>
</tr>
<tr bgColor="e7efef">
<td><strong>Telephone</strong></td>
<td><b><input type="text" size="10" maxlength="8" name="Tel" value="<?php echo $tel; ?>" disabled="TRUE" /></b></td>
</tr>
<tr bgColor="e7efef">
<td><strong>Credit Card</strong></td>
<td><b><input type="text" size="15" maxlength="14" name="Card" onKeypress="if (event.keyCode < 45 || event.keyCode > 57) event.returnValue = false;"></b></td>
</tr>
</table>
</td>
</tr>
</table>
<br>
<table width="400" align="center" border="0">
<tr>
<td align="center" width="200"><input type="submit" value="Submit"></td>
<td align="center" width="200"><input type="reset" name="reset" value="Reset Form" onClick="return confirm('Are you sure you want to reset the current information?');"></td>
</tr>
</table>
</form>
</td>
</tr>
</table>
</div>
</div>
</div>
<!--Random Featured Product End-->
<!--Special Promo Banner Start-->
<div class="box-promo" id="box-promo">
<div class="box-heading-1"><span>PROMO ON FEATURED ITEMS</span></div>
<div id="banner0" class="banner">
<div style="display:block;"><img src="image/addBanner-940x145.jpg" alt="Special Offers" title="Special Offers" /></div>
</div>
</div>
<!--Special Promo Banner End-->
<!--Coming Soon Product Start-->
<!--
<div class="box-heading-1" id="soon">
<div class="box-heading-1"><span>Coming Soon</span></div>
<div id="carousel0">
<ul class="jcarousel-skin-opencart">
-->
<!--Coming Soon Product End-->
<!--Carousel Start-->
<!--
<?php
// Included configuration file in our code.
//include("comingsoon.php");
?>
</ul>
</div>
</div>
-->
<!--Carousel End-->
<!--Footer Part Start-->
<?php include("footer.php");?>
<!--Footer Part End-->
</div>
<!-- Main Div Tag End-->
<!--Flexslider Javascript Part Start-->
<?php include("flexslider.php");?>
<!--Flexslider Javascript Part End-->
</body>
</html>
Cart
<?php
session_start();
if (isset($_SESSION['user_id']))
{
$userid = $_SESSION['user_id'];
echo "userid: " . $userid;
}
else
{
$userid = "";
}
?>
<?php
$_SESSION['code'] = rand();
$code = $_SESSION['code'];
echo "<br />Code: " . $code;
?>
<?php
// User is already logged in. Redirect them somewhere useful.
if (isset($_SESSION['username']))
{
$User = $_SESSION['username'];
}
else
{
$User = "";
}
?>
<!-- Head1 Part Start-->
<?php include("head1.html");?>
<!-- Head1 Part End-->
<!-- Top Part Start-->
<?php
if($User != "")
{
include("top_links2.php");
}
else
{
include("top_links.php");
}
?>
<!-- Top Part End-->
<!-- Main Div Tag Start-->
<div id="wrapper">
<!-- Header Part Start-->
<?php
if($User != "")
{
include("header2.php");
}
else
{
include("header.php");
}
?>
<!-- Header Part Start-->
<!-- Middle Part Start-->
<!-- Section Start-->
<?php include("section.html"); ?>
<!--Section End-->
<!--Middle Part End-->
<!--Random Featured Product Start-->
<div class="box mb0" id="cart">
<div class="box-heading-1"><span>SHOPPING CART</span></div>
<div class="box-content-1">
<div class="box-product-1" >
<?php
include("includes/mysqli_connection.php");
$sql = "SELECT COUNT(*) FROM cart WHERE cust_id = $userid AND checkout = 'n'";
$query = (mysqli_query($db_conx,$sql));
$row = mysqli_fetch_row($query);
// Here we have the total row count
$rows = $row[0];
$totalquantity = 0;
$subtotal = 0;
$totalamount = 0;
$vat1 = 0;
$selectproducts = "SELECT * FROM cart , jewellery WHERE cart.cust_id = $userid AND cart.checkout = 'n' AND jewellery.id = cart.jewel_id";
$query = mysqli_query($db_conx, $selectproducts);
$list = "";
$src = "Photos/";
if($rows == 0)
{
echo "<script>alert('No Items In Cart')</script>";
echo "<script>window.location.href='index-1.php';</script>";
}
else
{
$delivery = 500;
$vat = 0.15;
echo '<center>';
echo '<table align="center" border="1" cellspacing="1" cellpadding="0" width="75%">
<th align="center" bgcolor="e6e6e6">JEWEL ID</th><th align="center" bgcolor="e6e6e6">PRODUCT</th>
<th align="center" bgcolor="e6e6e6">QUANTITY</th><th align="center" bgcolor="e6e6e6">PRICE</th>
<th align="center" bgcolor="e6e6e6">AMOUNT</th>
<th align="center" bgcolor="e6e6e6" colspan="2">UPDATE QTY</th>
<th align="center" bgcolor="white">ADDED ON</th>
<th align="center"><font color="red">REMOVE ITEM</font></th>';
for($loop = 0; $loop < $rows; $loop++)
{
while($row = mysqli_fetch_array($query, MYSQLI_ASSOC))
{
$jewelid = $row["jewel_id"];
$qty = $row["qty"];
$userid = $row["cust_id"];
$checkout = $row['checkout'];
$dateadd = $row['added'];
$datechecked = $row['checkedon'];
$dateadd = date($dateadd);
$name = $row["prodname"];
$path = $row["path"];
$category = $row["category"];
$price = $row["price"];
$desc = $row["descr"];
$width="150px";
$height="150px";
$amount = ($qty * $price);
$amount = round($amount);
if (round($amount*10) == $amount*10 && round($amount)!=$amount) $amount = "$amount"."0"; //to avoid prices like 17.5 - write 17.50 instead
{
if (round($amount) == $amount) //add .00
{
$amount = "$amount".".00";
}
}
$totalquantity = $totalquantity + $qty;
$subtotal = $subtotal + $amount;
if($subtotal == 0)
{
$vat = 0;
}
else
{
$vat1 = round($vat * $subtotal);
if($vat1 > 0)
{
$vat1 = $vat1;
}
else
{
$vat1 =0;
}
}
$totalamount = ($subtotal + $vat1 + $delivery);
$list ='<tr align="center"><td>' . $jewelid . '</td><td>' . $name . '</td><td>' . $qty . '</td>';
$list .= '<td>' . $price . '</td><td>' . $amount . '</td>';
$list .='<td><form method="post" action="updateqty.php"><input type="hidden" size="4" name="txtjewelid" value="' . $jewelid .'" /><input type="submit" value="+1" /></form></td>';
$list .='<td><form method="post" action="removeqty.php"><input type="hidden" size="4" name="txtjewelid" value="' . $jewelid .'" /><input type="submit" value="-1" name="submit" /></form></td>';
$list .='<td>' . $dateadd . '</td>';
$list .='<td><form method="post" action="remove.php"><input type="hidden" size="4" name="txtjewelid" value="' . $jewelid .'" /><input type="submit" value="X" name="submit" /></form></td></tr>';
echo $list;
}
}
echo "</table></center><br />";
}
?>
<table border="1" align="center" width="300px">
<tr align="center">
<td width="150px"><font face="monotype corsiva"><b>Total Quantity</b></font></td><td width="150px"><?php echo $totalquantity;?></td>
</tr>
<tr align="center">
<td width="150px"><b>Total Items</b></td><td width="150px"><?php echo $rows;?></td>
</tr>
<tr align="center">
<td><b>Sub Total</b></td><td><?php echo $subtotal;?></td>
</tr>
<tr align="center">
<td><b>GST (18%)</b></td><td><?php echo $vat1;?></td>
</tr>
<tr align="center">
<td><b>Delivery Cost</b></td><td><?php echo $delivery;?></td>
</tr>
<tr align="center">
<td><b>Total Amount</b></td><td><?php echo $totalamount;?></td>
</tr>
</table>
<p align="center"><b>NOTE:- All figures rounded</b></p>
<?php
if(!$rows == 0)
{
?>
<p align="center"><input type="button" value="Checkout" onClick="javascript:location.href='checkout.php';"></p>
<?php
}
?>
</div>
</div>
</div>
<!--Random Featured Product End-->
<!--Special Promo Banner Start-->
<div class="box-promo" id="box-promo">
<div class="box-heading-1"><span>PROMO ON FEATURED ITEMS</span></div>
<div id="banner0" class="banner">
<div style="display:block;"><img src="image/addBanner-940x145.jpg" alt="Special Offers" title="Special Offers" /></div>
</div>
</div>
<!--Special Promo Banner End-->
<!--Coming Soon Product Start-->
<!--
<div class="box-heading-1" id="soon">
<div class="box-heading-1"><span>Coming Soon</span></div>
<div id="carousel0">
<ul class="jcarousel-skin-opencart">
-->
<!--Coming Soon Product End-->
<!--Carousel Start-->
<!--
<?php
// Included configuration file in our code.
//include("comingsoon.php");
?>
</ul>
</div>
</div>
-->
<!--Carousel End-->
<!--Footer Part Start-->
<?php include("footer.php");?>
<!--Footer Part End-->
</div>
<!-- Main Div Tag End-->
<!--Flexslider Javascript Part Start-->
<?php include("flexslider.php");?>
<!--Flexslider Javascript Part End-->
</body>
</html>
About
<?php
session_start();
if (isset($_SESSION['user_id']))
{
$userid = $_SESSION['user_id'];
echo "userid: " . $userid;
}
else
{
$userid = "";
}
?>
<?php
$_SESSION['code'] = rand();
$code = $_SESSION['code'];
echo "<br />Code: " . $code;
?>
<?php
// User is already logged in. Redirect them somewhere useful.
if (isset($_SESSION['username']))
{
$User = $_SESSION['username'];
}
else
{
$User = "";
}
?>
<!-- Head1 Part Start-->
<?php include("head1.html");?>
<!-- Head1 Part End-->
<!-- Top Part Start-->
<?php
if($User != "")
{
include("top_links2.php");
}
else
{
include("top_links.php");
}
?>
<!-- Top Part End-->
<!-- Main Div Tag Start-->
<div id="wrapper">
<!-- Header Part Start-->
<?php
if($User != "")
{
include("header2.php");
}
else
{
include("header.php");
}
?>
<!-- Header Part Start-->
<!-- Middle Part Start-->
<!-- Section Start-->
<?php include("section.html"); ?>
<!--Section End-->
<!--Middle Part End-->
<!--Random Featured Product Start-->
<div class="box mb0" id="cart">
<div class="box-heading-1"><span>SHOPPING CART</span></div>
<div class="box-content-1">
<div class="box-product-1" >
<?php
include("includes/mysqli_connection.php");
$sql = "SELECT COUNT(*) FROM cart WHERE cust_id = $userid AND checkout = 'n'";
$query = (mysqli_query($db_conx,$sql));
$row = mysqli_fetch_row($query);
// Here we have the total row count
$rows = $row[0];
$totalquantity = 0;
$subtotal = 0;
$totalamount = 0;
$vat1 = 0;
$selectproducts = "SELECT * FROM cart , jewellery WHERE cart.cust_id = $userid AND cart.checkout = 'n' AND jewellery.id = cart.jewel_id";
$query = mysqli_query($db_conx, $selectproducts);
$list = "";
$src = "Photos/";
if($rows == 0)
{
echo "<script>alert('No Items In Cart')</script>";
echo "<script>window.location.href='index-1.php';</script>";
}
else
{
$delivery = 500;
$vat = 0.15;
echo '<center>';
echo '<table align="center" border="1" cellspacing="1" cellpadding="0" width="75%">
<th align="center" bgcolor="e6e6e6">JEWEL ID</th><th align="center" bgcolor="e6e6e6">PRODUCT</th>
<th align="center" bgcolor="e6e6e6">QUANTITY</th><th align="center" bgcolor="e6e6e6">PRICE</th>
<th align="center" bgcolor="e6e6e6">AMOUNT</th>
<th align="center" bgcolor="e6e6e6" colspan="2">UPDATE QTY</th>
<th align="center" bgcolor="white">ADDED ON</th>
<th align="center"><font color="red">REMOVE ITEM</font></th>';
for($loop = 0; $loop < $rows; $loop++)
{
while($row = mysqli_fetch_array($query, MYSQLI_ASSOC))
{
$jewelid = $row["jewel_id"];
$qty = $row["qty"];
$userid = $row["cust_id"];
$checkout = $row['checkout'];
$dateadd = $row['added'];
$datechecked = $row['checkedon'];
$dateadd = date($dateadd);
$name = $row["prodname"];
$path = $row["path"];
$category = $row["category"];
$price = $row["price"];
$desc = $row["descr"];
$width="150px";
$height="150px";
$amount = ($qty * $price);
$amount = round($amount);
if (round($amount*10) == $amount*10 && round($amount)!=$amount) $amount = "$amount"."0"; //to avoid prices like 17.5 - write 17.50 instead
{
if (round($amount) == $amount) //add .00
{
$amount = "$amount".".00";
}
}
$totalquantity = $totalquantity + $qty;
$subtotal = $subtotal + $amount;
if($subtotal == 0)
{
$vat = 0;
}
else
{
$vat1 = round($vat * $subtotal);
if($vat1 > 0)
{
$vat1 = $vat1;
}
else
{
$vat1 =0;
}
}
$totalamount = ($subtotal + $vat1 + $delivery);
$list ='<tr align="center"><td>' . $jewelid . '</td><td>' . $name . '</td><td>' . $qty . '</td>';
$list .= '<td>' . $price . '</td><td>' . $amount . '</td>';
$list .='<td><form method="post" action="updateqty.php"><input type="hidden" size="4" name="txtjewelid" value="' . $jewelid .'" /><input type="submit" value="+1" /></form></td>';
$list .='<td><form method="post" action="removeqty.php"><input type="hidden" size="4" name="txtjewelid" value="' . $jewelid .'" /><input type="submit" value="-1" name="submit" /></form></td>';
$list .='<td>' . $dateadd . '</td>';
$list .='<td><form method="post" action="remove.php"><input type="hidden" size="4" name="txtjewelid" value="' . $jewelid .'" /><input type="submit" value="X" name="submit" /></form></td></tr>';
echo $list;
}
}
echo "</table></center><br />";
}
?>
<table border="1" align="center" width="300px">
<tr align="center">
<td width="150px"><font face="monotype corsiva"><b>Total Quantity</b></font></td><td width="150px"><?php echo $totalquantity;?></td>
</tr>
<tr align="center">
<td width="150px"><b>Total Items</b></td><td width="150px"><?php echo $rows;?></td>
</tr>
<tr align="center">
<td><b>Sub Total</b></td><td><?php echo $subtotal;?></td>
</tr>
<tr align="center">
<td><b>GST (18%)</b></td><td><?php echo $vat1;?></td>
</tr>
<tr align="center">
<td><b>Delivery Cost</b></td><td><?php echo $delivery;?></td>
</tr>
<tr align="center">
<td><b>Total Amount</b></td><td><?php echo $totalamount;?></td>
</tr>
</table>
<p align="center"><b>NOTE:- All figures rounded</b></p>
<?php
if(!$rows == 0)
{
?>
<p align="center"><input type="button" value="Checkout" onClick="javascript:location.href='checkout.php';"></p>
<?php
}
?>
</div>
</div>
</div>
<!--Random Featured Product End-->
<!--Special Promo Banner Start-->
<div class="box-promo" id="box-promo">
<div class="box-heading-1"><span>PROMO ON FEATURED ITEMS</span></div>
<div id="banner0" class="banner">
<div style="display:block;"><img src="image/addBanner-940x145.jpg" alt="Special Offers" title="Special Offers" /></div>
</div>
</div>
<!--Special Promo Banner End-->
<!--Coming Soon Product Start-->
<!--
<div class="box-heading-1" id="soon">
<div class="box-heading-1"><span>Coming Soon</span></div>
<div id="carousel0">
<ul class="jcarousel-skin-opencart">
-->
<!--Coming Soon Product End-->
<!--Carousel Start-->
<!--
<?php
// Included configuration file in our code.
//include("comingsoon.php");
?>
</ul>
</div>
</div>
-->
<!--Carousel End-->
<!--Footer Part Start-->
<?php include("footer.php");?>
<!--Footer Part End-->
</div>
<!-- Main Div Tag End-->
<!--Flexslider Javascript Part Start-->
<?php include("flexslider.php");?>
<!--Flexslider Javascript Part End-->
</body>
</html>
Coming soon
<?php
include("includes/mysqli_connection.php");
// This first query is just to get the total count of rows
$sql = "SELECT COUNT(*) FROM jewellery WHERE type LIKE 'soon' ORDER BY id ASC";
$query = mysqli_query($db_conx, $sql);
$row = mysqli_fetch_row($query);
// Here we have the total row count
$rows = $row[0];
// This is the number of results we want displayed per page
$page_rows = 4;
// This tells us the page number of our last page
$last = ceil($rows/$page_rows);
//ADDED BY ME! Number of pages to display
$Display_Pages = 10;
// This makes sure $last cannot be less than 1
if($last < 1){
$last = 1;
}
// Establish the $pagenum variable
$pagenum = 1;
// Get pagenum from URL vars if it is present, else it is = 1
if(isset($_GET['pn'])){
$pagenum = preg_replace('#[^0-9]#', '', $_GET['pn']);
}
// This makes sure the page number isn't below 1, or more than our $last page
if ($pagenum < 1) {
$pagenum = 1;
} else if ($pagenum > $last) {
$pagenum = $last;
}
// This sets the range of rows to query for the chosen $pagenum
$limit = 'LIMIT ' .($pagenum - 1) * $page_rows .',' .$page_rows;
// This is your query again, it is for grabbing just one page worth of rows by applying $limit
//$sql = "SELECT * FROM jewellery ORDER BY id ASC $limit";
$sql = " SELECT * FROM jewellery WHERE type LIKE 'soon' ORDER BY id ASC";
$query = mysqli_query($db_conx, $sql);
// This shows the user what page they are on, and the total number of pages
$textline1 = "Jewelleries (<b>$rows</b>)";
$textline2 = "Page <b>$pagenum</b> of <b>$last</b>";
// Establish the $paginationCtrls variable
$paginationCtrls = '';
// If there is more than 1 page worth of results
if($last != 1){
/* First we check if we are on page one. If we are then we don't need a link to
the previous page or the first page so we do nothing. If we aren't then we
generate links to the first page, and to the previous page. */
if ($pagenum > 1) {
$First = $pagenum == 1;
$previous = $pagenum - 1;
$paginationCtrls .= '<a href="'.$_SERVER['PHP_SELF'].'?pn='.$First.'">First</a> ';
$paginationCtrls .= '<a href="'.$_SERVER['PHP_SELF'].'?pn='.$previous.'">Previous</a> ';
// Render clickable number links that should appear on the left of the target page number
for($i = $pagenum-$Display_Pages; $i < $pagenum; $i++){
if($i > 0){
$paginationCtrls .= '<a href="'.$_SERVER['PHP_SELF'].'?pn='.$i.'">'.$i.'</a> ';
}
}
}
// Render the target page number, but without it being a link
$paginationCtrls .= ''.$pagenum.' ';
// Render clickable number links that should appear on the right of the target page number
for($i = $pagenum+1; $i <= $last; $i++){
$paginationCtrls .= '<a href="'.$_SERVER['PHP_SELF'].'?pn='.$i.'">'.$i.'</a> ';
if($i >= $pagenum+$Display_Pages){
break;
}
}
// This does the same as above, only checking if we are on the last page, and then generating the "Next"
if ($pagenum != $last) {
$next = $pagenum + 1;
$paginationCtrls .= ' <a href="'.$_SERVER['PHP_SELF'].'?pn='.$next.'">Next</a> ';
$Last = $last;
$paginationCtrls .= '<a href="'.$_SERVER['PHP_SELF'].'?pn='.$Last.'">Last</a>';
}
}
$list = '';
$src = "Photos/";
while($row = mysqli_fetch_array($query, MYSQLI_ASSOC))
{
$id = $row["id"];
$prodname = $row["prodname"];
$path = $row["path"];
$category = $row["category"];
$price = "Rs. " . $row["price"];
$desc = $row["descr"];
$width ="95px";
$heidht = "95px";
$list .='<li><a href="'. $src . $path . '"><img src="' . $src . $path . '" width="' . $width . '" height="' . $height . '" alt="' . $src . $prodname . '"/></a></li>'; // end list here
}
// Close your database connection
mysqli_close($db_conx);
echo $list;
?>
Confirm Checkout
<?php
date_default_timezone_set("Asia/Muscat");
session_start();
if (isset($_SESSION['user_id']))
{
$userid = $_SESSION['user_id'];
}
if (isset($_SESSION['username']))
{
$User = $_SESSION['username'];
}
else
{
$User = "";
}
?>
<?php
$_SESSION['code'] = rand();
$code = $_SESSION['code'];
?>
<?php
include("includes/mysqli_connection.php");
$sql = "SELECT * FROM cart WHERE cust_id = '$userid' AND checkout = 'n'";
$query = mysqli_query($db_conx, $sql);
while($row = mysqli_fetch_array($query, MYSQLI_ASSOC))
{
$id = $row['id'];
$jewelid = $row["jewel_id"];
$qty = $row["qty"];
$userid = $row["cust_id"];
$checkout = $row['checkout'];
$added = $row['added'];
$checked = $row['checkedon'];
$trans = $row['trans'];
$today = date("Y-m-d H:i:s");
//$topsell = "UPDATE jewellery SET topsell=(topsell + 1) WHERE jewellery.id = $jewelid";
//mysqli_query($db_conx,$topsell);
$sql = "UPDATE cart SET checkout = 'y', checkedon = '$today', trans = '$code' WHERE id = '$id'";
mysqli_query($db_conx, $sql);
}
// Close your database connection
mysqli_close($db_conx);
echo "<script>alert('Thank You for Your Purchase!')</script>";
echo "<script>window.location.href='receipt.php'</script>";
?>
Confirmation
<?php
include ("includes/mysqli_connection.php");
$Fname = mysqli_real_escape_string($db_conx,$_POST['Name']);
$Lname = mysqli_real_escape_string($db_conx,$_POST['Surname']);
$Uname = mysqli_real_escape_string($db_conx,$_POST['Username']);
$Pass = mysqli_real_escape_string($db_conx,$_POST['pw1']);
$Email = mysqli_real_escape_string($db_conx,$_POST['Email']);
$Address = mysqli_real_escape_string($db_conx,$_POST['Address']);
$Tel = mysqli_real_escape_string($db_conx,$_POST['Tel']);
// This first query is just to get the total count of rows
$sql = "SELECT COUNT(*) FROM users WHERE email LIKE '$Email'";
$query = mysqli_query($db_conx, $sql);
$row = mysqli_fetch_row($query);
// Here we have the total row count
$rows = $row[0];
if($rows == 0)
{
$insertSQL = "INSERT INTO users (user_id, name, surname, username, password, email, address, tel, ac_type, user_status)
VALUES (null, '$Fname', '$Lname', '$Uname', '$Pass', '$Email', '$Address', '$Tel', 'user', 1)";
mysqli_query($db_conx, $insertSQL);
if($insertSQL)
{
echo "<script>alert('Successfully Added!')</script>";
echo "<br />Redirecting to Home Page...";
echo "<script>alert('Login on Main Page!')</script>";
if(!isset($_SESSION['username']))
{
$_SESSION['username'] = $Fname;
}
else
{
$_SESSION['username'] = "";
}
//echo "<br />Welcome: <b>" . $_SESSION['username'] . "</b><br />" ;
echo "<script>window.location.href='index-1.php'</script>";
}
else
{
echo "<script>alert('An error occured while uploading the entry to database. Please try again later.')</script>";
}
}
else
{
echo "<font color='red'>Sorry This Email address already exists!</font>";
echo "<script>alert('You will be redirected to Home Page')</script>";
echo "<script>window.location.href='index-1.php'</script>";
}
// Close your database connection
mysqli_close($db_conx);
?>
Contact
<?php
echo "<script>window.location.href='contact/a.php';</script>";
?>
Default
<?php
//echo "<script>location.href='index-1.php';</script>";
header("location:index-1.php");
?>
Delivery
<!DOCTYPE HTML>
<html>
<head>
<title>Delivery Page</title>
</head>
<body>
<h1 align="center">DELIVERY INFORMATION</h1>
<blockquote>Goods will be delivered 24hrs after payment has been received. (If available in stock)</blockquote>
<p><b>NOTE:- BB Jewellery will contact you before any delivery is made.</b></p>
<input type="button" value="Back" onClick="javascript:history.go(-1);">
</body>
</html>
Featured
<?php
session_start();
?>
<?php
// User is already logged in. Redirect them somewhere useful.
if (isset($_SESSION['username']))
{
$User = $_SESSION['username'];
}
else
{
$User = "";
}
?>
<!-- Head1 Part Start-->
<?php include("head1.html");?>
<!-- Head1 Part End-->
<!-- Top Part Start-->
<?php
if($User != "")
{
include("top_links2.php");
}
else
{
include("top_links.php");
}
?>
<!-- Top Part End-->
<!-- Main Div Tag Start-->
<div id="wrapper">
<!-- Header Part Start-->
<?php
if($User != "")
{
include("header2.php");
}
else
{
include("header.php");
}
?>
<!-- Header Part Start-->
<!-- Middle Part Start-->
<!-- Section Start-->
<?php include("section.html"); ?>
<!--Section End-->
<!--Middle Part End-->
<!--Featured Product Start-->
<div class="box mb0" id="featured">
<div class="box-heading-1"><span>Featured</span></div>
<div class="box-content-1">
<div class="box-product-1" >
<?php
include("includes/mysqli_connection.php");
// This first query is just to get the total count of rows
$sql = "SELECT COUNT(*) FROM jewellery WHERE type LIKE 'featured' ORDER BY id ASC";
$query = mysqli_query($db_conx, $sql);
$row = mysqli_fetch_row($query);
// Here we have the total row count
$rows = $row[0];
// This is the number of results we want displayed per page
$page_rows = 8;
// This tells us the page number of our last page
$last = ceil($rows/$page_rows);
//ADDED BY ME! Number of pages to display
$Display_Pages = 10;
// This makes sure $last cannot be less than 1
if($last < 1){
$last = 1;
}
// Establish the $pagenum variable
$pagenum = 1;
// Get pagenum from URL vars if it is present, else it is = 1
if(isset($_GET['pn'])){
$pagenum = preg_replace('#[^0-9]#', '', $_GET['pn']);
}
// This makes sure the page number isn't below 1, or more than our $last page
if ($pagenum < 1) {
$pagenum = 1;
} else if ($pagenum > $last) {
$pagenum = $last;
}
// This sets the range of rows to query for the chosen $pagenum
$limit = 'LIMIT ' .($pagenum - 1) * $page_rows .',' .$page_rows;
// This is your query again, it is for grabbing just one page worth of rows by applying $limit
$sql = " SELECT * FROM jewellery WHERE type LIKE 'featured' ORDER BY id ASC $limit";
$query = mysqli_query($db_conx, $sql);
// This shows the user what page they are on, and the total number of pages
$textline1 = "Jewelleries (<b>$rows</b>)";
$textline2 = "Page <b>$pagenum</b> of <b>$last</b>";
// Establish the $paginationCtrls variable
$paginationCtrls = '';
// If there is more than 1 page worth of results
if($last != 1){
/* First we check if we are on page one. If we are then we don't need a link to
the previous page or the first page so we do nothing. If we aren't then we
generate links to the first page, and to the previous page. */
if ($pagenum > 1) {
$First = $pagenum == 1;
$previous = $pagenum - 1;
$paginationCtrls .= '<a href="'.$_SERVER['PHP_SELF'].'?pn=1'.$First.'">First</a> ';
$paginationCtrls .= '<a href="'.$_SERVER['PHP_SELF'].'?pn='.$previous.'">Previous</a> ';
// Render clickable number links that should appear on the left of the target page number
for($i = $pagenum-$Display_Pages; $i < $pagenum; $i++){
if($i > 0){
$paginationCtrls .= '<a href="'.$_SERVER['PHP_SELF'].'?pn='.$i.'">'.$i.'</a> ';
}
}
}
// Render the target page number, but without it being a link
$paginationCtrls .= ''.$pagenum.' ';
// Render clickable number links that should appear on the right of the target page number
for($i = $pagenum+1; $i <= $last; $i++){
$paginationCtrls .= '<a href="'.$_SERVER['PHP_SELF'].'?pn='.$i.'">'.$i.'</a> ';
if($i >= $pagenum+$Display_Pages){
break;
}
}
// This does the same as above, only checking if we are on the last page, and then generating the "Next"
if ($pagenum != $last) {
$next = $pagenum + 1;
$paginationCtrls .= ' <a href="'.$_SERVER['PHP_SELF'].'?pn='.$next.'">Next</a> ';
$Last = $last;
$paginationCtrls .= '<a href="'.$_SERVER['PHP_SELF'].'?pn='.$Last.'">Last</a>';
}
}
$list = '';
$src = "Photos/";
if(!isset($_SESSION['username']))
{
while($row = mysqli_fetch_array($query, MYSQLI_ASSOC))
{
$id = $row["id"];
$prodname = $row["prodname"];
$path = $row["path"];
$category = $row["category"];
$price = "Rs. " . $row["price"];
$desc = $row["descr"];
$width="150px";
$height="150px";
$list .='
<div>
<div class="image"><a href="' . $src . $path . '"><img width="' . $width . '" height="' . $height . '" src="' . $src . $path . '" alt = "' . $prodname . '"></a></div>';
$list .='
<div class="proName">
<div class="name"><a href="' . $src . $path . '">' . $desc . '</a></div>
<div class="price">' . $price . '</div>
<div class="cart">
<label class="btn">';
//$list .='<form method="post" action="view.php"><input type="hidden" name="txtid" value="'.$id.'"><input type="submit" value="Add to Cart" class="button"/></form>';
$list .='
</label>
</div>
</div>
</div>
'; // end list here
}
}
else
{
while($row = mysqli_fetch_array($query, MYSQLI_ASSOC))
{
$id = $row["id"];
$prodname = $row["prodname"];
$path = $row["path"];
$category = $row["category"];
$price = "Rs. " . $row["price"];
$desc = $row["descr"];
$width="150px";
$height="150px";
$list .='
<div>
<div class="image"><a href="' . $src . $path . '"><img width="' . $width . '" height="' . $height . '" src="' . $src . $path . '" alt = "' . $prodname . '"></a></div>';
$list .='
<div class="proName">
<div class="name"><a href="' . $src . $path . '">' . $desc . '</a></div>
<div class="price">' . $price . '</div>
<div class="cart">
<label class="btn">';
$list .='<form method="post" action="view.php"><input type="hidden" name="txtid" value="'.$id.'"><input type="submit" value="Add to Cart" class="button"/></form>';
$list .='
</label>
</div>
</div>
</div>
'; // end list here
}
}
// Close your database connection
mysqli_close($db_conx);
if($rows == 0)
{
echo "<h2 align='center'>Nothing to display</h2>";
}
else
{
echo "<blockquote><h2>" . $textline1 . " Paged</h2></blockquote>";
echo "<blockquote><p>" . $textline2 . "</p></blockquote>";
echo $list;
echo "<p align='center'>" . $paginationCtrls . "</p>";
}
?>
</div>
</div>
</div>
<!--Featured Product End-->
<!--Special Promo Banner Start-->
<div class="box-promo" id="box-promo">
<div class="box-heading-1"><span>PROMO ON FEATURED ITEMS</span></div>
<div id="banner0" class="banner">
<div style="display:block;"><img src="image/addBanner-940x145.jpg" alt="Special Offers" title="Special Offers" /></div>
</div>
</div>
<!--Special Promo Banner End-->
<!--Footer Part Start-->
<?php include("footer.php");?>
<!--Footer Part End-->
</div>
<!-- Main Div Tag End-->
<!--Flexslider Javascript Part Start-->
<?php include("flexslider.php");?>
<!--Flexslider Javascript Part End-->
</body>
</html>
Flexslider
<link rel="stylesheet" type="text/css" href="css/flexslider.css" />
<!-- JS Part Start-->
<script type="text/javascript" src="js/jquery-1.7.1.min.js"></script>
<script type="text/javascript" src="js/html5.js"></script>
<script type="text/javascript" src="js/tabs.js"></script>
<script type="text/javascript" src="js/jquery.flexslider-min.js"></script>
<script type="text/javascript" src="js/jquery.jcarousel.min.js"></script>
<script type="text/javascript" src="js/jquery.fancybox.pack.js"></script>
<script type="text/javascript" src="js/custom.js"></script>
<script type="text/javascript">
$(window).load(function() {
$('.flexslider').flexslider();
});
</script>
<!-- JS Part End-->
Footer
<!--Footer Part Start-->
<footer id="footerWrapper" class="clear">
<!--Custom Column Start-->
<div id="footer">
<div class="column">
<h3>Information</h3>
<ul>
<li><a href="about.php">About Us</a></li>
<li><a href="delivery.html">Delivery Information</a></li>
<li><a href="terms.html" target="_parent">Terms & Conditions</a></li>
</ul>
</div>
<div class="column">
<h3>Contact Info</h3>
<ul>
<li><a href="contact.php"><img src="image/mail.png" width="14px" height="14px">Contact Us</a></li>
<li><img src="image/phone.png" width="14px" height="14px">8505913041</li>
<li><a href="#" onmouseover="showAddress();" onmouseout="hideAddress();">Address</a></li>
</ul>
<div id="AddressDiv" class="AddressDiv">
<p><b>NIT ,Shop no. 1042,</b></p>
<p><b>Faridabad</b></p>
<p><b>Haryana 121001</b></p>
</div>
</div>
<div class="column">
<h3>Extras</h3>
<ul>
<li onclick="showPromo();" onmouseover="hidePromo();">Special Promo</a></li>
</ul>
</div>
<div class="column">
<h3>History</h3>
<ul>
<li><a href="viewpurchase.php">Order</a></li>
</ul>
</div>
</div>
<!--Custom Column End-->
<div class="powered-main">
<div id="powered"> Designed By <a href=mailto:"
[email protected]">Preeti Singh</a>
<div class="fr">Copyright <a href="default.php">BB Jewellery</a> Your Online Store © <?php /*$date = date("l, d F, Y");*/echo date("Y") ?></div>
<div id="back-top" class="back-to-top"><a class="backtotop" href="javascript:void(0)" title="Back to Top"></a></div>
</div>
</div>
</footer>
<!--Footer Part End-->
Head
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>BB Jewellery Online Store</title>
<meta name="HandheldFriendly" content="True" />
<meta name="MobileOptimized" content="320" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta name="description" content="BB Jewellery Online Store" />
<!-- CSS Part Start-->
<link href="image/favicon.png" rel="icon" />
<link rel="stylesheet" class="theme" type="text/css" href="css/stylesheet.css" />
<link rel="stylesheet" type="text/css" href="css/flexslider.css" />
<link rel="stylesheet" type="text/css" href="css/carousel.css" />
<style>
.LoginDiv{
background:#dee;
display:inline;/*IE6*/
float:left;
height:200px;
position:absolute;
width:24%;/*can be % px auto*/
z-index:10000;
display:none;/*IE6*/
border:1px solid #999;
border-radius:5px;
margin-left:75%;
}
.SearchDiv{
background:#dee;
display:inline;/*IE6*/
float:left;
height:200px;
position:absolute;
width:30%;/*can be % px auto*/
z-index:5;
display:none;/*IE6*/
border:1px solid #999;
border-radius:5px;
margin-left:10%;
text-align:center;
top: 1px;
left: 1px;
}
.AddressDiv{
background:#dee;
position:absolute;
text-align:center;
border:1px solid #999;
border-radius:5px;
height:10%;
width:10%;
display:none;/*IE6*/
margin-left:5%;
}
.box-promo{
display:none;/*IE6*/
}
</style>
<!-- CSS Part End-->
<script language="javascript">
function showLogin()
{
$('#loginDiv').show(500);
$('#loginDiv').load('login.php');
}
function showSearch()
{
$('#SearchDiv').show(100);
$('#SearchDiv').load('search.php');
}
function showAddress()
{
$('#AddressDiv').show(100);
//$('#AddressDiv').load('login.php');
}
function hideAddress()
{
$('#AddressDiv').hide(0);
}
function showPromo()
{
$('#box-promo').show(800);
}
function hidePromo()
{
$('#box-promo').hide(300);
}
</script>
</head>
<body>
<!-- Color Option Part Start-->
<div class="clbox">
<a class="toggle">Toggle</a>
<h2>Color</h2>
<ul id="changer">
<li><a href="#" class="col-1" rel="css/stylesheet.css"></a></li>
<li><a href="#" class="col-2" rel="css/stylesheet-1.css"></a></li>
<li><a href="#" class="col-3" rel="css/stylesheet-2.css"></a></li>
<li><a href="#" class="col-4" rel="css/stylesheet-3.css"></a></li>
<li><a href="#" class="col-5" rel="css/stylesheet-4.css"></a></li>
</ul>
</div>
<!-- Color Option Part End-->
Header
<header id="headerWrapper">
<div id="header">
<div id="logo">
<a href="index-1.php"><img src="image/jewelleryshop.jpg" title="BB Jewellery Logo" alt="Our Logo" /></a>';
</div>
<div id="welcome">Welcome visitor <a href="#" onClick="showLogin();">Login</a> or <a href="register.html">Sign Up</a> <a href="admin/loginadmin.php">Admin</a>. </div>
<div id="loginDiv" class="LoginDiv">
</div>
</div>
<!-- Main Navigation Start-->
<?php include("navigation.php");?>
<!-- Main Navigation End-->
<div id="SearchDiv" class="SearchDiv">
</div>
</header>
Header2
<?php
if (isset($_SESSION['user_id']))
{
$userid = $_SESSION['user_id'];
}
if (isset($_SESSION['username']))
{
$User = $_SESSION['username'];
}
else
{
$User = "";
}
?>
<?php
include("includes/mysqli_connection.php");
$sql = "SELECT COUNT(*) FROM cart WHERE cust_id = $userid AND checkout = 'n'";
$query = (mysqli_query($db_conx,$sql));
$row = mysqli_fetch_row($query);
// Here we have the total row count
$rows = $row[0];
$countrows = $rows;
$totalquantity = 0;
$subtotal = 0;
$totalamount = 0;
$vat = 0.18;
$delivery = 500;
$selectproducts = "SELECT * FROM cart , jewellery WHERE cart.cust_id = $userid AND jewellery.id = cart.jewel_id AND checkout = 'n'";
$query = mysqli_query($db_conx, $selectproducts);
for($loop = 0; $loop < $countrows; $loop++)
{
while($row = mysqli_fetch_array($query, MYSQLI_ASSOC))
{
$jewelid = $row["jewel_id"];
$qty = $row["qty"];
$userid = $row["cust_id"];
$checkout = $row["checkout"];
$prodname = $row["prodname"];
$path = $row["path"];
$category = $row["category"];
$price = $row["price"];
$desc = $row["descr"];
$width="150px";
$height="150px";
$amount = ($qty * $price);
$amount = round($amount);
if (round($amount*10) == $amount*10 && round($amount)!=$amount) $amount = "$amount"."0"; //to avoid prices like 17.5 - write 17.50 instead
{
if (round($amount) == $amount) //add .00
{
$amount = "$amount".".00";
}
}
$totalquantity = $totalquantity + $qty;
$subtotal = $subtotal + $amount;
$vat = round(0.18 * $subtotal);
$totalamount = ($subtotal + $vat + $delivery);
}
}
?>
<!-- Header Part Start-->
<header id="headerWrapper">
<div id="header">
<div id="logo">
<a href="index-1.php"><img src="image/logo.png" title="BB Jewellery Logo" alt="Our Logo" /></a>
</div>
<!-- Mini Cart Start-->
<div id="cart">
<div class="heading"><a href="cart.php"><span id="cart-total"><?php echo $countrows;?> item(s) - Rs <?php echo $totalamount;?></span></a></div>
</div>
<!-- Mini Cart End-->
<?php
// Display Username
echo '<div id="welcome"> Welcome <b>' . $User . '</b> || <a href="logout.php">Log Out</a></div>';
?>
</div>
<!-- Main Navigation Start-->
<?php include("navigation.php");?>
<!-- Main Navigation End-->
<div id="SearchDiv" class="SearchDiv">
</div>
</header>
<!-- Header Part End-->
CHAPTER-6
6. SUMMARY AND CONCLUSIONS
6.1 Summary:
Online Jewellery Shopping is the norm these days. There are lot of successful websites such as bluestone.com mirraaw.com etc in this space. Purpose of Online Jewellery Shopping system is to allow customer to shop virtually using internet. Computerization of online store will increase the ease, efficiency and reduce the chances of manual errors. With the popularity of PCs, and mobiles easy access to Internet and World Wide Web (WWW), Internet is increasingly used by consumers &vendors as a channel for shopping, payment & other operations.
The system will ease the shopping operations for customer of online store. It will provide vendor or administration functionality to manage categories and products. Consumer will be able to browse and search products under different categories. Selected products or items selected for purchase would be added into the virtual shopping cart. Which can be managed separately by customer. It can be examined at any time by customer for selected products, their quantity & price.
6.2 Limitations of the System:
6.2.1 Relatively large amounts paid in advance:
This is one matter with roots in the psychological background of most of us and it takes time to override it. The modus operandi of small scale trade for millennia is to immediately get what you paid for. In jewellery language: you put the ring on your finger, you pay for it and keep it there.
6.2.2 Security of payment and shipping:
The security of your payment is a serious issue and you have to make sure it is properly dealt with by checking the security policy of the jewellery merchant. In many cases though, the merchant is as exposed to fraud, as the customer and even more, since he have to ship an expensive jewellery before the payment is cleared. The customer have 3 to 7 days window to cancel the payment, while the shipping is irreversible.
6.2.3 Impossibility to examine and try on:
A major disadvantage, since very few pieces of jewellery fits well everybody. The touch of the polished gold or the glitter of a real diamond is impossible to simulate fully on the web page and thus, lives space for misconception. However this is promptly addressed with the implementation of proper return policy. A good return policy is one which provides a 30 day money back guarantee or possibly longer.
6.2.4 Overchoice:
The advantage of massive and diverse choice in overdose turns into disadvantage. If you write "diamond ring" in your browser you will get approximately 8 million entries. Not all of them are jewellery merchants but a good deal are, besides how could one know.
6.2.5 Impatience and Conservatism:
These personal qualities of some customers, are big disadvantage to the online jewelry shopping and unfortunately there is no viable strategy to deal with them. My only advice to the customer in doubt is: Give it a chance. It may turn the hassle and hesitation into a pleasurable and exciting experience.
6.3 Improvements:
6.3.1 Massive choice:
This particular point is one of the biggest advantages of online jewellery shopping and at the same time a disadvantage too. On the other hand choice and diversity means that you will find what you are looking for, even if you are not very certain what exactly it is and you will find it at the best possible price, which brings us to the next point.
6.3.2 Competitive prices:
Yes, it is logical for the prices to be more competitive online, exactly because of the massive choice. The convenience of being the only jeweller in town is replaced online, by the alternative of being a jewellery shop in enormous "jewellery only" shopping mall with thousands of jewellery shops next to each other, selling similar merchandise. The online jewellery retail stores are ran on very low cost, enabling the merchants to significantly narrow their markup margins and still make reasonable profit.
6.3.3 Information:
Any information about jewellery, diamonds and precious stones is widely available on the net and you don't need particular computer skills or a lot of time to obtain it. Armed with knowledge and ability to compare value for money at the click of the mouse the online customer is not to be taken for granted. Today's jewellers, whether they like it or not, will face educated customers, longing for the best value for their hard earned cash.
6.3.4 Time saving:
This advantage of online jewellery shopping is very obvious. The time necessary to visit an online jeweller, looking for particular piece is an average of 6 minutes if you are using the assistance of JewelGateway and about 20 minutes otherwise, considering the search and checking the sometime surprisingly well positioned irrelevant hits. The time to visit a conventional jewellery shop depends on many factors, but it will suffice to say that it is not in the comparable margins
6.3.5 Convenience:
Very much connected to the time topic but there is more. I would like to mention, time taken from work, time taken on weekend (depending on the jeweller's trading hours), making an appointment (and stick to it), driving to and from, looking for parking etc. After all this effort the inventory you will be seeing will be limited in comparison to your online choice. The guidance and advice you will be given will be sale orientated and in most cases not 100% objective.
6.4 Conclusion:
While developing the system a conscious effort has been made to create and Develop a software package, making use of available tools, techniques and resources – that would generate a proper System While making the system, an eye has been kept on making it as user-friendly, as cost-effective and as flexible as possible. As such, one may hope that the system will be acceptable to any user and will adequately meet his/her needs. As in case of any system development processes where there are a number of shortcomings, there have been some shortcomings in the development of this system also. The project is still under modification.
6.5 Future Scope:
FUTURE SCOPE OF APPLICATION :
This application can be easily implemented under various situations. We can add new features as and when we require. Reusability is possible as and when require in this application. There is flexibility in all the modules.
SOFTWARE SCOPE:
Extensibility: This software is extendable in ways that its original developers may not expect. The following principles enhances extensibility like hide data structure, avoid traversing multiple links or methods, avoid case statements on object type and distinguish public and private operations.
Reusability: Reusability is possible as and when require in this application. We can update it next version. Reusable software reduces design, coding and testing cost by amortizing effort over several designs. Reducing the amount of code also simplifies understanding, which increases the likelihood that the code is correct. We follow up both types of reusability: Sharing of newly written code within a project and reuse of previously written code on new project
Understandability: A method is understandable if someone other than the creator of the method can understand the code (as well as the creator after a time lapse). We use the method, which small and coherent helps to accomplish this.
Cost-effectiveness: Its cost is under the budget and make within given time period. It is desirable to aim for a system with a minimum cost subject to the condition that it must satisfy the entire requirement.
Scope of this document is to put down the requirements, clearly identifying the information needed by the user, the source of the information and outputs expected from the system.
REFRENCES
https://www.w3school.com
https://www.mysqltutorils.com
https://www.leranphp.com
https://www.youtube.com
https://nextdimensiontechnology.com
APPENDIX
DFD: A data flow diagram is graphical technique that depicts information flow and transforms that are applied as data move from input to output. The DFD is also known as Data Flow Graph or Bubble Chart. The DFD is used to represent increasing information flow and functional details. Also DFD can be states the starting point of the design phase that can functionally decomposes the requirement specification down to the lowest level of detail. Data flow diagram also shows how particular system will perform the flow of work and how each form are related to each other.
Component of Data Flow Diagram
There are four symbols that are used in the drawing of the data flow diagrams
Entities
External entities represent the source of data that enter the system or the recipients of the data that leave the system
Process
Processes represent the activities in which data is manipulated by being stored or retrieved or transformed in some way. A circle represents it. The process will show the data transformation and change.
Database
Database represent the storage of data within the system
Data Flow
A dataflow shows a flow of information from its source to its destination. A line represent the data flow, with arrow heads showing the direction of flow.
CFD: Context free diagram that represents the actors outside the system OR A context diagram is top level (also known as level as Level 0) data flow diagram. It only control only one process mode (process 0) that generalizes the function of the entire system in relationship to the external entities.
MODULAR DIAGRAM
Modular diagram are used to show the allocation of classes and objects to modules in the physical design of the system that in modules diagram indicate the partitioning of the system architecture.
Through these diagrams it is possible to understand the general physical architecture of the system. The two essential elements of the module diagram are their modules and their dependencies.
FLOWCHART
A flow chart is type of diagram that represents the algorithm, workflow or process, showing the steps of boxes of various kinds, and their order by connecting them with arrows. This diagrammatic representation illustrates a solution to a given problem. Flowcharts are used in analysing, designing, documenting or managing a process or program of various fields. The flowchart shows the flow of information within the project.
Start and end symbols
Represented as circles, ovals or rounded (fillet) rectangles, usually containing a word “Start” or “End”, or another phrase signaling the start and end of a process, such as “submit product” or “receive product”.
Arrows
Showing “flow of control”. An arrow coming from one symbol and ending at another symbol represents the control passes to the symbol the arrow points to. The line for the arrow can be solid or dashed. The meaning of the arrow with dash line may differ from one flowchart to another and can e defined in the legend.
Generic processing steps
Represented as rectangles. Examples: “Add 1 to X”; “replace defined part”; “save changes” or similar.
Subroutines
Represented as rectangles with double-struck vertical edges; these are used to show complex processing steps which may be defined in a separate flowchart. Examples: PROCESS-FILES. One subroutine may have multiple distinct entry points or exit flows; if so, these are shown as labelled ‘wells’ in the rectangle, and control arrows connect to these ‘wells’.
Input/ Output
Represented as parallelogram. Examples: Get X from the user, display X.
Peter chen developed ERDs in 1976. Since then Charles Bachman and Jason Martin have added some slight refinement to the ERD principles
Entities, which are represented by rectangles. An entity is an object or concept about which you want to store information.
A weak entity is an entity that must defined by a foreign key relationship with another entity as it cannot be uniquely identified by its own attributes alone.
Actions
Which are represented by diamond shapes, show how two entities share information in the database.
In some cases, entities can be self-linked. For example, employees can supervise other employees.
Attributes
Which are represented by ovals. A key attribute is the unique, distinguishing characteristic of the entity. For example, an employee's social security number might be the employee's key attribute.
A multivalued attribute can have more than one value. For example, an employee entity can have multiple skill values.
A derived attribute is based on another attribute. For example, an employee's monthly salary is based on the employee's annual salary.
Connecting lines
Solid lines that connect attributes to show the relationships of entities in the diagram.
Cardinality:
Specifies how many instances of an entity relate to one instance of another entity. Ordinality is also closely linked to cardinality. While cardinality specifies the occurrences of a relationship, Ordinality describes the relationship as either mandatory or optional. In other words, cardinality specifies the maximum number of relationships and ordinal specifies the absolute minimum number of relationships.
136