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
c0e2e55d
Commit
c0e2e55d
authored
Dec 17, 2018
by
Tobin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
daily commit
parent
e35f560e
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
41 additions
and
29 deletions
+41
-29
database.php
application/config/database.php
+3
-3
Ride.php
application/controllers/Ride.php
+4
-5
Ride_model.php
application/models/Ride_model.php
+18
-9
view.php
application/views/Company/view.php
+4
-2
scheduled_rides.php
application/views/Ride/scheduled_rides.php
+4
-2
nemt_custom.js
assets/js/nemt_custom.js
+8
-8
tobin_nemt_backend.sql
sql/tobin_nemt_backend.sql
+0
-0
No files found.
application/config/database.php
View file @
c0e2e55d
...
...
@@ -75,10 +75,10 @@ $query_builder = TRUE;
$db
[
'default'
]
=
array
(
'dsn'
=>
''
,
'hostname'
=>
'
localhost
'
,
'username'
=>
'
techlabz_nem
t'
,
'hostname'
=>
'
192.168.140.123
'
,
'username'
=>
'
roo
t'
,
'password'
=>
'Golden_123'
,
'database'
=>
't
echlabz
_nemt_backend'
,
'database'
=>
't
obin
_nemt_backend'
,
'dbdriver'
=>
'mysqli'
,
'dbprefix'
=>
''
,
'pconnect'
=>
FALSE
,
...
...
application/controllers/Ride.php
View file @
c0e2e55d
...
...
@@ -573,7 +573,6 @@ class Ride extends CI_Controller {
$company_data
=
''
;
if
(
$this
->
session
->
userdata
[
'user_type'
]
==
1
){
$company_id
=
''
;
$broker_id
=
(
!
isset
(
$_POST
[
'company_id'
])
||
empty
(
$company_id
=
$_POST
[
'company_id'
]))
?
''
:
$broker_id
;
...
...
@@ -717,10 +716,10 @@ class Ride extends CI_Controller {
$result
=
array
(
'status'
=>
'0'
);
if
(
!
isset
(
$_POST
)
||
empty
(
$_POST
)
||
!
isset
(
$_POST
[
'transport_id'
])
||
empty
(
$_POST
[
'transport_id'
])
||
!
isset
(
$_POST
[
'is_scheduled'
])
||
$_POST
[
'is_scheduled'
]
==
''
||
(
$_POST
[
'is_scheduled'
]
==
0
&&
(
!
isset
(
$_POST
[
'drivers'
])
||
empty
(
$_POST
[
'drivers'
])))){
!
isset
(
$_POST
[
'is_scheduled'
])
||
$_POST
[
'is_scheduled'
]
==
''
){
echo
json_encode
(
$result
);
exit
;
}
$drivers
=
(
isset
(
$_POST
[
'drivers'
])
&&
!
empty
(
$_POST
[
'drivers'
]))
?
$_POST
[
'drivers'
]
:
''
;
$ride_ids
=
$_POST
[
'transport_id'
];
$no_driver
=
(
isset
(
$_POST
[
'no_driver'
])
&&
$_POST
[
'no_driver'
]
==
'1'
)
?
'1'
:
'0'
;
...
...
@@ -746,9 +745,9 @@ class Ride extends CI_Controller {
echo
json_encode
(
$result
);
exit
;
}
function
changeScheduler
(
$ride_id
=
''
,
$is_scheduled
=
'0'
,
$drivers
=
array
(),
$no_driver
=
'0'
){
function
changeScheduler
(
$ride_id
=
''
,
$is_scheduled
=
'0'
,
$drivers
=
array
(),
$no_driver
=
'0'
){
$status
=
'0'
;
if
(
empty
(
$ride_id
)
||
(
$is_scheduled
==
'1'
&&
empty
(
$drivers
))
){
if
(
empty
(
$ride_id
)){
return
$status
;
}
if
(
$is_scheduled
==
1
){
...
...
application/models/Ride_model.php
View file @
c0e2e55d
...
...
@@ -42,12 +42,15 @@ 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
.=
(
$scheduled
!=
''
)
?
" AND TD.is_scheduled = '
$scheduled
'"
:
""
;
$cond
.=
(
!
empty
(
$company_id
))
?
" AND TD.company_id = '
$company_id
'"
:
""
;
if
(
$scheduled
!=
''
){
$cond
.=
" AND TD.is_scheduled = '
$scheduled
'"
;
}
if
(
!
empty
(
$condArr
)){
$cond
.=
implode
(
' '
,
$condArr
);
}
...
...
@@ -63,7 +66,6 @@ class Ride_model extends CI_Model {
LEFT JOIN appointment_reason AS AR ON (AR.reason_id = TD.reason_code)
WHERE TD.status != '2' "
.
$cond
.
"
ORDER BY TD.transport_id DESC"
;
$ride_data
=
$this
->
db
->
query
(
$sql
);
if
(
empty
(
$ride_data
)){
return
;
...
...
@@ -147,12 +149,14 @@ class Ride_model extends CI_Model {
function
autoAssignDriver
(
$ride_id
=
''
,
$appointment_time
=
''
,
$pickupLoc
=
array
(),
$drivers
=
array
(),
$no_driver
=
'0'
){
if
(
empty
(
$ride_id
)
||
empty
(
$appointment_time
)
||
empty
(
$drivers
)
||
empty
(
$pickupLoc
)
||
!
isset
(
$pickupLoc
[
'lat'
])
||
$pickupLoc
[
'lat'
]
==
''
||
!
isset
(
$pickupLoc
[
'lng'
])
||
$pickupLoc
[
'lng'
]
==
''
){
if
(
empty
(
$ride_id
)){
return
;
}
if
(
!
empty
(
$drivers
)
&&
!
empty
(
$appointment_time
)
&&
!
empty
(
$pickupLoc
)
&&
isset
(
$pickupLoc
[
'lat'
])
&&
!
$pickupLoc
[
'lat'
]
==
''
&&
isset
(
$pickupLoc
[
'lng'
])
&&
!
$pickupLoc
[
'lng'
]
==
''
){
$time
=
date
(
"G:i"
,
$appointment_time
);
$date
=
date
(
"d-m-Y"
,
$appointment_time
);
...
...
@@ -164,8 +168,12 @@ class Ride_model extends CI_Model {
$sql
=
"SELECT GROUP_CONCAT(TD.assigned_driver) AS assigned_drivers
FROM transport_details AS TD
INNER JOIN drivers AS DRV ON (DRV.driver_id = TD.assigned_driver)
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.appointment_time>
$startDateTime
AND
TD.appointment_time<
$endDateTime
AND
TD.appointment_time>DRV.online_start_time AND
TD.appointment_time<DRV.online_end_time AND
TD.status IN (4,5,8) AND TD.assigned_driver IN ("
.
implode
(
","
,
$drivers
)
.
")"
;
$prvDrivers
=
$this
->
db
->
query
(
$sql
);
...
...
@@ -193,12 +201,13 @@ class Ride_model extends CI_Model {
$driver_id
=
$nearByDriver
[
'driver_id'
];
$status
=
$this
->
db
->
update
(
'transport_details'
,
array
(
'driver_assign_status'
=>
'0'
,
'assigned_driver'
=>
$driver_id
,
'status'
=>
'3'
),
array
(
'driver_assign_status'
=>
'0'
,
'assigned_driver'
=>
$driver_id
,
'status'
=>
'3'
),
array
(
'transport_id'
=>
$ride_id
));
return
$status
;
}
}
}
$assignStatus
=
(
$no_driver
==
'1'
)
?
'2'
:
'1'
;
$status
=
$this
->
db
->
update
(
'transport_details'
,
array
(
'driver_assign_status'
=>
$assignStatus
,
'status'
=>
'3'
),
...
...
application/views/Company/view.php
View file @
c0e2e55d
...
...
@@ -63,7 +63,7 @@
</label>
</div>
</div>
<div
class=
"col-md-
5
"
>
<div
class=
"col-md-
3
"
>
<div
class=
"form-group has-feedback"
>
<span
style=
"padding-right: 108px;"
>
Fax
</span>
:
<label
style=
"padding-left: 10px;"
for=
"exampleInputEmail1"
>
...
...
@@ -89,6 +89,7 @@
</label>
</div>
</div>
<div
class=
"col-md-3"
>
</div>
</div>
<div
class=
"col-md-12"
style=
"padding-bottom: 15px;"
>
<div
class=
"col-md-12 box-header with-border"
><h4>
Payment Charges
</h4></div>
...
...
@@ -109,7 +110,7 @@
</label>
</div>
</div>
<div
class=
"col-md-
5
"
>
<div
class=
"col-md-
3
"
>
<div
class=
"form-group has-feedback"
>
<span
style=
"padding-right: 50px;"
>
Push Notification Charge
</span>
:
<label
style=
"padding-left: 10px;"
for=
"exampleInputEmail1"
>
...
...
@@ -123,6 +124,7 @@
</label>
</div>
</div>
<div
class=
"col-md-3"
>
</div>
</div>
</div>
</div>
...
...
application/views/Ride/scheduled_rides.php
View file @
c0e2e55d
...
...
@@ -95,9 +95,11 @@
if
(
!
empty
(
$ride
->
assigned_driver
)
&&
$ride
->
driver_assign_status
==
'1'
){
echo
'Driver Cancelled,<br> Auto Assigned to Dispatcher'
;
}
else
if
(
empty
(
$ride
->
assigned_driver
)
&&
$ride
->
driver_assign_status
==
'1'
){
echo
'No Driver Found,<br> Ride assigned to Dispatcher'
;
// echo 'No Driver Found,<br> Ride assigned to Dispatcher';
echo
'Ride assigned to Dispatcher'
;
}
else
if
(
empty
(
$ride
->
assigned_driver
)
&&
$ride
->
driver_assign_status
==
'2'
){
echo
'No Driver Found,<br> Ride assigned to No Driver'
;
// echo 'No Driver Found,<br> Ride assigned to No Driver';
echo
'Ride assigned to No Driver'
;
}
else
if
(
!
empty
(
$ride
->
assigned_driver
)
&&
$ride
->
driver_assign_status
==
'0'
&&
!
empty
(
$ride
->
assigned_driver_name
)
&&
$ride
->
status
==
3
){
echo
'Waiting for driver Approval<br>
Driver Name - '
.
$ride
->
assigned_driver_name
;
...
...
assets/js/nemt_custom.js
View file @
c0e2e55d
...
...
@@ -275,14 +275,14 @@ function markAsScheduled(transport_id,is_scheduled){
return
false
;
}
if
(
is_scheduled
==
0
&&
(
drivers
==
undefined
||
drivers
==
'undefined'
||
drivers
==
null
||
drivers
==
'null'
||
drivers
==
''
)){
slideTo
(
'selectDriverBlock'
);
jQuery
(
'[id="driverRequired"]'
).
fadeIn
(
500
);
setTimeout
(
function
(){
jQuery
(
'[id="driverRequired"]'
).
fadeOut
(
1000
);
},
5000
);
return
false
;
}
// if(is_scheduled == 0 && no_driver
== 0 && (drivers == undefined || drivers == 'undefined' || drivers == null || drivers == 'null' || drivers == '')){
//
slideTo('selectDriverBlock');
//
jQuery('[id="driverRequired"]').fadeIn(500);
//
setTimeout(function(){
//
jQuery('[id="driverRequired"]').fadeOut(1000);
//
}, 5000);
//
return false;
//
}
showFullScreenLoader
();
jQuery
.
ajax
({
...
...
sql/tobin_nemt_backend.sql
View file @
c0e2e55d
This diff is collapsed.
Click to expand it.
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