BBnepal-Accounts/application/views/admin/transport-report.php

304 lines
13 KiB
PHP
Raw Normal View History

2024-07-10 12:43:19 +00:00
<style>
form label.error,
#secNameerr {
color: red;
}
.cierr {
font-size: 14px;
}
#tbl1 tr th {
font-weight: 600;
font-size: 12px;
}
</style>
<div class="wraper responsive-width">
<main class="long-tbl-main students_list_table" id="main">
<?php
$search_batchid = (!empty($search_batch_id)) ? $search_batch_id : '';
// echo '<pre>';
// print_r($transportList);
?>
<!-- admin template section -->
<div class="admin_tempblock">
<div class="admin_tempsec">
<div class="admin_sec">
<div class="subsec_sec">
<div class="subject_r subject_l_full_width">
<div class="subject_lsec">
<!-- tab added -->
<div class="subject_lhead">Transport Report</div>
<form id="searchFilters" action="<?= base_url(); ?>admin/transport-report" method="POST" onkeydown=" return event.key != 'Enter'">
<div class="subject_lsec dashboard_graph report_sec_graph">
<div class="report_sec_cover">
<div class="row">
<div class="col-md-12">
<div class="row">
<div class="col-md-3">
<div class="subject-filter">
<label>Select Batch <span style="font-weight:bold;color:red;"> * </span></label>
<select id="f_batch" name="f_batch" class=" form-control">
<option value="">Select Batch</option>
<?php if (isset($batches) || !empty($batches)) {
foreach ($batches as $row) {
if ($search_batch != '')
$b_selected = ($row['id'] == $search_batch) ? 'selected' : '';
else
$b_selected = ($row['id'] == $school_info['batch_id']) ? 'selected' : '';
?>
<option value="<?php echo $row['id'] ?>" <?= $b_selected; ?>>
<?php echo $row['b_name']; ?></option>
<?php }
} ?>
</select>
<div class="text-danger cierr"><?php echo form_error('f_batch'); ?></div>
</div>
</div>
<div class="col-md-5">
<div class="form-group" style="margin-top: 1.5rem;">
<input type="submit" name="filtersubmit" id="filter_reset1" class="btn subject_addbtn btn-sm " style="width:250px;height:40px;" value="Filter">
<a href="<?php echo base_url() ?>admin/scholarship-list">
<button type="button" name="reset_filter" id="reset_filter" value="reset_filter" class="subject_addbtn subject_addbtn_nobg"><i class="fas fa-redo"></i>Reset</button>
</a>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</form>
<!-- <form method="post" id="downloadAll" action="<?php echo base_url(); ?>Admin/downloadAll"> -->
<div class="tab-content">
<div class="applicnts-list-wrap subject_lsec">
<div class="">
<table id="tbl1" class="display table-responsive">
<thead>
<tr>
<th>Student Id</th>
<th>Roll No.</th>
<th>Student Name</th>
<th>Class</th>
<th>Section</th>
<th>Route</th>
<th>Pick Up Location</th>
<th>One Way</th>
<th class="noExport">Active</th>
</tr>
</thead>
<tbody>
<?php
$sno = 1;
if (isset($transportList) && !empty($transportList)) {
foreach ($transportList as $studentList) {
$student = $studentList['student'][0];
// echo '<pre>';
// print_r($transportList);
?>
<tr>
<td><?= $student['studentId'] ?> </td>
<td><?= $student['roll_no'] ?> </td>
<td><?= $student['student_name'] ?> </td>
<td><?= $student['course_name'] ?> </td>
<td><?= $student['section_name'] ?> </td>
<td><?= $studentList['route_name'] ?> </td>
<td><?= $studentList['place_name'] ?> </td>
<td><?= ucwords($studentList['one_way']) ?> </td>
<td><?= ucwords($studentList['is_active']) ?> </td>
</tr>
<?php
$sno++;
}
} ?>
</tbody>
</table>
</div>
</div>
<!-- </form> -->
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- admin template section end -->
</main>
<!--End right-top side-->
</div>
<div class="modal fade " id="scholarshipDetailModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<div class="scholarship_detail_body">
</div>
<input type="hidden" id="student_id" name="student_id" class="form-control" />
</div>
</div>
</div>
<?php
// $theExportHeader = 'Student List';
if (isset($school_info) && !empty($school_info)) {
$theExportHeader = $school_info['school_name'] . ' - Transport Report';
// var_dump($school_info);
}
?>
<script>
$(document).ready(function() {
var jsTheExportHeader = '<?php echo $theExportHeader; ?>';
$('.user-drpdown').click(function() {
$('.drpdown-items').toggle();
});
//table js
$('#tbl1').DataTable({
"lengthMenu": [
[-1],
["All"]
],
dom: 'lBfrtip',
buttons: [{
extend: 'pdfHtml5',
title: 'Student List',
orientation: 'landscape',
exportOptions: {
columns: [1, 3, 4, 5, 6, 7, 8]
}
},
{
extend: 'csvHtml5',
exportOptions: {
columns: [1, 3, 4, 5, 6, 7, 8]
}
},
{
extend: 'excelHtml5',
header: true,
footer: true,
title: jsTheExportHeader,
exportOptions: {
columns: "thead th:not(.noExport)",
rows: function(indx, rowData, domElement) {
return $(domElement).css("display") != "none";
}
},
customize: function(xlsx) {
var sheet = xlsx.xl.worksheets['sheet1.xml'];
// $('row c[r^="C"]', sheet).attr('s', '2');
}
}
]
});
//table js end
//multiple select js start
$('select').selectpicker();
//multiple select js end
});
$('#filter_reset').click(function() {
});
$(document).ready(function() {
$('#chkParent').click(function() {
var isChecked = $(this).prop("checked");
$('#tbl1 tr:has(td)').find('input[type="checkbox"]').prop('checked', isChecked);
});
$('#tbl1 tr:has(td)').find('input[type="checkbox"]').click(function() {
var isChecked = $(this).prop("checked");
var isHeaderChecked = $("#chkParent").prop("checked");
if (isChecked == false && isHeaderChecked)
$("#chkParent").prop('checked', isChecked);
else {
$('#tbl1 tr:has(td)').find('input[type="checkbox"]').each(function() {
if ($(this).prop("checked") == false)
isChecked = false;
});
console.log(isChecked);
$("#chkParent").prop('checked', isChecked);
}
});
});
$(document).on('click', '.download_idcards', function() {
var studentidlist = [];
$.each($("input[name='student_id_list[]']:checked"), function() {
var item = $(this).data('studentid');
studentidlist.push(item);
});
if (studentidlist.length === 0) {
alert("Please Select Students");
} else {
$('#downloadAll').submit();
}
});
</script>
<script>
function coursedel(icn) {
// alert(icn);
$('#crid').val(icn);
}
$("#suspend_student").validate({
rules: {
"reason": {
required: true,
minlength: 10
}
},
submitHandler: function() {
form.submit();
} // end submitHandler
});
</script>
<script type="text/javascript">
window.onload = function() {
var mainInput = document.getElementById("end_date");
mainInput.nepaliDatePicker({
dateFormat: "DD-MM-YYYY",
language: 'english'
});
var mainInput1 = document.getElementById("start_date");
mainInput1.nepaliDatePicker({
dateFormat: "DD-MM-YYYY",
language: 'english'
});
};
</script>