Commit 84b636f9 by Tobin

daily

parent c517c215
......@@ -17,6 +17,7 @@ class Ride extends CI_Controller {
$this->load->model('Broker_model');
$this->load->model('Driver_model');
$this->load->model('Vehicle_model');
$this->load->model('Company_model');
$template['page'] = 'Ride/add_transport';
......@@ -29,6 +30,7 @@ class Ride extends CI_Controller {
$template['trip_type'] = $this->Ride_model->getTripType();
$template['driver_data'] = $this->Driver_model->getDriver();
$template['broker_data'] = $this->Broker_model->getBroker();
$template['company_data'] = $this->Company_model->getCompany();
$template['vehicle_data'] = $this->Vehicle_model->getVehicle();
$template['appointment_reason'] = $this->Ride_model->getAppReason();
......@@ -54,7 +56,7 @@ class Ride extends CI_Controller {
if($header == 0){
$headerArr[] = $col;
}else{
$rowArr[][$headerArr[$colCnt]] = $col;
$rowArr[$headerArr[$colCnt]] = $col;
$colCnt++;
}
}
......@@ -136,7 +138,7 @@ class Ride extends CI_Controller {
$this->session->set_flashdata('message',$flashMsg);
redirect(base_url('Ride/import_ride'));
}
$data = array("Appointment Date"=>$_POST['appointment_date'],"Appointment Time"=>$_POST['appointment_time'],"Member's First Name"=>$_POST['first_name'],"Member's Last Name"=>$_POST['last_name']);
$data = array("Member's First Name"=>$_POST['first_name'],"Member's Last Name"=>$_POST['last_name'],"Appointment Date"=>$_POST['appointment_date'],"Appointment Time"=>$_POST['appointment_time']);
$_POST['patient_name'] = $_POST['first_name'].' '.$_POST['last_name'];
$_POST['appointment_time'] = $_POST['appointment_date'].' '.$_POST['appointment_time'];
......@@ -211,6 +213,7 @@ class Ride extends CI_Controller {
$this->session->set_flashdata('message',$flashMsg);
redirect(base_url('Ride/view_rides'));
}
$template['data'] = $ride_data;
$template['ride_data'] = json_decode($ride_data->data,true);
$this->load->view('template',$template);
}
......
......@@ -34,6 +34,7 @@ class Ride_model extends CI_Model {
return 0;
}
$status = $this->db->insert('transport_details',$data);
pr($this->db->last_query());
return ($status)?1:0;
}
......
......@@ -165,6 +165,20 @@
?>
</select>
</div>
<!-- 3 - 5 -->
<div class="form-group has-feedback">
<label>Select NEMT 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>
</div>
<div class="col-md-12">
......
......@@ -26,33 +26,36 @@
<div class="box-header with-border">
<div class="col-md-6"><h3 class="box-title">Driver Details</h3></div>
<div class="col-md-6" align="right">
<a class="btn btn-sm btn-primary" href="<?= base_url('Driver/edit/'.encode_param($driver_id)) ?>">Edit</a>
<a class="btn btn-sm btn-primary" href="<?= base_url('Driver/driver_list') ?>">Back</a>
<a class="btn btn-sm btn-primary" href="<?= base_url('Ride/view_rides') ?>">Back</a>
</div>
</div>
<div class="box-body">
<div>
<div class="col-md-12">
<div class="col-md-6">
<div class="col-md-2"> Name </div>
<div class="col-md-6"> Booking Type </div>
<div class="col-md-1"> : </div>
<div class="col-md-3"> Name </div>
</div>
</div>
<div class="col-md-5"> <?= (empty($data->broker_name))?'Phone Booking':$data->broker_name ?> </div>
<?php
$row = 0;
$row_html = '<div class="col-md-2"> {:label} </div>
$col = 0;
$row_html = '<div class="col-md-6"> {:label} </div>
<div class="col-md-1"> : </div>
<div class="col-md-3"> {:value} </div>'
<div class="col-md-5"> {:value} </div>';
if(empty($data->broker_id)){
echo str_replace(array('{:label}','{:value}'), array('Medicaid Number',$data->medical_no), $row_html);
echo str_replace(array('{:label}','{:value}'), array('Member Name',$data->patient_name), $row_html);
echo str_replace(array('{:label}','{:value}'), array('Member\'s Age',$data->age), $row_html);
echo str_replace(array('{:label}','{:value}'), array('Member\'s Phone Number',$data->phone), $row_html);
echo str_replace(array('{:label}','{:value}'), array('Appointment Date & Time',$data->appointment_time), $row_html);
echo str_replace(array('{:label}','{:value}'), array('Pickup Address',$data->pickup_location), $row_html);
echo str_replace(array('{:label}','{:value}'), array('Delivery Address',$data->drop_location), $row_html);
echo str_replace(array('{:label}','{:value}'), array('Trip Reason Code',$data->reason_code), $row_html);
echo str_replace(array('{:label}','{:value}'), array('Vehicle Type',$data->vehicle_type), $row_html);
echo str_replace(array('{:label}','{:value}'), array('Trip Type',$data->trip_type), $row_html);
echo str_replace(array('{:label}','{:value}'), array('Trip Cost',$data->trip_cost), $row_html);
}
foreach($ride_data AS $key => $ride){
echo ($row == 0)?'<div class="col-md-12">':'';
echo ($row == 0)?'<div class="col-md-6">':'';
echo str_replace(array('{:label}','{:value}'), array($key,$ride), $row_html);
echo ($col == 2)?'</div>':'';
echo ($col == 1)?'</div>':'';
}
?>
</div>
</div>
</section>
</div>
......@@ -36,10 +36,10 @@
<th width="150px;">Patient Name</th>
<th width="50px;">Age</th>
<th width="100px;">Phone</th>
<th width="150px;">Appintment Date</th>
<th width="150px;">Appointment Date</th>
<th width="150px;">Status</th>
<th width="150px;">Data Source</th>
<th width="300px;">Action</th>
<th width="320px;">Action</th>
</tr>
</thead>
<tbody>
......@@ -55,6 +55,9 @@
<td class="center"><?= date('d-M-Y G:i',strtotime($ride->appointment_time)) ?></th>
<td class="center">
<?php
if(date('Ymd Gi') > strtotime($ride->appointment_time) && ($ride->status == 1 || $ride->status == 0)){
echo 'Ride Expired';
}else{
switch ($ride->status){
case 0: echo 'Inactive';break;
case 1: echo 'Waiting For Drivers';break;
......@@ -62,6 +65,7 @@
case 4: echo 'Ride Completed';break;
case 4: echo 'Ride Cancelled';break;
}
}
?>
</td>
<td class="center"><?= (!empty($ride->broker_name)?$ride->broker_name:'Phone Booking') ?></th>
......@@ -75,7 +79,7 @@
onClick="return doconfirm()">
<i class="fa fa-fw fa-trash"></i>Delete
</a>
<?php if($ride->status == 1 && date('Ymd Gi') < $ride->appointment_time){?>
<?php if($ride->status == 1 && date('Ymd Gi') < strtotime($ride->appointment_time)){?>
<a class="btn btn-sm btn-primary"
href="<?= base_url('Ride/view/'.encode_param($ride->transport_id)) ?>">
<i class="fa fa-fw fa-edit"></i>Assign Driver
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment