├── .gitignore
├── .htaccess
├── app
├── .htaccess
├── bootstrap.php
├── config
│ └── config.php
├── controller
│ ├── Admins.php
│ ├── Carts.php
│ ├── Categories.php
│ ├── Home.php
│ ├── Manufactures.php
│ ├── Orders.php
│ ├── Pages.php
│ ├── Products.php
│ └── Users.php
├── helpers
│ ├── auth.php
│ ├── csrf.php
│ ├── email.php
│ ├── errors.php
│ ├── redirect.php
│ └── session.php
├── libs
│ ├── Controller.php
│ ├── Core.php
│ └── Database.php
├── models
│ ├── Admin.php
│ ├── Cart.php
│ ├── Category.php
│ ├── Manufacture.php
│ ├── Order.php
│ ├── Product.php
│ └── User.php
└── views
│ ├── admins
│ ├── dashboard.php
│ └── login.php
│ ├── categories
│ ├── add.php
│ ├── all.php
│ ├── edit.php
│ ├── search.php
│ └── show.php
│ ├── front
│ ├── ProCategory.php
│ ├── ProManufacture.php
│ ├── cart.php
│ ├── details.php
│ ├── index.php
│ ├── orders.php
│ └── thank.php
│ ├── inc
│ ├── adminFooter.php
│ ├── adminHeader.php
│ ├── footer.php
│ ├── header.php
│ ├── messages.php
│ ├── sidebar.php
│ └── slider.php
│ ├── manufactures
│ ├── add.php
│ ├── all.php
│ ├── edit.php
│ ├── search.php
│ └── show.php
│ ├── orders
│ ├── all.php
│ ├── edit.php
│ └── show.php
│ ├── pages
│ ├── about.php
│ └── index.php
│ ├── products
│ ├── add.php
│ ├── all.php
│ ├── edit.php
│ ├── search.php
│ └── show.php
│ └── users
│ ├── avatar.php
│ ├── confirm.php
│ ├── edit.php
│ ├── forgotPassword.php
│ ├── login.php
│ ├── profile.php
│ ├── register.php
│ └── resetPassword.php
├── composer.json
├── composer.lock
├── html.html
├── market.sql
└── public
├── .htaccess
├── css
├── bootstrap.min.css
├── css.css
├── dropzone.min.css
├── font-awesome.css
├── fonts
│ ├── FontAwesome.otf
│ ├── font-awesome.min.css
│ ├── fontawesome-webfont.eot
│ ├── fontawesome-webfont.svg
│ ├── fontawesome-webfont.ttf
│ ├── fontawesome-webfont.woff
│ ├── fontawesome-webfont.woff2
│ ├── glyphicons-halflings-regular.eot
│ ├── glyphicons-halflings-regular.svg
│ ├── glyphicons-halflings-regular.ttf
│ ├── glyphicons-halflings-regular.woff
│ └── glyphicons-halflings-regular.woff2
└── jquery.fancybox.min.css
├── dist
├── jquery.fancybox.css
├── jquery.fancybox.js
├── jquery.fancybox.min.css
└── jquery.fancybox.min.js
├── docs
└── index.html
├── index.php
├── js
├── bootstrap.min.js
├── dropzone.min.js
├── jquery.fancybox.min.js
├── jquery.min.js
└── js.js
├── not.php
└── uploads
├── 1
├── phonex1560246238.jpg
├── phonexplus1560246238.jpg
├── samsung galaxy s61560246239.jpg
├── samsung galaxy s71560246239.jpg
├── samsung galaxy s81560246239.jpg
└── samsung galaxy s91560246239.jpg
├── 2
├── phone6plus1556449582.jpg
├── phone7plus1556449582.jpg
├── phone8plus1556449584.jpg
├── phonex1556449584.jpg
├── phonexplus1556449585.jpg
├── samsung galaxy s61556449585.jpg
├── samsung galaxy s71556449585.jpg
├── samsung galaxy s81556449585.jpg
└── samsung galaxy s91556449585.jpg
├── 031560246033.png
├── dress21556533376.jpg
├── dress61556545324.jpg
├── hima1556463721.jpg
├── hima1556469787.jpg
├── hima1558167663.jpg
├── laptop21556545482.png
├── samsung galaxy s91556448987.jpg
├── samsung galaxy s91556449490.jpg
├── samsung galaxy s91560246211.jpg
└── t-shirt41556545428.jpg
/.gitignore:
--------------------------------------------------------------------------------
1 | log.txt
2 | /vendor
--------------------------------------------------------------------------------
/.htaccess:
--------------------------------------------------------------------------------
1 |
2 | RewriteEngine on
3 | RewriteRule ^$ public/ [L]
4 | RewriteRule (.*) public/$1 [L]
5 |
6 |
--------------------------------------------------------------------------------
/app/.htaccess:
--------------------------------------------------------------------------------
1 | Options -Indexes
--------------------------------------------------------------------------------
/app/bootstrap.php:
--------------------------------------------------------------------------------
1 | >>>>>>>>>>>>>>>>>>>*/
6 | #<---> construct <--->#
7 | /*<<<<<<<<<<<<<<<<<<<<*/
8 | private $adminModel;
9 | private $vkey ;
10 | public function __construct(){
11 |
12 |
13 | $this->adminModel = $this->model('Admin');
14 | }
15 |
16 |
17 | /*>>>>>>>>>>>>>>>>>>>>*/
18 | #<---> login <--->#
19 | /*<<<<<<<<<<<<<<<<<<<<*/
20 | public function login(){
21 | $data['title1'] = 'Admin Login';
22 | Auth::adminGuest();
23 | if($_SERVER['REQUEST_METHOD']=='POST' && $_POST['login']){
24 | Csrf::CsrfToken();
25 | $email = $_POST['email'];
26 | $password = $_POST['password'];
27 |
28 | if (empty($email)) {
29 | $data['errEmail'] = 'Email Must Has Value.';
30 | }elseif (!filter_var($email,FILTER_VALIDATE_EMAIL)) {
31 | $data['errEmail'] = 'Enter Valid Email';
32 | }elseif($this->adminModel->findUserByEmail($email) == false){
33 | $data['errEmail'] = 'This Email Is Not Exist';
34 | }
35 |
36 | if (empty($password)) {
37 | $data['errPassword'] = "Password Must Has Value.";
38 | }
39 |
40 | if(empty($data['errEmail']) && empty($data['errPassword'])){
41 | $admin = $this->adminModel->login($email,$password);
42 | if($admin){
43 |
44 | Session::set('admin_name',$admin->full_name);
45 | Session::set('admin_id',$admin->user_id);
46 | Redirect::to('admins/dashboard');
47 | }else {
48 | $data['errPassword'] = "Password Not Valid OR not admin";
49 | $this->view('admins.login', $data);
50 | }
51 | }else{
52 | $this->view('admins.login', $data);
53 |
54 | }
55 |
56 | }else {
57 | $this->view('admins.login',$data);
58 | }
59 | }
60 |
61 |
62 |
63 | /*>>>>>>>>>>>>>>>>>>>>*/
64 | #<---> logout <--->#
65 | /*<<<<<<<<<<<<<<<<<<<<*/
66 | public function logout(){
67 | Auth::adminAuth();
68 | Session::clear('admin_name');
69 | Session::destroy();
70 | Redirect::to('admins/login');
71 | }
72 |
73 |
74 | /*>>>>>>>>>>>>>>>>>>>>*/
75 | #<---> dashboard <--->#
76 | /*<<<<<<<<<<<<<<<<<<<<*/
77 | public function dashboard(){
78 | Auth::adminAuth();
79 | $data['title1'] = 'Dashboard';
80 | $arrayName = explode(' ', Session::name('admin_name'));
81 | $data['admin_name'] = $arrayName[0];
82 | $this->view('admins.dashboard', $data);
83 | }
84 |
85 |
86 | }
87 |
--------------------------------------------------------------------------------
/app/controller/Carts.php:
--------------------------------------------------------------------------------
1 | cartModel = $this->model('Cart');
9 | $this->orderModel = $this->model('Order');
10 | }
11 |
12 |
13 |
14 |
15 | /*>>>>>>>>>>>>>>>>>>>>*/
16 | #<---> index <--->#
17 | /*<<<<<<<<<<<<<<<<<<<<*/
18 | public function index(){
19 | Auth::userAuth();
20 | $data['title1'] = 'Cart';
21 | $cartItems = 0;
22 | $data['cart'] = $this->cartModel->getAllCart();
23 | if($data['cart']){
24 | foreach ($data['cart'] as $cart) {
25 | $cartItems = $cartItems + $cart->qty;
26 | }
27 | }else {
28 | $cartItems = 0;
29 | }
30 | Session::set('user_cart', $cartItems );
31 | $this->view('front.cart',$data);
32 | }
33 |
34 |
35 | /*>>>>>>>>>>>>>>>>>>>>*/
36 | #<---> Thank <--->#
37 | /*<<<<<<<<<<<<<<<<<<<<*/
38 | public function thank(){
39 | Auth::userAuth();
40 | $data['title1'] = 'Thank You';
41 | $data['title2'] = 'Transaction Done';
42 | $this->view('front.thank',$data);
43 | }
44 |
45 |
46 | /*>>>>>>>>>>>>>>>>>>>>*/
47 | #<---> orders <--->#
48 | /*<<<<<<<<<<<<<<<<<<<<*/
49 | public function orders(){
50 | Auth::userAuth();
51 | $data['title1'] = 'Orders';
52 | $data['orderDetails'] = $this->orderModel->getUserOrderDetalails(Session::name('user_id'));
53 | $this->view('front.orders',$data);
54 | }
55 |
56 |
57 | /*>>>>>>>>>>>>>>>>>>>>*/
58 | #<---> add to cart<--->#
59 | /*<<<<<<<<<<<<<<<<<<<<*/
60 | public function add($pro_id,$price){
61 | Auth::userAuth();
62 | $user_id = Session::name('user_id');
63 | if($this->cartModel->findCartPro($pro_id,$user_id) > 0){
64 | $this->cartModel->addOne($pro_id,$user_id);
65 | Redirect::to('carts');
66 | }else{
67 | $this->cartModel->addnew($pro_id,$user_id,$price);
68 | Redirect::to('carts');
69 | }
70 | }
71 |
72 | /*>>>>>>>>>>>>>>>>>>>>*/
73 | #<---> update Qty <--->#
74 | /*<<<<<<<<<<<<<<<<<<<<*/
75 | public function updateQty($id){
76 | Auth::userAuth();
77 | Csrf::CsrfToken();
78 | if($_SERVER['REQUEST_METHOD']=='POST' && $_POST['upQty']){
79 | $qty = $_POST['qty'];
80 |
81 | if ($qty < 1 && empty($qty)) {
82 | Redirect::to('carts');
83 | }else {
84 | $this->cartModel->updateQty($id,$qty);
85 | Session::set('success', 'Qty has been updated');
86 | Redirect::to('carts');
87 | }
88 | }
89 | }
90 |
91 |
92 | /*>>>>>>>>>>>>>>>>>>>>*/
93 | #<---> delete <--->#
94 | /*<<<<<<<<<<<<<<<<<<<<*/
95 | public function delete($id){
96 | Auth::userAuth();
97 | Csrf::CsrfToken();
98 | Session::set('success', 'Item has been deleted');
99 | $delete = $this->cartModel->delete($id);
100 | if($delete){
101 | Redirect::to('carts');
102 | }
103 | }
104 |
105 | /*>>>>>>>>>>>>>>>>>>>>*/
106 | #<---> delete <--->#
107 | /*<<<<<<<<<<<<<<<<<<<<*/
108 | public function clear(){
109 | Auth::userAuth();
110 | Csrf::CsrfToken();
111 | Session::set('success', 'All Item has been deleted');
112 | $delete = $this->cartModel->clear();
113 | if($delete){
114 | Redirect::to('carts');
115 | }
116 | }
117 |
118 |
119 |
120 | /*>>>>>>>>>>>>>>>>>>>>*/
121 | #<---> checkout <--->#
122 | /*<<<<<<<<<<<<<<<<<<<<*/
123 | public function checkout(){
124 | Auth::userAuth();
125 | Csrf::CsrfToken();
126 | if($_SERVER['REQUEST_METHOD']=='POST'){
127 |
128 | require_once('../vendor/autoload.php');
129 | \Stripe\Stripe::setApiKey('sk_test_dRGPlCrOt3QXSuOxSwhvT5cZ00xTVDsc19');
130 |
131 | $POST = filter_var_array($_POST, FILTER_SANITIZE_STRING);
132 | $name = $_POST['name'];
133 | $email = $_POST['email'];
134 | $mobile = $_POST['mobile'];
135 | $address = $_POST['address'];
136 | $city = $_POST['city'];
137 | $total = $_POST['total'];
138 | $qty = $_POST['qty'];
139 |
140 |
141 | if(empty($_POST['payment_method'])){
142 | $data['errMethod'] = 'You must choose payment method';
143 | }
144 | if (strlen($name) < 4) {
145 | $data['errName'] = 'Name must not be less than 4 characters';
146 | }
147 | if (empty($email)) {
148 | $data['errEmail'] = 'Email Must Has Value.';
149 | }elseif (!filter_var($email,FILTER_VALIDATE_EMAIL)) {
150 | $data['errEmail'] = 'Enter Valid Email';
151 | }
152 |
153 | if (strlen($mobile) < 11) {
154 | $data['errMobile'] = 'Name must not be less than 11 characters';
155 | }
156 |
157 | if (empty($address)) {
158 | $data['errAddress'] = 'Address Must Has Value.';
159 | }
160 | if (empty($city)) {
161 | $data['errCity'] = 'City Must Has Value.';
162 | }
163 |
164 | if(empty($data['errName']) && empty($data['errEmail'])
165 | && empty($data['errMobile']) && empty($data['errAddress'])
166 | && empty($data['errCity']) && empty($data['errMethod'])){
167 |
168 | if($_POST['payment_method'] == 'stripe' ){
169 | $token = $_POST['stripeToken'];
170 | $customer = \Stripe\Customer::create(array(
171 | 'email' => $email,
172 | 'source'=>$token
173 | ));
174 |
175 | $charge = \Stripe\Charge::create([
176 | 'amount' => $qty * 100,
177 | 'currency' => 'usd',
178 | 'description' => 'Transaction from market website',
179 | 'customer' => $customer->id
180 | ]);
181 |
182 | }
183 |
184 | $shipping_id= $this->orderModel->addToShipping($name,$email,$mobile,$address,$city);
185 | Session::set('shipping_id', $shipping_id);
186 |
187 | //complete order
188 | $payment_id= $this->orderModel->addToPayment($_POST['payment_method'],$shipping_id);
189 |
190 | $order_id = $this->orderModel->addToOrder(
191 | Session::name('user_id'),$shipping_id,$payment_id
192 | ,$total
193 | );
194 |
195 | $data['cart'] = $this->cartModel->getAllCart();
196 | foreach ($data['cart'] as $cart) {
197 | $this->orderModel->addToOrderDetails(
198 | $order_id,$cart->product,$cart->pro_name,
199 | $cart->price ,$cart->qty,Session::name('user_id')
200 | );
201 | }
202 |
203 | $this->cartModel->clear();
204 | Session::set('user_cart', '0');
205 | Redirect::to("carts/thank");
206 |
207 | }else {
208 | $data['cart'] = $this->cartModel->getAllCart();
209 | $this->view('front.cart', $data);
210 | }
211 | }else {
212 | Redirect::to('carts');
213 | }
214 | }
215 | }
--------------------------------------------------------------------------------
/app/controller/Categories.php:
--------------------------------------------------------------------------------
1 | categoryModel = $this->model('Category');
8 | }
9 |
10 | /*>>>>>>>>>>>>>>>>>>>>*/
11 | #<---> index <--->#
12 | /*<<<<<<<<<<<<<<<<<<<<*/
13 | public function index(){
14 | Auth::adminAuth();
15 | $data['title1'] = 'All Categories';
16 | $data['categories'] = $this->categoryModel->getAllCat();
17 | $this->view('categories.all', $data);
18 | }
19 |
20 |
21 | /*>>>>>>>>>>>>>>>>>>>>*/
22 | #<---> show <--->#
23 | /*<<<<<<<<<<<<<<<<<<<<*/
24 | public function show($id){
25 | Auth::adminAuth();
26 | $data['category'] = $this->categoryModel->show($id);
27 | $data['title1'] = $data['category']->cat_name;
28 |
29 |
30 | if($data['category'] && is_numeric($id)){
31 | $this->view('categories.show', $data);
32 | }else {
33 | Session::set('danger', 'This id not found');
34 | Redirect::to('categories');
35 | }
36 | }
37 |
38 |
39 | /*>>>>>>>>>>>>>>>>>>>>*/
40 | #<---> add <--->#
41 | /*<<<<<<<<<<<<<<<<<<<<*/
42 | public function add(){
43 |
44 | Auth::adminAuth();
45 | Csrf::CsrfToken();
46 | $data['title1'] = 'Add Catrgory';
47 | if($_SERVER['REQUEST_METHOD']=='POST' && $_POST['addCategory']){
48 | $cat_name = $_POST['category'];
49 | $cat_user = Session::name('admin_id');
50 | $description = $_POST['description'];
51 |
52 | if (strlen($cat_name) < 3) {
53 | $data['errCat'] = 'Category name must not be less than 3 characters';
54 | }elseif($this->categoryModel->findCatName($cat_name) > 0) {
55 | $data['errCat'] = 'This name already exist choose anthor one';
56 | }
57 | if (strlen($description) < 5) {
58 | $data['errDes'] = 'Category description must not be less than 5 characters';
59 | }
60 |
61 | if(empty($data['errCat']) && empty($data['errDes'])){
62 | $this->categoryModel->add($cat_name,$cat_user,$description);
63 | Session::set('success', 'New category added successfully');
64 | Redirect::to('categories');
65 | }else {
66 | $this->view('categories.add', $data);
67 | }
68 | }else {
69 | $this->view('categories.add', $data);
70 | }
71 | }
72 |
73 |
74 | /*>>>>>>>>>>>>>>>>>>>>*/
75 | #<---> edit <--->#
76 | /*<<<<<<<<<<<<<<<<<<<<*/
77 | public function edit($id){
78 | Auth::adminAuth();
79 | $data['title1'] = 'Edit Category';
80 | $data['category'] = $this->categoryModel->show($id);
81 | if($data['category'] && is_numeric($id)){
82 | $this->view('categories.edit', $data);
83 | }else {
84 | Session::set('danger', 'This id not found');
85 | Redirect::to('categories');
86 | }
87 | }
88 |
89 |
90 | /*>>>>>>>>>>>>>>>>>>>>*/
91 | #<---> update <--->#
92 | /*<<<<<<<<<<<<<<<<<<<<*/
93 | public function update($id){
94 | Auth::adminAuth();
95 | Csrf::CsrfToken();
96 | $data['title1'] = 'Edit Category';
97 | if($_SERVER['REQUEST_METHOD']=='POST' && $_POST['editCategory']){
98 | $cat_name = $_POST['category'];
99 | $cat_id = $_POST['cat_id'];
100 | $description = $_POST['description'];
101 | $cat_user = Session::name('admin_id');
102 |
103 | if (strlen($cat_name) < 3) {
104 | $data['errCat'] = 'Category name must not be less than 3 characters';
105 | }elseif($this->categoryModel->findCatName($cat_name,$cat_id) > 0) {
106 | $data['errCat'] = 'This name already exist choose anthor one';
107 | }
108 |
109 | if (strlen($description) < 5) {
110 | $data['errDes'] = 'Category description must not be less than 5 characters';
111 | }
112 |
113 | if(empty($data['errCat']) && empty($data['errDes'])){
114 | $this->categoryModel->update($id, $cat_name,$description);
115 | Session::set('success', 'Category has been edited successfully');
116 | Redirect::to('categories');
117 | }else {
118 | $data['category'] = $this->categoryModel->show($id);
119 | $this->view('categories.edit', $data);
120 | }
121 |
122 | }else {
123 | Redirect::to('categories');
124 | }
125 | }
126 |
127 |
128 | /*>>>>>>>>>>>>>>>>>>>>*/
129 | #<---> activate <--->#
130 | /*<<<<<<<<<<<<<<<<<<<<*/
131 | public function activate($id){
132 | Auth::adminAuth();
133 | $activate = $this->categoryModel->activate($id);
134 | Session::set('success', 'Item has been activated');
135 | if($activate){
136 | Redirect::to('categories');
137 | }
138 | }
139 |
140 | /*>>>>>>>>>>>>>>>>>>>>*/
141 | #<---> inactivate <--->#
142 | /*<<<<<<<<<<<<<<<<<<<<*/
143 | public function inActivate($id){
144 | Auth::adminAuth();
145 | $inActivate = $this->categoryModel->inActivate($id);
146 | if($inActivate){
147 | Session::set('success', 'Item has been inActivated');
148 | Redirect::to('categories');
149 | }
150 | }
151 |
152 |
153 | /*>>>>>>>>>>>>>>>>>>>>*/
154 | #<---> search <--->#
155 | /*<<<<<<<<<<<<<<<<<<<<*/
156 | public function search(){
157 | Auth::adminAuth();
158 | $data['title1'] = 'All Categories';
159 | $searched = $_POST['search'];
160 | $results = $this->categoryModel->search($searched);
161 | $data['categories'] = $results;
162 | $this->view('categories.search', $data);
163 |
164 | }
165 |
166 | /*>>>>>>>>>>>>>>>>>>>>*/
167 | #<---> delete <--->#
168 | /*<<<<<<<<<<<<<<<<<<<<*/
169 | public function delete($id){
170 | Auth::adminAuth();
171 | Csrf::CsrfToken();
172 | Session::set('success', 'Item has been deleted');
173 | $delete = $this->categoryModel->delete($id);
174 | if($delete){
175 | Redirect::to('categories');
176 | }
177 | }
178 |
179 | }
--------------------------------------------------------------------------------
/app/controller/Home.php:
--------------------------------------------------------------------------------
1 | >>>>>>>>>>>>>>>>>>>*/
11 | #<---> construct <--->#
12 | /*<<<<<<<<<<<<<<<<<<<<*/
13 | public function __construct(){
14 | new Session;
15 | $this->categoryModel = $this->model('Category');
16 | $this->manufactureModel = $this->model('Manufacture');
17 | $this->productModel = $this->model('Product');
18 | }
19 |
20 | /*>>>>>>>>>>>>>>>>>>>>*/
21 | #<---> index <--->#
22 | /*<<<<<<<<<<<<<<<<<<<<*/
23 | public function index(){
24 | $data['title1'] = 'Home';
25 | $data['categories'] = $this->categoryModel->getAllCat(1);
26 | $data['manufactures'] = $this->manufactureModel->getAllMan(1);
27 | $data['products'] = $this->productModel->getAllPro(1);
28 | $this->view('front.index', $data);
29 | }
30 |
31 |
32 |
33 | /*>>>>>>>>>>>>>>>>>>>>*/
34 | #<---> search <--->#
35 | /*<<<<<<<<<<<<<<<<<<<<*/
36 | public function search(){
37 | $data['title1'] = 'Products';
38 | $searched = $_POST['search'];
39 | $data['categories'] = $this->categoryModel->getAllCat(1);
40 | $data['manufactures'] = $this->manufactureModel->getAllMan(1);
41 | if($_SERVER['REQUEST_METHOD']=="POST"){
42 | $results = $this->productModel->search($searched);
43 | $data['products'] = $results;
44 | $this->view('front.index', $data);
45 | }else {
46 | Redirect::to('home');
47 | }
48 |
49 | }
50 |
51 |
52 | /*>>>>>>>>>>>>>>>>>>>>*/
53 | #<---> By Categ <--->#
54 | /*<<<<<<<<<<<<<<<<<<<<*/
55 | public function getProByCat($cat_id){
56 | $data['categories'] = $this->categoryModel->getAllCat(1);
57 | $data['manufactures'] = $this->manufactureModel->getAllMan(1);
58 | $data['category'] = $this->categoryModel->show($cat_id);
59 | $data['products'] = $this->productModel->getProByCat($cat_id);
60 |
61 | $data['title1'] = $data['category']->cat_name;
62 |
63 | if($data['category'] && is_numeric($cat_id)){
64 | $this->view('front.ProCategory', $data);
65 | }else {
66 | Session::set('danger', 'this item not exist');
67 | Redirect::to('home');
68 | }
69 | }
70 |
71 | /*>>>>>>>>>>>>>>>>>>>>*/
72 | #<---> By Categ <--->#
73 | /*<<<<<<<<<<<<<<<<<<<<*/
74 | public function getProByMan($man_id){
75 | $data['categories'] = $this->categoryModel->getAllCat(1);
76 | $data['manufactures'] = $this->manufactureModel->getAllMan(1);
77 | $data['manufacture'] = $this->manufactureModel->show($man_id);
78 | $data['products'] = $this->productModel->getProByMan($man_id);
79 |
80 | $data['title1'] = $data['manufacture']->man_name;
81 |
82 | if($data['manufacture'] && is_numeric($man_id)){
83 | $this->view('front.ProManufacture', $data);
84 | }else {
85 | Session::set('danger', 'this item not exist');
86 | Redirect::to('home');
87 | }
88 | $this->view('front.ProManufacture', $data);
89 | }
90 |
91 |
92 | /*>>>>>>>>>>>>>>>>>>>>*/
93 | #<---> show <--->#
94 | /*<<<<<<<<<<<<<<<<<<<<*/
95 | public function show($id){
96 | $data['product'] = $this->productModel->show($id);
97 | $data['title1'] = $data['product']->name;
98 | $data['gallary'] = $this->productModel->getGallary($id);
99 | if($data['product'] && is_numeric($id)){
100 | $this->view('front.details', $data);
101 | }else {
102 | Session::set('danger', 'this item not exist');
103 | Redirect::to('home');
104 | }
105 |
106 | }
107 |
108 | /*>>>>>>>>>>>>>>>>>>>>*/
109 | #<---> about <--->#
110 | /*<<<<<<<<<<<<<<<<<<<<*/
111 | public function about(){
112 | $this->view('front.about', ['title'=> 'About Page']);
113 | }
114 |
115 | }
--------------------------------------------------------------------------------
/app/controller/Manufactures.php:
--------------------------------------------------------------------------------
1 | manufactureModel = $this->model('Manufacture');
8 | }
9 |
10 |
11 | /*>>>>>>>>>>>>>>>>>>>>*/
12 | #<---> index <--->#
13 | /*<<<<<<<<<<<<<<<<<<<<*/
14 | public function index(){
15 | Auth::adminAuth();
16 | $data['title1'] = 'All Brands';
17 | $data['manufactures'] = $this->manufactureModel->getAllMan();
18 | $this->view('manufactures.all', $data);
19 | }
20 |
21 |
22 | /*>>>>>>>>>>>>>>>>>>>>*/
23 | #<---> search <--->#
24 | /*<<<<<<<<<<<<<<<<<<<<*/
25 | public function search(){
26 | Auth::adminAuth();
27 | $data['title1'] = 'All Brands';
28 | $searched = $_POST['search'];
29 | $results = $this->manufactureModel->search($searched);
30 | $data['manufactures'] = $results;
31 | $this->view('manufactures.search', $data);
32 |
33 | }
34 |
35 |
36 | /*>>>>>>>>>>>>>>>>>>>>*/
37 | #<---> show <--->#
38 | /*<<<<<<<<<<<<<<<<<<<<*/
39 | public function show($id){
40 | Auth::adminAuth();
41 | $data['manufacture'] = $this->manufactureModel->show($id);
42 | $data['title1'] = $data['manufacture']->man_name;
43 | if($data['manufacture'] && is_numeric($id)){
44 | $this->view('manufactures.show', $data);
45 | }else {
46 | Session::set('danger', 'This id not found');
47 | Redirect::to('manufactures');
48 | }
49 | }
50 |
51 |
52 | /*>>>>>>>>>>>>>>>>>>>>*/
53 | #<---> add <--->#
54 | /*<<<<<<<<<<<<<<<<<<<<*/
55 | public function add(){
56 | Auth::adminAuth();
57 | Csrf::CsrfToken();
58 | $data['title1'] = 'Add Brand';
59 | if($_SERVER['REQUEST_METHOD']=='POST' && $_POST['addManufacture']){
60 | $man_name = $_POST['manufacture'];
61 | $man_user = Session::name('admin_id');
62 | $description = $_POST['description'];
63 |
64 | if (strlen($man_name) < 3) {
65 | $data['errMan'] = 'manufacture name must not be less than 3 characters';
66 | }elseif($this->manufactureModel->findManName($man_name) > 0) {
67 | $data['errMan'] = 'This name already exist choose anthor one';
68 | }
69 | if (strlen($description) < 5) {
70 | $data['errDes'] = 'manufacture description must not be less than 5 characters';
71 | }
72 |
73 | if(empty($data['errMan']) && empty($data['errDes'])){
74 | $this->manufactureModel->add($man_name,$man_user,$description);
75 | Session::set('success', 'New manufacture added successfully');
76 | Redirect::to('manufactures');
77 | }else {
78 | $this->view('manufactures.add', $data);
79 | }
80 | }else {
81 | $this->view('manufactures.add',$data);
82 | }
83 | }
84 |
85 |
86 | /*>>>>>>>>>>>>>>>>>>>>*/
87 | #<---> edit <--->#
88 | /*<<<<<<<<<<<<<<<<<<<<*/
89 | public function edit($id){
90 | Auth::adminAuth();
91 | $data['title1'] = 'Edit Brand';
92 | $data['manufacture'] = $this->manufactureModel->show($id);
93 | if($data['manufacture'] && is_numeric($id)){
94 | $this->view('manufactures.edit', $data);
95 | }else {
96 | Session::set('danger', 'This id not found');
97 | Redirect::to('manufactures');
98 | }
99 | }
100 |
101 |
102 | /*>>>>>>>>>>>>>>>>>>>>*/
103 | #<---> update <--->#
104 | /*<<<<<<<<<<<<<<<<<<<<*/
105 | public function update($id){
106 | Auth::adminAuth();
107 | Csrf::CsrfToken();
108 | $data['title1'] = 'Edit Brand';
109 | if($_SERVER['REQUEST_METHOD']=='POST' && $_POST['editManufacture']){
110 | $man_name = $_POST['manufacture'];
111 | $man_id = $_POST['man_id'];
112 | $description = $_POST['description'];
113 | $man_user = Session::name('admin_id');
114 |
115 | if (strlen($man_name) < 3) {
116 | $data['errMan'] = 'manufacture name must not be less than 3 characters';
117 | }elseif($this->manufactureModel->findManName($man_name,$man_id) > 0) {
118 | $data['errMan'] = 'This name already exist choose anthor one';
119 | }
120 |
121 | if (strlen($description) < 5) {
122 | $data['errDes'] = 'manufacture description must not be less than 5 characters';
123 | }
124 |
125 | if(empty($data['errMan']) && empty($data['errDes'])){
126 | $this->manufactureModel->update($id, $man_name,$description);
127 | Session::set('success', 'manufacture has been edited successfully');
128 | Redirect::to('manufactures');
129 | }else {
130 | $data['manufacture'] = $this->manufactureModel->show($id);
131 | $this->view('manufactures.edit', $data);
132 | }
133 |
134 | }else {
135 | Redirect::to('manufactures');
136 | }
137 | }
138 |
139 |
140 |
141 | /*>>>>>>>>>>>>>>>>>>>>*/
142 | #<---> activate <--->#
143 | /*<<<<<<<<<<<<<<<<<<<<*/
144 | public function activate($id){
145 | Auth::adminAuth();
146 | $activate = $this->manufactureModel->activate($id);
147 | Session::set('success', 'Item has been activated');
148 | if($activate){
149 | Redirect::to('manufactures');
150 | }
151 | }
152 |
153 |
154 | /*>>>>>>>>>>>>>>>>>>>>*/
155 | #<---> inactivate <--->#
156 | /*<<<<<<<<<<<<<<<<<<<<*/
157 | public function inActivate($id){
158 | Auth::adminAuth();
159 | $inActivate = $this->manufactureModel->inActivate($id);
160 | if($inActivate){
161 | Session::set('success', 'Item has been inActivated');
162 | Redirect::to('manufactures');
163 | }
164 | }
165 |
166 |
167 | /*>>>>>>>>>>>>>>>>>>>>*/
168 | #<---> delete <--->#
169 | /*<<<<<<<<<<<<<<<<<<<<*/
170 | public function delete($id){
171 | Auth::adminAuth();
172 | Csrf::CsrfToken();
173 | Session::set('success', 'Item has been deleted');
174 | $delete = $this->manufactureModel->delete($id);
175 | if($delete){
176 | Redirect::to('manufactures');
177 | }
178 | }
179 |
180 | }
--------------------------------------------------------------------------------
/app/controller/Orders.php:
--------------------------------------------------------------------------------
1 | orderModel = $this->model('order');
8 | }
9 |
10 |
11 | /*>>>>>>>>>>>>>>>>>>>>*/
12 | #<---> index <--->#
13 | /*<<<<<<<<<<<<<<<<<<<<*/
14 | public function index(){
15 | Auth::adminAuth();
16 | $data['title1'] = 'All Orders';
17 | $data['orders'] = $this->orderModel->getAllOrder();
18 | $this->view('orders.all', $data);
19 | }
20 |
21 |
22 | /*>>>>>>>>>>>>>>>>>>>>*/
23 | #<---> show <--->#
24 | /*<<<<<<<<<<<<<<<<<<<<*/
25 | public function show($id){
26 | Auth::adminAuth();
27 | $data['order'] = $this->orderModel->show($id);
28 | $data['shipping'] = $this->orderModel->showShipping($data['order']->shipping_id);
29 | $data['orderDetails'] = $this->orderModel->getAllOrderDetalails($data['order']->order_id);
30 | $data['title1'] = 'Order '.$data['order']->order_id;
31 | $this->view('orders.show', $data);
32 | }
33 |
34 |
35 |
36 | /*>>>>>>>>>>>>>>>>>>>>*/
37 | #<---> activate <--->#
38 | /*<<<<<<<<<<<<<<<<<<<<*/
39 | public function activate($id){
40 | Auth::adminAuth();
41 | $activate = $this->orderModel->activate($id);
42 | Session::set('success', 'Item has been activated');
43 | if($activate){
44 | Redirect::to('orders');
45 | }
46 | }
47 |
48 |
49 | /*>>>>>>>>>>>>>>>>>>>>*/
50 | #<---> inactivate <--->#
51 | /*<<<<<<<<<<<<<<<<<<<<*/
52 | public function inActivate($id){
53 | Auth::adminAuth();
54 | $inActivate = $this->orderModel->inActivate($id);
55 | if($inActivate){
56 | Session::set('success', 'Item has been inActivated');
57 | Redirect::to('orders');
58 | }
59 | }
60 |
61 |
62 | /*>>>>>>>>>>>>>>>>>>>>*/
63 | #<---> delete <--->#
64 | /*<<<<<<<<<<<<<<<<<<<<*/
65 | public function delete($id){
66 | Auth::adminAuth();
67 | $delete = $this->orderModel->delete($id);
68 | Session::set('success', 'Item has been deleted');
69 | Redirect::to('orders');
70 |
71 | }
72 |
73 | }
--------------------------------------------------------------------------------
/app/controller/Pages.php:
--------------------------------------------------------------------------------
1 | >>>>>>>>>>>>>>>>>>>*/
6 | #<---> index <--->#
7 | /*<<<<<<<<<<<<<<<<<<<<*/
8 | public function index(){
9 | $data = [
10 | "title1"=>'Home Page',
11 | ];
12 | $this->view('pages.index', $data);
13 | }
14 |
15 | /*>>>>>>>>>>>>>>>>>>>>*/
16 | #<---> about <--->#
17 | /*<<<<<<<<<<<<<<<<<<<<*/
18 | public function about(){
19 | $this->view('pages.about', ['title'=> 'About Page']);
20 | }
21 |
22 | }
--------------------------------------------------------------------------------
/app/helpers/auth.php:
--------------------------------------------------------------------------------
1 | SMTPDebug = 2; // Enable verbose debug output
17 | $mail->isSMTP(); // Set mailer to use SMTP
18 | $mail->Host = 'smtp.gmail.com'; // Specify main and backup SMTP servers
19 | $mail->SMTPAuth = true; // Enable SMTP authentication
20 | $mail->Username = 'himaelgadid@gmail.com'; // SMTP username
21 | $mail->Password = 'G010202396Mail25a'; // SMTP password
22 | $mail->SMTPSecure = 'ssl'; // Enable TLS encryption, `ssl` also accepted
23 | $mail->Port = 465; // TCP port to connect to
24 |
25 | // $host = "smtp.gmail.com";
26 | // $port = "587";
27 | // $checkconn = fsockopen($host, $port, $errno, $errstr, 5);
28 | // if(!$checkconn){
29 | // echo "($errno) $errstr";
30 | // } else {
31 | // echo 'ok';
32 | // }
33 | //Recipients
34 | $mail->setFrom('himaelgadid@gmail.com', 'Hima');
35 | $mail->addAddress($email); // Add a recipient
36 | // $mail->addAddress('ellen@example.com'); // Name is optional
37 | // $mail->addReplyTo('info@example.com', 'Information');
38 | // $mail->addCC('cc@example.com');
39 | // $mail->addBCC('bcc@example.com');
40 |
41 | // //Attachments
42 | // $mail->addAttachment('/var/tmp/file.tar.gz'); // Add attachments
43 | // $mail->addAttachment('/tmp/image.jpg', 'new.jpg'); // Optional name
44 |
45 | //Content
46 | $mail->isHTML(true); // Set email format to HTML
47 | $mail->Subject = 'Here is the subject';
48 | $mail->Body = 'Thank you for joining us your code :'.$vkey .
49 | ' '.'Now You Can Go Confirm Now' ;
50 | $mail->AltBody = 'Thank you';
51 |
52 | $mail->send();
53 | $_SESSION['msg'] = 'Confirmtaion Message has been sent to your email';
54 | $_SESSION['email'] = $email;
55 | header('location:confirm.php');
56 | } catch (Exception $e) {
57 | echo 'Message could not be sent. Mailer Error: ', $mail->ErrorInfo;
58 | }}
59 |
60 |
61 | function sendpass($email,$vkey){
62 | //Load Composer's autoloader
63 | require dirname(ROOT).'/vendor/autoload.php';
64 |
65 | $mail = new PHPMailer(true); // Passing `true` enables exceptions
66 | try {
67 | //Server settings
68 | $mail->SMTPDebug = 2; // Enable verbose debug output
69 | $mail->isSMTP(); // Set mailer to use SMTP
70 | $mail->Host = 'smtp.gmail.com'; // Specify main and backup SMTP servers
71 | $mail->SMTPAuth = true; // Enable SMTP authentication
72 | $mail->Username = 'himaelgadid@gmail.com'; // SMTP username
73 | $mail->Password = 'G010202396Mail25a'; // SMTP password
74 | $mail->SMTPSecure = 'ssl'; // Enable TLS encryption, `ssl` also accepted
75 | $mail->Port = 465; // TCP port to connect to
76 |
77 | // $host = "smtp.gmail.com";
78 | // $port = "587";
79 | // $checkconn = fsockopen($host, $port, $errno, $errstr, 5);
80 | // if(!$checkconn){
81 | // echo "($errno) $errstr";
82 | // } else {
83 | // echo 'ok';
84 | // }
85 | //Recipients
86 | $mail->setFrom('himaelgadid@gmail.com', 'Hima');
87 | $mail->addAddress($email); // Add a recipient
88 | // $mail->addAddress('ellen@example.com'); // Name is optional
89 | // $mail->addReplyTo('info@example.com', 'Information');
90 | // $mail->addCC('cc@example.com');
91 | // $mail->addBCC('bcc@example.com');
92 |
93 | // //Attachments
94 | // $mail->addAttachment('/var/tmp/file.tar.gz'); // Add attachments
95 | // $mail->addAttachment('/tmp/image.jpg', 'new.jpg'); // Optional name
96 |
97 | //Content
98 | $mail->isHTML(true); // Set email format to HTML
99 | $mail->Subject = 'Here is the subject';
100 | $mail->Body = 'Now You Can Go New password' ;
101 | $mail->AltBody = 'Thank you';
102 |
103 | $mail->send();
104 | $_SESSION['msg'] = 'Confirmtaion Message has been sent to your email';
105 | $_SESSION['email'] = $email;
106 | header('location:confirm.php');
107 | } catch (Exception $e) {
108 | echo 'Message could not be sent. Mailer Error: ', $mail->ErrorInfo;
109 | }}
110 |
111 |
--------------------------------------------------------------------------------
/app/helpers/errors.php:
--------------------------------------------------------------------------------
1 | errors =array();
8 |
9 | if(isset($error)){
10 | array_push($this->errors,$error);
11 | }
12 |
13 | if(in_array($error,$this->errors)){
14 | return $error;
15 | }
16 | }
17 | }
18 |
19 |
--------------------------------------------------------------------------------
/app/helpers/redirect.php:
--------------------------------------------------------------------------------
1 |
40 |
42 | '.$_SESSION[$msg].'';
43 | unset($_SESSION[$msg]);
44 | }
45 | }
46 |
47 | public static function danger($msg){
48 | if(isset($_SESSION[$msg])){
49 | echo '
51 | '.$_SESSION[$msg].'
';
52 | unset($_SESSION[$msg]);
53 | }
54 | }
55 | }
56 |
57 |
--------------------------------------------------------------------------------
/app/libs/Controller.php:
--------------------------------------------------------------------------------
1 | getUrl();
11 | if(file_exists("../app/controller/".ucwords($url[0]).".php")){
12 | $this->currentController = ucwords($url[0]);
13 | unset($url[0]);
14 | }
15 |
16 | require_once "../app/controller/".$this->currentController.".php";
17 | $this->currentController = new $this->currentController;
18 |
19 | if(isset($url[1])){
20 | if(method_exists($this->currentController,$url[1])){
21 | $this->currentMethod = $url[1];
22 | unset($url[1]);
23 | }
24 | }
25 |
26 | $this->params = $url ? array_values($url):[];
27 | // print_r(array_values($url));
28 | call_user_func_array(
29 | [$this->currentController,$this->currentMethod],$this->params
30 | );
31 | }
32 |
33 | public function getUrl(){
34 | if(isset($_GET['url'])){
35 | $url = rtrim($_GET['url'], '/');
36 | $url = filter_var($url, FILTER_SANITIZE_URL);
37 | $url = explode('/', $url);
38 | return $url;
39 | }
40 | }
41 | }
42 |
43 | ?>
--------------------------------------------------------------------------------
/app/libs/Database.php:
--------------------------------------------------------------------------------
1 | host . ';dbname=' . $this->dbname;
16 | $options = array(
17 | PDO::ATTR_PERSISTENT => true,
18 | PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION
19 | );
20 |
21 | // Create PDO instance
22 | try{
23 | $this->conn = new PDO($dsn, $this->user, $this->pass, $options);
24 | } catch(PDOException $e){
25 | $this->error = $e->getMessage();
26 | echo $this->error;
27 | }
28 | }
29 | // Prepare statement with query
30 | public function query($sql){
31 | $this->stmt = $this->conn->prepare($sql);
32 | }
33 |
34 | // Bind values
35 | public function bind($param, $value, $type = null){
36 | if(is_null($type)){
37 | switch(true){
38 | case is_int($value):
39 | $type = PDO::PARAM_INT;
40 | break;
41 | case is_bool($value):
42 | $type = PDO::PARAM_BOOL;
43 | break;
44 | case is_null($value):
45 | $type = PDO::PARAM_NULL;
46 | break;
47 | default:
48 | $type = PDO::PARAM_STR;
49 | }
50 | }
51 |
52 | $this->stmt->bindValue($param, $value, $type);
53 | }
54 |
55 | // Execute the prepared statement
56 | public function execute(){
57 | return $this->stmt->execute();
58 | }
59 |
60 | // Get result set as array of objects
61 | public function resultSet(){
62 | $this->execute();
63 | return $this->stmt->fetchAll(PDO::FETCH_OBJ);
64 | }
65 |
66 | // Get single record as object
67 | public function single(){
68 | $this->execute();
69 | return $this->stmt->fetch(PDO::FETCH_OBJ);
70 | }
71 |
72 | public function insertById(){
73 | $this->execute();
74 | return $this->stmt = $this->conn->lastInsertId();
75 | }
76 |
77 | // Get row count
78 | public function rowCount(){
79 | return $this->stmt->rowCount();
80 | }
81 | }
--------------------------------------------------------------------------------
/app/models/Admin.php:
--------------------------------------------------------------------------------
1 | db = new Database();
8 | }
9 |
10 | public function login($email,$password){
11 | $this->db->query("SELECT * FROM users WHERE email =:email AND admin = 1");
12 | $this->db->bind(':email',$email);
13 | $user = $this->db->single();
14 | if($user){
15 | $hashedPassword = $user->password;
16 | if(password_verify($password,$hashedPassword)){
17 | return $user;
18 | }else{
19 | return false;
20 | }
21 | }
22 | }
23 |
24 |
25 | public function findUserByEmail($email){
26 | $this->db->query("SELECT * FROM users WHERE email =:email");
27 | $this->db->bind(':email',$email);
28 | $this->db->execute();
29 | if($this->db->rowCount() > 0){
30 | return true;
31 | }else{
32 | return false;
33 | };
34 | }
35 |
36 |
37 | }
--------------------------------------------------------------------------------
/app/models/Cart.php:
--------------------------------------------------------------------------------
1 | db = new Database();
8 | }
9 |
10 | public function getAllCart(){
11 |
12 | $this->db->query("SELECT cart.*,products.name as pro_name ,
13 | products.price as price FROM cart
14 | INNER JOIN users ON cart.user = users.user_id
15 | INNER JOIN products ON cart.product= products.product_id
16 | WHERE cart.user = :user");
17 | $this->db->bind(':user', Session::name('user_id'));
18 | $carts = $this->db->resultSet();
19 | if($carts){
20 | return $carts;
21 | }else{
22 | return false;
23 | }
24 | }
25 |
26 |
27 | public function addOne($pro_id){
28 | $this->db->query("UPDATE cart SET qty=qty + 1
29 | WHERE product = :pro_id AND user = :user");
30 | $this->db->bind(':pro_id',$pro_id);
31 | $this->db->bind(':user',Session::name('user_id'));
32 | $this->db->execute();
33 | }
34 |
35 | public function addnew($pro_id,$user_id,$price){
36 | $this->db->query("INSERT INTO
37 | cart (product,user,qty,price)
38 | VALUES (:product,:user_id,1,:price)");
39 | $this->db->bind(':product',$pro_id);
40 | $this->db->bind(':user_id',$user_id);
41 | $this->db->bind(':price',$price);
42 | $this->db->execute();
43 | }
44 |
45 | public function updateQty($id,$qty){
46 | $this->db->query("UPDATE cart SET qty=:qty
47 | WHERE product=:product AND user=:user");
48 | $this->db->bind(':product',$id);
49 | $this->db->bind(':qty',$qty);
50 | $this->db->bind(':user',Session::name('user_id'));
51 | $this->db->execute();
52 | }
53 |
54 |
55 |
56 | public function findCartPro($pro_id,$user_id){
57 | $this->db->query("SELECT * FROM cart
58 | WHERE product =:product_id AND user=:user");
59 | $this->db->bind(':user',$user_id);
60 | $this->db->bind(':product_id',$pro_id);
61 | $this->db->execute();
62 | return $this->db->rowCount();
63 | }
64 |
65 | public function delete($id){
66 | $this->db->query("DELETE FROM cart WHERE cart_id=:id");
67 | $this->db->bind(':id',$id);
68 | return $this->db->execute();
69 | }
70 |
71 | public function clear(){
72 | $this->db->query("DELETE FROM cart WHERE user=:user");
73 | $this->db->bind(':user',Session::name('user_id'));
74 | return $this->db->execute();
75 | }
76 |
77 | }
--------------------------------------------------------------------------------
/app/models/Category.php:
--------------------------------------------------------------------------------
1 | db = new Database();
8 | }
9 |
10 | public function getAllCat($active=''){
11 | if($active==''){
12 | $sql = "";
13 | }else {
14 | $sql = "WHERE categories.active=$active";
15 | }
16 | $this->db->query("SELECT categories.*, users.full_name as
17 | creator FROM categories INNER JOIN users ON
18 | categories.cat_user = users.user_id $sql");
19 | $categories = $this->db->resultSet();
20 | if($categories){
21 | return $categories;
22 | }else {
23 | return false;
24 | }
25 | }
26 |
27 | public function search($searched){
28 | $this->db->query("SELECT categories.*, users.full_name as
29 | creator FROM categories INNER JOIN users ON
30 | categories.cat_user = users.user_id WHERE cat_name LIKE
31 | '%$searched%'");
32 | // $this->db->bind(':searched',$searched);
33 | $results = $this->db->resultSet();
34 | if($results){
35 | return $results;
36 | }else {
37 | return false;
38 | }
39 | }
40 |
41 | public function add($cat_name,$cat_user,$description){
42 | $this->db->query("INSERT INTO
43 | categories (cat_name,cat_user,active,description)
44 | VALUES (:cat_name,:cat_user,0,:description)");
45 | $this->db->bind(':cat_name',$cat_name);
46 | $this->db->bind(':cat_user',$cat_user);
47 | $this->db->bind(':description',$description);
48 | $this->db->execute();
49 | }
50 |
51 | public function update($id,$name,$description){
52 | $this->db->query("UPDATE categories SET cat_name=:cat_name
53 | ,description=:description WHERE cat_id=:cat_id");
54 | $this->db->bind(':cat_name',$name);
55 | $this->db->bind(':description',$description);
56 | $this->db->bind(':cat_id',$id);
57 | $this->db->execute();
58 | }
59 |
60 | public function show($id){
61 | $this->db->query("SELECT categories.*, users.full_name as
62 | creator FROM categories INNER JOIN users ON
63 | categories.cat_user = users.user_id WHERE cat_id=:cat_id");
64 | $this->db->bind(':cat_id',$id);
65 | $category = $this->db->single();
66 | return $category;
67 | }
68 |
69 |
70 |
71 | public function findCatName($cat_name,$cat_id = ''){
72 | $this->db->query("SELECT cat_id FROM categories
73 | WHERE cat_name =:cat_name AND cat_id != :cat_id");
74 | $this->db->bind(':cat_name',$cat_name);
75 | $this->db->bind(':cat_id',$cat_id);
76 | $this->db->execute();
77 | return $this->db->rowCount();
78 | }
79 |
80 | public function delete($id){
81 | $this->db->query("DELETE FROM categories WHERE cat_id=:id");
82 | $this->db->bind(':id',$id);
83 | return $this->db->execute();
84 | }
85 |
86 | public function activate($id){
87 | $this->db->query("UPDATE categories SET active = 1 WHERE cat_id=:id");
88 | $this->db->bind(':id',$id);
89 | return $this->db->execute();
90 | }
91 |
92 | public function inActivate($id){
93 | $this->db->query("UPDATE categories SET active = 0 WHERE cat_id=:id");
94 | $this->db->bind(':id',$id);
95 | return $this->db->execute();
96 | }
97 |
98 |
99 | }
--------------------------------------------------------------------------------
/app/models/Manufacture.php:
--------------------------------------------------------------------------------
1 | db = new Database();
8 | }
9 |
10 | public function getAllMan($active=''){
11 | if($active==''){
12 | $sql = "";
13 | }else {
14 | $sql = "WHERE manufactures.active=$active";
15 | }
16 | $this->db->query("SELECT manufactures.*, users.full_name as
17 | creator FROM manufactures INNER JOIN users ON
18 | manufactures.man_user = users.user_id $sql");
19 | $manufactures = $this->db->resultSet();
20 | if($manufactures){
21 | return $manufactures;
22 | }else {
23 | return false;
24 | }
25 | }
26 |
27 |
28 | public function search($searched){
29 | $this->db->query("SELECT manufactures.*, users.full_name as
30 | creator FROM manufactures INNER JOIN users ON
31 | manufactures.man_user = users.user_id WHERE man_name LIKE
32 | '%$searched%'");
33 | // $this->db->bind(':searched',$searched);
34 | $results = $this->db->resultSet();
35 | if($results){
36 | return $results;
37 | }else {
38 | return false;
39 | }
40 | }
41 |
42 |
43 |
44 | public function add($man_name,$man_user,$description){
45 | $this->db->query("INSERT INTO
46 | manufactures (man_name,man_user,active,description)
47 | VALUES (:man_name,:man_user,0,:description)");
48 | $this->db->bind(':man_name',$man_name);
49 | $this->db->bind(':man_user',$man_user);
50 | $this->db->bind(':description',$description);
51 | $this->db->execute();
52 | }
53 |
54 | public function update($id,$name,$description){
55 | $this->db->query("UPDATE manufactures SET man_name=:man_name
56 | ,description=:description WHERE man_id=:man_id");
57 | $this->db->bind(':man_name',$name);
58 | $this->db->bind(':description',$description);
59 | $this->db->bind(':man_id',$id);
60 | $this->db->execute();
61 | }
62 |
63 | public function show($id){
64 | $this->db->query("SELECT manufactures.*, users.full_name as
65 | creator FROM manufactures INNER JOIN users ON
66 | manufactures.man_user = users.user_id WHERE man_id=:man_id");
67 | $this->db->bind(':man_id',$id);
68 | $manufacture = $this->db->single();
69 | return $manufacture;
70 | }
71 |
72 |
73 |
74 | public function findManName($man_name,$man_id = ''){
75 | $this->db->query("SELECT man_id FROM manufactures
76 | WHERE man_name =:man_name AND man_id != :man_id");
77 | $this->db->bind(':man_name',$man_name);
78 | $this->db->bind(':man_id',$man_id);
79 | $this->db->execute();
80 | return $this->db->rowCount();
81 | }
82 |
83 | public function delete($id){
84 | $this->db->query("DELETE FROM manufactures WHERE man_id=:id");
85 | $this->db->bind(':id',$id);
86 | return $this->db->execute();
87 | }
88 |
89 | public function activate($id){
90 | $this->db->query("UPDATE manufactures SET active = 1 WHERE man_id=:id");
91 | $this->db->bind(':id',$id);
92 | return $this->db->execute();
93 | }
94 |
95 | public function inActivate($id){
96 | $this->db->query("UPDATE manufactures SET active = 0 WHERE man_id=:id");
97 | $this->db->bind(':id',$id);
98 | return $this->db->execute();
99 | }
100 |
101 |
102 | }
--------------------------------------------------------------------------------
/app/models/Order.php:
--------------------------------------------------------------------------------
1 | db = new Database();
8 | }
9 |
10 | public function getAllOrder($status=''){
11 | if($status==''){
12 | $sql = "";
13 | }else {
14 | $sql = "WHERE c_order.status=$status";
15 | }
16 |
17 | $this->db->query("SELECT c_order.*, users.full_name as
18 | creator, payment.payment_method as method FROM c_order
19 | INNER JOIN users ON c_order.customer_id = users.user_id
20 | INNER JOIN payment ON c_order.payment_id =
21 | payment.payment_id
22 | $sql");
23 | $orders = $this->db->resultSet();
24 | if($orders){
25 | return $orders;
26 | }else {
27 | return false;
28 | }
29 | }
30 |
31 | public function addToShipping($name,$email,$mobile,$address,$city){
32 | $this->db->query("INSERT INTO shipping
33 | (full_name,email,mobile,address,city)
34 | VALUES(:full_name,:email,:mobile,:address,:city)");
35 | $this->db->bind(':full_name',$name);
36 | $this->db->bind(':email',$email);
37 | $this->db->bind(':mobile',$mobile);
38 | $this->db->bind(':address',$address);
39 | $this->db->bind(':city',$city);
40 | return $this->db->insertById();
41 | }
42 |
43 | public function addToPayment($method,$shipping){
44 | $this->db->query("INSERT INTO payment
45 | (payment_method,payment_status,payment_shipping)
46 | VALUES(:method,0,:payment_shipping)");
47 | $this->db->bind(':method',$method);
48 | $this->db->bind(':payment_shipping',$shipping);
49 | return $this->db->insertById();
50 | }
51 |
52 |
53 | public function addToOrder($customer,$shipping,$payment,$total){
54 | $this->db->query("INSERT INTO c_order (customer_id,shipping_id,
55 | payment_id,order_status,order_total)
56 | VALUES(:customer_id,:shipping_id,
57 | :payment_id,0,:order_total)");
58 | $this->db->bind(':customer_id',$customer);
59 | $this->db->bind(':shipping_id',$shipping);
60 | $this->db->bind(':payment_id',$payment);
61 | $this->db->bind(':order_total',$total);
62 | return $this->db->insertById();
63 | }
64 |
65 | public function addToOrderDetails($order,$product,$product_name,
66 | $price,$qty,$user){
67 | $this->db->query("INSERT INTO c_order_details
68 | (order_id,product_id,
69 | product_name,product_price,product_qty,user)
70 | VALUES(:order_id,:product_id,
71 | :product_name,:product_price,:product_qty,:user)");
72 | $this->db->bind(':order_id',$order);
73 | $this->db->bind(':product_id',$product);
74 | $this->db->bind(':product_name',$product_name);
75 | $this->db->bind(':product_price',$price);
76 | $this->db->bind(':product_qty',$qty);
77 | $this->db->bind(':user',$user);
78 | $this->db->execute();
79 | }
80 |
81 | public function show($id){
82 | $this->db->query("SELECT * FROM c_order
83 | WHERE order_id=:order_id");
84 | $this->db->bind(':order_id',$id);
85 | return $this->db->single();
86 | }
87 |
88 | public function showShipping($id){
89 | $this->db->query("SELECT * FROM shipping
90 | WHERE shipping_id=:shipping_id");
91 | $this->db->bind(':shipping_id',$id);
92 | return $this->db->single();
93 | }
94 |
95 |
96 | public function getAllOrderDetalails($id){
97 | $this->db->query("SELECT * FROM c_order_details
98 | WHERE order_id=:order_id");
99 | $this->db->bind(':order_id',$id);
100 | return $this->db->resultSet();
101 | }
102 |
103 | public function getUserOrderDetalails($user){
104 | $this->db->query("SELECT * FROM c_order_details
105 | WHERE user=:user");
106 | $this->db->bind(':user',$user);
107 | return $this->db->resultSet();
108 | }
109 |
110 | public function delete($id){
111 | $this->db->query("DELETE FROM shipping
112 | WHERE shipping_id=:shipping_id");
113 | $this->db->bind(':shipping_id',$id);
114 | $this->db->execute();
115 | }
116 |
117 |
118 |
119 | public function activate($id){
120 | $this->db->query("UPDATE c_order SET order_status = 1 WHERE order_id=:id");
121 | $this->db->bind(':id',$id);
122 | return $this->db->execute();
123 | }
124 |
125 | public function inActivate($id){
126 | $this->db->query("UPDATE c_order SET order_status = 0 WHERE order_id=:id");
127 | $this->db->bind(':id',$id);
128 | return $this->db->execute();
129 | }
130 |
131 | }
--------------------------------------------------------------------------------
/app/models/Product.php:
--------------------------------------------------------------------------------
1 | >>>>>>>>>>>>>>>>>>>*/
7 | #<---> construct <--->#
8 | /*<<<<<<<<<<<<<<<<<<<<*/
9 | public function __construct(){
10 | $this->db = new Database();
11 | }
12 |
13 | /*>>>>>>>>>>>>>>>>>>>>*/
14 | #<--->allProducts <--->#
15 | /*<<<<<<<<<<<<<<<<<<<<*/
16 | public function getAllPro($active=''){
17 | if($active==''){
18 | $act = "";
19 | }else {
20 | $act = "WHERE products.active=$active";
21 | }
22 |
23 | $this->db->query("SELECT products.*, users.full_name as creator,
24 | categories.cat_name,manufactures.man_name FROM products
25 | INNER JOIN users ON products.user = users.user_id
26 | INNER JOIN categories ON products.cat = categories.cat_id
27 | INNER JOIN manufactures ON products.man = manufactures.man_id
28 | $act
29 | ");
30 | $products = $this->db->resultSet();
31 | if($products){
32 | return $products;
33 | }else {
34 | return false;
35 | }
36 | }
37 |
38 |
39 | public function search($searched){
40 | $this->db->query("SELECT products.*, users.full_name as creator,
41 | categories.cat_name,manufactures.man_name FROM products
42 | INNER JOIN users ON products.user = users.user_id
43 | INNER JOIN categories ON products.cat = categories.cat_id
44 | INNER JOIN manufactures ON products.man = manufactures.man_id
45 | WHERE name LIKE '%$searched%'");
46 | // $this->db->bind(':searched',$searched);
47 | $results = $this->db->resultSet();
48 | if($results){
49 | return $results;
50 | }else {
51 | return false;
52 | }
53 | }
54 | /*>>>>>>>>>>>>>>>>>>>>>>>>*/
55 | #<--->products by cat<--->#
56 | /*<<<<<<<<<<<<<<<<<<<<<<<*/
57 | public function getProByCat($catedgory){
58 | $this->db->query("SELECT products.*, users.full_name as creator,
59 | categories.cat_name,manufactures.man_name FROM products
60 | INNER JOIN users ON products.user = users.user_id
61 | INNER JOIN categories ON products.cat = categories.cat_id
62 | INNER JOIN manufactures ON products.man = manufactures.man_id
63 | WHERE cat=:cat AND products.active=1
64 | ");
65 | $this->db->bind(':cat',$catedgory);
66 | $products = $this->db->resultSet();
67 | if($products){
68 | return $products;
69 | }else {
70 | return false;
71 | }
72 | }
73 |
74 | /*>>>>>>>>>>>>>>>>>>>>>>>>*/
75 | #<--->products by man<--->#
76 | /*<<<<<<<<<<<<<<<<<<<<<<<*/
77 | public function getProByMan($man){
78 | $this->db->query("SELECT products.*, users.full_name as creator,
79 | categories.cat_name,manufactures.man_name FROM products
80 | INNER JOIN users ON products.user = users.user_id
81 | INNER JOIN categories ON products.cat = categories.cat_id
82 | INNER JOIN manufactures ON products.man = manufactures.man_id
83 | WHERE man=:man AND products.active=1
84 | ");
85 | $this->db->bind(':man',$man);
86 | $products = $this->db->resultSet();
87 | if($products){
88 | return $products;
89 | }else {
90 | return false;
91 | }
92 | }
93 |
94 |
95 | /*>>>>>>>>>>>>>>>>>>>>*/
96 | #<---> add <--->#
97 | /*<<<<<<<<<<<<<<<<<<<<*/
98 | public function add(
99 | $name,$desc,$user,$cat,$man,$image,$price,$size,$color
100 | ){
101 | $this->db->query(
102 | "INSERT INTO products
103 | (name,description,user,cat,man,active
104 | ,image
105 | ,price,size,color)
106 | VALUES
107 | (:name,:description,:user,:cat,:man,0,
108 | :image,
109 | :price,:size,:color)
110 | ");
111 | $this->db->bind(':name',$name);
112 | $this->db->bind(':description',$desc);
113 | $this->db->bind(':user',$user);
114 | $this->db->bind(':cat',$cat);
115 | $this->db->bind(':man',$man);
116 | $this->db->bind(':image',$image);
117 | $this->db->bind(':price',$price);
118 | $this->db->bind(':size',$size);
119 | $this->db->bind(':color',$color);
120 | $this->db->execute();
121 | }
122 |
123 | /*>>>>>>>>>>>>>>>>>>>>*/
124 | #<---> update <--->#
125 | /*<<<<<<<<<<<<<<<<<<<<*/
126 | public function update(
127 | $id,$name,$desc,$user,$img,$cat,$man,$price,$size,$color
128 | ){
129 | $this->db->query("UPDATE products SET
130 | name=:name,description=:description,user=:user,cat=:cat,
131 | man=:man,price=:price,size=:size,color=:color,image=:image
132 | WHERE product_id=:product_id
133 | ");
134 | $this->db->bind(':product_id',$id);
135 | $this->db->bind(':name',$name);
136 | $this->db->bind(':description',$desc);
137 | $this->db->bind(':user',$user);
138 | $this->db->bind(':cat',$cat);
139 | $this->db->bind(':man',$man);
140 | $this->db->bind(':image',$img);
141 | $this->db->bind(':price',$price);
142 | $this->db->bind(':size',$size);
143 | $this->db->bind(':color',$color);
144 | $this->db->execute();
145 | }
146 |
147 | public function show($id){
148 | $this->db->query("SELECT products.*, users.full_name as creator,
149 | categories.cat_name as cat_name,manufactures.man_name
150 | as man_name FROM products
151 | INNER JOIN users ON products.user = users.user_id
152 | INNER JOIN categories ON products.cat = categories.cat_id
153 | INNER JOIN manufactures ON products.man = manufactures.man_id
154 | WHERE product_id=:product_id");
155 | $this->db->bind(':product_id',$id);
156 | $product = $this->db->single();
157 | return $product;
158 | }
159 |
160 |
161 |
162 | public function findProName($name,$id = ''){
163 | $this->db->query("SELECT product_id FROM products
164 | WHERE name =:name AND product_id != :product_id");
165 | $this->db->bind(':name',$name);
166 | $this->db->bind(':product_id',$id);
167 | $this->db->execute();
168 | return $this->db->rowCount();
169 | }
170 |
171 | public function delete($id){
172 | $this->db->query("DELETE FROM products WHERE product_id=:id");
173 | $this->db->bind(':id',$id);
174 | return $this->db->execute();
175 | }
176 |
177 | public function activate($id){
178 | $this->db->query("UPDATE products SET active = 1 WHERE product_id=:id");
179 | $this->db->bind(':id',$id);
180 | return $this->db->execute();
181 | }
182 |
183 | public function inActivate($id){
184 | $this->db->query("UPDATE products SET active = 0 WHERE product_id=:id");
185 | $this->db->bind(':id',$id);
186 | return $this->db->execute();
187 | }
188 |
189 | public function addGallary($id,$img){
190 | $this->db->query("INSERT INTO gallary(image_name,product_id)
191 | VALUES(:image_name,:product_id)");
192 | $this->db->bind(':product_id',$id);
193 | $this->db->bind(':image_name',$img);
194 | return $this->db->execute();
195 | }
196 |
197 | public function getGallary($id){
198 | $this->db->query("SELECT * FROM gallary WHERE
199 | product_id=:product_id ");
200 | $this->db->bind(':product_id',$id);
201 | return $this->db->resultSet();
202 | }
203 |
204 | public function deleteGallaryImage($id){
205 | $this->db->query("DELETE FROM gallary WHERE image_id=:image_id");
206 | $this->db->bind(':image_id',$id);
207 | return $this->db->execute();
208 | }
209 |
210 | public function deleteGallary($id){
211 | $this->db->query("DELETE FROM gallary WHERE product_id=:product_id");
212 | $this->db->bind(':product_id',$id);
213 | return $this->db->execute();
214 | }
215 |
216 | }
--------------------------------------------------------------------------------
/app/models/User.php:
--------------------------------------------------------------------------------
1 | db = new Database();
8 | }
9 |
10 | public function register($fullname, $email,$img, $hashedPassword,$vkey){
11 |
12 | $this->db->query(
13 | "INSERT INTO users (full_name,email,image,password,verified,vkey,admin,active)
14 | VALUES (:full_name,:email,:image,:password,0,:vkey,0,0)
15 | ");
16 |
17 | $this->db->bind(':full_name',$fullname);
18 | $this->db->bind(':email',$email);
19 | $this->db->bind(':image',$img);
20 | $this->db->bind(':password',$hashedPassword);
21 | $this->db->bind(':vkey',$vkey);
22 | $this->db->execute();
23 | }
24 |
25 | public function login($email,$password){
26 | $this->db->query("SELECT * FROM users WHERE email =:email");
27 | $this->db->bind(':email',$email);
28 | $user = $this->db->single();
29 |
30 | $hashedPassword = $user->password;
31 | if(password_verify($password,$hashedPassword)){
32 | return $user;
33 | }else{
34 | return false;
35 | }
36 | }
37 |
38 | public function show($id){
39 | $this->db->query("SELECT * FROM users WHERE user_id=:user_id");
40 | $this->db->bind(':user_id',$id);
41 | $user = $this->db->single();
42 | return $user;
43 | }
44 |
45 | public function update($id,$name,$email,$password){
46 | $this->db->query("UPDATE users SET full_name=:full_name
47 | ,email=:email,password=:password WHERE user_id=:user_id");
48 | $this->db->bind(':full_name',$name);
49 | $this->db->bind(':email',$email);
50 | $this->db->bind(':password',$password);
51 | $this->db->bind(':user_id',$id);
52 | $this->db->execute();
53 | }
54 |
55 |
56 | public function notVerified($email){
57 | $this->db->query("SELECT * FROM users WHERE email =:email");
58 | $this->db->bind(':email',$email);
59 | $row = $this->db->single();
60 | $verified = $row->verified;
61 | if($verified == 0){
62 | return true;
63 | }else {
64 | return false;
65 | }
66 | }
67 |
68 | public function findUserByEmail($email,$id=''){
69 | $this->db->query("SELECT * FROM users WHERE
70 | email =:email AND user_id != :user_id");
71 | $this->db->bind(':email',$email);
72 | $this->db->bind(':user_id',$id);
73 | $this->db->execute();
74 | if($this->db->rowCount() > 0){
75 | return true;
76 | }else{
77 | return false;
78 | };
79 | }
80 |
81 | public function forgotP($email,$vkey){
82 | $this->db->query("SELECT `user_id` FROM `users` WHERE `email` = :email");
83 | $this->db->bind(':email', $email);
84 | $this->db->execute();
85 | $row = $this->db->rowCount();
86 | if($row != 0 ){
87 |
88 | $this->db->query("UPDATE users SET vkey = :vkey ,
89 | token_expire = DATE_ADD(NOW(), INTERVAL 60 MINUTE)
90 | WHERE email=:email");
91 | $this->db->bind(':email', $email);
92 | $this->db->bind(':vkey', $vkey);
93 | if($this->db->execute()){
94 | return true;
95 | }else {
96 | return false;
97 | }
98 | }
99 | }
100 |
101 | public function resetP($vkey,$password){
102 |
103 | $this->db->query("SELECT user_id FROM users WHERE
104 | vkey =:vkey AND token_expire > NOW()");
105 | $this->db->bind(':vkey',$vkey);
106 | $this->db->execute();
107 | $row = $this->db->rowCount();
108 | if($row > 0){
109 | $this->db->query("UPDATE users SET password =:password
110 | WHERE vkey=:vkey");
111 | $this->db->bind(':vkey',$vkey);
112 | $this->db->bind(':password',$password);
113 | if($this->db->execute()){
114 | return true;
115 | }else {
116 | return false;
117 | };
118 | }else{
119 | return false;
120 | }
121 | }
122 |
123 |
124 |
125 | public function selectVkey($email,$vkey){
126 | $this->db->query("SELECT * FROM users WHERE vkey=:vkey AND email=:email");
127 | $this->db->bind(':vkey',$vkey);
128 | $this->db->bind(':email',$email);
129 | $userData = $this->db->single();
130 | $user = $this->db->rowCount();
131 | if ($user > 0) {
132 | $this->db->query("UPDATE users SET verified = 1 WHERE vkey=:vkey AND email=:email");
133 | $this->db->bind(':vkey',$vkey);
134 | $this->db->bind(':email',$email);
135 | $user1 = $this->db->execute();
136 | if($user1){
137 | return $userData;
138 | }else {
139 | return false;
140 | }
141 | } else {
142 | return false;
143 | }
144 |
145 |
146 | }
147 |
148 | public function userData($name,$user_id){
149 | $this->db->query("SELECT * FROM users WHERE user_id=:user_id AND full_name=:full_name");
150 | $this->db->bind(':user_id',$user_id);
151 | $this->db->bind(':full_name',$name);
152 | $user = $this->db->single();
153 | if($user){
154 | return $user;
155 | }else{
156 | return false;
157 | }
158 | }
159 |
160 | public function avatar($id, $img){
161 | $this->db->query("UPDATE users SET image = :image
162 | WHERE user_id=:user_id");
163 | $this->db->bind(':image',$img);
164 | $this->db->bind(':user_id',$id);
165 | return $this->db->execute();
166 | }
167 |
168 | }
--------------------------------------------------------------------------------
/app/views/admins/dashboard.php:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/app/views/admins/login.php:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
13 |
20 |
21 |
22 |
23 | '.$data['errPassword'].'
' : '' ?>
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/app/views/categories/add.php:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
13 |
20 |
21 |
26 | '.$data['errDes'].'
' : '' ?>
27 |
28 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
--------------------------------------------------------------------------------
/app/views/categories/all.php:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
Categories Management
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 | Add new cat +
15 |
16 |
17 |
60 |
61 |
There is no Categoroes
62 |
63 |
64 |
65 |
66 |
--------------------------------------------------------------------------------
/app/views/categories/edit.php:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
13 |
27 |
28 |
33 | '.$data['errDes'].'
' : '' ?>
34 |
35 |
36 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
--------------------------------------------------------------------------------
/app/views/categories/search.php:
--------------------------------------------------------------------------------
1 |
2 | 0){ ?>
3 |
46 |
47 | There is no results
48 |
49 |
50 |
51 |
--------------------------------------------------------------------------------
/app/views/categories/show.php:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
cat_name ?>
8 |
9 |
12 |
13 |
14 | -
15 | Category: cat_name ?>
16 |
17 | -
18 | ID: cat_id ?>
19 |
20 | -
21 | Description: description ?>
22 |
23 | -
24 | Status: active == 0? 'Active':'InActive'?>
25 |
26 | -
27 | Creator: creator ?>
28 |
29 | -
30 | Date: created_at ?>
31 |
32 |
33 |
34 |
35 |
36 |
37 | Go Back
38 |
39 |
40 |
41 |
42 |
--------------------------------------------------------------------------------
/app/views/front/ProCategory.php:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
Prouducts
6 |
7 |
8 |
Categories
9 |
10 |
14 | - cat_name ?>
15 |
17 | There is no categories
18 |
20 |
21 |
22 |
Brands
23 |
24 |
28 | - man_name ?>
29 |
31 | There is no Brands
32 |
34 |
35 |
36 |
37 |
38 |
42 |
43 |
44 |
price?>$
45 |

46 |
47 |
name ?>
48 |
Details
49 |
50 |
51 |
52 |
53 |
55 |
There is no any products under this category
56 |
58 |
59 |
60 |
--------------------------------------------------------------------------------
/app/views/front/ProManufacture.php:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
Prouducts
6 |
7 |
8 |
Categories
9 |
10 |
14 | - cat_name ?>
15 |
17 | There is no categories
18 |
20 |
21 |
22 |
Brands
23 |
24 |
28 | - man_name ?>
29 |
31 | There is no Brands
32 |
34 |
35 |
36 |
37 |
38 |
42 |
43 |
44 |
price?>$
45 |

46 |
47 |
name ?>
48 |
Details
49 |
50 |
51 |
52 |
53 |
55 |
There is no any products under this brand
56 |
58 |
59 |
60 |
--------------------------------------------------------------------------------
/app/views/front/cart.php:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | Name |
9 | Price |
10 | Qty |
11 | Update Qty |
12 | Total |
13 |
14 |
15 |
16 |
21 |
22 | pro_name ?> |
23 | price ?> |
24 |
25 | qty ?>
26 | |
27 |
28 |
33 |
37 | |
38 | qty * $cart->price, 2 , '.', '');
42 | ?> |
43 |
44 | qty * $cart->price);
46 | $qty = $qty + ($cart->qty);
47 | }?>
48 |
49 |
50 |
51 | Cart Details
52 | - Total Price:
55 |
56 |
57 | - Total Qty :
60 |
61 | -
62 |
66 |
67 |
68 |
69 |
70 |
71 |
74 |
80 |
81 |
82 | '.$data['errEmail'].'
' : '' ?>
83 |
84 |
85 |
86 | '.$data['errMobile'].'
' : '' ?>
87 |
88 |
89 |
90 | '.$data['errAddress'].'
' : '' ?>
91 |
92 |
93 |
95 | '.$data['errCity'].'
' : '' ?>
96 |
97 |
98 |
99 |
100 |
101 | '.$data['errMethod'].'' : '' ?>
102 | if you want online payment click twice on stripe
103 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 | There is no items in cart
125 |
126 |
127 | Go Back
128 |
129 |
130 |
131 |
132 |
--------------------------------------------------------------------------------
/app/views/front/details.php:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
name ?>
5 |
6 |
9 |
10 |
11 |
12 |

13 |
14 |
15 |
16 | -
17 | Product: name ?>
18 |
19 | -
20 | Price: price ?>$
21 |
22 |
23 | -
24 | Color: color ?>
25 |
26 | -
27 | Size: size ?>
28 |
29 | -
30 |
-
31 | Brand: man_name ?>
32 |
33 | -
34 | Category: cat_name?>
35 |
36 | Description: description ?>
37 |
38 |
39 | -
40 | Creator: creator ?>
41 |
42 | -
43 | Date: created_at ?>
44 |
45 |
46 |
Gallary
47 | 0){?>
49 |
50 |
52 |
53 |
54 |
55 |
56 |
57 |
59 |
No gallary for this product
60 |
62 |
63 |
64 |
65 |
69 |
70 |
71 |
--------------------------------------------------------------------------------
/app/views/front/index.php:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
Our Prouducts
5 |
13 |
14 |
15 |
16 |
17 |
Categories
18 |
19 |
23 | - cat_name ?>
24 |
26 | There is no categories
27 |
29 |
30 |
31 |
Brands
32 |
33 |
37 | - man_name ?>
38 |
40 | There is no Brands
41 |
43 |
44 |
45 |
46 |
47 |
51 |
52 |
53 |
price?>$
54 |

55 |
56 |
name ?>
57 |
Details
58 |
59 |
60 |
61 |
62 |
64 |
There is no Products
65 |
67 |
68 |
69 |
--------------------------------------------------------------------------------
/app/views/front/orders.php:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
Your Orders
5 |
6 |
9 |
10 |
11 |
12 |
13 | Series |
14 | Product Name |
15 | Product Price |
16 | Quantity |
17 | SubTotal |
18 |
19 |
23 |
24 | |
25 | product_name ?> |
26 | product_price,2) ?>$ |
27 | product_qty ?> |
28 | product_price * $order->product_qty,2) ?>$ |
29 |
30 |
32 | There is no Orders
33 |
35 |
36 |
37 |
38 |
39 |
40 |
--------------------------------------------------------------------------------
/app/views/front/thank.php:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Thank You For Purshasing, We Will Contact You Soon...
7 |
8 |
see your orders...
9 |
Go Back
10 |
--------------------------------------------------------------------------------
/app/views/inc/adminFooter.php:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |