Sei sulla pagina 1di 8

Freshersworld Assignment

Assignment is all about a secure Product Management System.

Technology to be used
1. Programming Language – PHP and Javascript
2. Database – Mysql

Instruction and supporting data

1. All operations should be password protected


2. Fields in forms are mandatory and validation to be done
3. Database table schema provided at the end of document
4. Sample Data also provided
5. Use provided table and data to build this application
6. Sample design for each page is being provided in the pictures below,
please use the same design layout for all the pages
7. The coding standards like naming convention, query optimization,
database design should be maintained.
8. For all these pages design of html should be clean.

This application has three pages


1. Login page
2. Product Store listing page
3. Add/Edit product page

1
Login page
First user has to enter his username and password to access product add and
product display page.
• Create a login form and use the table and data provided at the end of this
document.
• Add Validation for Username and Password.
• After successful login user should be automatically redirected to Products
Listing Page (Screen 2).
• Design for the login page on Screen1

Screen 1:

2
Product Store listing page
• This page will list all the products from all product categories and all sub-
categories.
• On click of any product name the product image should open as a popup.
• Operation column has two things Edit and Delete actions, which a user
can take for any product in the listing page by clicking on the icon Edit

and Delete
• Edit action should take to Edit Page (Screen 4)
• Delete action prompt confirmation message asking” Do you want to
delete: Yes or No”
• To delete multiple products in one action use Check All/Uncheck All then
select from drop down menu Delete like any mailbox.

• Pagination required like . Each page would display


maximum of 8 products.

Screen : 2

3
• From the menu user can go to add products page.

Add/Edit product page


• Add page should be like on screen 3.
• All fields are mandatory so add validation for all fields.
• Data for the drop down menu will come from database table Product
category and Product Sub-Category. The data is also provided in the end
of this document. Their category and sub category is coming from the
database and both are relative. For example If user select a category of
electronics goods then all the sub categories of electronic good should be
fetched from database and populated in the subcategory field.
• While a user uploads a product picture (For this the file extension should
be checked and file name should be same as the product id when saving
in the server).

Screen :3

4
• Edit product will be like screen 4.
• By default all the data should be filled in the form fields for the selected
product.

Screen:4

• After logout the user should to be taken to login page.


• He should not be able to view product pages without login in.

5
Database for this Application:
--
-- Database: `products`
--

-- --------------------------------------------------------

--
-- Table structure for table `admin`
--

CREATE TABLE IF NOT EXISTS `admin` (


`id` int(11) NOT NULL auto_increment,
`username` varchar(20) NOT NULL,
`password` varchar(20) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `username` (`username`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;

--
-- Dumping data for table `admin`
--

INSERT INTO `admin` (`id`, `username`, `password`) VALUES


(1, 'admin', 'admin');

-- --------------------------------------------------------

--
-- Table structure for table `category`
--

CREATE TABLE IF NOT EXISTS `category` (


`cat_id` int(11) NOT NULL auto_increment,
`cat_name` varchar(80) NOT NULL,
PRIMARY KEY (`cat_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=5 ;

--
-- Dumping data for table `category`

6
--

INSERT INTO `category` (`cat_id`, `cat_name`) VALUES


(1, 'Electronics Goods'),
(2, 'Household Items'),
(3, 'Books'),
(4, 'Furnitures');

-- --------------------------------------------------------

--
-- Table structure for table `products`
--

CREATE TABLE IF NOT EXISTS `products` (


`product_id` int(11) NOT NULL auto_increment,
`product_name` varchar(150) NOT NULL,
`subcat_id` int(11) NOT NULL,
`price` varchar(20) NOT NULL,
`description` text NOT NULL,
`product_image` varchar(200) NOT NULL,
`uploaded_date` varchar(50) NOT NULL,
PRIMARY KEY (`product_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

--
-- Table structure for table `subcategory`
--

CREATE TABLE IF NOT EXISTS `subcategory` (


`subcat_id` int(11) NOT NULL auto_increment,
`cat_id` int(11) NOT NULL,
`subcat_name` varchar(80) NOT NULL,
PRIMARY KEY (`subcat_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=11 ;

--
-- Dumping data for table `subcategory`
--

7
INSERT INTO `subcategory` (`subcat_id`, `cat_id`, `subcat_name`) VALUES
(1, 1, 'Laptops'),
(2, 1, 'Computers'),
(3, 1, 'Television'),
(4, 2, 'Interior Decoration items'),
(5, 2, 'Gas Oven'),
(6, 3, 'Story Books'),
(7, 3, 'Cartoons'),
(8, 3, 'Technology'),
(9, 4, 'Tables'),
(10, 4, 'Chairs');

Potrebbero piacerti anche