BBnepal-Accounts/application/views/admin/fee-course.php
Sampanna Rimal 9cd05ef3cb commitall
2024-07-10 18:28:19 +05:45

275 lines
16 KiB
PHP

<style>
.action_subject_addbtn {
background: #032DA4;
border-radius: 35px;
color: #fff;
padding: 5px 15px;
border: none;
font-size: 12px;
cursor: pointer;
text-decoration: none;
}
form label.error,
#secNameerr {
color: red;
}
.cierr {
font-size: 14px;
}
</style>
<?php
function isJSON($string)
{
return is_string($string) && is_array(json_decode($string, true)) ? true : false;
}
?>
<div class="wraper responsive-width w-90">
<main class="" id="main">
<div class="from-group adding-class form-group_lng">
<a href="<?= base_url(); ?>admin/assign-all-fees">
<button type="button" class="btn btn-primary btn-sm">Assign All Fees</button>
</a> &nbsp;&nbsp;
<a href="<?= base_url(); ?>admin/ae-fee-course/0">
<button type="button" class="btn btn-success btn-sm">Add fees</button>
</a>
</div>
<div class="admin_tempblock">
<div class="admin_tempsec">
<div class="admin_sec">
<div class="subsec_sec">
<div class="subject_r subject_r_lng">
<div class="subject_lsec">
<div class="subject_lhead">Fees List <p id="success" style="color:green;"></p>
</div>
<!-- tab added -->
<form method="post" action="<?php echo base_url(); ?>admin/fee-course">
<div class="filter_lbl">
<i class="fas fa-filter"></i>
Filter
</div>
<div class="row">
<div class="col-md-3">
<div class="form-group">
<label class="mb-0" style="font-size: 13px;">Batch </label>
<select id="course" class="form-control" placeholder="Select Course" name="filter-batch">
<option value=" "> Select ..</option>
<?php
if (isset($batch) || !empty($batch)) {
foreach ($batch as $row) { ?>
<option value="<?php echo $row['id'] ?>" <?= $selected_batch == $row['id'] ? 'selected' : '' ?>>
<?php echo $row['b_name']; ?>
</option>
<?php }
} ?>
</select>
<div class="text-danger cierr"><?php echo form_error('filter-batch'); ?></div>
</div>
</div>
<div class="col-md-3">
<div class="form-group">
<label class="mb-0" style="font-size: 13px;">Course Name</label>
<select id="course" class="form-control" placeholder="Select Course" name="filter-course">
<option value=" "> Select ..</option>
<?php if (isset($course) || !empty($course)) {
foreach ($course as $row) { ?>
<option value="<?php echo $row['id'] ?>" <?php echo set_select('filter-course', $row['id'], (!empty($courseId) ? TRUE : FALSE)); ?>>
<?php echo $row['course_name']; ?></option>
<?php }
} ?>
</select>
<div class="text-danger cierr"><?php echo form_error('filter-course'); ?></div>
</div>
</div>
<div class="col-md-2 pl-0">
<div class="form-group">
<label class="mb-0" style="font-size: 13px;">Fees Type</label>
<select id="course" class="form-control" placeholder="Select Course" name="filter-feeType">
<option value=" "> Select ..</option>
<?php if (isset($fee_types) || !empty($fee_types)) {
foreach ($fee_types as $row) { ?>
<option value="<?php echo $row['id'] ?>" <?php echo set_select('filter-feeType', $row['id'], (!empty($feeType_id) ? TRUE : FALSE)); ?>>
<?php echo $row['feetype_name']; ?></option>
<?php }
} ?>
</select>
<div class="text-danger cierr"><?php echo form_error('filter-feeType'); ?></div>
</div>
</div>
<div class="col-md-2 p-0">
<div class="form-group">
<label class="mb-0" style="font-size: 13px;">Fees Name</label>
<input type="text" name="filter-feesName" class="form-control" value="<?php echo (isset($feeName) && !empty($feeName)) ? $feeName : '' ?>">
</div>
</div>
<div class="col-md-2">
<div class="form-group" style="margin-top: 1.5rem;">
<input type="submit" name="filterSubmit" id="filter_reset" class="btn btn-success" value="Filter">
<a href="<?php echo base_url() ?>admin/fee-course"><button type="button" name="reset_filter" id="reset_filter" value="reset_filter" class="subject_addbtn subject_addbtn_nobg p-0"><i class="fas fa-redo "></i>Reset</button></a>
</div>
</div>
</div>
</form>
<?php if ($this->session->flashdata('success')) { ?>
<div class="alert alert-success alert-dismissible fade show" role="alert">
<p><?php echo $this->session->flashdata('success') ?></p>
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<?php } ?>
<?php if ($this->session->flashdata('failed')) { ?>
<div class="alert alert-danger alert-dismissible fade show" role="alert">
<p><?php echo $this->session->flashdata('failed') ?></p>
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<?php } ?>
<table id="tbl" class="display table-responsive">
<thead>
<tr>
<th>Sl.No</th>
<th>Refer Id</th>
<th>Fees Type</th>
<th>Batch</th>
<th>Course</th>
<th>Fees Name</th>
<th>Amount</th>
<th>Due Date</th>
<th>Actions </th>
</tr>
</thead>
<tbody>
<?php
// dd($course_fees);
if (isset($course_fees) && !empty($course_fees)) {
foreach ($course_fees as $key => $value) {
$feenames = json_decode($value['fees_name']);
?>
<tr>
<td><?php echo $key + 1 ?></td>
<td><?php echo $value['id']; ?></td>
<td><?= $value['feetype'] ?></td>
<td><?= $value['batch'] ?></td>
<td><?= $value['course'] ?></td>
<td>
<?php
if (isJSON($value['fees_name'])) {
foreach ($feenames as $index => $ele) {
?> <?= $ele->name ?>-<?= $ele->amount ?>
<?php }
} else {
echo $value['fees_name'];
}
?>
</td>
<td class="text-center"><?= $value['amount'] ?></td>
<td><?= $value['due_date'] ?></td>
<td>
<div class="sub_tabbtnsec">
<!-- <div class="sub_viewbtn" title="view">
<a href="<?php //echo base_url()
?>admin/student_fee_course/<?php //echo $value['id']
?>">
<i class="fa fa-eye" aria-hidden="true"></i>
</a>
</div> -->
<div class="sub_editbtn"><a href="<?php echo base_url() ?>admin/ae-fee-course/<?php echo $value['id'] ?>"><i class="fas fa-pencil-alt"></i></a></div>
<a data-toggle="modal" onclick="coursedel(<?php echo $value['id'] ?>)" href="#deleteModal">
<div class="sub_delbtn">
<i class="fa fa-trash" aria-hidden="true"></i>
</div>
</a>
<div>
<a class="action_subject_addbtn" style=" width: 122px !important;display: block;padding: 5px 5px;" href="<?= base_url() ?>admin/manage-installments/<?= $value['id'] ?>">Assign Students</a>
</div>
</div>
</td>
</tr>
<?php }
} else { ?>
<tr>
<td class="text-center" colspan="9">No data Found</td>
</tr>
<?php } ?>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</main>
</div>
<div class="viewDoc delete-modal-wrap">
<div class="modal fade" id="deleteModal" role="dialog">
<div class="modal-dialog">
<div class="modal-content">
<button type="button" class="close" data-dismiss="modal">&times;</button>
<div class="delete-modal">
<i class="far fa-times-circle"></i>
<input type="hidden" id="fid" />
<h4>Are you sure?</h4>
<p>Are you sure you want to delete this item?</p>
<div class="delete-modal-btn">
<button type="button" class="subject_addbtn subject_addbtn_red" onclick="deletedata($('#fid').val());">Delete</button>
<button type="button" class="subject_addbtn subject_addbtn_cancel" data-dismiss="modal">Cancel</button>
</div>
</div>
</div>
</div>
</div>
</div>
<script>
$(document).ready(function() {
//table js
$('#tbl').DataTable({
"lengthMenu": [
[50, 75, 100, -1],
[50, 75, 100, "All"]
]
});
//table js end
});
</script>
<script type="text/javascript">
function coursedel(icn) {
$('#fid').val(icn);
}
function deletedata(id) {
window.location.href = "<?php echo base_url(); ?>Admin/delete_course_fees/" + id;
}
</script>