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
fff67804
Commit
fff67804
authored
Sep 28, 2018
by
Tobin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
daily commit
parent
a84a8538
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
259 additions
and
97 deletions
+259
-97
database.php
application/config/database.php
+3
-6
Login.php
application/controllers/Login.php
+3
-8
Ride.php
application/controllers/Ride.php
+21
-22
Ride_model.php
application/models/Ride_model.php
+16
-0
Settings_model.php
application/models/Settings_model.php
+5
-2
add_transport.php
application/views/Ride/add_transport.php
+191
-0
add_vehicle.php
application/views/Ride/add_vehicle.php
+0
-53
footer-script.php
application/views/Templates/footer-script.php
+6
-4
nemt_custom.js
assets/js/nemt_custom.js
+14
-2
No files found.
application/config/database.php
View file @
fff67804
...
...
@@ -75,13 +75,10 @@ $query_builder = TRUE;
$db
[
'default'
]
=
array
(
'dsn'
=>
''
,
'hostname'
=>
'
localhost
'
,
'hostname'
=>
'
192.168.140.123
'
,
'username'
=>
'root'
,
'password'
=>
''
,
// 'hostname' => '192.168.140.123',
// 'username' => 'root',
// 'password' => 'Golden_123',
'database'
=>
'tobin_nemt'
,
'password'
=>
'Golden_123'
,
'database'
=>
'tobin_nemt_backend'
,
'dbdriver'
=>
'mysqli'
,
'dbprefix'
=>
''
,
'pconnect'
=>
FALSE
,
...
...
application/controllers/Login.php
View file @
fff67804
...
...
@@ -47,17 +47,12 @@ class Login extends CI_Controller {
$sess_array
=
array
(
'id'
=>
$result
->
id
,
'username'
=>
$result
->
username
);
$resulttitles
=
$this
->
Settings_model
->
settings_viewing
();
$sessing_arrays
=
array
(
'title'
=>
$resulttitles
->
title
,
'title_short'
=>
$resulttitles
->
title_short
,
'image'
=>
$result
->
image
);
$settings
=
$this
->
Settings_model
->
settings_viewing
();
$this
->
session
->
set_userdata
(
'title'
,
$sessing_arrays
);
$this
->
session
->
set_userdata
(
'logged_in'
,
$sess_array
);
$this
->
session
->
set_userdata
(
'id'
,
$result
->
id
);
$this
->
session
->
set_userdata
(
'settings'
,
$settings
);
$this
->
session
->
set_userdata
(
'logged_in'
,
$sess_array
);
$this
->
session
->
set_userdata
(
'user_type'
,
$result
->
user_type
);
$this
->
session
->
set_userdata
(
'menu_config'
,
$menu_config
);
$this
->
session
->
set_userdata
(
'menu_permision'
,
$menu_permision
);
$this
->
session
->
set_userdata
(
'profile_pic'
,
$result
->
profile_image
);
return
TRUE
;
...
...
application/controllers/Ride.php
View file @
fff67804
...
...
@@ -14,13 +14,20 @@ class Ride extends CI_Controller {
}
function
import_ride
(){
$template
[
'page'
]
=
'Ride/add_vehicle'
;
$this
->
load
->
model
(
'Vehicle_model'
);
$template
[
'page'
]
=
'Ride/add_transport'
;
$template
[
'menu'
]
=
"Ride Management"
;
$template
[
'sub_menu'
]
=
"Import Rides"
;
$template
[
'sub_menu'
]
=
"Create/Import Rides"
;
$template
[
'page_desc'
]
=
"Create/Import Ride data"
;
$template
[
'page_title'
]
=
"Create/Import Ride"
;
$template
[
'trip_type'
]
=
$this
->
Ride_model
->
getTripType
();
$template
[
'vehicle_data'
]
=
$this
->
Vehicle_model
->
getVehicle
();
$template
[
'appointment_reason'
]
=
$this
->
Ride_model
->
getAppReason
();
$template
[
'page_desc'
]
=
"Import Broker Ride data through CSV File"
;
$template
[
'page_title'
]
=
"Import Ride"
;
$this
->
load
->
view
(
'template'
,
$template
);
}
...
...
@@ -42,28 +49,19 @@ class Ride extends CI_Controller {
$colCnt
++
;
}
}
$insertData
=
array
(
'medical_no'
=>
$row
[
0
],
'patient_name'
=>
$row
[
2
]
.
' '
.
$col
[
1
],
'age'
=>
$row
[
4
],
'phone'
=>
$row
[
5
],
'trip_no'
=>
$row
[
7
],
'appointment_time'
=>
$row
[
8
]
.
' '
.
$col
[
8
],
'reason_code'
=>
$row
[
11
],
'trip_cost'
=>
$row
[
22
],
'pickup_location'
=>
$row
[
23
],
'drop_location'
=>
$row
[
28
],
'trip_bid_status'
=>
$row
[
37
],
'trip_status'
=>
$row
[
12
],
'vehicle_type'
=>
$row
[
13
],
'trip_type'
=>
$row
[
14
]);
if
(
$header
!=
0
){
$insertData
=
array
(
'medical_no'
=>
$row
[
0
],
'patient_name'
=>
$row
[
2
]
.
' '
.
$col
[
1
],
'age'
=>
$row
[
4
],
'phone'
=>
$row
[
5
],
'trip_no'
=>
$row
[
7
],
'appointment_time'
=>
$row
[
8
]
.
' '
.
$col
[
8
],
'reason_code'
=>
$row
[
11
],
'trip_cost'
=>
$row
[
22
],
'pickup_location'
=>
$row
[
23
],
'drop_location'
=>
$row
[
28
],
'trip_bid_status'
=>
$row
[
37
],
'trip_status'
=>
$row
[
12
],
'vehicle_type'
=>
$row
[
13
],
'trip_type'
=>
$row
[
14
]);
$insertData
[
'data'
]
=
json_encode
(
$rowArr
);
$insertArr
[]
=
$insertData
;
$insertData
[
'data'
]
=
json_encode
(
$rowArr
);
$insertArr
[]
=
$insertData
;
}
$header
=
1
;
}
pr
(
$insertArr
);
fclose
(
$handle
);
}
pr
(
$json_data
);
$flashMsg
=
array
(
'message'
=>
'Something went wrong, please try again..!'
,
'class'
=>
'error'
);
$this
->
session
->
set_flashdata
(
'message'
,
$flashMsg
);
redirect
(
base_url
(
'Broker/add_broker'
));
// $insertArr
}
}
\ No newline at end of file
application/models/Ride_model.php
View file @
fff67804
...
...
@@ -5,5 +5,20 @@ class Ride_model extends CI_Model {
parent
::
_construct
();
}
function
getAppReason
(){
$reason
=
$this
->
db
->
get_where
(
'appointment_reason'
,
array
(
'status'
=>
'1'
));
if
(
!
empty
(
$reason
)){
return
$reason
->
result
();
}
return
;
}
function
getTripType
(){
$tripType
=
$this
->
db
->
get_where
(
'trip_type'
,
array
(
'status'
=>
'1'
));
if
(
!
empty
(
$tripType
)){
return
$tripType
->
result
();
}
return
;
}
}
?>
\ No newline at end of file
application/models/Settings_model.php
View file @
fff67804
...
...
@@ -11,8 +11,11 @@ class Settings_model extends CI_Model {
function
settings_viewing
(){
$query
=
$this
->
db
->
query
(
" SELECT * FROM `setting` order by id DESC "
)
->
row
();
return
$query
;
$query
=
$this
->
db
->
query
(
" SELECT * FROM `setting` order by id DESC "
);
if
(
!
empty
(
$query
)){
return
$query
->
row_array
();
}
return
;
}
...
...
application/views/Ride/add_transport.php
0 → 100644
View file @
fff67804
This diff is collapsed.
Click to expand it.
application/views/Ride/add_vehicle.php
deleted
100644 → 0
View file @
a84a8538
<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"
>
Vehicle Details
</h3>
</div>
<form
role=
"form"
action=
"
<?=
base_url
(
'Ride/import'
)
?>
"
method=
"post"
class=
"validate"
data-parsley-validate=
""
enctype=
"multipart/form-data"
>
<div
class=
"box-body"
>
<div
class=
"col-md-6"
>
<div
class=
"form-group has-feedback"
>
<label
for=
"exampleInputEmail1"
>
Vehicle Type
</label>
</div>
<div
class=
"col-md-12"
>
<div
class=
"box-footer"
>
<button
type=
"submit"
class=
"btn btn-primary"
>
Submit
</button>
</div>
</div>
</div>
<div
class=
"col-md-6"
>
<div
class=
"form-group"
>
<label
for=
"exampleInputEmail1"
>
Vehicle Photo
</label>
<div
class=
"col-md-9"
style=
"padding-top: 25px;"
>
<input
name=
"csv_file"
type=
"file"
class=
"required"
/>
</div>
</div>
</div>
</form>
</div>
</section>
</div>
\ No newline at end of file
application/views/Templates/footer-script.php
View file @
fff67804
<script>
base_url
=
"
<?php
echo
base_url
();
?>
"
;
country_flag
=
'
<?=
$this
->
session
->
userdata
[
'settings'
][
'country_flag'
]
?>
'
;
</script>
<!-- jQuery 2.1.4 -->
<script
src=
"
<?php
echo
base_url
();
?>
assets/js/jQuery-2.1.4.min.js"
></script>
<!-- Google Map -->
<script
src=
"https://maps.googleapis.com/maps/api/js?key=AIzaSyC9JX3BZZfx2S6GQieC_PqjuJdUbZ7_wyM&libraries=places"
></script>
<!-- Bootstrap 3.3.5 -->
<script
src=
"
<?php
echo
base_url
();
?>
assets/js/bootstrap.min.js"
></script>
<script
src=
"
<?php
echo
base_url
();
?>
assets/js/pace.js"
></script>
...
...
@@ -25,14 +28,13 @@
<script
src=
"
<?php
echo
base_url
();
?>
assets/js/nemt_custom.js"
></script>
<!--datepicker-->
<link
rel=
"stylesheet"
href=
"
<?php
echo
base_url
();
?>
assets/css/jquery.datetimepicker.css"
/>
<script
src=
"
<?php
echo
base_url
();
?>
assets/js/jquery.datetimepicker.full.js"
></script>
<link
rel=
"stylesheet"
href=
"
<?php
echo
base_url
();
?>
assets/css/jquery.datetimepicker.css"
/>
<script
src=
"
<?php
echo
base_url
();
?>
assets/js/jquery.datetimepicker.full.js"
></script>
<!--datepicker-->
<script
src=
"https://cdn.ckeditor.com/4.5.7/standard/ckeditor.js"
></script>
;
<!-- CK Editor -->
<script
src=
"https://maps.googleapis.com/maps/api/js?key=AIzaSyC9JX3BZZfx2S6GQieC_PqjuJdUbZ7_wyM&libraries=places&callback=initMap"
async
defer
></script>
<script>
$
(
function
()
{
//Initialize Select2 Elements
...
...
assets/js/nemt_custom.js
View file @
fff67804
...
...
@@ -7,4 +7,16 @@ function setImg(input,id) {
};
reader
.
readAsDataURL
(
input
.
files
[
0
]);
}
}
\ No newline at end of file
}
function
initPickUp
()
{
var
options
=
{
componentRestrictions
:
{
country
:
country_flag
}};
var
input
=
document
.
getElementById
(
'pickup_location'
);
var
autocomplete
=
new
google
.
maps
.
places
.
Autocomplete
(
input
,
options
);
}
google
.
maps
.
event
.
addDomListener
(
window
,
'load'
,
initPickUp
);
function
initDestination
()
{
var
options
=
{
componentRestrictions
:
{
country
:
country_flag
}};
var
input
=
document
.
getElementById
(
'drop_location'
);
var
autocomplete
=
new
google
.
maps
.
places
.
Autocomplete
(
input
,
options
);
}
google
.
maps
.
event
.
addDomListener
(
window
,
'load'
,
initDestination
);
\ No newline at end of file
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