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
1273c01f
Commit
1273c01f
authored
5 years ago
by
Jansa Jose
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into 'local_production'
add new shop tab in admin panel See merge request
!171
parents
bc1a52fd
e0ee42b3
Show 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 @
1273c01f
...
@@ -138,5 +138,16 @@ class Shop extends CI_Controller {
...
@@ -138,5 +138,16 @@ class Shop extends CI_Controller {
redirect
(
base_url
(
'Shop/editShop/'
.
$shop_id
));
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
This diff is collapsed.
Click to expand it.
application/models/Shop_model.php
View file @
1273c01f
...
@@ -10,6 +10,8 @@ class Shop_model extends CI_Model {
...
@@ -10,6 +10,8 @@ class Shop_model extends CI_Model {
return
0
;
return
0
;
}
}
$shop_data
[
'mechanic_id'
]
=
$this
->
session
->
userdata
[
'id'
];
//pr($shop_data);
$status
=
$this
->
db
->
insert
(
'mechanic_shop'
,
$shop_data
);
$status
=
$this
->
db
->
insert
(
'mechanic_shop'
,
$shop_data
);
return
(
$status
)
?
1
:
0
;
return
(
$status
)
?
1
:
0
;
}
}
...
@@ -42,5 +44,23 @@ class Shop_model extends CI_Model {
...
@@ -42,5 +44,23 @@ class Shop_model extends CI_Model {
return
(
$status
)
?
1
:
0
;
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
This diff is collapsed.
Click to expand it.
application/views/Templates/left-menu.php
View file @
1273c01f
...
@@ -16,27 +16,6 @@
...
@@ -16,27 +16,6 @@
<li
class=
"treeview"
>
<li
class=
"treeview"
>
<a
href=
"#"
>
<a
href=
"#"
>
<i
class=
"fa fa-bars"
aria-hidden=
"true"
></i>
<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>
<span>
Services
</span>
<i
class=
"fa fa-angle-left pull-right"
></i>
<i
class=
"fa fa-angle-left pull-right"
></i>
</a>
</a>
...
@@ -94,6 +73,27 @@
...
@@ -94,6 +73,27 @@
<li
class=
"treeview"
>
<li
class=
"treeview"
>
<a
href=
"#"
>
<a
href=
"#"
>
<i
class=
"fa fa-bars"
aria-hidden=
"true"
></i>
<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>
<span>
Customer Management
</span>
<i
class=
"fa fa-angle-left pull-right"
></i>
<i
class=
"fa fa-angle-left pull-right"
></i>
</a>
</a>
...
@@ -192,7 +192,12 @@
...
@@ -192,7 +192,12 @@
</li>
</li>
</ul>
</ul>
</li>
</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'
)
?>
"
>
<li><a
href=
"
<?=
base_url
(
'Settings'
)
?>
"
>
<i
class=
"fa fa-wrench"
aria-hidden=
"true"
>
<i
class=
"fa fa-wrench"
aria-hidden=
"true"
>
</i><span>
Settings
</span></a>
</i><span>
Settings
</span></a>
...
...
This diff is collapsed.
Click to expand it.
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