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
65b69a7a
Commit
65b69a7a
authored
Apr 10, 2019
by
Tobin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dc
parent
678c927e
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
158 additions
and
28 deletions
+158
-28
Ride.php
application/controllers/Ride.php
+127
-18
excel_reader_helper.txt
application/helpers/excel_reader_helper.txt
+9
-0
Ride_model.php
application/models/Ride_model.php
+10
-8
add_transport.php
application/views/Ride/add_transport.php
+6
-0
view_rides.php
application/views/Ride/view_rides.php
+6
-2
No files found.
application/controllers/Ride.php
View file @
65b69a7a
This diff is collapsed.
Click to expand it.
application/helpers/excel_reader_helper.txt
0 → 100644
View file @
65b69a7a
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
include('excelReaderLibrary/SpreadsheetReader.php');
include('excelReaderLibrary/php-excel-reader/excel_reader.php');
?>
\ No newline at end of file
application/models/Ride_model.php
View file @
65b69a7a
...
...
@@ -42,7 +42,7 @@ class Ride_model extends CI_Model {
return
(
$status
)
?
1
:
0
;
}
function
getRideData
(
$ride_id
=
''
,
$company_id
=
''
,
$broker_id
=
''
,
$scheduled
=
''
,
$condArr
=
array
()){
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
'"
:
""
;
...
...
@@ -147,11 +147,13 @@ class Ride_model extends CI_Model {
$this
->
db
->
delete
(
'ride_status'
,
array
(
'ride_id'
=>
$ride_id
));
}
function
autoAssignDriver
(
$ride_id
=
''
,
$appointment_time
=
''
,
$
pickupLoc
=
array
(),
function
autoAssignDriver
(
$ride_id
=
''
,
$appointment_time
=
''
,
$
locData
=
array
(),
$drivers
=
array
(),
$no_driver
=
'0'
){
if
(
empty
(
$ride_id
)
||
empty
(
$appointment_time
)
||
empty
(
$pickupLoc
)
||
!
isset
(
$pickupLoc
[
'lat'
])
||
$pickupLoc
[
'lat'
]
==
''
||
!
isset
(
$pickupLoc
[
'lng'
])
||
$pickupLoc
[
'lng'
]
==
''
){
if
(
empty
(
$ride_id
)
||
empty
(
$appointment_time
)
||
empty
(
$locData
)
||
!
isset
(
$locData
[
'plat'
])
||
$locData
[
'plat'
]
==
''
||
!
isset
(
$locData
[
'plng'
])
||
$locData
[
'plng'
]
==
''
||
!
isset
(
$locData
[
'dlat'
])
||
$locData
[
'dlat'
]
==
''
||
!
isset
(
$locData
[
'dlng'
])
||
$locData
[
'dlng'
]
==
''
){
return
0
;
}
...
...
@@ -180,9 +182,9 @@ class Ride_model extends CI_Model {
}
if
(
!
empty
(
$drivers
)){
$sql
=
"SELECT DRV.driver_id,
3956*2*ASIN(SQRT(POWER(SIN(("
.
$
pickupLoc
[
'
lat'
]
.
"-DRV.active_loc_lat)*
pi()/180/2),2)+COS("
.
$
pickupLoc
[
'
lat'
]
.
"*pi()/180)*COS(DRV.active_loc_lat*
pi()/180)*POWER(SIN(("
.
$
pickupLoc
[
'
lng'
]
.
"-DRV.active_loc_lng)*
3956*2*ASIN(SQRT(POWER(SIN(("
.
$
locData
[
'p
lat'
]
.
"-DRV.active_loc_lat)*
pi()/180/2),2)+COS("
.
$
locData
[
'p
lat'
]
.
"*pi()/180)*COS(DRV.active_loc_lat*
pi()/180)*POWER(SIN(("
.
$
locData
[
'p
lng'
]
.
"-DRV.active_loc_lng)*
pi()/180/2),2))) AS distance
FROM drivers AS DRV
WHERE DRV.status = 1 AND DRV.driver_id IN ("
.
implode
(
","
,
$drivers
)
.
") AND
...
...
application/views/Ride/add_transport.php
View file @
65b69a7a
...
...
@@ -281,6 +281,12 @@
</div>
</div>
</div>
<div
class=
"col-md-12"
style=
"padding-left:30px;padding-bottom:10px;"
>
<input
type=
"checkbox"
name=
"skipMapping"
checked
>
<p
style=
"display:inline;padding-left:10px;"
>
Auto skip Mapping Page (If mapping data is available)
</p>
</div>
<div
class=
"col-md-12"
>
<div
class=
"box-footer"
>
<button
type=
"submit"
class=
"btn btn-primary"
>
Upload
</button>
...
...
application/views/Ride/view_rides.php
View file @
65b69a7a
...
...
@@ -168,16 +168,20 @@
$report_data
=
array
();
if
(
!
empty
(
$ride_data
)){
foreach
(
$ride_data
as
$ride
)
{
$
ride_ids
[]
=
$ride
->
transport_id
;
$
schedFlag
=
0
;
$json_ride
=
json_decode
(
$ride
->
data
,
true
);
if
(
empty
(
$json_ride
)){
continue
;
}
if
(
$json_ride
[
'Trip_Status'
]
==
'S1'
){
$schedFlag
=
1
;
$ride_ids
[]
=
$ride
->
transport_id
;
}
?>
<tr>
<th
class=
"hidden"
>
<?=
$ride
->
transport_id
?>
</th>
<th
class=
"center"
>
<?php
if
(
$this
->
session
->
userdata
[
'user_type'
]
!=
1
&&
!
empty
(
$drivers_data
)){
<?php
if
(
$
schedFlag
&&
$
this
->
session
->
userdata
[
'user_type'
]
!=
1
&&
!
empty
(
$drivers_data
)){
$style
=
'style="color:red;";'
;
$ride
->
is_scheduled
=
(
isset
(
$ride
->
is_scheduled
))
?
$ride
->
is_scheduled
:
0
;
if
(
$ride
->
is_scheduled
==
1
){
...
...
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