- Admin
- display users
- remove users
- change user data: name, email, role(admin, employee, user)
- add new user (name, email, role)
- Employee
- display seedlings
- remove seedlings
- change seedling data: name, description, price, quantity
- add new seedling data: name, description, price, quantity
- display orders
- set order as sent + send email notification
- User (default)
- display seedlings
- place order (select seedlings, set quantity per seedling)
- payment using PayPal
- display orders
- display ready orders
Users table
CREATE TABLE `users` (
`id` int(10) UNSIGNED NOT NULL,
`name` varchar(50) NOT NULL,
`role` set('user','admin','employee') NOT NULL DEFAULT 'user',
`email` varchar(100) NOT NULL,
`pass` varchar(100) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
Seedlings table
CREATE TABLE `seedlings` (
`id` int(10) UNSIGNED NOT NULL,
`name` varchar(100) NOT NULL,
`price` decimal(10,2) NOT NULL,
`description` varchar(255) DEFAULT NULL,
`quantity` int(10) UNSIGNED DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
Orders table
CREATE TABLE `orders` (
`id` int(10) UNSIGNED NOT NULL,
`seedling_id` int(10) UNSIGNED NOT NULL,
`order_quantity` int(11) NOT NULL,
`created_at` datetime NOT NULL,
`status` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
Payments table
CREATE TABLE `payment` (
`id` int(10) UNSIGNED NOT NULL,
`user` varchar(255) NOT NULL,
`full_price` float NOT NULL,
`created_at` datetime NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
- passwords encrypted using argon
- user data sending by sessions
- after successful purchase data are insert into database
- payment realised using PayPal and sandbox account
- email notification realised by PHPMailer
- MySQL is used for database
Create directory and files in root directory (where are files ex. index.php and README.md):
โโโโcredentials
โ โโโโdb-login.php
โ โโโโemail-login.php
โโโโpaypal
โ โโโโclient-id.php
db-login.php
<?php
$login = ''; // your db login
$pass = ''; // your db password
?>
email-login.php
<?php
$email = ''; // your email
$pass = ''; // your email password
?>
client-id.php
<?php
$clientId = ''; // your paypal client id
?>