Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nemt_backend
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
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
nemt_backend
Commits
25040841
Commit
25040841
authored
Oct 16, 2018
by
Tobin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
daily commit
parent
19a9e556
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
185 additions
and
1 deletion
+185
-1
Settings.php
application/controllers/Settings.php
+82
-0
viewSettings.php
application/views/Settings/viewSettings.php
+96
-0
header-menu.php
application/views/Templates/header-menu.php
+3
-1
left-menu.php
application/views/Templates/left-menu.php
+4
-0
No files found.
application/controllers/Settings.php
0 → 100644
View file @
25040841
<?php
defined
(
'BASEPATH'
)
OR
exit
(
'No direct script access allowed'
);
class
Settings
extends
CI_Controller
{
public
function
__construct
()
{
parent
::
__construct
();
date_default_timezone_set
(
"Asia/Kolkata"
);
$this
->
load
->
model
(
'Settings_model'
);
$this
->
load
->
model
(
'Dashboard_model'
);
if
(
!
$this
->
session
->
userdata
(
'logged_in'
))
{
redirect
(
base_url
(
'Login'
));
}
if
(
$this
->
session
->
userdata
[
'user_type'
]
!=
1
){
$flashMsg
=
array
(
'message'
=>
'Access Denied You don\'t have permission to access this Page'
,
'class'
=>
'error'
);
$this
->
session
->
set_flashdata
(
'message'
,
$flashMsg
);
redirect
(
base_url
());
}
}
public
function
index
()
{
$template
[
'page'
]
=
'Settings/viewSettings'
;
$template
[
'menu'
]
=
"Site Settings"
;
$template
[
'sub_menu'
]
=
"Change Settings"
;
$template
[
'page_desc'
]
=
"Edit or View Settings"
;
$template
[
'page_title'
]
=
"Settings"
;
$template
[
'data'
]
=
$this
->
Settings_model
->
settings_viewing
();
$this
->
load
->
view
(
'template'
,
$template
);
}
public
function
change_settings
(){
$flashMsg
=
array
(
'message'
=>
'Something went wrong, please try again..!'
,
'class'
=>
'error'
);
if
(
!
isset
(
$_POST
)
||
empty
(
$_POST
)){
$this
->
session
->
set_flashdata
(
'message'
,
$flashMsg
);
redirect
(
base_url
(
'Settings'
));
}
if
(
isset
(
$_FILES
[
'site_logo'
])
&&
!
empty
(
$_FILES
[
'site_logo'
])){
$config
=
set_upload_service
(
"assets/uploads/services"
);
$this
->
load
->
library
(
'upload'
);
$config
[
'file_name'
]
=
time
()
.
"_"
.
$_FILES
[
'site_logo'
][
'name'
];
$this
->
upload
->
initialize
(
$config
);
if
(
$this
->
upload
->
do_upload
(
'site_logo'
)){
$upload_data
=
$this
->
upload
->
data
();
$_POST
[
'site_logo'
]
=
$config
[
'upload_path'
]
.
"/"
.
$upload_data
[
'file_name'
];
}
}
if
(
isset
(
$_FILES
[
'fav_icon'
])
&&
!
empty
(
$_FILES
[
'fav_icon'
])){
$config
=
set_upload_service
(
"assets/uploads/services"
);
$this
->
load
->
library
(
'upload'
);
$config
[
'file_name'
]
=
time
()
.
"_"
.
$_FILES
[
'fav_icon'
][
'name'
];
$this
->
upload
->
initialize
(
$config
);
if
(
$this
->
upload
->
do_upload
(
'fav_icon'
)){
$upload_data
=
$this
->
upload
->
data
();
$_POST
[
'fav_icon'
]
=
$config
[
'upload_path'
]
.
"/"
.
$upload_data
[
'file_name'
];
}
}
$status
=
$this
->
Settings_model
->
update_settings
(
$_POST
);
if
(
$status
){
$flashMsg
[
'class'
]
=
'success'
;
$flashMsg
[
'message'
]
=
'Settings Successfully Updated..!'
;
$settings
=
$this
->
Settings_model
->
settings_viewing
();
if
(
!
empty
(
$settings
)){
$this
->
session
->
set_userdata
(
'settings'
,
$settings
);
}
}
$this
->
session
->
set_flashdata
(
'message'
,
$flashMsg
);
redirect
(
base_url
(
'Settings'
));
}
}
?>
\ No newline at end of file
application/views/Settings/viewSettings.php
0 → 100644
View file @
25040841
<div
class=
"content-wrapper"
>
<section
class=
"content-header"
>
<h1>
<?=
$page_title
?>
<small>
<?=
$page_desc
?>
</small>
</h1>
<ol
class=
"breadcrumb"
>
<li><a
href=
"
<?=
base_url
()
?>
"
><i
class=
"fa fa-star-o"
aria-hidden=
"true"
></i>
Home
</a></li>
<li>
<?=
$menu
?>
</li>
<li
class=
"active"
>
<?=
$sub_menu
?>
</li>
</ol>
</section>
<section
class=
"content"
>
<div
class=
"row"
>
<div
class=
"col-md-12"
>
<?php
if
(
$this
->
session
->
flashdata
(
'message'
))
{
$flashdata
=
$this
->
session
->
flashdata
(
'message'
);
?>
<div
class=
"alert alert-
<?=
$flashdata
[
'class'
]
?>
"
>
<button
class=
"close"
data-dismiss=
"alert"
type=
"button"
>
×
</button>
<?=
$flashdata
[
'message'
]
?>
</div>
<?php
}
?>
</div>
<div
class=
"col-md-12"
>
<div
class=
"box box-warning"
>
<div
class=
"box-header with-border"
>
<h3
class=
"box-title"
>
Edit Driver Details
</h3>
</div>
<form
method=
"post"
class=
"validate"
role=
"form"
action=
"
<?=
base_url
()
.
'Settings/change_settings'
?>
"
enctype=
"multipart/form-data"
data-parsley-validate=
""
>
<div
class=
"box-body"
>
<div
class=
"row"
>
<div
class=
"form-group col-xs-4"
>
<label>
Site Title
</label>
<input
type=
"text"
name=
"title"
class=
"form-control required"
placeholder=
"Enter Site Title"
value=
"
<?=
$data
[
'title'
]
?>
"
>
</div>
<div
class=
"form-group col-xs-3"
>
<label>
Title Short
</label>
<input
type=
"text"
name=
"title_short"
class=
"form-control required"
placeholder=
"Enter Site Title"
value=
"
<?=
$data
[
'title_short'
]
?>
"
>
</div>
<div
class=
"form-group col-xs-5"
>
<label
for=
"exampleInputEmail1"
>
Site Logo
</label>
<div
class=
"col-md-12"
>
<div
class=
"col-md-3"
>
<img
id=
"site_logo"
src=
"
<?=
base_url
(
$data
[
'site_logo'
])
?>
"
onerror=
"this.src='
<?=
base_url
(
"assets/images/no_image.png"
)
?>
';"
height=
"75"
width=
"75"
>
</div>
<div
class=
"col-md-9"
style=
"padding-top: 25px;"
>
<input
name=
"site_logo"
type=
"file"
accept=
"image/*"
onchange=
"setImg(this,'site_logo');"
/>
</div>
</div>
</div>
</div>
<div
class=
"row"
>
<div
class=
"form-group col-xs-4"
>
<label>
Country Code
</label>
<input
type=
"text"
name=
"country_flag"
class=
"form-control required"
placeholder=
"Enter SMTP Username"
value=
"
<?=
$data
[
'country_flag'
]
?>
"
>
</div>
<div
class=
"form-group col-xs-3"
>
<label>
Currency
</label>
<input
type=
"text"
name=
"currency"
class=
"form-control required"
placeholder=
"Enter SMTP Password"
value=
"
<?=
$data
[
'currency'
]
?>
"
>
</div>
<div
class=
"form-group col-xs-5"
>
<label
for=
"exampleInputEmail1"
>
Fav Icon
</label>
<div
class=
"col-md-12"
>
<div
class=
"col-md-3"
>
<img
id=
"fav_icon"
src=
"
<?=
base_url
(
$data
[
'fav_icon'
])
?>
"
onerror=
"this.src='
<?=
base_url
(
"assets/images/no_image.png"
)
?>
';"
height=
"75"
width=
"75"
/>
</div>
<div
class=
"col-md-9"
style=
"padding-top: 25px;"
>
<input
name=
"fav_icon"
type=
"file"
accept=
"image/*"
onchange=
"setImg(this,'fav_icon');"
/>
</div>
</div>
</div>
</div>
<div
class=
"row"
>
<div
class=
"form-group col-xs-4"
>
<label>
SMTP Username
</label>
<input
type=
"text"
name=
"smtp_username"
class=
"form-control required"
placeholder=
"Enter SMTP Username"
value=
"
<?=
$data
[
'smtp_username'
]
?>
"
>
</div>
<div
class=
"form-group col-xs-3"
>
<label>
SMTP Password
</label>
<input
type=
"text"
name=
"smtp_password"
class=
"form-control required"
placeholder=
"Enter SMTP Password"
value=
"
<?=
$data
[
'smtp_password'
]
?>
"
>
</div>
<div
class=
"form-group col-xs-4"
>
<label>
SMTP Host
</label>
<input
type=
"text"
name=
"smtp_host"
class=
"form-control required"
placeholder=
"Enter Host Name"
value=
"
<?=
$data
[
'smtp_host'
]
?>
"
>
</div>
</div>
</div>
<div
class=
"box-footer"
style=
"padding-left:46%"
>
<button
type=
"submit"
class=
"btn btn-info"
>
Update
</button>
</div>
</form>
</div>
</section>
</div>
\ No newline at end of file
application/views/Templates/header-menu.php
View file @
25040841
...
@@ -3,7 +3,9 @@
...
@@ -3,7 +3,9 @@
<a
href=
"
<?php
echo
base_url
();
?>
"
class=
"logo"
>
<a
href=
"
<?php
echo
base_url
();
?>
"
class=
"logo"
>
<!-- mini logo for sidebar mini 50x50 pixels -->
<!-- mini logo for sidebar mini 50x50 pixels -->
<!-- <span class="logo-mini"><b>B S</b></span>-->
<!-- <span class="logo-mini"><b>B S</b></span>-->
<span
class=
"logo-mini"
><b>
<?=
$this
->
session
->
userdata
[
'settings'
][
'title_short'
]
?>
</b></span>
<span
class=
"logo-mini"
>
<img
id=
"fav_icon"
src=
"
<?=
base_url
(
$this
->
session
->
userdata
[
'settings'
][
'site_logo'
])
?>
"
onerror=
"this.src='
<?=
base_url
(
"assets/images/no_image.png"
)
?>
';"
height=
"50"
width=
"50"
/>
</span>
<!-- logo for regular state and mobile devices -->
<!-- logo for regular state and mobile devices -->
<!-- <span class="logo-lg"><b>Bus Solution</b></span>-->
<!-- <span class="logo-lg"><b>Bus Solution</b></span>-->
<span
class=
"hidden-xs"
>
<?=
$this
->
session
->
userdata
[
'settings'
][
'title_short'
]
?>
</span>
<span
class=
"hidden-xs"
>
<?=
$this
->
session
->
userdata
[
'settings'
][
'title_short'
]
?>
</span>
...
...
application/views/Templates/left-menu.php
View file @
25040841
...
@@ -146,6 +146,10 @@
...
@@ -146,6 +146,10 @@
<i
class=
"fa fa-wrench"
aria-hidden=
"true"
>
<i
class=
"fa fa-wrench"
aria-hidden=
"true"
>
</i><span>
Report Generation
</span></a>
</i><span>
Report Generation
</span></a>
</li>
</li>
<li><a
href=
"
<?=
base_url
(
'Settings'
)
?>
"
>
<i
class=
"fa fa-wrench"
aria-hidden=
"true"
>
</i><span>
Settings
</span></a>
</li>
</ul>
</ul>
</section>
</section>
<!-- /.sidebar -->
<!-- /.sidebar -->
...
...
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