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

166 lines
9.6 KiB
PHP

<main class="wraper responsive-width" id="main">
<div class="from-group adding-class form-group_lng form-group_full-width ">
<a href="<?php echo base_url() ?>admin/send-sms"><button type="button" class="btn subject_addbtn btn-sm mr-3">Send SMS</button></a>
<a href="<?php echo base_url() ?>admin/send-notification"><button type="button" class="btn subject_addbtn btn-sm">Send Notification</button></a>
</div>
<!----admin template section---->
<div class="admin_tempblock form-group_full-width">
<div class="admin_tempsec">
<div class="admin_sec">
<form method="post" action="<?php echo base_url(); ?>Admin/notifications">
<div class="subsec_sec ">
<div class="subject_r subject_r_lng">
<div class="subject_lsec">
<div class="subject_lhead">Notifications</div>
<div class="top-filter notif_filter">
<div class="filter_lbl">
<i class="fas fa-filter"></i>
Filter
</div>
<div class="subject-filter">
<select class="form-control" name="filter-name" placeholder="Select Subject">
<option selected disabled value=""> Select </option>
<?php foreach ($filterArray['title'] as $row) {
echo '<option value="' . $row['notification_title'] . '"> ' . $row['notification_title'] . ' </option>';
} ?>
</select>
</div>
<div class="subject-filter">
<select id=" " name="filter-classroom" class="form-control" placeholder="Select Subject">
<option selected disabled value="">Classroom</option>
<?php foreach ($filterArray['class'] as $row) {
if ($row['student_classroom'] != NULL) {
echo '<option value="' . $row['student_classroom'] . '"> ' . $row['student_classroom'] . ' </option>';
}
} ?>
</select>
</div>
<div class="subject-filter">
<select id=" " name="filter-teacher" class="form-control" placeholder="Select Subject">
<option selected disabled value="">Teacher</option>
<?php foreach ($filterArray['teacher'] as $row) {
if ($row['teacher_name'] != NULL) {
echo '<option value="' . $row['teacher_name'] . '"> ' . $row['teacher_name'] . ' </option>';
}
} ?>
</select>
</div>
<div class="date-filter">
<div class="date-fil-row">
<label></label>
<div class="po-calendar">
<input type="text" placeholder="Select date" name="filter-date" class="nepal-date form-control">
<i class="fas fa-calendar-alt cal-icon"></i>
</div>
</div>
</div>
<div class="filter-reset">
<input type="submit" name="filterSubmit" id="filter_reset" class="btn btn-success" value="Filter">
<a href="<?php echo base_url() ?>Admin/notifications"><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>
<?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 } ?>
<div class="">
<table id="tbl" class="display table-responsive">
<thead>
<tr>
<th>Sl.No</th>
<th>Title of Notifications</th>
<th>Description</th>
<th>Notification to</th>
<th>Date</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<?php foreach ($notificationInfo as $key => $value) {
$originalDate = $notificationInfo[$key]['created_at'];
$newDate = date("d-m-Y", strtotime($originalDate));
?>
<tr>
<td><?php echo $key + 1 ?></td>
<td><?php echo $notificationInfo[$key]['notification_title'] ?></td>
<td>
<div class="sub_descdetail_notif"><?php echo substr($notificationInfo[$key]['description'], 0, 120) ?>...</div>
</td>
<td><?php echo $notificationInfo[$key]['notification_to'] ?></td>
<td>
<div class="width_control"><?php echo $newDate ?></div>
</td>
<td>
<div class="sub_tabbtnsec">
<div class="sub_viewbtn"><a href="<?php echo base_url() ?>admin/view-notification/<?php echo $notificationInfo[$key]['notification_id'] ?>"><i class="fa fa-eye" aria-hidden="true"></i></a></div>
<!-- <div class="sub_editbtn"><i class="fas fa-pencil-alt"></i></div> -->
<div class="sub_delbtn"><a href="<?php echo base_url() ?>Admin/delete_notification?id=<?php echo $notificationInfo[$key]['notification_id'] ?>"><i class="fa fa-trash" aria-hidden="true"></i></a></div>
</div>
</td>
</tr>
<?php } ?>
</tbody>
</table>
</div>
</div>
</div>
</div>
</form>
</div>
</div>
</div>
<!----admin template section end---->
</main>
<!--End right-top side-->
<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
//multiple select js start
$('select').selectpicker();
//multiple select js end
});
</script>