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
6d302e54
Commit
6d302e54
authored
Nov 12, 2018
by
Tobin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
daily commit
parent
fb2d85e1
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
1061 additions
and
212 deletions
+1061
-212
Ride.php
application/controllers/Ride.php
+336
-59
generals_helper.php
application/helpers/generals_helper.php
+10
-0
Ride_model.php
application/models/Ride_model.php
+92
-2
add_transport.php
application/views/Ride/add_transport.php
+12
-9
excel_mapping.php
application/views/Ride/excel_mapping.php
+92
-0
scheduled_rides.php
application/views/Ride/scheduled_rides.php
+128
-0
view_rides.php
application/views/Ride/view_rides.php
+21
-2
footer-script.php
application/views/Templates/footer-script.php
+1
-1
header-script.php
application/views/Templates/header-script.php
+1
-1
left-menu.php
application/views/Templates/left-menu.php
+8
-0
custom-style.css
assets/css/custom-style.css
+176
-121
nemt_custom.js
assets/js/nemt_custom.js
+184
-17
No files found.
application/controllers/Ride.php
View file @
6d302e54
...
...
@@ -38,80 +38,170 @@ class Ride extends CI_Controller {
$this
->
load
->
view
(
'template'
,
$template
);
}
function
import
(){
function
excelMapping
(){
$flashMsg
=
array
(
'message'
=>
'Something went wrong, please try again..!'
,
'class'
=>
'error'
);
if
(
!
isset
(
$_FILES
)
||
empty
(
$_FILES
)
||
!
isset
(
$_FILES
[
'csv_file'
])
||
empty
(
$_FILES
[
'csv_file'
])
||
!
isset
(
$_POST
)
||
empty
(
$_POST
)
||
!
isset
(
$_POST
[
'broker_id'
])
||
empty
(
$_POST
[
'broker_id'
])
||
!
isset
(
$_POST
[
'company_id'
])
||
empty
(
$_POST
[
'company_id'
])){
if
(
!
isset
(
$_FILES
)
||
empty
(
$_FILES
)
||
!
isset
(
$_FILES
[
'import_file'
])
||
empty
(
$_FILES
[
'import_file'
])
||
!
isset
(
$_POST
)
||
empty
(
$_POST
)
||
!
isset
(
$_POST
[
'broker_id'
])
||
empty
(
$_POST
[
'broker_id'
])
||
!
isset
(
$_POST
[
'company_id'
])
||
empty
(
$_POST
[
'company_id'
])){
$this
->
session
->
set_flashdata
(
'message'
,
$flashMsg
);
redirect
(
base_url
(
'Ride/import_ride'
));
}
$fileType
=
''
;
$importedFile
=
''
;
$this
->
load
->
library
(
'upload'
);
$config
=
set_upload_all_files
(
"assets/uploads/upload_files"
);
$config
[
'file_name'
]
=
'importFile'
.
date
(
'dmyhis'
)
.
$_FILES
[
'import_file'
][
'name'
];
$this
->
upload
->
initialize
(
$config
);
$fileData
=
explode
(
'.'
,
$_FILES
[
'import_file'
][
'name'
]);
if
(
$this
->
upload
->
do_upload
(
'import_file'
)
&&
!
empty
(
$fileData
)
&&
isset
(
$fileData
[
1
])
&&
!
empty
(
$fileData
[
1
])){
$fileType
=
strtolower
(
$fileData
[
1
]);
$upload_data
=
$this
->
upload
->
data
();
$importedFile
=
$config
[
'upload_path'
]
.
"/"
.
$upload_data
[
'file_name'
];
}
else
{
$this
->
session
->
set_flashdata
(
'message'
,
$flashMsg
);
redirect
(
base_url
(
'Ride/import_ride'
));
}
$importData
=
''
;
switch
(
$fileType
){
case
'csv'
:
$importData
=
$this
->
getImportDataCSV
(
$importedFile
,
0
);
break
;
}
if
(
empty
(
$importData
)
||
!
isset
(
$importData
[
'status'
])
||
$importData
[
'status'
]
==
3
||
$importData
[
'status'
]
==
4
||
(
$importData
[
'status'
]
==
1
&&
empty
(
$importData
[
'headerArr'
]))){
$this
->
session
->
set_flashdata
(
'message'
,
$flashMsg
);
redirect
(
base_url
(
'Ride/import_ride'
));
}
if
(
$importData
[
'status'
]
==
2
){
$flashMsg
[
'message'
]
=
"Please Choose a vaild file..!"
;
$this
->
session
->
set_flashdata
(
'message'
,
$flashMsg
);
redirect
(
base_url
(
'Ride/import_ride'
));
}
$template
[
'fileType'
]
=
$fileType
;
$template
[
'headerArr'
]
=
$importData
[
'headerArr'
];
$template
[
'broker_id'
]
=
$_POST
[
'broker_id'
];
$template
[
'company_id'
]
=
$_POST
[
'company_id'
];
$template
[
'import_file'
]
=
$importedFile
;
$template
[
'page'
]
=
'Ride/excel_mapping'
;
$template
[
'menu'
]
=
"Excel Import Manager"
;
$template
[
'sub_menu'
]
=
"Excel Field Mapping"
;
$template
[
'page_title'
]
=
"Ride Management"
;
$template
[
'page_desc'
]
=
"Excel Field Mapping"
;
$this
->
load
->
view
(
'template'
,
$template
);
}
function
getImportDataCSV
(
$importedFile
=
''
,
$header
=
0
,
$headerOrder
=
array
()){
$retData
=
array
(
'status'
=>
0
);
if
(
empty
(
$importedFile
)){
return
$retData
;
}
if
(
$header
==
1
&&
empty
(
$headerOrder
)){
return
4
;
}
$header
=
0
;
$insertArr
=
array
();
$headerArr
=
array
();
$insertData
=
array
();
$
medical
Ids
=
array
();
$
customer
Ids
=
array
();
$custInsrData
=
array
();
if
((
$handle
=
fopen
(
$_FILES
[
'csv_file'
][
'tmp_name'
],
"r"
))
!==
FALSE
)
{
while
((
$row
=
fgetcsv
(
$handle
,
1000
,
","
))
!==
FALSE
)
{
$colCnt
=
0
;
$rowArr
=
array
();
foreach
(
$row
as
$col
){
if
(
$header
==
0
){
$col
=
str_replace
(
' '
,
'_'
,
$col
);
$col
=
preg_replace
(
'/[^A-Za-z0-9\_\/]/'
,
''
,
$col
);
$headerArr
[]
=
$col
;
}
else
{
if
(
$headerArr
[
$colCnt
]
==
'Appointment_Date'
){
$col
=
date
(
'd-m-Y'
,
strtotime
(
$col
));
}
if
(
$headerArr
[
$colCnt
]
==
'Appointment_Time'
){
$last
=
substr
(
$col
,
-
2
);
$col
=
str_replace
(
$last
,
":"
.
$last
,
$col
);
$col
=
(
!
empty
(
$col
))
?
date
(
'G:i'
,
strtotime
(
$col
))
:
''
;
}
$rowArr
[
$headerArr
[
$colCnt
]]
=
$col
;
$colCnt
++
;
}
}
if
(
$header
!=
0
){
$time
=
'12:00'
;
if
(
!
empty
(
$row
[
10
])){
$last
=
substr
(
$row
[
10
],
-
2
);
$time
=
str_replace
(
$last
,
":"
.
$last
,
$row
[
10
]);
$time
=
(
!
empty
(
$time
))
?
date
(
'G:i'
,
strtotime
(
$time
))
:
'12:00'
;
if
((
$handle
=
fopen
(
$importedFile
,
"r"
))
===
FALSE
)
{
$retData
[
'status'
]
=
2
;
return
$retData
;
}
while
((
$row
=
fgetcsv
(
$handle
,
1000
,
","
))
!==
FALSE
)
{
$colCnt
=
0
;
$rowArr
=
array
();
foreach
(
$row
as
$col
){
if
(
$header
==
0
){
$col
=
str_replace
(
' '
,
'_'
,
$col
);
$col
=
preg_replace
(
'/[^A-Za-z0-9\_\/]/'
,
''
,
$col
);
$headerArr
[]
=
$col
;
}
else
{
if
(
$headerArr
[
$colCnt
]
==
'Appointment_Date'
){
$col
=
date
(
'd-m-Y'
,
strtotime
(
$col
));
}
$date_time
=
(
!
empty
(
$row
[
8
]))
?
date
(
'd-m-Y'
,
strtotime
(
$row
[
8
]))
.
' '
.
$time
:
''
;
$insertData
=
array
(
'company_id'
=>
$_POST
[
'company_id'
],
'broker_id'
=>
$_POST
[
'broker_id'
],
'medical_no'
=>
$row
[
0
],
'patient_name'
=>
$row
[
2
]
.
' '
.
$row
[
1
],
'age'
=>
$row
[
4
],
'phone'
=>
$row
[
5
],
'trip_no'
=>
$row
[
7
],
'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
],
'data'
=>
json_encode
(
$rowArr
));
$insertData
[
'appointment_time'
]
=
strtotime
(
$date_time
);
$insertArr
[]
=
$insertData
;
$custData
=
$this
->
db
->
query
(
"SELECT medical_id FROM customers WHERE medical_id='"
.
$row
[
0
]
.
"' AND status <> '2'"
);
if
(
1
>
$custData
->
num_rows
()
&&
!
in_array
(
$row
[
0
],
$medicalIds
)){
$medicalIds
[]
=
$row
[
0
];
$custInsrData
[]
=
array
(
'medical_id'
=>
$row
[
0
],
'first_name'
=>
$row
[
2
],
'last_name'
=>
$row
[
1
],
'date_of_birth'
=>
$row
[
3
],
'age'
=>
$row
[
4
],
'phone'
=>
$row
[
5
],
'alt_phone'
=>
$row
[
6
]);
if
(
$headerArr
[
$colCnt
]
==
'Appointment_Time'
){
$last
=
substr
(
$col
,
-
2
);
$col
=
str_replace
(
$last
,
":"
.
$last
,
$col
);
$col
=
(
!
empty
(
$col
))
?
date
(
'G:i'
,
strtotime
(
$col
))
:
''
;
}
$rowArr
[
$headerArr
[
$colCnt
]]
=
$col
;
$colCnt
++
;
}
$header
=
1
;
}
fclose
(
$handle
);
$status
=
$this
->
Ride_model
->
uploadRides
(
$insertArr
,
$custInsrData
);
if
(
$status
){
$flashMsg
[
'class'
]
=
"success"
;
$flashMsg
[
'message'
]
=
"Upload Scuccessfull"
;
$this
->
session
->
set_flashdata
(
'message'
,
$flashMsg
);
redirect
(
base_url
(
'Ride/view_rides'
));
if
(
!
empty
(
$headerArr
)
&&
$header
==
1
){
$retData
[
'status'
]
=
1
;
$retData
[
'headerArr'
]
=
$headerArr
;
return
$retData
;
}
}
else
{
$flashMsg
[
'message'
]
=
"Please Choose a valid File"
;
if
(
$header
!=
0
){
$time
=
'12:00'
;
if
(
!
empty
(
$row
[
10
])){
$last
=
substr
(
$row
[
10
],
-
2
);
$time
=
str_replace
(
$last
,
":"
.
$last
,
$row
[
10
]);
$time
=
(
!
empty
(
$time
))
?
date
(
'G:i'
,
strtotime
(
$time
))
:
'12:00'
;
}
$date_time
=
(
!
empty
(
$row
[
8
]))
?
date
(
'd-m-Y'
,
strtotime
(
$row
[
8
]))
.
' '
.
$time
:
''
;
$insertData
=
array
(
'company_id'
=>
$_POST
[
'company_id'
],
'broker_id'
=>
$_POST
[
'broker_id'
],
'medical_no'
=>
$row
[
0
],
'patient_name'
=>
$row
[
2
]
.
' '
.
$row
[
1
],
'age'
=>
$row
[
4
],
'phone'
=>
$row
[
5
],
'trip_no'
=>
$row
[
7
],
'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
],
'data'
=>
json_encode
(
$rowArr
));
$insertData
[
'appointment_time'
]
=
strtotime
(
$date_time
);
$insertArr
[]
=
$insertData
;
$custData
=
$this
->
db
->
query
(
"SELECT medical_id FROM customers WHERE medical_id='"
.
$row
[
0
]
.
"' AND status <> '2'"
);
if
(
1
>
$custData
->
num_rows
()
&&
!
in_array
(
$row
[
0
],
$customerIds
)){
$medicalIds
[]
=
$row
[
0
];
$custInsrData
[]
=
array
(
'medical_id'
=>
$row
[
0
],
'first_name'
=>
$row
[
2
],
'last_name'
=>
$row
[
1
],
'date_of_birth'
=>
$row
[
3
],
'age'
=>
$row
[
4
],
'phone'
=>
$row
[
5
],
'alt_phone'
=>
$row
[
6
]);
}
}
$header
=
1
;
}
$this
->
session
->
set_flashdata
(
'message'
,
$flashMsg
);
redirect
(
base_url
(
'Ride/import_ride'
));
fclose
(
$handle
);
if
(
empty
(
$insertArr
)){
$retData
[
'status'
]
=
3
;
}
else
{
$retData
[
'status'
]
=
1
;
$retData
[
'insertArr'
]
=
$insertArr
;
$retData
[
'custInsrData'
]
=
$custInsrData
;
}
return
$retData
;
}
function
import
(){
$flashMsg
=
array
(
'message'
=>
'Something went wrong, please try again..!'
,
'class'
=>
'error'
);
if
(
!
isset
(
$_POST
)
||
empty
(
$_POST
)
||
!
isset
(
$_POST
[
'broker_id'
])
||
empty
(
$_POST
[
'broker_id'
])
||
!
isset
(
$_POST
[
'company_id'
])
||
empty
(
$_POST
[
'company_id'
])
||
!
isset
(
$_POST
[
'header_order'
])
||
empty
(
$_POST
[
'header_order'
])
||
!
isset
(
$_POST
[
'file_type'
])
||
empty
(
$_POST
[
'file_type'
])
||
!
isset
(
$_POST
[
'import_file'
])
||
empty
(
$_POST
[
'import_file'
])){
$this
->
session
->
set_flashdata
(
'message'
,
$flashMsg
);
redirect
(
base_url
(
'Ride/import_ride'
));
}
$importData
=
$this
->
getImportDataCSV
(
$_POST
[
'import_file'
],
1
,
$_POST
[
'header_order'
]);
}
function
create_ride
(){
...
...
@@ -358,5 +448,191 @@ class Ride extends CI_Controller {
$this
->
session
->
set_flashdata
(
'message'
,
$flashMsg
);
redirect
(
base_url
(
'Ride/assign_driver/'
.
encode_param
(
$ride_id
)));
}
function
changeSchuduleStatus
(){
if
(
!
isset
(
$_POST
)
||
empty
(
$_POST
)
||
!
isset
(
$_POST
[
'transport_id'
])
||
empty
(
$_POST
[
'transport_id'
])
||
!
isset
(
$_POST
[
'is_scheduled'
])
||
$_POST
[
'is_scheduled'
]
==
''
){
echo
json_encode
(
$result
);
exit
;
}
$ride_ids
=
$_POST
[
'transport_id'
];
$is_scheduled
=
(
$_POST
[
'is_scheduled'
]
==
1
)
?
0
:
1
;
$succArr
=
array
();
if
(
is_array
(
$ride_ids
)){
foreach
(
$ride_ids
AS
$ride_id
)
{
$result
=
$this
->
changeScheduler
(
$ride_id
,
$is_scheduled
);
if
(
$result
[
'status'
]
==
1
){
$succArr
[]
=
$ride_id
;
}
$result
[
'succArr'
]
=
$succArr
;
}
}
else
{
$result
=
$this
->
changeScheduler
(
$ride_ids
,
$is_scheduled
);
if
(
$result
[
'status'
]
==
1
){
$result
[
'succArr'
]
=
array
(
$ride_ids
);
}
}
echo
json_encode
(
$result
);
exit
;
}
function
changeScheduler
(
$ride_id
,
$is_scheduled
=
'0'
){
$result
=
array
(
'status'
=>
'0'
);
if
(
empty
(
$ride_id
)){
return
$result
;
}
$status
=
$this
->
Ride_model
->
changeSchuduleStatus
(
$ride_id
,
$is_scheduled
);
if
(
$status
){
$result
[
'status'
]
=
1
;
if
(
$is_scheduled
==
1
){
$ride_data
=
$this
->
Ride_model
->
getRideData
(
$ride_id
);
if
(
empty
(
$ride_data
)){
$result
[
'status'
]
=
0
;
$status
=
$this
->
Ride_model
->
changeSchuduleStatus
(
$ride_id
,
0
);
}
else
{
$pickup_location
=
$ride_data
->
pickup_location
;
$appointment_time
=
$ride_data
->
appointment_time
;
if
(
empty
(
$pickup_location
)
||
empty
(
$appointment_time
)){
$result
[
'status'
]
=
0
;
$status
=
$this
->
Ride_model
->
changeSchuduleStatus
(
$ride_id
,
0
);
}
$pickupLocData
=
$this
->
getLatLngFromLocation
(
$pickup_location
);
if
(
empty
(
$pickupLocData
)){
$result
[
'status'
]
=
0
;
$status
=
$this
->
Ride_model
->
changeSchuduleStatus
(
$ride_id
,
0
);
}
else
{
$status
=
$this
->
Ride_model
->
autoAssignDriver
(
$ride_id
,
$appointment_time
,
array
(
'lat'
=>
$pickupLocData
[
'lat'
],
'lng'
=>
$pickupLocData
[
'lng'
]));
if
(
!
$status
){
$result
[
'status'
]
=
0
;
$status
=
$this
->
Ride_model
->
changeSchuduleStatus
(
$ride_id
,
0
);
}
}
}
}
}
return
$result
;
}
function
getLatLngFromLocation
(
$location
=
''
){
if
(
empty
(
$location
))
return
0
;
$locData
=
file_get_contents
(
"https://maps.google.com/maps/api/geocode/json?address="
.
urlencode
(
$location
)
.
"&sensor=false&key=AIzaSyC9JX3BZZfx2S6GQieC_PqjuJdUbZ7_wyM"
);
if
(
empty
(
$locData
))
return
0
;
$loc_data
=
json_decode
(
$locData
);
if
(
empty
(
$loc_data
))
return
0
;
$locArr
[
'lat'
]
=
$loc_data
->
{
'results'
}[
0
]
->
{
'geometry'
}
->
{
'location'
}
->
{
'lat'
};
$locArr
[
'lng'
]
=
$loc_data
->
{
'results'
}[
0
]
->
{
'geometry'
}
->
{
'location'
}
->
{
'lng'
};
if
(
empty
(
$locArr
[
'lat'
])
||
empty
(
$locArr
[
'lng'
])){
return
0
;
}
return
$locArr
;
}
function
scheduled_rides
(){
if
(
$this
->
session
->
userdata
[
'user_type'
]
==
1
){
redirect
(
base_url
());
}
$this
->
load
->
model
(
'Broker_model'
);
$template
[
'page'
]
=
'Ride/scheduled_rides'
;
$template
[
'page_title'
]
=
"Scheduled Rides"
;
$template
[
'page_desc'
]
=
"View Scheduled Ride"
;
$template
[
'menu'
]
=
"Ride Management"
;
$template
[
'sub_menu'
]
=
"View Scheduled Rides"
;
$condArr
=
array
();
if
(
isset
(
$_POST
)
&&
isset
(
$_POST
[
'search_date'
])
&&
!
empty
(
$_POST
[
'search_date'
])){
$srtDateTime
=
strtotime
(
$_POST
[
'search_date'
]);
$endDateTime
=
strtotime
(
$_POST
[
'search_date'
]
.
' 23:59'
);
$condArr
[]
=
" AND (TD.appointment_time>'
$srtDateTime
' AND TD.appointment_time<'
$endDateTime
') "
;
}
$company_id
=
(
$this
->
session
->
userdata
[
'user_type'
]
!=
1
)
?
$this
->
session
->
userdata
[
'id'
]
:
''
;
$template
[
'ride_data'
]
=
$this
->
Ride_model
->
getRideData
(
''
,
$company_id
,
''
,
1
,
$condArr
);
$this
->
load
->
view
(
'template'
,
$template
);
}
}
// function import(){
// $flashMsg = array('message'=>'Something went wrong, please try again..!','class'=>'error');
// if(!isset($_FILES) || empty($_FILES) || !isset($_FILES['csv_file']) || empty($_FILES['csv_file']) || !isset($_POST) || empty($_POST) || !isset($_POST['broker_id']) || empty($_POST['broker_id'])|| !isset($_POST['company_id']) || empty($_POST['company_id'])){
// $this->session->set_flashdata('message',$flashMsg);
// redirect(base_url('Ride/import_ride'));
// }
// $status = $this->Ride_model->uploadRides($insertArr,$custInsrData);
// if($status){
// $flashMsg['class'] = "success";
// $flashMsg['message'] = "Upload Scuccessfull";
// $this->session->set_flashdata('message',$flashMsg);
// redirect(base_url('Ride/view_rides'));
// }
// }else{
// $flashMsg['message'] = "Please Choose a valid File";
// }
// $this->session->set_flashdata('message',$flashMsg);
// redirect(base_url('Ride/import_ride'));
// }
// EXCEL EXPORT
// $allowedFileType = ['application/vnd.ms-excel','text/xls','text/xlsx',
// 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'];
// if(in_array($_FILES["import_file"]["type"],$allowedFileType)){
// $targetPath = 'uploads/'.$_FILES['import_file']['name'];
// move_uploaded_file($_FILES['import_file']['tmp_name'], $targetPath);
// $Reader = new SpreadsheetReader($targetPath);
// $sheetCount = count($Reader->sheets());
// for($i=0; $i<$sheetCount; $i++){
// $Reader->ChangeSheet($i);
// foreach ($Reader as $Row){
// $name = "";
// if(isset($Row[0])) {
// $name = mysqli_real_escape_string($conn,$Row[0]);
// }
// $description = "";
// if(isset($Row[1])) {
// $description = mysqli_real_escape_string($conn,$Row[1]);
// }
// if (!empty($name) || !empty($description)) {
// $query = "insert into tbl_info(name,description) values('".$name."','".$description."')";
// $result = mysqli_query($conn, $query);
// if (! empty($result)) {
// $type = "success";
// $message = "Excel Data Imported into the Database";
// } else {
// $type = "error";
// $message = "Problem in Importing Excel Data";
// }
// }
// }
// }
// } else {
// $type = "error";
// $message = "Invalid File Type. Upload Excel File.";
// }
?>
\ No newline at end of file
application/helpers/generals_helper.php
View file @
6d302e54
...
...
@@ -40,6 +40,16 @@ function set_upload_editservice($path){
}
function
set_upload_all_files
(
$path
){
$config
=
array
();
$config
[
'upload_path'
]
=
$path
;
$config
[
'allowed_types'
]
=
'*'
;
$config
[
'overwrite'
]
=
FALSE
;
return
$config
;
}
function
remove_html
(
&
$item
,
$key
)
{
$item
=
strip_tags
(
$item
);
...
...
application/models/Ride_model.php
View file @
6d302e54
...
...
@@ -42,14 +42,24 @@ class Ride_model extends CI_Model {
return
(
$status
)
?
1
:
0
;
}
function
getRideData
(
$ride_id
=
''
,
$company_id
=
''
,
$broker_id
=
''
){
function
getRideData
(
$ride_id
=
''
,
$company_id
=
''
,
$broker_id
=
''
,
$scheduled
=
''
,
$condArr
=
array
()
){
$cond
=
(
!
empty
(
$ride_id
))
?
" AND TD.transport_id = '
$ride_id
'"
:
""
;
$cond
.=
(
$broker_id
!=
''
)
?
" AND TD.broker_id = '
$broker_id
'"
:
""
;
$cond
.=
(
!
empty
(
$company_id
))
?
" AND TD.company_id = '
$company_id
'"
:
""
;
$sql
=
"SELECT TD.*,BK.broker_name,AR.reason,VH.vehicle_id,VH.vehicle_type,TT.trip_type,TS.trip_status
if
(
$scheduled
!=
''
){
$cond
.=
" AND TD.is_scheduled = '
$scheduled
'"
;
}
if
(
!
empty
(
$condArr
)){
$cond
.=
implode
(
' '
,
$condArr
);
}
$sql
=
"SELECT TD.*,CONCAT(DV.first_name,' ',DV.last_name) AS assigned_driver_name,BK.broker_name,
AR.reason,VH.vehicle_id,VH.vehicle_type,TT.trip_type,TS.trip_status
FROM transport_details AS TD
LEFT JOIN brokers AS BK ON (TD.broker_id = BK.broker_id)
LEFT JOIN drivers AS DV ON (DV.driver_id = TD.assigned_driver)
LEFT JOIN vehicles AS VH ON (VH.vehicle_id = TD.vehicle_type)
LEFT JOIN trip_type AS TT ON (TT.trip_id = TD.trip_type)
LEFT JOIN trip_status AS TS ON (TS.trip_status_id = TD.trip_status)
...
...
@@ -111,5 +121,84 @@ class Ride_model extends CI_Model {
return
(
$status
)
?
1
:
0
;
}
function
changeSchuduleStatus
(
$ride_id
=
''
,
$is_scheduled
=
'0'
){
if
(
empty
(
$ride_id
)){
return
;
}
$status
=
$this
->
db
->
update
(
'transport_details'
,
array
(
'is_scheduled'
=>
$is_scheduled
),
array
(
'transport_id'
=>
$ride_id
));
if
(
$is_scheduled
==
0
){
$this
->
deleteAssignedRider
(
$ride_id
);
}
return
$status
;
}
function
deleteAssignedRider
(
$ride_id
=
''
){
if
(
empty
(
$ride_id
)){
return
;
}
$this
->
db
->
delete
(
'ride_status'
,
array
(
'ride_id'
=>
$ride_id
));
}
function
autoAssignDriver
(
$ride_id
=
''
,
$appointment_time
=
''
,
$pickupLoc
=
array
()){
if
(
empty
(
$ride_id
)
||
empty
(
$appointment_time
)
||
empty
(
$pickupLoc
)
||
!
isset
(
$pickupLoc
[
'lat'
])
||
$pickupLoc
[
'lat'
]
==
''
||
!
isset
(
$pickupLoc
[
'lng'
])
||
$pickupLoc
[
'lng'
]
==
''
){
return
;
}
$time
=
date
(
"G:i"
,
$appointment_time
);
$date
=
date
(
"d-m-y"
,
$appointment_time
);
$endTime
=
date
(
"G:i"
,
strtotime
(
$time
)
+
60
*
60
);
$startTime
=
date
(
"G:i"
,
strtotime
(
$time
)
-
60
*
60
);
$endDateTime
=
strtotime
(
$date
.
' '
.
$endTime
);
$startDateTime
=
strtotime
(
$date
.
' '
.
$startTime
);
$sql
=
"SELECT GROUP_CONCAT(TD.assigned_driver) AS assigned_drivers
FROM transport_details AS TD
WHERE TD.driver_assign_status='0' AND TD.assigned_driver<>'0' AND TD.is_scheduled='1' AND
TD.appointment_time>
$startDateTime
AND TD.appointment_time<
$endDateTime
AND
TD.status IN (4,5,8)"
;
$prvDrivers
=
$this
->
db
->
query
(
$sql
);
if
(
empty
(
$prvDrivers
)){
return
0
;
}
$driverCond
=
''
;
if
(
$prvDrivers
->
num_rows
()
>
0
){
$prvDrivers
=
$prvDrivers
->
row_array
();
$driverCond
=
(
isset
(
$prvDrivers
[
'assigned_drivers'
])
&&
!
empty
(
$prvDrivers
[
'assigned_drivers'
]))
?
'AND DRV.driver_id NOT IN ('
.
$prvDrivers
[
'assigned_drivers'
]
.
')'
:
''
;
}
$sql
=
"SELECT DRV.driver_id,3956*2*ASIN(SQRT(POWER(SIN(("
.
$pickupLoc
[
'lat'
]
.
"-DRV.lat_driver)*
pi()/180/2),2)+COS("
.
$pickupLoc
[
'lat'
]
.
"*pi()/180)*COS(DRV.lat_driver*pi()/180)*
POWER(SIN(("
.
$pickupLoc
[
'lng'
]
.
"-DRV.lng_driver)*pi()/180/2),2))) AS distance
FROM drivers AS DRV
WHERE DRV.status = 1 "
.
$driverCond
.
"
HAVING distance < 25
ORDER BY distance
LIMIT 0,1"
;
$driverData
=
$this
->
db
->
query
(
$sql
);
if
(
empty
(
$driverData
)){
return
0
;
}
if
(
$driverData
->
num_rows
()
>
0
){
$nearByDriver
=
$driverData
->
row_array
();
$nearByDriver
=
$nearByDriver
[
'driver_id'
];
$status
=
$this
->
db
->
update
(
'transport_details'
,
array
(
'driver_assign_status'
=>
'0'
,
'assigned_driver'
=>
$nearByDriver
,
'status'
=>
'3'
),
array
(
'transport_id'
=>
$ride_id
));
}
else
{
$status
=
$this
->
db
->
update
(
'transport_details'
,
array
(
'driver_assign_status'
=>
'1'
,
'status'
=>
'3'
),
array
(
'transport_id'
=>
$ride_id
));
}
return
$status
;
}
}
?>
\ No newline at end of file
application/views/Ride/add_transport.php
View file @
6d302e54
...
...
@@ -218,7 +218,7 @@
<div
class=
"box-header with-border"
>
<h3
class=
"box-title"
>
Upload Ride
</h3>
</div>
<form
role=
"form"
action=
"
<?=
base_url
(
'Ride/
import
'
)
?>
"
method=
"post"
class=
"validate"
data-parsley-validate=
""
enctype=
"multipart/form-data"
>
<form
role=
"form"
action=
"
<?=
base_url
(
'Ride/
excelMapping
'
)
?>
"
method=
"post"
class=
"validate"
data-parsley-validate=
""
enctype=
"multipart/form-data"
>
<br>
<div
class=
"box-body"
>
<div
class=
"col-md-12"
>
...
...
@@ -231,7 +231,9 @@
<?php
if
(
!
empty
(
$company_data
)){
foreach
(
$company_data
as
$company
)
{
echo
'<option value="'
.
$company
->
company_id
.
'">'
.
$company
->
company_name
.
'</option>'
;
echo
'<option value="'
.
$company
->
company_id
.
'">'
.
$company
->
company_name
.
'</option>'
;
}
}
?>
...
...
@@ -257,16 +259,17 @@
</div>
</div>
<div
class=
"col-md-4"
>
<div
class=
"form-group has-feedback"
>
<label>
CSV File
</label>
<input
name=
"csv_file"
type=
"file"
accept=
".csv"
class=
"required"
/>
</div>
<div
class=
"form-group has-feedback"
>
<label>
File to be Uploaded
</label>
<input
name=
"import_file"
type=
"file"
accept=
".csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel"
class=
"required"
/>
</div>
</div>
</div>
<div
class=
"col-md-12"
>
<div
class=
"box-footer"
>
<button
type=
"submit"
class=
"btn btn-primary"
>
Upload
</button>
</div>
<div
class=
"box-footer"
>
<button
type=
"submit"
class=
"btn btn-primary"
>
Upload
</button>
</div>
</div>
</div>
<br>
...
...
application/views/Ride/excel_mapping.php
0 → 100644
View file @
6d302e54
<?php
$headerArr
=
Array
(
0
=>
'Medicaid_Number'
,
1
=>
'Members_Last_Name'
,
2
=>
'Members_First_Name'
,
3
=>
'Members_Date_of_Birth'
,
4
=>
'Members_Age'
,
5
=>
'Members_Phone_Number'
,
6
=>
'Members_Alt_Phone'
,
7
=>
'Trip_Number'
,
8
=>
'Appointment_Date'
,
9
=>
'Appointment_Day_of_Week'
,
10
=>
'Appointment_Time'
,
11
=>
'Trip_Reason_Code'
,
12
=>
'Trip_Status'
,
13
=>
'Vehicle_Type'
,
14
=>
'Trip_Type'
,
15
=>
'Wheelchair_Flag'
,
16
=>
'Crutches_\/_Walker_\/_Cane_Flag'
,
17
=>
'Number_of_Car_Seats_Required'
,
18
=>
'Pregnant_Flag'
,
19
=>
'Number_of_Additional_Passengers'
,
20
=>
'Additional_Passengers_With_Appointments'
,
21
=>
'Trip_Mileage'
,
22
=>
'Trip_Cost'
,
23
=>
'Pickup_Address'
,
24
=>
'Pickup_City'
,
25
=>
'Pickup_State'
,
26
=>
'Pickup_Zip_Code'
,
27
=>
'Delivery_Name'
,
28
=>
'Delivery_Address'
,
29
=>
'Delivery_City'
,
30
=>
'Delivery_State'
,
31
=>
'Delivery_Zip_Code'
,
32
=>
'Delivery_Phone_Number'
,
33
=>
'Special_Needs'
,
34
=>
'Inst_\/_Directions'
,
35
=>
'Return_Time'
,
36
=>
'Attendant_Flag'
,
37
=>
'Trip_Bid_Status'
,
38
=>
'Date_Trip_Bid_Status_Was_Changed'
,
39
=>
'Confirmation_Number'
,
40
=>
'Copay'
,
41
=>
'Trip_Status_Date'
);
?>
<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"
>
<div
class=
"col-md-6"
>
<h3
class=
"box-title"
>
Excel Mapping
</h3>
</div>
</div>
<div
class=
"box-body"
>
<div
class=
"col-md-7"
>
<div
style=
"overflow:scroll;height:400px;"
>
<table
id=
"mappedHeaders"
class=
"border-cls"
style=
"width:98%;"
>
<?php
foreach
(
$headerArr
AS
$id
=>
$header
){
echo
'<tr class="border-cls">
<td class="headtag-td">'
.
str_replace
(
'_'
,
' '
,
$header
)
.
'</td>
<td class="headtag-td">
<div type="child" class="drag-box" id="order_'
.
$id
.
'" ondrop="dropElement(event)"
ondragover="allowDropElement(event)" headOrder="'
.
$id
.
'"></div>
</td>
</tr>'
;
}
?>
</table>
</div>
</div>
<div
class=
"col-md-5"
>
<div
type=
"parent"
class=
"header-tag-box"
ondrop=
"dropElement(event)"
ondragover=
"allowDropElement(event)"
>
<?php
if
(
!
empty
(
$headerArr
)){
foreach
(
$headerArr
AS
$headID
=>
$heading
)
{
?>
<div
id=
"tempHead_
<?=
$headID
?>
"
class=
"header-tag"
draggable=
"true"
ondragstart=
"dragElement(event)"
tmporder=
"
<?=
$headID
?>
"
>
<?=
str_replace
(
array
(
'/'
,
'_'
),
array
(
''
,
' '
),
$heading
)
?>
</div>
<?php
}
}
?>
</div>
</div>
<div
class=
"col-md-12 btn-mapping"
>
<button
id=
"upload_excell"
type=
"button"
class=
"btn btn-primary"
dmclick=
"0"
>
Import Excell
</button>
</div>
</div>
</div>
</div>
</div>
</section>
<input
type=
"hidden"
name=
"fileType"
value=
"
<?=
$fileType
?>
"
>
<input
type=
"hidden"
name=
"broker_id"
value=
"
<?=
$broker_id
?>
"
>
<input
type=
"hidden"
name=
"company_id"
value=
"
<?=
$company_id
?>
"
>
<input
type=
"hidden"
name=
"import_file"
value=
"
<?=
$import_file
?>
"
>
</div>
\ No newline at end of file
application/views/Ride/scheduled_rides.php
0 → 100644
View file @
6d302e54
<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"
>
<div
class=
"col-md-6"
>
<h3
class=
"box-title"
>
Scheduled Rides
</h3>
</div>
</div>
<div
class=
"box-body"
>
<form
action=
"
<?=
base_url
(
'Ride/scheduled_rides'
)
?>
"
method=
"post"
class=
"validate"
data-parsley-validate=
""
enctype=
"multipart/form-data"
>
<div
class=
"col-md-12"
>
<div
class=
"form-group has-feedback"
>
<label>
Appointment Date
</label>
<div
class=
"input-group date"
data-provide=
"datepicker"
>
<input
id=
"datepicker"
type=
"text"
class=
"form-control required"
data-parsley-trigger=
"change"
data-parsley-minlength=
"2"
required=
""
name=
"search_date"
placeholder=
"Search Date"
autocomplete=
"off"
>
<div
class=
"input-group-addon"
>
<i
class=
"fa fa-calendar"
></i>
</div>
</div>
</div>
</div>
<div
class=
"col-md-12"
>
<div
class=
"col-md-2"
style=
"float:right;padding:initial;"
>
<a
class=
"btn btn-sm btn-primary"
style=
"width: 150px;"
href=
"
<?=
base_url
(
'Ride/scheduled_rides'
)
?>
"
>
View All
</a>
</div>
<div
class=
"col-md-2"
style=
"float:right;padding:initial;"
>
<button
class=
"btn btn-sm btn-primary"
style=
"width: 150px;"
type=
"submit"
>
Search
</button>
</div>
</div>
</form>
</div>
</div>
</div>
<div
class=
"col-md-12"
>
<div
class=
"box box-warning"
>
<div
class=
"box-body"
>
<table
class=
"table table-bordered table-striped datatable "
>
<thead>
<tr>
<th
class=
"hidden"
>
ID
</th>
<th
width=
"100px"
>
Scheduled Time
</th>
<th
width=
"100px"
>
Arrival Time
</th>
<th
width=
"100px"
>
Coustomer Name
</th>
<th
width=
"100px"
>
Mobility
</th>
<th
width=
"100px"
>
Pick Up Address
</th>
<th
width=
"100px"
>
Drop Off Address
</th>
<th
width=
"100px"
>
Rider Status
</th>
<th
width=
"40px"
>
View
</th>
</tr>
</thead>
<tbody>
<?php
$report_data
=
array
();
if
(
!
empty
(
$ride_data
)){
foreach
(
$ride_data
as
$ride
)
{
$json_ride
=
json_decode
(
$ride
->
data
,
true
);
if
(
empty
(
$json_ride
)){
continue
;
}
?>
<tr>
<th
class=
"hidden"
>
<?=
$ride
->
transport_id
?>
</th>
<th
class=
"center"
>
<?=
date
(
"d-m-y G:i"
,
$ride
->
appointment_time
)
?>
</th>
<th
class=
"center"
></th>
<th
class=
"center"
>
<?=
$ride
->
patient_name
?>
</th>
<th
class=
"center"
></th>
<th
class=
"center"
>
<?=
$ride
->
pickup_location
?>
</th>
<th
class=
"center"
>
<?=
$ride
->
drop_location
?>
</th>
<th
class=
"center"
>
<?php
if
(
!
empty
(
$ride
->
assigned_driver
)
&&
$ride
->
driver_assign_status
==
'1'
){
echo
'Driver Cancelled & Auto Assigned to Dispatcher'
;
}
else
if
(
empty
(
$ride
->
assigned_driver
)
&&
$ride
->
driver_assign_status
==
'1'
){
echo
'No Driver Found, ride assigned to dispatcher'
;
}
else
if
(
!
empty
(
$ride
->
assigned_driver
)
&&
$ride
->
driver_assign_status
==
'0'
&&
!
empty
(
$ride
->
assigned_driver_name
)
&&
$ride
->
status
==
3
){
echo
'Waiting for driver response : Driver Name '
.
$ride
->
assigned_driver_name
;
}
else
if
(
!
empty
(
$ride
->
assigned_driver
)
&&
$ride
->
driver_assign_status
==
'0'
&&
!
empty
(
$ride
->
assigned_driver_name
)
&&
$ride
->
status
==
4
){
echo
'Driver Accepted : Driver Name '
.
$ride
->
assigned_driver_name
;
}
?>
</th>
<th
class=
"center"
>
<a
id=
"viewRideDetails"
key=
"
<?=
$ride
->
transport_id
?>
"
class=
"cpoint"
>
<i
class=
"fa fa-fw fa-eye"
></i>
</a>
</th>
</tr>
<?php
$report_data
[
$ride
->
transport_id
]
=
$json_ride
;
}
}
?>
</tbody>
</table>
</div>
</div>
</div>
</div>
</section>
</div>
<script
type=
"text/javascript"
>
report_data
=
<?=
json_encode
(
$report_data
);
?>
;
</script>
\ No newline at end of file
application/views/Ride/view_rides.php
View file @
6d302e54
<?php
$headerArr
=
array
(
"Medicaid_Number"
,
"Members_Last_Name"
,
"Members_First_Name"
,
"Members_Date_of_Birth"
,
"Members_Age"
,
"Members_Phone_Number"
,
"Members_Alt_Phone"
,
"Trip_Number"
,
"Appointment_Date"
,
"Appointment_Day_of_Week"
,
"Appointment_Time"
,
"Trip_Reason_Code"
,
"Trip_Status"
,
"Vehicle_Type"
,
"Trip_Type"
,
"Wheelchair_Flag"
,
"Crutches_\/_Walker_\/_Cane_Flag"
,
"Number_of_Car_Seats_Required"
,
"Pregnant_Flag"
,
"Number_of_Additional_Passengers"
,
"Additional_Passengers_With_Appointments"
,
"Trip_Mileage"
,
"Trip_Cost"
,
"Pickup_Address"
,
"Pickup_City"
,
"Pickup_State"
,
"Pickup_Zip_Code"
,
"Delivery_Name"
,
"Delivery_Address"
,
"Delivery_City"
,
"Delivery_State"
,
"Delivery_Zip_Code"
,
"Delivery_Phone_Number"
,
"Special_Needs"
,
"Inst_\/_Directions"
,
"Return_Time"
,
"Attendant_Flag"
,
"Trip_Bid_Status"
,
"Date_Trip_Bid_Status_Was_Changed"
,
"Confirmation_Number"
,
"Copay"
,
"Trip_Status_Date"
);
?>
<div
class=
"content-wrapper"
>
<!-- Content Header (Page header) -->
<section
class=
"content-header"
>
...
...
@@ -50,7 +49,7 @@
}
}
?>
<option
value=
"0"
<?=
(
$broker_id
==
0
)
?
'selected'
:
''
?>
>
Phone Bookings
</option>
<option
value=
"0"
<?=
(
$broker_id
!=
''
&&
$broker_id
==
0
)
?
'selected'
:
''
?>
>
Phone Bookings
</option>
</select>
</div>
</div>
...
...
@@ -77,9 +76,11 @@
</thead>
<tbody>
<?php
$ride_ids
=
array
();
$report_data
=
array
();
if
(
!
empty
(
$ride_data
)){
foreach
(
$ride_data
as
$ride
)
{
$ride_ids
[]
=
$ride
->
transport_id
;
$json_ride
=
json_decode
(
$ride
->
data
,
true
);
if
(
empty
(
$json_ride
)){
continue
;
...
...
@@ -88,6 +89,16 @@
<tr>
<th
class=
"hidden"
>
<?=
$ride
->
transport_id
?>
</th>
<th
class=
"center"
>
<?php
if
(
$this
->
session
->
userdata
[
'user_type'
]
!=
1
){
$style
=
'style="color:red;";'
;
if
(
$ride
->
is_scheduled
==
1
){
$style
=
'style="color:green;";'
;
}
?>
<a
id=
"markSchedule_
<?=
$ride
->
transport_id
?>
"
transport_id=
"
<?=
$ride
->
transport_id
?>
"
is_scheduled=
"
<?=
$ride
->
is_scheduled
?>
"
class=
"cpoint"
>
<i
class=
"fa fa-fw fa-check"
<?=
$style
?>
></i>
</a>
<?php
}
?>
<a
id=
"viewRideDetails"
key=
"
<?=
$ride
->
transport_id
?>
"
class=
"cpoint"
>
<i
class=
"fa fa-fw fa-eye"
></i>
</a>
...
...
@@ -117,6 +128,13 @@
}
?>
</tbody>
</table>
<?php
if
(
$this
->
session
->
userdata
[
'user_type'
]
!=
1
){
?>
<div
class=
"col-md-1"
style=
"float:right;padding:initial;"
>
<a
id=
"scheduleAll"
class=
"btn btn-sm btn-primary"
>
Schedule All
</a>
</div>
<?php
}
?>
</div>
</div>
</div>
...
...
@@ -124,5 +142,6 @@
</section>
</div>
<script
type=
"text/javascript"
>
ride_ids
=
<?=
json_encode
(
$ride_ids
);
?>
;
report_data
=
<?=
json_encode
(
$report_data
);
?>
;
</script>
application/views/Templates/footer-script.php
View file @
6d302e54
...
...
@@ -45,7 +45,7 @@
}
});
});
<?php
break
;
?>
<?php
break
;
default
:
?>
jQuery
(
function
()
{
jQuery
(
'.datatable'
).
DataTable
({
...
...
application/views/Templates/header-script.php
View file @
6d302e54
...
...
@@ -22,6 +22,6 @@
<script
src=
"
<?php
echo
base_url
();
?>
assets/js/jQuery-2.1.4.min.js"
></script>
<script
type=
"text/javascript"
>
report_data
=
[];
report_data
=
ride_ids
=
[];
</script>
</head>
application/views/Templates/left-menu.php
View file @
6d302e54
...
...
@@ -136,6 +136,14 @@
Import Rides
</a>
</li>
<?php
if
(
$this
->
session
->
userdata
[
'user_type'
]
!=
1
){
?>
<li>
<a
href=
"
<?=
base_url
(
'Ride/scheduled_rides'
)
?>
"
>
<i
class=
"fa fa-circle-o text-aqua"
></i>
Scheduled Rides
</a>
</li>
<?php
}
?>
</ul>
</li>
<li><a
href=
"
<?=
base_url
(
'Payment/getPayDetails'
)
?>
"
>
...
...
assets/css/custom-style.css
View file @
6d302e54
...
...
@@ -3,7 +3,7 @@
}
.dropdown-toggle
{
background
:
rgba
(
0
,
0
,
0
,
0.1
)
none
repeat
scroll
0
0
;
background
:
rgba
(
0
,
0
,
0
,
0.1
)
none
repeat
scroll
0
0
;
}
.modal-wide
.modal-dialog
{
width
:
80%
!important
;
...
...
@@ -18,13 +18,13 @@
border
:
none
!important
;
}
#map_canvas
{
height
:
350px
;
width
:
98%
;
height
:
350px
;
width
:
98%
;
}
#map_canvasmap
{
height
:
350px
;
width
:
98%
;
height
:
350px
;
width
:
98%
;
}
.input_size
{
width
:
280px
!important
;}
...
...
@@ -78,38 +78,38 @@
.sleeper
{
background-image
:
url(./images/1.png)
;
background-repeat
:
no-repeat
;
height
:
23px
;
width
:
34px
;
margin-top
:
10px
;
height
:
41px
;
}
.seater
{
background-image
:
url(./images/4.png)
;
background-repeat
:
no-repeat
;
height
:
23px
;
width
:
34px
;
margin-top
:
10px
;
height
:
41px
;
}
.sleeper1
{
background-image
:
url(../images/empty.png)
;
background-repeat
:
no-repeat
;
height
:
23px
;
width
:
34px
;
margin-top
:
10px
;
height
:
41px
;
}
width
:
34px
;
margin-top
:
10px
;
height
:
41px
;
}
.seater
{
background-image
:
url(./images/4.png)
;
background-repeat
:
no-repeat
;
height
:
23px
;
width
:
34px
;
margin-top
:
10px
;
height
:
41px
;
}
.sleeper1
{
background-image
:
url(../images/empty.png)
;
background-repeat
:
no-repeat
;
height
:
23px
;
width
:
34px
;
margin-top
:
10px
;
height
:
41px
;
}
.sub_buttons
{
padding-top
:
23px
!important
;}
.well
{
position
:
absolute
;
z-index
:
1
;
margin-top
:
-30px
;
height
:
30px
;
min-height
:
30px
;
padding
:
0
6.5px
;
left
:
25%
;
}
.sub_buttons
{
padding-top
:
23px
!important
;}
.well
{
position
:
absolute
;
z-index
:
1
;
margin-top
:
-30px
;
height
:
30px
;
min-height
:
30px
;
padding
:
0
6.5px
;
left
:
25%
;
}
.thumbnailss
{
list-style
:
none
;
}
.thumbnailss
{
list-style
:
none
;
}
/******SEAT BLOCK CSS********/
.sleeper
{
/******SEAT BLOCK CSS********/
.sleeper
{
background-image
:
url(../images/1.png)
;
background-repeat
:
no-repeat
;
height
:
23px
;
...
...
@@ -117,26 +117,26 @@
margin-top
:
10px
;
height
:
39px
;
cursor
:
pointer
;
}
.ssleeper
{
}
.ssleeper
{
background-image
:
url(../images/3.png)
;
background-repeat
:
no-repeat
;
height
:
23px
;
width
:
34px
;
margin-top
:
10px
;
height
:
39px
;
}
.bsleeper
{
}
.bsleeper
{
background-image
:
url(../images/3.png)
;
background-repeat
:
no-repeat
;
height
:
23px
;
width
:
34px
;
margin-top
:
10px
;
height
:
39px
;
}
.selectedsleeper
{
}
.selectedsleeper
{
background-image
:
url(../images/2.png)
;
background-repeat
:
no-repeat
;
height
:
23px
;
...
...
@@ -144,44 +144,44 @@
margin-top
:
10px
;
height
:
39px
;
cursor
:
pointer
;
}
.selectedsleeper1
{
background-image
:
url(../images/1.png)
;
background-repeat
:
no-repeat
;
height
:
23px
;
width
:
34px
;
margin-top
:
10px
;
height
:
39px
;
cursor
:
pointer
;
}
}
.selectedsleeper1
{
background-image
:
url(../images/1.png)
;
background-repeat
:
no-repeat
;
height
:
23px
;
width
:
34px
;
margin-top
:
10px
;
height
:
39px
;
cursor
:
pointer
;
}
.seater
{
background-image
:
url(../images/4.png)
;
background-repeat
:
no-repeat
;
height
:
23px
;
width
:
34px
;
margin-top
:
10px
;
height
:
27px
;
cursor
:
pointer
;
.seater
{
background-image
:
url(../images/4.png)
;
background-repeat
:
no-repeat
;
height
:
23px
;
width
:
34px
;
margin-top
:
10px
;
height
:
27px
;
cursor
:
pointer
;
}
.sseater
{
background-image
:
url(../images/7.png)
;
background-repeat
:
no-repeat
;
height
:
23px
;
width
:
34px
;
margin-top
:
10px
;
height
:
39px
;
background-image
:
url(../images/7.png)
;
background-repeat
:
no-repeat
;
height
:
23px
;
width
:
34px
;
margin-top
:
10px
;
height
:
39px
;
}
.bseater
{
background-image
:
url(../images/7.png)
;
background-repeat
:
no-repeat
;
height
:
23px
;
width
:
34px
;
margin-top
:
10px
;
height
:
39px
;
background-image
:
url(../images/7.png)
;
background-repeat
:
no-repeat
;
height
:
23px
;
width
:
34px
;
margin-top
:
10px
;
height
:
39px
;
}
/*.ssseater{
background-image: url(../images/4.png);
background-repeat: no-repeat;
...
...
@@ -190,56 +190,111 @@
margin-top: 10px;
height: 27px;
cursor: pointer;
}*/
.selectedseat
{
background-image
:
url(../images/6.png)
;
/*background-image: url(../images/6.png);*/
background-repeat
:
no-repeat
;
height
:
23px
;
width
:
34px
;
margin-top
:
10px
;
height
:
27px
;
cursor
:
pointer
;
}
.sleeper1
{
background-image
:
url(../images/empty.png)
;
background-repeat
:
no-repeat
;
height
:
23px
;
width
:
34px
;
margin-top
:
10px
;
height
:
21px
;
}
/******SEAT BLOCK CSS********/
}*/
.selectedseat
{
background-image
:
url(../images/6.png)
;
/*background-image: url(../images/6.png);*/
background-repeat
:
no-repeat
;
height
:
23px
;
width
:
34px
;
margin-top
:
10px
;
height
:
27px
;
cursor
:
pointer
;
}
.sleeper1
{
background-image
:
url(../images/empty.png)
;
background-repeat
:
no-repeat
;
height
:
23px
;
width
:
34px
;
margin-top
:
10px
;
height
:
21px
;
}
/******SEAT BLOCK CSS********/
.prevent-click
{
pointer-events
:
none
;
cursor
:
default
;
text-decoration
:
none
;
color
:
black
;
}
.prevent-click
{
pointer-events
:
none
;
cursor
:
default
;
text-decoration
:
none
;
color
:
black
;
}
.hide
{
display
:
none
!important
;
}
.hide
{
display
:
none
!important
;
}
.loader
{
position
:
absolute
;
top
:
0px
;
right
:
0px
;
bottom
:
0px
;
left
:
0px
;
text-align
:
center
;
background-image
:
url(../images/loader.gif)
;
background-size
:
12
%
;
background-position
:
center
;
background-repeat
:
no-repeat
;
background-color
:
rgba
(
211
,
211
,
211
,
0.5
);
}
.loader
{
position
:
absolute
;
top
:
0px
;
right
:
0px
;
bottom
:
0px
;
left
:
0px
;
text-align
:
center
;
background-image
:
url(../images/loader.gif)
;
background-size
:
5
%
;
background-position
:
center
;
background-repeat
:
no-repeat
;
background-color
:
rgba
(
0
,
0
,
0
,
0.56
);
}
.height_200
{
.height_200
{
height
:
200px
!important
;
}
}
.cpoint
{
.cpoint
{
cursor
:
pointer
!important
;
}
\ No newline at end of file
}
.overlay
{
position
:
fixed
;
/* Sit on top of the page content */
display
:
none
;
/* Hidden by default */
width
:
100%
;
/* Full width (cover the whole page) */
height
:
100%
;
/* Full height (cover the whole page) */
top
:
0
;
left
:
0
;
right
:
0
;
bottom
:
0
;
background-color
:
rgba
(
0
,
0
,
0
,
0.5
);
/* Black background with opacity */
z-index
:
2
;
/* Specify a stack order in case you're using a different order for other elements */
cursor
:
pointer
;
/* Add a pointer on hover */
}
.drag-box
{
float
:
left
;
width
:
100%
;
min-height
:
25px
;
margin
:
2px
;
border
:
1px
solid
#A8A8A8
;
}
.border-cls
{
border
:
1px
solid
#e0dbdb
;
}
.headtag-td
{
padding
:
5px
;
width
:
50%
;
}
.header-tag
{
border
:
1px
solid
darkgray
;
border-radius
:
10px
;
padding
:
0px
10px
;
display
:
inline-block
;
margin
:
2px
;
background
:
#c2ccd6
;
}
.header-tag-box
{
width
:
100%
;
min-height
:
400px
;
border
:
1px
solid
#dfdbdb
;
padding
:
2px
;
}
.clear
{
clear
:
both
!important
;
}
.btn-mapping
{
text-align
:
center
;
padding
:
15px
;
}
\ No newline at end of file
assets/js/nemt_custom.js
View file @
6d302e54
jQuery
(
document
).
ready
(
function
(){
jQuery
(
'<div class="overlay"></div>'
).
insertBefore
(
".content-wrapper"
);
});
function
setImg
(
input
,
id
)
{
if
(
input
.
files
&&
input
.
files
[
0
])
{
var
reader
=
new
FileReader
();
...
...
@@ -9,9 +13,9 @@ function setImg(input,id) {
}
}
function
initPickUp
()
{
var
options
=
{
componentRestrictions
:
{
country
:
country_flag
}};
var
input
=
document
.
getElementById
(
'pickup_location'
);
var
autocomplete
=
new
google
.
maps
.
places
.
Autocomplete
(
input
,
options
);
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
()
{
...
...
@@ -51,10 +55,10 @@ jQuery('[name="fieldType"]').click(function(){
jQuery
(
'[id="rGenerate"]'
).
click
(
function
(){
event
.
preventDefault
();
var
fields
=
''
,
action
=
jQuery
(
this
).
attr
(
'action'
),
thisObj
=
jQuery
(
this
);
fieldType
=
jQuery
(
'input[name="fieldType"]:checked'
).
val
(),
where_cond
=
jQuery
(
'[id="where_cond"]'
).
serialize
();
action
=
jQuery
(
this
).
attr
(
'action'
),
thisObj
=
jQuery
(
this
);
fieldType
=
jQuery
(
'input[name="fieldType"]:checked'
).
val
(),
where_cond
=
jQuery
(
'[id="where_cond"]'
).
serialize
();
if
(
thisObj
.
attr
(
'dmclick'
)
==
1
){
return
false
;
...
...
@@ -98,8 +102,8 @@ jQuery('[id="rGenerate"]').click(function(){
report_data
[
key
]
=
data
;
var
vBtn
=
'<a class="btn btn-sm btn-primary" id="report_view_pop_'
+
key
+
'" key="'
+
key
+
'"><i class="fa fa-fw fa-edit"></i>View</a>'
;
table
.
row
.
add
([
data
[
'Order_ID'
],
data
[
'Medical_Number'
],
data
[
'Patient_Name'
],
data
[
'Patient_Age'
],
data
[
'Patient_Phone'
],
data
[
'Appointment_Reason'
],
data
[
'Appointment_Time'
],
vBtn
]).
draw
();
data
[
'Patient_Age'
],
data
[
'Patient_Phone'
],
data
[
'Appointment_Reason'
],
data
[
'Appointment_Time'
],
vBtn
]).
draw
();
});
jQuery
(
'[id="report_table_html"]'
).
removeClass
(
'hide'
);
slideTo
(
'report_table_html'
);
...
...
@@ -127,14 +131,14 @@ function slideTo(id){
jQuery
(
'#report_table tbody'
).
on
(
'click'
,
'a'
,
function
()
{
var
thisObj
=
jQuery
(
this
),
key
=
thisObj
.
attr
(
'key'
);
key
=
thisObj
.
attr
(
'key'
);
viewOrderDetails
(
key
);
});
jQuery
(
'[id="viewRideDetails"]'
).
click
(
function
(){
console
.
log
(
'sdrfg'
);
var
thisObj
=
jQuery
(
this
),
key
=
thisObj
.
attr
(
'key'
);
key
=
thisObj
.
attr
(
'key'
);
viewOrderDetails
(
key
);
});
...
...
@@ -146,10 +150,10 @@ function viewOrderDetails(key){
jQuery
.
each
(
report_data
[
key
],
function
(
field
,
value
)
{
value
=
(
value
==
null
||
value
==
'null'
||
value
==
undefined
||
value
==
'undefined'
)?
'--'
:
value
;
rowHtml
+=
'<div class="col-xs-6"><div class="col-xs-12">'
+
'<div class="col-xs-6">'
+
field
.
replace
(
/_/g
,
' '
)
+
'</div>'
+
'<div class="col-xs-1">:</div>'
+
'<div class="col-xs-5">'
+
value
+
'</div>'
+
'</div></div>'
;
'<div class="col-xs-6">'
+
field
.
replace
(
/_/g
,
' '
)
+
'</div>'
+
'<div class="col-xs-1">:</div>'
+
'<div class="col-xs-5">'
+
value
+
'</div>'
+
'</div></div>'
;
if
(
colCount
==
2
){
body_html
+=
rowHtml
;
rowHtml
=
''
;
...
...
@@ -189,4 +193,167 @@ function addModalLoader(){
function
remModalLoader
(){
jQuery
(
"[id='modal_loader_body']"
).
remove
();
jQuery
(
"[id='modal_content']"
).
removeClass
(
'relative height_200'
);
}
\ No newline at end of file
}
jQuery
(
'[id="scheduleAll"]'
).
click
(
function
(){
if
(
ride_ids
==
undefined
||
ride_ids
==
'undefined'
||
ride_ids
==
null
||
ride_ids
==
'null'
||
ride_ids
==
''
){
return
false
;
}
markAsScheduled
(
ride_ids
,
'0'
);
});
jQuery
(
'[id^="markSchedule_"]'
).
click
(
function
(){
var
thisObj
=
jQuery
(
this
),
is_scheduled
=
thisObj
.
attr
(
'is_scheduled'
),
transport_id
=
thisObj
.
attr
(
'transport_id'
);
if
(
transport_id
==
undefined
||
transport_id
==
'undefined'
||
transport_id
==
null
||
transport_id
==
'null'
||
transport_id
==
''
||
is_scheduled
==
undefined
||
is_scheduled
==
'undefined'
||
is_scheduled
==
null
||
is_scheduled
==
'null'
||
is_scheduled
==
''
){
return
false
;
}
if
(
is_scheduled
==
1
){
flag
=
confirm
(
"Are you sure to continue with this action...?"
);
if
(
flag
!=
true
)
return
false
;
}
markAsScheduled
(
transport_id
,
is_scheduled
);
});
function
markAsScheduled
(
transport_id
,
is_scheduled
){
if
(
transport_id
==
undefined
||
transport_id
==
'undefined'
||
transport_id
==
null
||
transport_id
==
'null'
||
transport_id
==
''
||
is_scheduled
==
undefined
||
is_scheduled
==
'undefined'
||
is_scheduled
==
null
||
is_scheduled
==
'null'
||
is_scheduled
==
''
){
return
false
;
}
showFullScreenLoader
();
jQuery
.
ajax
({
url
:
base_url
+
"Ride/changeSchuduleStatus"
,
type
:
'POST'
,
data
:
{
'transport_id'
:
transport_id
,
'is_scheduled'
:
is_scheduled
},
success
:
function
(
resp
){
if
(
resp
==
''
||
resp
==
undefined
||
resp
==
null
||
resp
==
'null'
||
resp
==
'undefined'
){
remFullScreenLoader
();
return
false
;
}
resp
=
jQuery
.
parseJSON
(
resp
);
if
(
resp
[
'status'
]
==
1
){
var
color
=
''
;
if
(
is_scheduled
==
1
){
color
=
'red'
is_scheduled
=
0
;
}
else
{
color
=
'green'
is_scheduled
=
1
;
}
jQuery
.
each
(
resp
[
'succArr'
],
function
(
index
,
value
)
{
jQuery
(
'[id="markSchedule_'
+
value
+
'"]'
).
attr
(
'is_scheduled'
,
is_scheduled
);
jQuery
(
jQuery
(
'[id="markSchedule_'
+
value
+
'"]'
)).
children
().
css
(
"color"
,
color
);
});
remFullScreenLoader
();
}
},
error
:
function
(
jqXHR
,
exception
)
{
remFullScreenLoader
();
}
});
}
function
showFullScreenLoader
(){
var
thisObj
=
jQuery
(
'.overlay'
);
thisObj
.
css
(
"display"
,
'block'
);
thisObj
.
addClass
(
'relative'
);
thisObj
.
prepend
(
"<div id='fullScreenLoaderBody' class='loader'></div>"
);
}
function
remFullScreenLoader
(){
var
thisObj
=
jQuery
(
'.overlay'
);
thisObj
.
css
(
"display"
,
'none'
);
jQuery
(
'[id="fullScreenLoaderBody"]'
).
remove
();
thisObj
.
removeClass
(
'relative'
);
}
function
allowDropElement
(
ev
)
{
if
(
ev
.
target
.
getAttribute
(
'type'
)
!=
'parent'
&&
ev
.
target
.
firstChild
!=
null
){
return
false
;
}
ev
.
preventDefault
();
}
function
dragElement
(
ev
)
{
ev
.
dataTransfer
.
setData
(
"tmporderid"
,
ev
.
target
.
getAttribute
(
'id'
));
}
function
dropElement
(
ev
)
{
ev
.
preventDefault
();
var
tmporderid
=
ev
.
dataTransfer
.
getData
(
"tmporderid"
);
ev
.
target
.
appendChild
(
document
.
getElementById
(
tmporderid
));
}
jQuery
(
'[id="upload_excell"]'
).
click
(
function
(){
var
thisObj
=
jQuery
(
this
),
childThisObj
=
''
,
headerOrder
=
[],
fileType
=
jQuery
(
'[name="fileType"]'
).
val
(),
broker_id
=
jQuery
(
'[name="broker_id"]'
).
val
(),
company_id
=
jQuery
(
'[name="company_id"]'
).
val
(),
import_file
=
jQuery
(
'[name="import_file"]'
).
val
();
if
(
thisObj
.
attr
(
'dmclick'
)
!=
0
){
return
false
;
}
if
(
fileType
==
''
||
fileType
==
undefined
||
fileType
==
null
||
fileType
==
'null'
||
fileType
==
'undefined'
||
broker_id
==
''
||
broker_id
==
undefined
||
broker_id
==
null
||
broker_id
==
'null'
||
broker_id
==
'undefined'
||
company_id
==
''
||
company_id
==
undefined
||
company_id
==
null
||
company_id
==
'null'
||
company_id
==
'undefined'
||
import_file
==
''
||
import_file
==
undefined
||
import_file
==
null
||
import_file
==
'null'
||
import_file
==
'undefined'
){
setErrModal
(
'Error Uploading Excell'
,
'Please Map All the Fields to the corrospinding header..!'
);
return
false
;
}
showFullScreenLoader
();
thisObj
.
attr
(
'dmclick'
,
1
);
jQuery
(
'[id="mappedHeaders"] [type="child"]'
).
each
(
function
(){
childThisObj
=
jQuery
(
this
);
if
(
childThisObj
.
children
().
length
<=
0
)
{
remFullScreenLoader
();
thisObj
.
attr
(
'dmclick'
,
0
);
setErrModal
(
'Error Uploading Excell'
,
'Something went wrong, please try again later..!'
);
return
false
;
}
var
childHead
=
childThisObj
.
children
();
headerOrder
[
childThisObj
.
attr
(
'headOrder'
)]
=
childHead
.
attr
(
'tmporder'
);
});
jQuery
.
ajax
({
url
:
base_url
+
"Ride/import"
,
type
:
'POST'
,
data
:
{
'broker_id'
:
broker_id
,
'company_id'
:
company_id
,
'header_order'
:
headerOrder
,
'file_type'
:
fileType
,
'import_file'
:
import_file
},
success
:
function
(
resp
){
if
(
resp
==
''
||
resp
==
undefined
||
resp
==
null
||
resp
==
'null'
||
resp
==
'undefined'
){
remFullScreenLoader
();
thisObj
.
attr
(
'dmclick'
,
0
);
setErrModal
(
'Error Uploading Excell'
,
'Something went wrong, please try again..!'
);
return
false
;
}
resp
=
jQuery
.
parseJSON
(
resp
);
if
(
resp
[
'status'
]
==
1
){
var
color
=
''
;
if
(
is_scheduled
==
1
){
color
=
'red'
is_scheduled
=
0
;
}
else
{
color
=
'green'
is_scheduled
=
1
;
}
jQuery
.
each
(
resp
[
'succArr'
],
function
(
index
,
value
)
{
jQuery
(
'[id="markSchedule_'
+
value
+
'"]'
).
attr
(
'is_scheduled'
,
is_scheduled
);
jQuery
(
jQuery
(
'[id="markSchedule_'
+
value
+
'"]'
)).
children
().
css
(
"color"
,
color
);
});
remFullScreenLoader
();
}
},
error
:
function
(
jqXHR
,
exception
)
{
remFullScreenLoader
();
thisObj
.
attr
(
'dmclick'
,
0
);
setErrModal
(
'Error Uploading Excell'
,
'Something went wrong, please try again..!'
);
return
false
;
}
});
});
\ 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