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
9799a161
Commit
9799a161
authored
Aug 30, 2019
by
Tobin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dc
parent
1378c2da
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
41 additions
and
25 deletions
+41
-25
Ride.php
application/controllers/Ride.php
+8
-10
Ride_model.php
application/models/Ride_model.php
+22
-4
view_rides.php
application/views/Ride/view_rides.php
+3
-0
nemt_custom.js
assets/js/nemt_custom.js
+8
-11
No files found.
application/controllers/Ride.php
View file @
9799a161
...
@@ -695,18 +695,17 @@ class Ride extends CI_Controller {
...
@@ -695,18 +695,17 @@ class Ride extends CI_Controller {
$template
[
'page_desc'
]
=
"View Rides Details"
;
$template
[
'page_desc'
]
=
"View Rides Details"
;
$template
[
'page_title'
]
=
"View Rides"
;
$template
[
'page_title'
]
=
"View Rides"
;
$aDate
=
''
;
// $cond = array();
if
(
isset
(
$_POST
[
'search_date'
])
&&
!
empty
(
$aDate
=
$_POST
[
'search_date'
])){
if
(
isset
(
$_POST
[
'search_date'
])
&&
!
empty
(
$aDate
=
$_POST
[
'search_date'
])){
// $sDate = strtotime(date('Y-m-d',strtotime($_POST['search_date']
)));
$sDate
=
strtotime
(
date
(
'Y-m-d'
,
strtotime
(
$aDate
)));
//
$eDate = strtotime(date('Y-m-d',strtotime("+1 day",$sDate)));
$eDate
=
strtotime
(
date
(
'Y-m-d'
,
strtotime
(
"+1 day"
,
$sDate
)));
//
$cond[] = " AND TD.appointment_time>='$sDate' AND TD.appointment_time<'$eDate' ";
$cond
[]
=
" AND TD.appointment_time>='
$sDate
' AND TD.appointment_time<'
$eDate
' "
;
}
else
{
}
else
{
$aDate
=
date
(
'm/d/Y'
);
$aDate
=
date
(
'm/d/Y'
);
//
$sDate = strtotime(date('Y-m-d',strtotime(date('Y-m-d'))));
$sDate
=
strtotime
(
date
(
'Y-m-d'
,
strtotime
(
date
(
'Y-m-d'
))));
//
$eDate = strtotime(date('Y-m-d',strtotime("+1 day",$sDate)));
$eDate
=
strtotime
(
date
(
'Y-m-d'
,
strtotime
(
"+1 day"
,
$sDate
)));
//
$cond[] = " AND TD.appointment_time>='$sDate' AND TD.appointment_time<'$eDate' ";
$cond
[]
=
" AND TD.appointment_time>='
$sDate
' AND TD.appointment_time<'
$eDate
' "
;
}
}
$broker_id
=
(
isset
(
$_POST
[
'broker_id'
]))
?
$_POST
[
'broker_id'
]
:
''
;
$broker_id
=
(
isset
(
$_POST
[
'broker_id'
]))
?
$_POST
[
'broker_id'
]
:
''
;
$company_id
=
$this
->
session
->
userdata
[
'id'
];
$company_id
=
$this
->
session
->
userdata
[
'id'
];
...
@@ -718,14 +717,13 @@ class Ride extends CI_Controller {
...
@@ -718,14 +717,13 @@ class Ride extends CI_Controller {
$company_data
=
$this
->
Company_model
->
getCompany
();
$company_data
=
$this
->
Company_model
->
getCompany
();
}
}
$template
[
'aDate'
]
=
$aDate
;
$template
[
'aDate'
]
=
$aDate
;
$template
[
'ride_ids'
]
=
$this
->
Ride_model
->
getTotalCount
(
$company_id
,
$broker_id
,
$cond
,
''
,
1
);
$template
[
'broker_id'
]
=
$broker_id
;
$template
[
'broker_id'
]
=
$broker_id
;
$template
[
'company_id'
]
=
$company_id
;
$template
[
'company_id'
]
=
$company_id
;
$template
[
'company_data'
]
=
$company_data
;
$template
[
'company_data'
]
=
$company_data
;
$template
[
'broker_data'
]
=
(
!
empty
(
$company_id
))
?
$template
[
'broker_data'
]
=
(
!
empty
(
$company_id
))
?
$this
->
Broker_model
->
getBroker
(
''
,
''
,
$company_id
)
:
''
;
$this
->
Broker_model
->
getBroker
(
''
,
''
,
$company_id
)
:
''
;
$template
[
'drivers_data'
]
=
$this
->
Driver_model
->
getDriver
(
''
,
'1'
,
$company_id
);
$template
[
'drivers_data'
]
=
$this
->
Driver_model
->
getDriver
(
''
,
'1'
,
$company_id
);
// $template['ride_data'] = $this->Ride_model->getRideData('',$company_id,$broker_id,'',$cond);
$this
->
load
->
view
(
'template'
,
$template
);
$this
->
load
->
view
(
'template'
,
$template
);
}
}
...
...
application/models/Ride_model.php
View file @
9799a161
...
@@ -106,15 +106,33 @@ class Ride_model extends CI_Model {
...
@@ -106,15 +106,33 @@ class Ride_model extends CI_Model {
}
}
return
$ride_data
;
return
$ride_data
;
}
}
function
getTotalCount
(
$company_id
=
''
,
$broker_id
=
''
,
$condArr
=
array
(),
$fltr
=
array
()){
function
getTotalCount
(
$company_id
=
''
,
$broker_id
=
''
,
$condArr
=
array
(),
$fltr
=
array
()
,
$scheduleCnt
=
0
){
$cond
=
(
!
empty
(
$condArr
))
?
implode
(
' '
,
$condArr
)
:
''
;
$cond
=
(
!
empty
(
$condArr
))
?
implode
(
' '
,
$condArr
)
:
''
;
$cond
.=
(
$broker_id
!=
''
)
?
" AND TD.broker_id = '
$broker_id
'"
:
""
;
$cond
.=
(
$broker_id
!=
''
)
?
" AND TD.broker_id = '
$broker_id
'"
:
""
;
$cond
.=
(
!
empty
(
$company_id
))
?
" AND TD.company_id = '
$company_id
'"
:
""
;
$cond
.=
(
!
empty
(
$company_id
))
?
" AND TD.company_id = '
$company_id
'"
:
""
;
$cond
.=
(
!
empty
(
$fltr
)
&&
!
empty
(
$fltr
[
'where'
]))
?
' AND ('
.
$fltr
[
'where'
]
.
') '
:
''
;
$cond
.=
(
!
empty
(
$fltr
)
&&
!
empty
(
$fltr
[
'where'
]))
?
' AND ('
.
$fltr
[
'where'
]
.
') '
:
''
;
$sql
=
"SELECT count(TD.transport_id) AS count FROM transport_details TD WHERE TD.status!='2' "
.
$cond
;
$field
=
'count(TD.transport_id) AS count'
;
$count
=
$this
->
db
->
query
(
$sql
)
->
row_array
();
if
(
$scheduleCnt
==
1
){
return
(
!
empty
(
$count
)
&&
isset
(
$count
[
'count'
])
&&
!
empty
(
$count
[
'count'
]))
?
$count
[
'count'
]
:
0
;
$field
=
" TD.transport_id "
;
$cond
.=
" AND TD.is_scheduled='0' "
;
}
$sql
=
"SELECT
$field
FROM transport_details TD WHERE TD.status!='2' "
.
$cond
;
if
(
$scheduleCnt
==
1
){
$rideIds
=
array
();
$scheduleIds
=
$this
->
db
->
query
(
$sql
)
->
result_array
();
if
(
!
empty
(
$scheduleIds
)){
foreach
(
$scheduleIds
AS
$id
)
{
$rideIds
[]
=
$id
[
'transport_id'
];
}
}
return
$rideIds
;
}
else
{
$count
=
$this
->
db
->
query
(
$sql
)
->
row_array
();
return
(
!
empty
(
$count
)
&&
isset
(
$count
[
'count'
])
&&
!
empty
(
$count
[
'count'
]))
?
$count
[
'count'
]
:
0
;
}
}
}
function
changeStatus
(
$ride_id
=
''
,
$status
=
'0'
){
function
changeStatus
(
$ride_id
=
''
,
$status
=
'0'
){
...
...
application/views/Ride/view_rides.php
View file @
9799a161
...
@@ -182,3 +182,6 @@
...
@@ -182,3 +182,6 @@
</div>
</div>
</section>
</section>
</div>
</div>
<script
type=
"text/javascript"
>
ride_ids
=
<?=
!
empty
(
$ride_ids
)
?
json_encode
(
$ride_ids
)
:
json_encode
(
array
())
?>
</script>
assets/js/nemt_custom.js
View file @
9799a161
...
@@ -322,15 +322,6 @@ function markAsScheduled(transport_id,is_scheduled,thisObj){
...
@@ -322,15 +322,6 @@ function markAsScheduled(transport_id,is_scheduled,thisObj){
transport_id
==
undefined
||
transport_id
==
'undefined'
||
transport_id
==
null
||
transport_id
==
'null'
||
transport_id
==
''
){
transport_id
==
undefined
||
transport_id
==
'undefined'
||
transport_id
==
null
||
transport_id
==
'null'
||
transport_id
==
''
){
return
false
;
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
();
showFullScreenLoader
();
jQuery
.
ajax
({
jQuery
.
ajax
({
...
@@ -353,6 +344,13 @@ function markAsScheduled(transport_id,is_scheduled,thisObj){
...
@@ -353,6 +344,13 @@ function markAsScheduled(transport_id,is_scheduled,thisObj){
is_scheduled
=
1
;
is_scheduled
=
1
;
}
}
jQuery
.
each
(
resp
[
'succArr'
],
function
(
index
,
value
)
{
jQuery
.
each
(
resp
[
'succArr'
],
function
(
index
,
value
)
{
if
(
ride_ids
!=
undefined
&&
ride_ids
!=
'undefined'
&&
ride_ids
!=
null
&&
ride_ids
!=
'null'
&&
ride_ids
!=
''
){
if
(
is_scheduled
==
'1'
){
if
(
ride_ids
.
includes
(
value
))
ride_ids
.
splice
(
ride_ids
.
indexOf
(
value
),
1
);
}
else
{
if
(
!
ride_ids
.
includes
(
value
))
ride_ids
.
push
(
value
);
}
}
if
(
thisObj
!=
''
){
if
(
thisObj
!=
''
){
thisObj
.
attr
(
'is_scheduled'
,
is_scheduled
);
thisObj
.
attr
(
'is_scheduled'
,
is_scheduled
);
thisObj
.
children
().
css
(
"color"
,
color
);
thisObj
.
children
().
css
(
"color"
,
color
);
...
@@ -572,4 +570,4 @@ jQuery('[id^="updateBrkPayDate_"]').on('click',function() {
...
@@ -572,4 +570,4 @@ jQuery('[id^="updateBrkPayDate_"]').on('click',function() {
return
false
;
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