BBnepal-Accounts/bustracking/application/views/bustracking-admin/student-info.php

249 lines
12 KiB
PHP
Raw Normal View History

2024-07-10 12:43:19 +00:00
<link rel="stylesheet" type="text/css" href="<?php echo base_url();?>assets-bustracking/css/style-drivers.css">
<main class="common_margin" id="main">
<div class="row dash-main-row">
<div class="col-md-12 col-lg-12 p-0">
<button type="button" class="btn btn-dark deleted-btn btn-sm" onclick="goBack()">Back</button>
<ul class="nav nav-pills mb-3 student-tabs row" id="pills-tab" role="tablist">
<li class="nav-item col-md-4 p-0">
<a class="nav-link student-head active" id="pills-student-tab" data-toggle="pill" href="#pills-student" role="tab" aria-controls="pills-student" aria-selected="true">Student Info</a>
</li>
<li class="nav-item col-md-4 p-0">
<a class="nav-link student-head" id="pills-fees-tab" data-toggle="pill" href="#pills-fees" role="tab" aria-controls="pills-fees" aria-selected="false">Bus Fee Details</a>
</li>
</ul>
</div>
</div>
<?php
$bus_no = $studentId = $student_name = $photo = $class = $email = $mobile = $dob = $gender = $addrress = $bus_fee = $payment_date = $place_name = $drop_point='';
if (isset($student_details) && !empty($student_details) && isset($route_data) && !empty($route_data))
{
$bus_no = $route_data['bus_no'];
$place_name = $route_data['route_name'];
$drop_point = $route_data['drop_point'];
$studentId = $student_details['studentId'];
$student_name = $student_details['student_name'];
$photo = $student_details['photo'];
$class = $student_details['classroom_name'];
$email = $student_details['email'];
$mobile = $student_details['mobile'];
$dob = $student_details['dob'];
$gender = $student_details['gender'];
$addrress = $student_details['address1'];
$bus_fee = $student_details['bus_fee_total'];
$payment_date = $student_details['payment_details'];
}
?>
<div class="tab-content" id="pills-tabContent">
<div class="tab-pane fade show active" id="pills-student" role="tabpanel" aria-labelledby="pills-student-tab">
<div class="row dash-main-row">
<div class="col-md-8 student-info">
<form method="post" action="<?php echo base_url() ?>student/update-route">
<?php $url = str_replace('bus-tracking/','', base_url()); ?>
<img class="student-info-img" src="<?php echo $url ?>assets_student/application/<?php echo $photo; ?>" alt="">
<div class="student-info-fields">
<p class="student-fields-left">Student ID:</p>
<p class="student-fields-right"><?php echo $studentId ?></p>
</div>
<div class="student-info-fields">
<p class="student-fields-left">Bus No:</p>
<p class="student-fields-right"><?php echo $bus_no ?></p>
</div>
<div class="student-info-fields">
<p class="student-fields-left">Name:</p>
<p class="student-fields-right"><?php echo $student_name ?></p>
</div>
<div class="student-info-fields">
<p class="student-fields-left">Heading To:</p>
<!-- <p class="student-fields-right"><?php echo $place_name ?></p> -->
<p class="student-fields-right">
<?php if (empty($update)) {
echo $place_name;
} else{?>
<select class="" id="route_id" name="route_id">
<?php
foreach ($route_name as $k => $v) {
if ($v['route_id'] == $route_data['route_id']){
?>
<option value="<?php echo $v['route_id'] ?>" selected >
<?php echo $v['route_name'] ?>
</option>
<?php } else {?>
<option value="<?php echo $v['route_id'] ?>" >
<?php echo $v['route_name'] ?>
</option>
<?php }
} } ?>
</select>
</p>
</div>
<?php if($update == 1){ ?>
<input type="hidden" name="id" value="<?php echo $route_details[0]['student_list_id'] ?>">
<div class="student-info-fields">
<p class="student-fields-left">Drop Point:</p>
<p class="student-fields-right">
<select class="" id="stop_id" name="stop_id">
<?php
foreach ($route_details as $key => $value) {
if ($drop_point == $value['place_name']){
?>
<option value="<?php echo $value['id'] ?>" selected >
<?php echo $value['place_name'] ?>
</option>
<?php } else {?>
<option value="<?php echo $value['id'] ?>" >
<?php echo $value['place_name'] ?>
</option>
<?php }
} ?>
</select>
</p>
</div>
<?php } else { ?>
<div class="student-info-fields">
<p class="student-fields-left">Drop Point:</p>
<p class="student-fields-right"><?php echo $drop_point; ?></p>
</div>
<?php } ?>
<div class="student-info-fields">
<p class="student-fields-left">Class:</p>
<p class="student-fields-right"><?php echo $class ?></p>
</div>
<div class="student-info-fields">
<p class="student-fields-left">Email:</p>
<p class="student-fields-right">andrew1997@email.com</p>
</div>
<div class="student-info-fields">
<p class="student-fields-left">Contact number:</p>
<p class="student-fields-right">+ <?php echo $mobile ?></p>
</div>
<div class="student-info-fields">
<p class="student-fields-left">Date of birth:</p>
<p class="student-fields-right"><?php echo date('d-m-Y', strtotime($dob)); ?></p>
</div>
<div class="student-info-fields">
<p class="student-fields-left">Gender:</p>
<p class="student-fields-right"><?php echo $gender; ?></p>
</div>
<div class="student-info-fields">
<p class="student-fields-left">Address:</p>
<p class="student-fields-right"><?php echo $addrress ?></p>
</div>
<?php if($update == 1){ ?>
<button class="subject_addbtn">Update</button>
<?php }?>
</form>
</div>
</div>
</div>
<div class="tab-pane fade" id="pills-fees" role="tabpanel" aria-labelledby="pills-fees-tab">
<div class="row dash-main-row">
<div class="col-md-8 course-details">
<div class="course-info-fields">
<p class="course-fields-left">Bus Fee Total:</p>
<p class="course-fields-right">N <?php echo $bus_fee ?></p>
</div>
<div class="course-info-fields">
<p class="course-fields-left">Payment Dates:</p>
<div class="course-fields-right">
<?php if (isset($payment_date) && !empty($payment_date)) {
$payment_date = json_decode($payment_date);
foreach ($payment_date as $key => $value) { ?>
<div class="course-fields-right_block">
<div class="fields-right-1">
<?php if ($value->payment_status == 'yes') { ?>
<img class="student-check-img" src="<?php echo base_url() ?>assets-bustracking/images/dashboard/check.svg" alt="">
<?php }else{ ?>
<img class="student-check-img" src="<?php echo base_url() ?>assets-bustracking/images/dashboard/pending-check.svg" alt="">
<?php } ?>
<p>N <?php echo $value->paid_amount ? $value->paid_amount: $value->feeamount ?></p>
</div>
<div class="fields-right-2">
<p>Paid on: <?php echo date('d-m-Y', strtotime($value->paid_date)); ?></p>
</div>
</div>
<?php }
} ?>
</div>
</div>
</div>
</div>
</div>
</div>
</main>
<!--End right-top side-->
</div>
<script src="<?php echo base_url();?>assets-bustracking/js/jquery-3.4.1.min.js" ></script>
<script src="<?php echo base_url();?>assets-bustracking/js/bootstrap.min.js"></script>
<script>
$(document).ready(function(){
$('.user-drpdown').click(function(){
$('.drpdown-items').toggle();
});
});
//table js
$('#tbl').DataTable( {
"lengthMenu": [[5,10, 25, 50, -1], [5,10, 25, 50, "All"]]
} );
//table js end
</script>
<script>
function goBack() {
window.history.back();
}
</script>
<script>
$('#route_id').change(function(){
var route_id = $('#route_id').find(":selected").val();
$.ajax({
url: '<?php echo base_url() ?>BustrackingAdmin/get_droppoint_from_route',
type:'POST',
data:{
'route_id' : route_id,
},
success: function(result) {
var res = JSON.parse(result);
console.log(result);
let teachers = '';
teachers += '<option value=""> - Select Drop Point- </option>';
$.each(res, function(key, value) {
teachers += '<option value="'+ value['drop_id']+'">'+value['place_name'] +'</option>';
});
$("#stop_id").html(teachers);
}
});
});
</script>
</body>
</html>