BBnepal-Accounts/application/views/admin/scholarship-list.php

434 lines
19 KiB
PHP
Raw Permalink 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 : '';
?>
<!-- admin template section -->
<div class="admin_tempblock">
<div class="admin_tempsec">
<div class="admin_sec">
<div class="from-group adding-class form-group_lng">
<a href="<?= base_url(); ?>admin/scholarship-types" class="">
<button type="button" class="btn subject_addbtn btn-sm">Scholarship Types</button>
</a>
<a href="<?= base_url(); ?>admin/scholarship" class="ml-4">
<button type="button" class="btn subject_addbtn btn-sm">Assign Scholarship</button>
</a>
</div>
<?php
if (!empty($this->session->flashdata('success'))) { ?>
<div class="alert alert-success">
<a href="#" class="close" data-dismiss="alert">&times;</a>
<strong>Success!</strong> <?php echo $this->session->flashdata('success'); ?>
</div>
<?php
}
if (!empty($this->session->flashdata('error'))) {
?>
<div class="alert alert-danger">
<a href="#" class="close" data-dismiss="alert">&times;</a>
<strong>Failed!</strong> <?php echo $this->session->flashdata('error'); ?>
</div>
<?php } ?>
<div class="subsec_sec">
<div class="subject_r subject_l_full_width">
<div class="subject_lsec">
<!-- tab added -->
<div class="subject_lhead">Scholar Students</div>
<form id="searchFilters" action="<?= base_url(); ?>admin/scholarship-list" 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-9">
<div class="form-group" style="margin-top: 1.5rem;">
<input type="submit" name="filtersubmit" id="filter_reset1" class="btn subject_addbtn btn-sm " style="height:40px;" value="View Assigned Scholarship Students">
<!-- <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>Roll No</th>
<th>Student Id</th>
<th>Student Name</th>
<th>Course</th>
<th>Section</th>
<th>Total Assigned Fee</th>
<th>Total Assigned Scholarship</th>
<th class="noExport">Action</th>
</tr>
</thead>
<tbody>
<?php
$sno = 1;
if (isset($scholarStudents) && !empty($scholarStudents)) {
foreach ($scholarStudents as $student) {
$scholarshipArray = [];
$totalAssignedFee = 0;
$totalAssignedScholarship = 0;
foreach ($student['scholarship'] as $ss_key => $ss_value) {
array_push($scholarshipArray, $ss_value['fee_type']);
$totalAssignedFee = $totalAssignedFee + $ss_value['fee_amount'];
$totalAssignedScholarship = $totalAssignedScholarship + $ss_value['scholarship_amount'];
}
$scholarshipArray = array_unique($scholarshipArray);
?>
<tr>
<td><?= $student['roll_no'] ?> </td>
<td><?= $student['studentId'] ?> </td>
<td><?= $student['student_name'] ?> </td>
<td><?= $student['course_name'] ?> </td>
<td><?= $student['section_name'] ?> </td>
<td>
<?php
echo $totalAssignedFee;
?>
</td>
<td><?= $totalAssignedScholarship ?> </td>
<td>
<div class="sub_tabbtnsec stud_tabbtnsec">
<div class="sub_viewbtn">
<a href="javascript:void(0)" data-toggle="tooltip" data-id="<?php echo $student['student_id']; ?>" title="View Details">
<i class="fa fa-eye scholarship_modal" data-id="<?php echo $student['student_id']; ?>" aria-hidden="true"></i>
</a>
</div>
</div>
</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'] . ' - Scholarship Students ';
}
?>
<script>
$(".scholarship_modal").click(function() {
var studentid = $(this).data('id');
var batchid = "<?php echo $search_batchid; ?>";
var divdata = '';
$.ajax({
url: "<?php echo base_url(); ?>admin/getscholarshipDetails",
method: "POST",
data: {
batch_id: batchid,
studentId: studentid
},
success: function(htmldata) {
$('#student_id').val(studentid);
$(".scholarship_detail_body").html(htmldata);
$('#scholarshipDetailModal').modal({
backdrop: 'static',
keyboard: true,
show: true
});
}
});
});
$("#update_scholarship_btn").click(function(e) {
var selectedVal = "";
var alertsection = '';
var isActive = $("input[type='checkbox'][name='isActive']:checked");
var searchIDs = $('input:checked').map(function() {
return $(this).val();
});
console.log('is one way ============> ' + isActive.length);
console.log('is one way ============> ' + searchIDs);
// $.ajax({
// url: "<?php echo base_url(); ?>admin/updateScholarship",
// method: "POST",
// data: {
// route_id: selectedVal,
// student_id: studentid1,
// stop_id: Selected_r,
// batch_id: batchid,
// is_one_way: isOneWay.length > 0 ? 'yes' : 'no'
// },
// success: function(result) {
// $('#scholarshipDetailModal').modal("hide");
// if (result == 1) {
// <?php $this->session->set_flashdata('success_msg', 'Route Assigned Successfully'); ?>
// // swal({
// // title: "Good job",
// // text: "Route Assigned Successfully!",
// // type: "success"
// // },
// // function(){
// // location.reload();
// // });
// // $(".bootstrap_alert").html('<div class="alert alert-success"><a href="#" class="close" data-dismiss="alert">&times;</a><strong>Success!</strong> Route Assigned Successfully </div>');
// } else {
// <?php $this->session->set_flashdata('error_msg', 'Route Assiging Failed'); ?>
// // swal({
// // title: "Sorry",
// // text: "Route Assiging Failed!",
// // type: "error"
// // },
// // function(){
// // location.reload();
// // });
// // $(".bootstrap_alert").html('<div class="alert alert-danger"><a href="#" class="close" data-dismiss="alert">&times;</a><strong>Danger!</strong> Route Assiging Failed </div>');
// }
// location.reload();
// }
// });
})
</script>
<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>