Mini Shell
<?php
session_start();
$rootPath = realpath(dirname(__FILE__) . '/..');
require_once $rootPath . '/PortalMM/config/config.php'; // Use clean config file
require_once $rootPath . '/PortalMM/include/auth_validate.php'; // Use clean config file
//$query3 = "SELECT * FROM `accesslevelmanagement`";
//$result3 = mysqli_query($connection, $query3);
/////// Code for new access control on header menu /////////////////////////
$User = $_SESSION['id'];
$User = $_SESSION['User_Type'];
$User_Type = "";
$result = mysqli_query( $conn,"SELECT * FROM admin_accounts WHERE id = '$User' ");
$num = mysqli_num_rows($result);
if ($num >0){
$rows = mysqli_fetch_array($result);
$User_Type = $rows['Access_Level'];
//$UserDepartment = $rows['UserDepartment'];
}
require_once $rootPath . '/PortalMM/include/AdminHeader.php';
?>
<div id="page-wrapper">
<div class="row">
<div class="col-lg-12">
<h4 class="page-header">Student Notifications</h4>
</div>
</div>
<?php include('include/flash_messages.php') ?>
<?php
if (isset($del_stat) && $del_stat == 1) {
echo '<div class="alert alert-info">Successfully deleted</div>';
}
?>
<div class="modal-dialog">
<div class="modal-header" style="text-align:center; background-color:#BAC4CC;">
<h5 class="modal-title" style="text-align:center;"><strong>DOWNLOAD THE STUDENTS LIST TO RECEIVE THE NOTICE</strong> </h5>
</div>
<div class="modal-body" style="text-align:center; background-color:#F6F7FA;">
<div class="template-section">
<h5 style="color: #4e73df; font-weight: 600; margin-bottom: 15px;">
<i class="fa fa-bell"></i> Student Notifications
</h5>
<form class="form-inline" action="Notice_List_Export.php">
<div class="form-group" style="margin-bottom: 10px; display: block; text-align: left;">
<select name="Grade" class="form-control" required id="Grade"
style="width: 100%; padding: 8px 12px; border-radius: 4px; border: 1px solid #ced4da;">
<option value="">-- Select Grade/Class --</option>
<option value="All">All Classes</option>
<option value="Baby Class">Baby Class</option>
<option value="Middle Class">Middle Class</option>
<option value="Top Class">Top Class</option>
<option value="Year 1">Year 1</option>
<option value="Year 2">Year 2</option>
<option value="Year 3">Year 3</option>
<option value="Year 4">Year 4</option>
<option value="Year 5">Year 5</option>
<option value="Year 6">Year 6</option>
<option value="Year 7">Year 7</option>
<option value="Year 8">Year 8</option>
<option value="Year 9">Year 9</option>
<option value="Year 10">Year 10</option>
</select>
</div>
<button type="submit" class="btn btn-primary"
style="width: 100%; margin-top: 10px; padding: 8px 16px; border-radius: 4px;">
<i class="glyphicon glyphicon-download"></i> Download Students List for the notice
</button>
<p class="small text-muted" style="margin-top: 8px;">
A list of the students you want to receive the notification
</p>
</form>
<br><hr>
<div class="template-section">
<h5 style="color: #1cc88a; font-weight: 600; margin-bottom: 15px;">
<i class="fa fa-bell"></i> Upload New Notice
</h5>
<div style="text-align: center;">
<a href="#" data-toggle="modal" data-target="#Upload-NewStudent" class="btn btn-success"
style="padding: 8px 20px; border-radius: 4px; width: 100%;">
<i class="glyphicon glyphicon-upload"></i>
<span style="font-weight: 500;">Upload Notificication Records</span>
</a>
<p class="small text-muted" style="margin-top: 8px;">
Button for upading the list you want to receive the notice
</p>
</div>
</div>
</div>
</div>
<br>
<!-- Adding Fees Payments Modal -->
<div class="modal fade" id="Upload-NewStudent" role="dialog">
<div class="modal-dialog">
<form action="Notice_Upload.php" method="post" id="contact_form" enctype="multipart/form-data">
<div class="modal-content">
<div class="modal-header" style="text-align:center; background-color:#BAC4CC;">
<button type="button" class="close" data-dismiss="modal">×</button>
<h5 class="modal-title" style="text-align:center;"><strong>UPLOAD A NEW NOTICE</strong></h5>
</div>
<div class="modal-body">
<div class="form-group">
<label for="Heading">NOTICE HEADING *</label>
<input type="text" class="form-control" id="Heading" name="Heading" placeholder="Heading" required>
</div>
<div class="form-group">
<label for="Message">Message *</label>
<textarea class="form-control" placeholder="Not more than 1000 characters including spaces" required name="Message" id="Message" style="height: 100px" maxlength="1000"></textarea>
<small class="text-muted"><span id="charCount">0</span>/1000 characters</small>
</div>
<div class="form-group">
<label class="control-label">Attach Students List in CSV format *</label>
<div class="form-control">
<input type="file" name="file" id="file" required accept=".csv" />
<small class="text-muted">CSV format: Student_No, Email, Full_Name</small>
</div>
</div>
<div class="form-group">
<label for="subscribe">
<input type="checkbox" id="subscribe" name="Send_Email" value="yes">
Send Email to Students
</label>
</div>
<div class="form-group">
<label for="subscribe">
<input type="checkbox" checked name="Save_Notice" value="yes">
Save to Notices Database
</label>
</div>
<div class="alert alert-info">
<strong>Note:</strong> CSV file should have columns: Student_No, Full_Name, Level, Email
</div>
</div>
<div class="modal-footer">
<button type="submit" name="submit" id="submit" class="btn btn-warning pull-left">
Save & Send <span class="glyphicon glyphicon-send"></span>
</button>
<button type="button" class="btn btn-primary" data-dismiss="modal">
Cancel <span class="glyphicon glyphicon-remove"></span>
</button>
</div>
</div>
</form>
<script>
// Character counter for message
document.getElementById('Message').addEventListener('input', function() {
const charCount = this.value.length;
document.getElementById('charCount').textContent = charCount;
if (charCount > 1000) {
this.value = this.value.substring(0, 1000);
document.getElementById('charCount').textContent = 1000;
}
});
</script>
</div>
</div>
</div></div></div>
<br>
<?php include_once 'include/footer.php'; ?>