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
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
254 additions
and
91 deletions
+254
-91
database.php
application/config/database.php
+3
-6
Login.php
application/controllers/Login.php
+3
-8
Ride.php
application/controllers/Ride.php
+19
-20
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
+4
-2
nemt_custom.js
assets/js/nemt_custom.js
+13
-0
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
;
}
$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
<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-12"
>
<div
class=
"col-md-4"
>
<!-- 1 - 1 -->
<div
class=
"form-group has-feedback"
>
<label>
Medical Number
</label>
<input
type=
"text"
class=
"form-control required"
data-parsley-trigger=
"change"
data-parsley-minlength=
"2"
data-parsley-pattern=
"^[a-zA-Z0-9\ . ! @ # $ % ^ & * () + = , \/]+$"
required=
""
name=
"medical_no"
placeholder=
"Enter Medical Number"
>
<span
class=
"glyphicon form-control-feedback"
></span>
</div>
<!-- 1 - 2 -->
<div
class=
"form-group has-feedback"
>
<label>
Age
</label>
<input
type=
"text"
class=
"form-control required"
data-parsley-trigger=
"change"
data-parsley-minlength=
"2"
data-parsley-pattern=
"^[0-9]+$"
required=
""
name=
"age"
placeholder=
"Enter Age"
>
<span
class=
"glyphicon form-control-feedback"
></span>
</div>
<!-- 1 - 3 -->
<div
class=
"form-group has-feedback"
>
<label>
Appointment Date
</label>
<input
type=
"text"
class=
"form-control required"
data-parsley-trigger=
"change"
data-parsley-minlength=
"2"
data-parsley-pattern=
"^[a-zA-Z0-9\ . ! @ # $ % ^ & * () + = , \/]+$"
required=
""
name=
"appointment_date"
placeholder=
"Enter Appointment Date"
>
<span
class=
"glyphicon form-control-feedback"
></span>
</div>
<!-- 1 - 4 -->
<div
class=
"form-group has-feedback"
>
<label>
Trip Cost
</label>
<input
type=
"text"
class=
"form-control required"
data-parsley-trigger=
"change"
data-parsley-minlength=
"2"
data-parsley-pattern=
"^[0-9 , . ]+$"
required=
""
name=
"trip_cost"
placeholder=
"Enter Trip Cost"
>
<span
class=
"glyphicon form-control-feedback"
></span>
</div>
<!-- 1 - 5 -->
<div
class=
"form-group has-feedback"
>
<label>
Vehicle Type
</label>
<select
name=
"reason"
class=
"form-control required"
data-parsley-trigger=
"change"
required
>
<option
selected
disabled
>
Select Vehicle Type
</option>
<?php
if
(
!
empty
(
$vehicle_data
)){
foreach
(
$vehicle_data
as
$vehicle
)
{
echo
'<option value="'
.
$vehicle
->
vehicle_id
.
'">'
.
$vehicle
->
vehicle_type
.
'</option>'
;
}
}
?>
</select>
</div>
</div>
<div
class=
"col-md-4"
>
<!-- 2 - 1 -->
<div
class=
"form-group has-feedback"
>
<label>
First Name
</label>
<input
type=
"text"
class=
"form-control required"
data-parsley-trigger=
"change"
data-parsley-minlength=
"2"
data-parsley-pattern=
"^[a-zA-Z\ . ! @ # $ % ^ & * () + = , \/]+$"
required=
""
name=
"first_name"
placeholder=
"Enter First Name"
>
<span
class=
"glyphicon form-control-feedback"
></span>
</div>
<!-- 2 - 2 -->
<div
class=
"form-group has-feedback"
>
<label>
Phone Number
</label>
<input
type=
"text"
class=
"form-control required"
data-parsley-trigger=
"change"
data-parsley-minlength=
"2"
required=
""
name=
"phone"
placeholder=
"Enter Phone Number"
>
<span
class=
"glyphicon form-control-feedback"
></span>
</div>
<!-- 2 - 3 -->
<div
class=
"form-group has-feedback"
>
<label>
Appointment Time
</label>
<input
type=
"text"
class=
"form-control required"
data-parsley-trigger=
"change"
data-parsley-minlength=
"2"
required=
""
name=
"appointment_time"
placeholder=
"Appointment Time"
>
<span
class=
"glyphicon form-control-feedback"
></span>
</div>
<!-- 2 - 4 -->
<div
class=
"form-group has-feedback"
>
<label>
Pickup Location
</label>
<input
type=
"text"
class=
"form-control required"
data-parsley-trigger=
"change"
required=
""
id=
"pickup_location"
name=
"pickup_location"
placeholder=
"Select Pickup Location"
>
<span
class=
"glyphicon form-control-feedback"
></span>
</div>
<!-- 2 - 5 -->
<div
class=
"form-group has-feedback"
>
<label>
Trip Type
</label>
<select
name=
"trip_type"
class=
"form-control required"
data-parsley-trigger=
"change"
required
>
<option
selected
disabled
>
Select Trip Type
</option>
<?php
if
(
!
empty
(
$trip_type
)){
foreach
(
$trip_type
as
$type
)
{
echo
'<option value="'
.
$type
->
trip_id
.
'">'
.
$type
->
trip_type
.
'</option>'
;
}
}
?>
</select>
</div>
</div>
<div
class=
"col-md-4"
>
<!-- 3 - 1 -->
<div
class=
"form-group has-feedback"
>
<label>
Last Name
</label>
<input
type=
"text"
class=
"form-control required"
data-parsley-trigger=
"change"
data-parsley-minlength=
"2"
data-parsley-pattern=
"^[a-zA-Z\ . ! @ # $ % ^ & * () + = , \/]+$"
required=
""
name=
"last_name"
placeholder=
"Enter Last Name"
>
<span
class=
"glyphicon form-control-feedback"
></span>
</div>
<!-- 3 - 2 -->
<div
class=
"form-group has-feedback"
>
<label>
Trip Number
</label>
<input
type=
"text"
class=
"form-control required"
data-parsley-trigger=
"change"
data-parsley-minlength=
"2"
data-parsley-pattern=
"^[a-zA-Z0-9\ . ! @ # $ % ^ & * () + = , \/]+$"
required=
""
name=
"trip_no"
placeholder=
"Enter Trip Number"
>
<span
class=
"glyphicon form-control-feedback"
></span>
</div>
<!-- 3 - 3 -->
<div
class=
"form-group has-feedback"
>
<label>
Reason
</label>
<select
name=
"reason"
class=
"form-control required"
data-parsley-trigger=
"change"
required
>
<option
selected
disabled
>
Select Reason
</option>
<?php
if
(
!
empty
(
$appointment_reason
)){
foreach
(
$appointment_reason
as
$reason
)
{
echo
'<option value="'
.
$reason
->
reason_id
.
'">'
.
$reason
->
reason
.
'</option>'
;
}
}
?>
</select>
</div>
<!-- 3 - 4 -->
<div
class=
"form-group has-feedback"
>
<label>
Drop Location
</label>
<input
type=
"text"
class=
"form-control required"
data-parsley-trigger=
"change"
required=
""
id=
"drop_location"
name=
"drop_location"
placeholder=
"Select Drop Location"
>
<span
class=
"glyphicon form-control-feedback"
></span>
</div>
</div>
</div>
<div
class=
"col-md-12"
>
<div
class=
"box-footer"
>
<button
type=
"submit"
class=
"btn btn-primary"
>
Submit
</button>
</div>
</div>
</div>
</form>
</div>
</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"
>
<br>
<div
class=
"box-body"
>
<div
class=
"col-md-4"
>
<label>
Broker CSV File
</label>
</div>
<div
class=
"col-md-5"
>
<input
name=
"csv_file"
type=
"file"
accept=
".csv"
class=
"required"
/>
</div>
<div
class=
"col-md-3"
>
<button
type=
"submit"
class=
"btn btn-primary"
>
Upload
</button>
</div>
</div>
<br>
</form>
</div>
</div>
</div>
</section>
</div>
\ No newline at end of file
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>
...
...
@@ -31,8 +34,7 @@
<!--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
...
...
@@ -8,3 +8,15 @@ function setImg(input,id) {
reader
.
readAsDataURL
(
input
.
files
[
0
]);
}
}
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