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
3f6bb88b
Commit
3f6bb88b
authored
Aug 30, 2019
by
Tobin
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into 'production'
dc See merge request
!33
parents
f4bde183
9799a161
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
38 additions
and
21 deletions
+38
-21
Ride.php
application/controllers/Ride.php
+8
-10
Ride_model.php
application/models/Ride_model.php
+20
-2
view_rides.php
application/views/Ride/view_rides.php
+3
-0
nemt_custom.js
assets/js/nemt_custom.js
+7
-9
No files found.
application/controllers/Ride.php
View file @
3f6bb88b
...
@@ -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 @
3f6bb88b
...
@@ -106,17 +106,35 @@ class Ride_model extends CI_Model {
...
@@ -106,17 +106,35 @@ 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'
;
if
(
$scheduleCnt
==
1
){
$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
();
$count
=
$this
->
db
->
query
(
$sql
)
->
row_array
();
return
(
!
empty
(
$count
)
&&
isset
(
$count
[
'count'
])
&&
!
empty
(
$count
[
'count'
]))
?
$count
[
'count'
]
:
0
;
return
(
!
empty
(
$count
)
&&
isset
(
$count
[
'count'
])
&&
!
empty
(
$count
[
'count'
]))
?
$count
[
'count'
]
:
0
;
}
}
}
function
changeStatus
(
$ride_id
=
''
,
$status
=
'0'
){
function
changeStatus
(
$ride_id
=
''
,
$status
=
'0'
){
if
(
empty
(
$ride_id
)){
if
(
empty
(
$ride_id
)){
return
0
;
return
0
;
...
...
application/views/Ride/view_rides.php
View file @
3f6bb88b
...
@@ -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 @
3f6bb88b
...
@@ -323,15 +323,6 @@ function markAsScheduled(transport_id,is_scheduled,thisObj){
...
@@ -323,15 +323,6 @@ function markAsScheduled(transport_id,is_scheduled,thisObj){
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
({
url
:
base_url
+
"Ride/changeSchuduleStatus"
,
url
:
base_url
+
"Ride/changeSchuduleStatus"
,
...
@@ -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
);
...
...
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