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
7b547f56
Commit
7b547f56
authored
Oct 10, 2018
by
Tobin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
daily commit
parent
c17c1b19
Show whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
453 additions
and
33 deletions
+453
-33
Broker.php
application/controllers/Broker.php
+2
-0
Driver.php
application/controllers/Driver.php
+2
-0
Report.php
application/controllers/Report.php
+52
-0
Ride.php
application/controllers/Ride.php
+25
-5
Vehicle.php
application/controllers/Vehicle.php
+2
-0
company.php
application/controllers/company.php
+2
-0
generals_helper.php
application/helpers/generals_helper.php
+1
-0
Company_model.php
application/models/Company_model.php
+28
-9
Report_model.php
application/models/Report_model.php
+36
-0
create_offer.php
application/views/Company/create_offer.php
+2
-2
offer_list_page.php
application/views/Company/offer_list_page.php
+3
-3
generate.php
application/views/Report/generate.php
+242
-0
add_transport.php
application/views/Ride/add_transport.php
+2
-2
view.php
application/views/Ride/view.php
+0
-0
view_rides.php
application/views/Ride/view_rides.php
+3
-3
footer-script.php
application/views/Templates/footer-script.php
+3
-8
left-menu.php
application/views/Templates/left-menu.php
+4
-1
nemt_custom.js
assets/js/nemt_custom.js
+44
-0
No files found.
application/controllers/Broker.php
View file @
7b547f56
...
...
@@ -157,3 +157,4 @@ class Broker extends CI_Controller {
}
}
?>
\ No newline at end of file
application/controllers/Driver.php
View file @
7b547f56
...
...
@@ -255,3 +255,4 @@ class Driver extends CI_Controller {
}
}
?>
\ No newline at end of file
application/controllers/Report.php
0 → 100644
View file @
7b547f56
<?php
defined
(
'BASEPATH'
)
OR
exit
(
'No direct script access allowed'
);
class
Report
extends
CI_Controller
{
public
function
__construct
()
{
parent
::
__construct
();
date_default_timezone_set
(
"Asia/Kolkata"
);
$this
->
load
->
model
(
'Report_model'
);
$this
->
load
->
model
(
'Company_model'
);
if
(
!
$this
->
session
->
userdata
(
'logged_in'
))
{
redirect
(
base_url
(
'Login'
));
}
}
public
function
generate
()
{
$template
[
'page'
]
=
'Report/generate'
;
$template
[
'menu'
]
=
"Report Management"
;
$template
[
'sub_menu'
]
=
"Report Generate"
;
$template
[
'page_desc'
]
=
"Report Generation Page"
;
$template
[
'page_title'
]
=
"Report Management"
;
$template
[
'company_data'
]
=
$this
->
Company_model
->
getCompany
();
$this
->
load
->
view
(
'template'
,
$template
);
}
public
function
rGenerate
(){
$return_arr
=
array
(
'status'
=>
'0'
,
'message'
=>
'error'
);
if
(
!
isset
(
$_POST
)
||
empty
(
$_POST
)
||
!
isset
(
$_POST
[
'fields'
])
||
empty
(
$_POST
[
'fields'
])
||
!
isset
(
$_POST
[
'action'
])
||
empty
(
$_POST
[
'action'
])){
echo
json_encode
(
$return_arr
);
}
$action
=
$_POST
[
'action'
];
$fields
=
$_POST
[
'fields'
];
$where_cond
=
array
();
if
(
isset
(
$_POST
[
'where_cond'
])
&&
!
empty
(
$_POST
[
'where_cond'
])){
parse_str
(
$_POST
[
'where_cond'
],
$where_cond
);
}
// if($action == 'view'){
// $report_data = $this->Report_model->get_report($fields,$where_cond);
// }
}
}
?>
\ No newline at end of file
application/controllers/Ride.php
View file @
7b547f56
...
...
@@ -58,16 +58,32 @@ class Ride extends CI_Controller {
$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
(
$last2
,
":"
.
$last
,
$col
);
$col
=
(
!
empty
(
$col
))
?
date
(
'G:i'
,
strtotime
(
$col
))
:
''
;
}
$rowArr
[
$headerArr
[
$colCnt
]]
=
$col
;
$colCnt
++
;
}
}
if
(
$header
!=
0
){
$time
=
$row
[
10
];
if
(
!
empty
(
$time
)){
$last
=
substr
(
$time
,
-
2
);
$time
=
str_replace
(
$last2
,
":"
.
$last
,
$time
);
$time
=
(
!
empty
(
$time
))
?
date
(
'G:i'
,
strtotime
(
$time
))
:
''
;
}
$date
=
(
!
empty
(
$row
[
8
]))
?
date
(
'd-m-Y'
,
strtotime
(
$row
[
8
]))
:
''
;
$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
],
'appointment_time'
=>
$row
[
8
]
.
' '
.
$row
[
10
],
'reason_code'
=>
$row
[
11
],
'trip_cost'
=>
$row
[
22
],
'pickup_location'
=>
$row
[
23
],
'drop_location'
=>
$row
[
28
],
'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
;
}
$header
=
1
;
...
...
@@ -147,8 +163,8 @@ class Ride extends CI_Controller {
$data
[
'Members_Last_Name'
]
=
$_POST
[
'last_name'
];
$data
[
'Members_Age'
]
=
$_POST
[
'age'
];
$data
[
"Appointment_Date"
]
=
$_POST
[
'appointment_date'
]
;
$data
[
"Appointment_Time"
]
=
$_POST
[
'appointment_time'
]
;
$data
[
"Appointment_Date"
]
=
(
!
empty
(
$_POST
[
'appointment_date'
]))
?
date
(
'd-m-y'
,
strtotime
(
$_POST
[
'appointment_date'
]))
:
''
;
$data
[
"Appointment_Time"
]
=
(
!
empty
(
$_POST
[
'appointment_time'
]))
?
date
(
'G:i'
,
strtotime
(
$_POST
[
'appointment_time'
]))
:
''
;
$data
[
'Vehicle_Type'
]
=
$_POST
[
'vehicle_type'
];
$data
[
'Trip_Type'
]
=
$_POST
[
'trip_type'
];
...
...
@@ -161,7 +177,9 @@ class Ride extends CI_Controller {
$data
[
'Crutches_/_Walker_/_Cane_Flag'
]
=
(
isset
(
$_POST
[
'c_w_c_flag'
]))
?
1
:
0
;
$_POST
[
'patient_name'
]
=
$_POST
[
'first_name'
]
.
' '
.
$_POST
[
'last_name'
];
$_POST
[
'appointment_time'
]
=
$_POST
[
'appointment_date'
]
.
' '
.
$_POST
[
'appointment_time'
];
$date_time
=
(
!
empty
(
$_POST
[
'appointment_date'
]))
?
$_POST
[
'appointment_date'
]
:
''
;
$date_time
.=
(
!
empty
(
$_POST
[
'appointment_time'
]))
?
' '
.
$_POST
[
'appointment_time'
]
:
''
;
$_POST
[
'appointment_time'
]
=
strtotime
(
$date_time
);
unset
(
$_POST
[
'first_name'
]);
unset
(
$_POST
[
'last_name'
]);
...
...
@@ -315,3 +333,4 @@ class Ride extends CI_Controller {
redirect
(
base_url
(
'Ride/assign_driver/'
.
encode_param
(
$ride_id
)));
}
}
?>
\ No newline at end of file
application/controllers/Vehicle.php
View file @
7b547f56
...
...
@@ -172,3 +172,4 @@ class Vehicle extends CI_Controller {
}
}
?>
\ No newline at end of file
application/controllers/company.php
View file @
7b547f56
...
...
@@ -346,6 +346,8 @@ class Company extends CI_Controller {
$flashMsg
[
'message'
]
=
'Offer Created'
;
$this
->
session
->
set_flashdata
(
'message'
,
$flashMsg
);
redirect
(
base_url
(
'Company/manager_offers'
));
}
else
if
(
$status
==
2
){
$flashMsg
[
'message'
]
=
'There is an existing offer in this period, try another date..! '
;
}
$this
->
session
->
set_flashdata
(
'message'
,
$flashMsg
);
redirect
(
base_url
(
'Company/create_offer'
));
...
...
application/helpers/generals_helper.php
View file @
7b547f56
...
...
@@ -76,6 +76,7 @@ function pre($val){
echo
(
is_array
(
$val
))
?
'<pre>'
:
''
;
print_r
(
$val
);
echo
(
is_array
(
$val
))
?
'</pre>'
:
''
;
echo
'<br>'
;
}
function
encode_param
(
$param
=
''
){
...
...
application/models/Company_model.php
View file @
7b547f56
...
...
@@ -16,22 +16,24 @@ class Company_model extends CI_Model {
}
$status
=
$this
->
db
->
insert
(
'admin_users'
,
array
(
'username'
=>
$company_data
[
'email_id'
],
'password'
=>
md5
(
$company_data
[
'password'
]),
'user_type'
=>
'2'
,
'display_name'
=>
$company_data
[
'company_name'
],
'profile_image'
=>
$company_data
[
'profile_image'
]));
if
(
$status
){
unset
(
$company_data
[
'password'
]);
unset
(
$company_data
[
'profile_image'
]);
unset
(
$company_data
[
'display_name'
]);
$company_data
[
'company_id'
]
=
$this
->
db
->
insert_id
();
$status
=
$this
->
db
->
insert
(
'company'
,
$company_data
);
$company_id
=
$this
->
db
->
insert_id
();
$status
=
$this
->
db
->
insert
(
'company'
,
array
(
'company_id'
=>
$company_id
,
'company_name'
=>
$company_data
[
'company_name'
],
'address'
=>
$company_data
[
'address'
],
'phone'
=>
$company_data
[
'phone'
],
'fax'
=>
$company_data
[
'fax'
],
'email_id'
=>
$company_data
[
'email_id'
],
'company_contact'
=>
$company_data
[
'company_contact'
],
'company_info'
=>
$company_data
[
'company_info'
],
'company_federal_id'
=>
$company_data
[
'company_federal_id'
]));
$this
->
db
->
insert
(
'company_payment_details'
,
array
(
'company_id'
=>
$company_id
,
'booking_charge'
=>
$company_data
[
'booking_charge'
],
'sms_charge'
=>
$company_data
[
'sms_charge'
],
'push_charge'
=>
$company_data
[
'push_charge'
],
'report_charge'
=>
$company_data
[
'report_charge'
]));
return
(
$status
)
?
1
:
0
;
}
return
0
;
}
function
getCompany
(
$company_id
=
''
){
$cond
=
(
!
empty
(
$company_id
))
?
" AND company_id = '
$company_id
'"
:
""
;
$cond
=
(
!
empty
(
$company_id
))
?
" AND
CMP.
company_id = '
$company_id
'"
:
""
;
$sql
=
"SELECT CMP.*,AU.*
$sql
=
"SELECT CMP.*,AU.*
,CPAY.*
FROM company AS CMP
INNER JOIN admin_users AS AU ON (AU.id = CMP.company_id)
INNER JOIN company_payment_details AS CPAY ON (CPAY.company_id = CMP.company_id)
WHERE AU.status IN (0,1)
$cond
"
;
$result
=
$this
->
db
->
query
(
$sql
);
if
(
empty
(
$result
)){
...
...
@@ -44,7 +46,7 @@ class Company_model extends CI_Model {
if
(
empty
(
$company_id
)){
return
0
;
}
$status
=
$this
->
db
->
update
(
'admin_users'
,
array
(
'status'
=>
$status
),
array
(
'id'
=>
$company_id
));
$status
=
$this
->
db
->
update
(
'admin_users'
,
array
(
'status'
=>
$status
),
array
(
'id'
=>
$company_id
));
return
$status
;
}
...
...
@@ -62,7 +64,8 @@ class Company_model extends CI_Model {
}
$status
=
$this
->
db
->
update
(
'admin_users'
,
$upArr
,
array
(
'id'
=>
$company_id
));
if
(
$status
){
$status
=
$this
->
db
->
update
(
'company'
,
array
(
'company_name'
=>
$company_data
[
'company_name'
],
'address'
=>
$company_data
[
'address'
],
'phone'
=>
$company_data
[
'phone'
],
'fax'
=>
$company_data
[
'fax'
],
'email_id'
=>
$company_data
[
'email_id'
],
'company_contact'
=>
$company_data
[
'company_contact'
],
'company_info'
=>
$company_data
[
'company_info'
],
'company_federal_id'
=>
$company_data
[
'company_federal_id'
],
'report_charge'
=>
$company_data
[
'report_charge'
],
'push_charge'
=>
$company_data
[
'push_charge'
],
'sms_charge'
=>
$company_data
[
'sms_charge'
],
'booking_charge'
=>
$company_data
[
'booking_charge'
]),
array
(
'company_id'
=>
$company_id
));
$status
=
$this
->
db
->
update
(
'company'
,
array
(
'company_name'
=>
$company_data
[
'company_name'
],
'address'
=>
$company_data
[
'address'
],
'phone'
=>
$company_data
[
'phone'
],
'fax'
=>
$company_data
[
'fax'
],
'email_id'
=>
$company_data
[
'email_id'
],
'company_contact'
=>
$company_data
[
'company_contact'
],
'company_info'
=>
$company_data
[
'company_info'
],
'company_federal_id'
=>
$company_data
[
'company_federal_id'
]),
array
(
'company_id'
=>
$company_id
));
$this
->
db
->
update
(
'company_payment_details'
,
array
(
'booking_charge'
=>
$company_data
[
'booking_charge'
],
'sms_charge'
=>
$company_data
[
'sms_charge'
],
'push_charge'
=>
$company_data
[
'push_charge'
],
'report_charge'
=>
$company_data
[
'report_charge'
]),
array
(
'company_id'
=>
$company_id
));
return
(
$status
)
?
1
:
0
;
}
return
0
;
...
...
@@ -95,6 +98,22 @@ class Company_model extends CI_Model {
if
(
empty
(
$offer_data
)){
return
0
;
}
$offer_data
[
'expiry_date'
]
=
strtotime
(
$offer_data
[
'expiry_date'
]);
$offer_data
[
'activation_date'
]
=
strtotime
(
$offer_data
[
'activation_date'
]);
$sql
=
"SELECT * FROM company_offers
WHERE company_id = '"
.
$offer_data
[
'company_id'
]
.
"' AND
(((activation_date <= '"
.
$offer_data
[
'activation_date'
]
.
"' AND
expiry_date >= '"
.
$offer_data
[
'activation_date'
]
.
"') OR
(activation_date <= '"
.
$offer_data
[
'expiry_date'
]
.
"' AND
expiry_date >= '"
.
$offer_data
[
'expiry_date'
]
.
"')
) OR
(activation_date >= '"
.
$offer_data
[
'activation_date'
]
.
"' AND
expiry_date <= '"
.
$offer_data
[
'expiry_date'
]
.
"')
) AND status != '2'"
;
$result
=
$this
->
db
->
query
(
$sql
);
if
(
!
empty
(
$result
)
&&
$result
->
num_rows
()
>=
1
){
return
2
;
}
$offer_data
[
'status'
]
=
1
;
$status
=
$this
->
db
->
insert
(
'company_offers'
,
$offer_data
);
return
(
$status
)
?
1
:
0
;
...
...
application/models/Report_model.php
0 → 100644
View file @
7b547f56
<?php
class
Report_model
extends
CI_Model
{
public
function
_consruct
(){
parent
::
_construct
();
}
public
function
get_report
(
$fields
=
array
(),
$where_cond
=
array
()){
if
(
empty
(
$fields
)){
return
0
;
}
$where_clause
=
''
;
if
(
!
empty
(
$where_cond
)){
if
(
!
empty
(
$where_cond
[
'company_id'
])){
$where_clause
=
" WHERE TDLS.company_id = '"
.
$where_cond
[
'company_id'
]
.
"' "
;
}
if
(
!
empty
(
$where_cond
[
'start_date'
])
&&
!
empty
(
$where_cond
[
'end_date'
])){
$where_clause
.=
(
empty
(
$where_clause
))
?
' WHERE '
:
' AND '
;
$where_clause
.=
""
;
}
}
// $sql = "SELECT ".$fields."
// FROM transport_details AS TDLS
// INNER JOIN drivers AS DRV ON (DRV.driver_id = TDLS.assigned_driver)
// INNER JOIN vehicles AS VEH ON (VEH.vehicle_id = DRV.vehicle_id)
// INNER JOIN company AS CMP ON (CMP.company_id = TDLS.company_id)
// INNER JOIN company_payment_details AS CPAY ON (CPAY.company_id = TDLS.company_id)
// LEFT JOIN brokers AS BRKR ON (BRKR.broker_id = TDLS.broker_id)
// LEFT JOIN appointment_reason AS APRES ON (APRES.reason_id = TDLS.reason_code)
// LEFT JOIN trip_status AS TSTATUS ON (TSTATUS.trip_status_id = TDLS.trip_status)
// LEFT JOIN trip_type AS TTYPE ON (TTYPE.trip_id = TDLS.trip_type)
// WHERE
// ";
}
}
\ No newline at end of file
application/views/Company/create_offer.php
View file @
7b547f56
...
...
@@ -48,7 +48,7 @@
<div
class=
"form-group has-feedback"
>
<label>
Offer Activation 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=
"activation_date"
placeholder=
"Pick Appointment Date"
>
<input
id=
"datepicker"
type=
"text"
class=
"form-control required"
data-parsley-trigger=
"change"
data-parsley-minlength=
"2"
required=
""
name=
"activation_date"
placeholder=
"Pick Appointment Date"
autocomplete=
"off"
>
<div
class=
"input-group-addon"
>
<i
class=
"fa fa-calendar"
></i>
</div>
...
...
@@ -59,7 +59,7 @@
<div
class=
"form-group has-feedback"
>
<label>
Offer Expiry 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=
"expiry_date"
placeholder=
"Pick Appointment Date"
>
<input
id=
"datepicker"
type=
"text"
class=
"form-control required"
data-parsley-trigger=
"change"
data-parsley-minlength=
"2"
required=
""
name=
"expiry_date"
placeholder=
"Pick Appointment Date"
autocomplete=
"off"
>
<div
class=
"input-group-addon"
>
<i
class=
"fa fa-calendar"
></i>
</div>
...
...
application/views/Company/offer_list_page.php
View file @
7b547f56
...
...
@@ -51,15 +51,15 @@
(
$offer
->
offer_type
==
1
)
?
'Free Trail'
:
$offer
->
discount
.
'% Discount Per Booking'
?>
</th>
<td
class=
"center"
><b>
<?=
date
(
"d-M-y"
,
strtotime
(
$offer
->
activation_date
))
.
' - '
.
date
(
"d-M-y"
,
strtotime
(
$offer
->
expiry_date
)
)
?>
</b></th>
<td
class=
"center"
><b>
<?=
date
(
"d-M-y"
,
$offer
->
activation_date
)
.
' - '
.
date
(
"d-M-y"
,
$offer
->
expiry_date
)
?>
</b></th>
<td
class=
"center"
>
<strong>
<?php
if
(
$offer
->
status
==
0
){
echo
'Offer De-activated'
;
}
else
if
(
date
(
'd-M-y'
)
<
date
(
"d-M-y"
,
strtotime
(
$offer
->
activation_date
))
){
}
else
if
(
strtotime
(
date
(
'd-M-y'
))
<
$offer
->
activation_date
){
echo
'Not Yet Activated'
;
}
else
if
(
date
(
'd-M-y'
)
>
date
(
"d-M-y"
,
strtotime
(
$offer
->
expiry_date
))
){
}
else
if
(
strtotime
(
date
(
'd-M-y'
))
>
$offer
->
expiry_date
){
echo
'Offer Expired'
;
}
else
{
echo
'Currently Active'
;
...
...
application/views/Report/generate.php
0 → 100644
View file @
7b547f56
<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>
<div
class=
"box box-warning"
>
<div
class=
"box-header with-border"
>
<h3
class=
"box-title"
>
Search Conditions
</h3>
</div>
<div
class=
"box-body"
>
<form
id=
"where_cond"
>
<div
class=
"col-md-12"
>
<?php
if
(
$this
->
session
->
userdata
[
'user_type'
]
==
1
){
?>
<div
class=
"col-md-3"
>
<div
class=
"form-group has-feedback"
>
<label
for=
"exampleInputEmail1"
>
Select Company
</label>
<select
name=
"company_id"
class=
"form-control required"
data-parsley-trigger=
"change"
required
>
<option
selected
disabled
>
Select Company
</option>
<?php
if
(
!
empty
(
$company_data
)){
foreach
(
$company_data
as
$company
)
{
echo
'<option value="'
.
$company
->
company_id
.
'">'
.
$company
->
company_name
.
'</option>'
;
}
}
?>
</select>
</div>
</div>
<?php
}
else
{
?>
<input
type=
"hidden"
name=
"company_id"
value=
"
<?=
$this
->
session
->
userdata
[
'id'
]
?>
"
>
<?php
}
?>
<div
class=
"col-md-3"
>
<div
class=
"form-group has-feedback"
>
<label>
Start 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=
"start_date"
placeholder=
"Pick Appointment Date"
autocomplete=
"off"
>
<div
class=
"input-group-addon"
>
<i
class=
"fa fa-calendar"
></i>
</div>
</div>
</div>
</div>
<div
class=
"col-md-3"
>
<div
class=
"form-group has-feedback"
>
<label>
End 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=
"end_date"
placeholder=
"Pick Appointment Date"
autocomplete=
"off"
>
<div
class=
"input-group-addon"
>
<i
class=
"fa fa-calendar"
></i>
</div>
</div>
</div>
</div>
<div
class=
"col-md-3"
>
<div
class=
"form-group has-feedback"
>
<label>
Select Ride Status
</label>
<select
name=
"status"
class=
"form-control required"
data-parsley-trigger=
"change"
required
>
<option
selected
disabled
>
Select Ride Status
</option>
<?php
$status
=
array
(
'0'
=>
'Inactive'
,
'1'
=>
'Yet to assign Driver'
,
'2'
=>
'Deleted'
,
'3'
=>
'Waiting For Driver Approval'
,
'4'
=>
'Driver Accepted'
,
'5'
=>
'Processing'
,
'6'
=>
'Ride Completed'
,
'7'
=>
'Driver Canceled'
,
'8'
=>
'Driver Manually Assigned'
);
foreach
(
$status
as
$key
=>
$stat
)
{
echo
'<option value="'
.
$key
.
'">'
.
$stat
.
'</option>'
;
}
?>
</select>
</div>
</div>
</div>
</form>
</div>
<div
class=
"box-header with-border"
>
<h3
class=
"box-title"
>
Fields to View In Report
</h3>
</div>
<div
class=
"box-body"
>
<div
class=
"col-md-12"
>
<div
class=
"col-md-3"
>
<input
name=
"fieldType"
type=
"radio"
checked=
"checked"
style=
"padding-left: 10px;"
action=
"hide"
value=
"all"
>
<label
style=
"padding-left:15px;"
>
All Fields
</label>
</div>
<div
class=
"col-md-3"
>
<input
name=
"fieldType"
type=
"radio"
onclick=
"checkChild($(this));"
action=
"show"
value=
"custom"
>
<label
style=
"padding-left:15px;"
>
Custom Fields
</label>
</div>
</div>
<div
class=
"col-md-12"
>
<form
id=
"field_list"
>
<table
class=
"table table-striped hide"
id=
"customFields"
>
<tbody>
<?php
$html
=
''
;
$count
=
0
;
$rowFlg
=
0
;
$tables
=
array
(
'patient_details'
=>
array
(
'name'
=>
'Patient Details'
,
'fields'
=>
array
(
'TDLS.transport_id'
=>
'Order ID'
,
'TDLS.medical_no'
=>
'Medical Number'
,
'TDLS.patient_name'
=>
'Patient Name'
,
'TDLS.age'
=>
'Patient Age'
,
'TDLS.phone'
=>
'Patient Phone'
,
'APRES.reason'
=>
'Appointment Reason'
,
'TDLS.appointment_time'
=>
'Appointment Time'
)
),
'drivers'
=>
array
(
'name'
=>
'Driver Details'
,
'fields'
=>
array
(
'DRV.driver_id'
=>
'Driver ID'
,
'DRV.first_name'
=>
'Driver First Name'
,
'DRV.last_name'
=>
'Driver First Name'
,
'DRV.email_id'
=>
'Driver Email ID'
,
'VEH.vehicle_type'
=>
'Driver Vehicle'
)
),
'company'
=>
array
(
'name'
=>
'Company Details'
,
'fields'
=>
array
(
'CMP.company_id'
=>
'Company ID'
,
'CMP.company_name'
=>
'Company Name'
,
'CMP.address'
=>
'Company Address'
,
'CMP.phone'
=>
'Company Phone'
,
'CMP.fax'
=>
'Company Fax'
,
'CMP.email_id'
=>
'Company Email ID'
,
'CMP.company_contact'
=>
'Company Contact'
,
'CMP.company_info'
=>
'Company Contact Person'
,
'CMP.company_federal_id'
=>
'Company Federal ID'
,
'CMP.booking_charge'
=>
'Booking Charge'
,
'CMP.sms_charge'
=>
'SMS Charge'
,
'CMP.push_charge'
=>
'Notification Charge'
)
),
'brokers'
=>
array
(
'name'
=>
'Broker Details'
,
'fields'
=>
array
(
'CMP.broker_id'
=>
'Broker ID'
,
'CMP.broker_name'
=>
'Broker Name'
,
'CMP.broker_email'
=>
'Broker Email ID'
,
'CMP.broker_phone'
=>
'Broker Phone'
)
),
'company_payment_details'
=>
array
(
'name'
=>
'Payment Details'
,
'fields'
=>
array
(
'CPAY.booking_charge'
=>
'Charge for Booking'
,
'CPAY.sms_charge'
=>
'Amount Per SMS'
,
'CPAY.push_charge'
=>
'Amount Per Notification'
,
'CPAY.report_charge'
=>
'Amount Per Report'
,
'CPAY.booking_count'
=>
'Total No. of Booking'
,
'CPAY.sms_count'
=>
'Total No. of SMS Send'
,
'CPAY.push_count'
=>
'Push Notification Count'
,
'CPAY.report_count'
=>
'Report Generated Count'
,
'CPAY.paid_amount'
=>
'Total Amount Paid'
,
'CPAY.outstanding_amount'
=>
'Amount Outstanding'
,
'CPAY.total_earnings'
=>
'Total Earnings'
,
'CPAY.last_paid_date'
=>
'Last Payment Date'
)
)
);
$baseHtml
=
'<tr>{:baseHtml}</tr>'
;
$ottrHtml
=
'<td><div class="box-body" style="padding-left: 100px">
<label>
<input type="checkbox" id="table_{:table}" table="{:table}" onclick="checkChild($(this));" >
{:table_name}
</label>
{:innerHtml}
</div></td>'
;
$innerHtml
=
'<div class="form-group"><div class="col-sm-10"><div class="checkbox">
<label>
<input type="checkbox" name="{:field_alias}" id="table_{:table}_{:field_alias}" value="{:field_alias}">
{:field_name}
</label>
</div></div></div>'
;
$htmlArr
=
array
();
$allFields
=
array
();
foreach
(
$tables
AS
$table
=>
$tableDetails
){
$fieldsHtml
=
''
;
foreach
(
$tableDetails
[
'fields'
]
as
$alias
=>
$field
)
{
$allFields
[]
=
$alias
;
$fieldsHtml
.=
str_replace
(
array
(
'{:field_alias}'
,
'{:field_name}'
),
array
(
$alias
,
$field
),
$innerHtml
);
}
$fieldsHtml
=
str_replace
(
'{:table}'
,
$table
,
$fieldsHtml
);
$html
.=
str_replace
(
array
(
'{:table}'
,
'{:table_name}'
,
'{:innerHtml}'
),
array
(
$table
,
$tableDetails
[
'name'
],
$fieldsHtml
,),
$ottrHtml
);
if
(
$count
==
2
){
$rowFlg
=
1
;
$count
=
0
;
$htmlArr
[]
=
str_replace
(
'{:baseHtml}'
,
$html
,
$baseHtml
);
$html
=
''
;
}
else
{
$count
+=
1
;
}
}
if
(
$rowFlg
==
0
){
$html
=
str_replace
(
'{:baseHtml}'
,
$html
,
$baseHtml
);
}
else
{
$lstRw
=
str_replace
(
'{:baseHtml}'
,
$html
,
$baseHtml
);
$html
=
implode
(
''
,
$htmlArr
);
$html
.=
$lstRw
;
}
echo
$html
;
?>
</tbody>
</table>
</form>
</div>
<div
class=
"col-md-12"
style=
"padding-top:20px;"
>
<div
class=
"box-footer"
style=
"padding-left:40%;"
>
<input
type=
"hidden"
id=
"all_fields"
all_fields=
"
<?=
implode
(
','
,
$allFields
)
?>
"
>
<button
id=
"rGenerate"
type=
"submit"
action=
"view"
class=
"btn btn-primary"
>
View Report
</button>
<button
id=
"rGenerate"
type=
"submit"
action=
"export"
class=
"btn btn-info"
>
Export Report
</button>
</div>
</div>
</div>
</div>
</section>
</div>
\ No newline at end of file
application/views/Ride/add_transport.php
View file @
7b547f56
...
...
@@ -49,7 +49,7 @@
<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=
"appointment_date"
placeholder=
"Pick Appointment Date"
>
<input
id=
"datepicker"
type=
"text"
class=
"form-control required"
data-parsley-trigger=
"change"
data-parsley-minlength=
"2"
required=
""
name=
"appointment_date"
placeholder=
"Pick Appointment Date"
autocomplete=
"off"
>
<div
class=
"input-group-addon"
>
<i
class=
"fa fa-calendar"
></i>
</div>
...
...
@@ -88,7 +88,7 @@
<div
class=
"form-group has-feedback clockpicker"
data-placement=
"right"
data-align=
"top"
data-autoclose=
"true"
>
<label>
Appointment Time
</label>
<div
class=
"input-group date"
id=
'timepicker'
>
<input
type=
"text"
class=
"form-control required"
data-parsley-trigger=
"change"
data-parsley-minlength=
"2"
required=
""
name=
"appointment_time"
placeholder=
"Pick Appointment Time"
>
<input
type=
"text"
class=
"form-control required"
data-parsley-trigger=
"change"
data-parsley-minlength=
"2"
required=
""
name=
"appointment_time"
placeholder=
"Pick Appointment Time"
autocomplete=
"off"
>
<div
class=
"input-group-addon"
>
<i
class=
"fa fa-clock-o"
></i>
</div>
...
...
application/views/Ride/view.php
View file @
7b547f56
application/views/Ride/view_rides.php
View file @
7b547f56
...
...
@@ -52,10 +52,10 @@
<td
class=
"center"
>
<?=
$ride
->
patient_name
?>
</th>
<td
class=
"center"
>
<?=
$ride
->
age
?>
</th>
<td
class=
"center"
>
<?=
$ride
->
phone
?>
</th>
<td
class=
"center"
>
<?=
date
(
'd-M-Y G:i'
,
strtotime
(
$ride
->
appointment_time
)
)
?>
</th>
<td
class=
"center"
>
<?=
date
(
'd-M-Y G:i'
,
$ride
->
appointment_time
)
?>
</th>
<td
class=
"center"
>
<?php
if
(
date
(
'Ymd Gi'
)
>
strtotime
(
$ride
->
appointment_time
)
&&
(
$ride
->
status
==
1
||
$ride
->
status
==
0
)){
if
(
date
(
'Ymd Gi'
)
>
$ride
->
appointment_time
&&
(
$ride
->
status
==
1
||
$ride
->
status
==
0
)){
echo
'Ride Expired'
;
}
else
{
switch
(
$ride
->
status
){
...
...
@@ -82,7 +82,7 @@
onClick=
"return doconfirm()"
>
<i
class=
"fa fa-fw fa-trash"
></i>
Delete
</a>
<?php
if
(
$this
->
session
->
userdata
[
'user_type'
]
!=
1
&&
(
$ride
->
status
==
1
||
$ride
->
status
==
7
)
&&
date
(
'Ymd Gi'
)
<
strtotime
(
$ride
->
appointment_time
)
){
?>
<?php
if
(
$this
->
session
->
userdata
[
'user_type'
]
!=
1
&&
(
$ride
->
status
==
1
||
$ride
->
status
==
7
)
&&
date
(
'Ymd Gi'
)
<
$ride
->
appointment_time
){
?>
<a
class=
"btn btn-sm btn-primary"
href=
"
<?=
base_url
(
'Ride/assign_driver/'
.
encode_param
(
$ride
->
transport_id
))
?>
"
>
<i
class=
"fa fa-fw fa-edit"
></i>
Assign Driver
...
...
application/views/Templates/footer-script.php
View file @
7b547f56
...
...
@@ -12,9 +12,7 @@
<script
src=
"
<?php
echo
base_url
();
?>
assets/js/app.min.js"
></script>
<script
src=
"
<?php
echo
base_url
();
?>
assets/js/custom-script.js"
></script>
<script
src=
"
<?php
echo
base_url
();
?>
assets/js/parsley.min.js"
></script>
<script
src=
"
<?php
echo
base_url
();
?>
assets/js/nemt_custom.js"
></script>
<script
src=
"https://cdn.ckeditor.com/4.5.7/standard/ckeditor.js"
></script>
<script
src=
"
<?php
echo
base_url
();
?>
assets/js/bootstrap-datepicker.js"
></script>
<script
type=
"text/javascript"
src=
"
<?=
base_url
(
'assets/js/clockpicker.js'
)
?>
"
></script>
...
...
@@ -32,6 +30,8 @@
if
(
job
!=
true
)
return
false
;
}
jQuery
(
'.clockpicker'
).
clockpicker
();
</script>
<?php
...
...
@@ -46,9 +46,3 @@
break
;
}
?>
\ No newline at end of file
<script
type=
"text/javascript"
>
$
(
'.clockpicker'
).
clockpicker
();
</script>
application/views/Templates/left-menu.php
View file @
7b547f56
...
...
@@ -16,7 +16,7 @@
</div>
<ul
class=
"sidebar-menu"
>
<li><a
href=
"
http://localhost/nemt_backend/Dashboard
"
><i
class=
"fa fa-wrench"
aria-hidden=
"true"
>
<li><a
href=
"
<?=
base_url
(
'Dashboard'
)
?>
"
><i
class=
"fa fa-wrench"
aria-hidden=
"true"
>
</i><span>
Dashboard
</span></a>
</li>
<li
class=
"treeview"
>
...
...
@@ -138,6 +138,9 @@
</li>
</ul>
</li>
<li><a
href=
"
<?=
base_url
(
'Report/generate'
)
?>
"
><i
class=
"fa fa-wrench"
aria-hidden=
"true"
>
</i><span>
Report Generation
</span></a>
</li>
</ul>
</section>
<!-- /.sidebar -->
...
...
assets/js/nemt_custom.js
View file @
7b547f56
...
...
@@ -29,3 +29,46 @@ jQuery('[name="offer_type"]').click(function(){
jQuery
(
'[id="input_discount"]'
).
html
(
''
);
}
});
function
checkChild
(
thisObj
){
var
table
=
thisObj
.
attr
(
'table'
);
if
(
thisObj
.
prop
(
"checked"
)
==
true
){
jQuery
(
'[id^="table_'
+
table
+
'_"]'
).
prop
(
"checked"
,
true
);
}
else
{
jQuery
(
'[id^="table_'
+
table
+
'_"]'
).
prop
(
"checked"
,
false
);
}
}
jQuery
(
'[name="fieldType"]'
).
click
(
function
(){
var
action
=
jQuery
(
this
).
attr
(
'action'
);
if
(
action
==
'show'
){
jQuery
(
'[id="customFields"]'
).
removeClass
(
'hide'
);
}
else
{
jQuery
(
'[id="customFields"]'
).
addClass
(
'hide'
);
}
});
jQuery
(
'[id="rGenerate"]'
).
click
(
function
(){
event
.
preventDefault
();
var
fields
=
''
,
action
=
jQuery
(
this
).
attr
(
'action'
),
fieldType
=
jQuery
(
'input[name="fieldType"]:checked'
).
val
(),
where_cond
=
jQuery
(
'[id="where_cond"]'
).
serialize
();
if
(
fieldType
==
'custom'
){
jQuery
.
each
(
jQuery
(
'[id="field_list"]'
).
serialize
().
split
(
'&'
),
function
(
key
,
field
)
{
var
field_arr
=
field
.
split
(
'='
);
fields
+=
field_arr
[
1
]
+
','
;
});
}
else
{
fields
=
jQuery
(
'[id="all_fields"]'
).
attr
(
'all_fields'
);
}
jQuery
.
ajax
({
url
:
base_url
+
"Report/rGenerate"
,
type
:
'POST'
,
data
:
{
'action'
:
action
,
'fields'
:
fields
,
'where_cond'
:
where_cond
},
success
:
function
(
result
){
$
(
"#div1"
).
html
(
result
);
}
});
});
\ 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