BBnepal-Accounts/application/views/admin/routedata.php

153 lines
6.6 KiB
PHP
Raw Normal View History

2024-07-10 12:43:19 +00:00
<style>
.tooltip {
z-index: 1151 !important;
}
</style>
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel"> Route Details : [ Batch - <?= $batch_name; ?>]</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<?php // echo $route_course_fee_id;
?>
<table>
<tbody>
<tr>
<th style="font-weight:600;"> Student Name: &nbsp;</th>
<td>&nbsp; <?= $student_info['name']; ?></td>
</tr>
<tr>
<th style="font-weight:600;">Student ID: &nbsp;</th>
<td>&nbsp; <?= $student_info['studentId']; ?></td>
</tr>
</tbody>
</table>
<div class="row">
<div class="col-md-12">
<span class="text-danger" style="font-size:12px;" id="modalStudentPayment" data-payment-status='<?php echo ($payment_status) ? $payment_status : 0; ?>'>
<?php
echo $payment_status_msg = ($payment_status) ? "One or more payments are already done for the present selected route. SO, the route can not be updated now." : "";
?>
</span>
</div>
</div>
<hr>
<div class="row">
<div class="col-md-12">
<table id="tbl1" cellspacing="0" width="100%">
<thead>
<tr>
<th width="5%">SNo</th>
<th width="10%">Select</th>
<th width="25%">Route Name</th>
<th width="25%">Stop Name</th>
<th width="15%">One Way</th>
<th width="25%">Fee</th>
<!-- <th>PickUp</th>
<th>Drop</th> -->
</tr>
</thead>
<tbody id="routes_body">
<?php
$sno = 1;
if (isset($route_data) && !empty($route_data)) {
// default one way is no.
$oneWay = 'no';
if ($student_assigned_route != null) {
// echo '<pre>';
// var_dump($student_assigned_route);
// Check if the one way is checked.
$oneWay = $student_assigned_route['one_way'];
}
foreach ($route_data as $value) {
$BTSdb = $this->load->database('erisnClassroom_bts', TRUE);
$pick_sele = $BTSdb->query('SELECT pick_up_id FROM bt_students_bus_route_details WHERE student_id=' . $student_info['id'] . ' and route_id=' . $value['route_id'] . ' order by id desc limit 1')->row_array();
$pick_sele = (isset($pick_sele['pick_up_id']) && !empty($pick_sele['pick_up_id'])) ? $pick_sele['pick_up_id'] : 0;
?>
<tr>
<td><?= $sno; ?></td>
<td>
<?php if ($value['route_fee'] != 0) {
$student_routeID = ($student_route_id > 0) ? $student_route_id : 0;
$student_route_checked = ($value['route_id'] == $student_routeID) ? "checked" : '';
$student_one_way_checked = ($oneWay == 'yes') ? "checked" : '';
$payment_status_disabled = ($payment_status) ? "data-toggle='tooltip' title='Payment partial or full installment paid'" : '';
// $payment_status_disabled = ($payment_status) ? "data-toggle='tooltip' title='Payment partial or full installment paid'" : '';
?>
<input type="radio" name="route_id" value="<?php echo $value['route_id']; ?>" <?= $payment_status_disabled; ?> <?= $student_route_checked; ?>>
<?php } else {
echo "<h5> - </h5>";
} ?>
</td>
<td><?php echo $value['route_name']; ?></td>
<td>
<select id="stop_name_<?php echo $value['route_id'] ?>" class="form-control stop_list" data-route_id="<?php echo $value['route_id']; ?>" placeholder="Select Stop Name" name="filter-Stop">
<option value="0"> Select Stop Name</option>
<?php if (isset($stop_list) || !empty($stop_list)) {
foreach ($stop_list[$value['route_id']] as $row) { ?>
<option value="<?php echo $row['stops_id'] ?>" <?php echo ($pick_sele == $row['stops_id']) ? 'selected' : ''; ?>>
<?php echo $row['place_name']; ?></option>
<?php }
} ?>
</select>
</td>
<td>
<!-- <?= $value['route_id'] ?>
<?= $student_route_id ?> -->
<input type="checkbox" name="isOneWay" value="<?php echo $value['route_id']; ?>" <?= $value['route_id'] == $student_route_id ? $student_one_way_checked : ''; ?>>
</td>
<td><?php if ($value['route_fee'] != 0)
echo $value['route_fee'];
else
echo "<p class='text-danger'>The fees is not yet created for this route.</p>";
?></td>
</tr>
<?php $sno++;
}
} ?>
</tbody>
</table>
<input type="hidden" id="s_course" name="s_course" class="form-control" value="<?= $student_info['course'] ?>" />
</div>
</div>
</div>
<script>
$(document).ready(function() {
$('#tbl1').DataTable({
"autoWidth": false,
"lengthMenu": [
[25, 50, 100, 150, -1],
[25, 50, 100, 150, "All"]
]
});
});
</script>