Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
dcarfixers
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
2
Issues
2
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Tobin
dcarfixers
Commits
e0ee42b3
Commit
e0ee42b3
authored
Aug 07, 2019
by
Jansa Jose
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add new shop tab in admin panel
parent
1c207318
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
60 additions
and
22 deletions
+60
-22
Shop.php
application/controllers/Shop.php
+12
-0
Shop_model.php
application/models/Shop_model.php
+21
-0
left-menu.php
application/views/Templates/left-menu.php
+27
-22
No files found.
application/controllers/Shop.php
View file @
e0ee42b3
...
...
@@ -138,5 +138,16 @@ class Shop extends CI_Controller {
redirect
(
base_url
(
'Shop/editShop/'
.
$shop_id
));
}
}
public
function
listShops
(){
$template
[
'page'
]
=
'Shop/listShops'
;
$template
[
'menu'
]
=
'Shops List'
;
$template
[
'smenu'
]
=
' List Shop'
;
$template
[
'pTitle'
]
=
"Shop List"
;
$template
[
'pDescription'
]
=
"List Shops and Co-workers"
;
$template
[
'shop_data'
]
=
$this
->
Shop_model
->
listShop
();
//pr($template['shop_data']);
$this
->
load
->
view
(
'template'
,
$template
);
}
}
?>
\ No newline at end of file
application/models/Shop_model.php
View file @
e0ee42b3
...
...
@@ -10,6 +10,8 @@ class Shop_model extends CI_Model {
return
0
;
}
$shop_data
[
'mechanic_id'
]
=
$this
->
session
->
userdata
[
'id'
];
//pr($shop_data);
$status
=
$this
->
db
->
insert
(
'mechanic_shop'
,
$shop_data
);
return
(
$status
)
?
1
:
0
;
}
...
...
@@ -42,5 +44,23 @@ class Shop_model extends CI_Model {
return
(
$status
)
?
1
:
0
;
}
function
listShop
(){
$id
=
$this
->
session
->
userdata
[
'id'
];
$respArr
=
array
(
'status'
=>
'error'
);
$this
->
db
->
select
(
'mechanic_shop.*'
);
$this
->
db
->
join
(
'mechanic_shop'
,
'mechanic_shop.shop_id = mechanic.shop_id'
,
'left'
);
$shop
=
$this
->
db
->
get_where
(
'mechanic'
,
array
(
'mechanic.mechanic_id'
=>
$id
));
if
(
!
empty
(
$shop
)
&&
$shop
->
num_rows
()
>
0
&&
!
empty
(
$shop
=
$shop
->
row_array
())){
$respArr
[
'status'
]
=
"success"
;
$respArr
[
'shops'
]
=
$shop
;
$mechs
=
$this
->
db
->
get_where
(
'mechanic'
,
array
(
'shop_id'
=>
$shop
[
'shop_id'
],
'mechanic_id!='
=>
$id
));
if
(
!
empty
(
$mechs
)
&&
$mechs
->
num_rows
()
>
0
&&
!
empty
(
$mechanics
=
$mechs
->
result_array
())){
$respArr
[
'coworkers'
]
=
$mechanics
;
}
}
return
$respArr
;
}
}
?>
\ No newline at end of file
application/views/Templates/left-menu.php
View file @
e0ee42b3
...
...
@@ -16,27 +16,6 @@
<li
class=
"treeview"
>
<a
href=
"#"
>
<i
class=
"fa fa-bars"
aria-hidden=
"true"
></i>
<span>
Auto Service Centers
</span>
<i
class=
"fa fa-angle-left pull-right"
></i>
</a>
<ul
class=
"treeview-menu"
>
<li>
<a
href=
"
<?=
base_url
(
'Shop/addShop'
)
?>
"
>
<i
class=
"fa fa-circle-o text-aqua"
></i>
Add Mechanic Shop
</a>
</li>
<li>
<a
href=
"
<?=
base_url
(
'Shop/viewShops'
)
?>
"
>
<i
class=
"fa fa-circle-o text-aqua"
></i>
View Mechanic Shops
</a>
</li>
</ul>
</li>
<li
class=
"treeview"
>
<a
href=
"#"
>
<i
class=
"fa fa-bars"
aria-hidden=
"true"
></i>
<span>
Services
</span>
<i
class=
"fa fa-angle-left pull-right"
></i>
</a>
...
...
@@ -94,6 +73,27 @@
<li
class=
"treeview"
>
<a
href=
"#"
>
<i
class=
"fa fa-bars"
aria-hidden=
"true"
></i>
<span>
Auto Service Centers
</span>
<i
class=
"fa fa-angle-left pull-right"
></i>
</a>
<ul
class=
"treeview-menu"
>
<li>
<a
href=
"
<?=
base_url
(
'Shop/addShop'
)
?>
"
>
<i
class=
"fa fa-circle-o text-aqua"
></i>
Add Mechanic Shop
</a>
</li>
<li>
<a
href=
"
<?=
base_url
(
'Shop/viewShops'
)
?>
"
>
<i
class=
"fa fa-circle-o text-aqua"
></i>
View Mechanic Shops
</a>
</li>
</ul>
</li>
<li
class=
"treeview"
>
<a
href=
"#"
>
<i
class=
"fa fa-bars"
aria-hidden=
"true"
></i>
<span>
Customer Management
</span>
<i
class=
"fa fa-angle-left pull-right"
></i>
</a>
...
...
@@ -192,7 +192,12 @@
</li>
</ul>
</li>
<?php
if
(
$this
->
session
->
userdata
[
'user_type'
]
==
1
){
?>
<?php
if
(
$this
->
session
->
userdata
[
'user_type'
]
!=
1
){
?>
<li>
<a
href=
"
<?=
base_url
(
'Shop/listShops'
)
?>
"
><i
class=
"fa fa-book"
aria-hidden=
"true"
>
</i><span>
View Shop
</span></a>
</li>
<?php
}
if
(
$this
->
session
->
userdata
[
'user_type'
]
==
1
){
?>
<li><a
href=
"
<?=
base_url
(
'Settings'
)
?>
"
>
<i
class=
"fa fa-wrench"
aria-hidden=
"true"
>
</i><span>
Settings
</span></a>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment