File: /home/nyiet8349bzl/Backup/sbc_back/homedir/public_html/bsadmin-portal/alumni-list.php
<?php
include("../config/connection.php");
$connection = new createCon();
$connection->connect();
if($_SESSION['admin']['user_id']=='')
{
echo "<script>window.location.href='index.php'</script>";
}
if(isset($_REQUEST['action'],$_REQUEST['id'],$_SESSION['admin']['user_id']) and ($_REQUEST['action']=='DeleteAlumni') and !empty($_REQUEST['id']) and !empty($_SESSION['admin']['user_id']))
{
$id = $_REQUEST['id'];
$sql = mysqli_query($connection->myconn, "delete FROM aurobindo_alumni WHERE id ='".$id."'");
if($sql==true)
{
echo "<script>alert('Alumni successfully deleted.')</script>";
echo "<script>window.location='alumni-list.php'</script>";
}
}
?>
<!doctype html>
<html class="fixed">
<head>
<!-- Basic -->
<meta charset="UTF-8">
<title>Sri Aurobindo College :: Admin</title>
<meta name="keywords" content="HTML5 Admin Template" />
<meta name="description" content="Porto Admin - Responsive HTML5 Template">
<meta name="author" content="okler.net">
<?php include("inc-head.php"); ?>
<!-- Vendor CSS -->
<link rel="stylesheet" href="assets/vendor/bootstrap/css/bootstrap.css" />
<link rel="stylesheet" href="assets/vendor/font-awesome/css/font-awesome.css" />
<link rel="stylesheet" href="assets/vendor/magnific-popup/magnific-popup.css" />
<link rel="stylesheet" href="assets/vendor/bootstrap-datepicker/css/bootstrap-datepicker3.css" />
<!-- Specific Page Vendor CSS -->
<link rel="stylesheet" href="assets/vendor/select2/css/select2.css" />
<link rel="stylesheet" href="assets/vendor/select2-bootstrap-theme/select2-bootstrap.css" />
<link rel="stylesheet" href="assets/vendor/jquery-datatables-bs3/assets/css/datatables.css" />
<!-- Theme CSS -->
<link rel="stylesheet" href="assets/stylesheets/theme.css" />
<!-- Theme Custom CSS -->
<link rel="stylesheet" href="assets/stylesheets/theme-custom.css">
<!-- Head Libs -->
<script src="assets/vendor/modernizr/modernizr.js"></script>
<script src="assets/vendor/style-switcher/style.switcher.localstorage.js"></script>
</head>
<body>
<section class="body">
<!-- start: header -->
<?php include("inc-header.php"); ?>
<!-- end: header -->
<div class="inner-wrapper">
<!-- start: sidebar -->
<?php include("inc-navigation.php"); ?>
<!-- end: sidebar -->
<section role="main" class="content-body">
<header class="page-header">
<h2>Alumni Registration Management</h2>
<div class="right-wrapper pull-right">
<ol class="breadcrumbs">
<li>
<a href="dashboard.php">
<i class="fa fa-home"></i>
</a>
</li>
<li><span>Alumni Registration Management</span></li>
<li><span>Alumni Registration</span></li>
</ol>
<a class="sidebar-right-toggle"></a>
</div>
</header>
<!-- start: page -->
<section class="panel">
<header class="panel-heading">
<div class="panel-actions">
<a href="#" class="panel-action panel-action-toggle" data-panel-toggle></a>
<a href="#" class="panel-action panel-action-dismiss" data-panel-dismiss></a>
</div>
<h2 class="panel-title">Alumni Registration User List</h2>
</header>
<div class="panel-body">
<div style="width:100%; overflow:scroll">
<table class="table table-bordered table-striped mb-none" id="example" >
<thead>
<tr>
<th>Name</th>
<th>Email</th>
<th>Mobile</th>
<th>Sex</th>
<th>Date of Birth</th>
<th>Course</th>
<th>Passed out / Left Year</th>
<th>Address</th>
<th>Designation</th>
<th>Organiation</th>
<th>Office Address</th>
<th>Create</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<?php
$sql = mysqli_query($connection->myconn, "SELECT * FROM aurobindo_alumni order by created_on desc") or die(mysqli_error($connection->myconn));
while($rows=mysqli_fetch_array($sql))
{
$createdOn=date('d M Y',strtotime($rows['created_on']));
?>
<tr>
<td><?php echo $rows['sname']." ".$rows['fname']." ".$rows['mname']." ".$rows['lname']; ?></td>
<td><?php echo $rows['email']; ?></td>
<td><?php echo $rows['mobile']; ?></td>
<td><?php echo $rows['sex']; ?></td>
<td><?php echo date('d-m-Y',strtotime($rows['dob'])); ?></td>
<td><?php echo $rows['course']; ?></td>
<td><?php echo $rows['passout']; ?></td>
<td><?php echo $rows['address']." ".$rows['city']." ".$rows['country']." ".$rows['zip']; ?></td>
<td><?php echo $rows['designation']; ?></td>
<td><?php echo $rows['organiation']; ?></td>
<td><?php echo $rows['office']; ?></td>
<td><?php echo $createdOn; ?></td>
<td class="actions">
<a style="color:#0369a9;" href="edit-alumni.php?action=editAlumni&id=<?php echo $rows['id'] ?>" title="Edit Alumni">
<i class="fa fa-pencil fa-2x"></i>
</a>
<a style="color:#FF0000;" href="alumni-list.php?action=DeleteAlumni&id=<?php echo $rows['id'] ?>" title="Delete Alumni" onClick="return confirm('Are you sure want to delete ?')">
<i class="fa fa-trash-o fa-2x"></i>
</a>
</td>
</tr>
<?php } ?>
</tbody>
</table>
</div>
</div>
</section>
<!-- end: page -->
</section>
</div>
</section>
<?php include("inc-footer.php"); ?>
<!-- Specific Page Vendor -->
<script src="assets/vendor/select2/js/select2.js"></script>
<script src="assets/vendor/jquery-datatables/media/js/jquery.dataTables.js"></script>
<script src="assets/vendor/jquery-datatables-bs3/assets/js/datatables.js"></script>
<!-- Theme Base, Components and Settings -->
<script src="assets/javascripts/theme.js"></script>
<!-- Theme Custom -->
<script src="assets/javascripts/theme.custom.js"></script>
<!-- Theme Initialization Files -->
<script src="assets/javascripts/theme.init.js"></script>
<!-- Examples -->
<script src="assets/javascripts/tables/examples.datatables.editable.js"></script>
<!--<script>
$(function(){
$("#example").dataTable();
})
</script>-->
<!----------------------FOR DOWNLOAD PDF AND EXCEL START------------------------>
<script src="https://cdn.datatables.net/buttons/1.2.4/js/dataTables.buttons.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/jszip/2.5.0/jszip.min.js"></script>
<script src="//cdn.datatables.net/buttons/1.2.4/js/buttons.html5.min.js"></script>
<!----------------------FOR DOWNLOAD PDF AND EXCEL END------------------------>
<script>
$(document).ready(function(){
$('#example').DataTable({
dom: 'frtipB',
buttons: {
buttons: [
{ extend: 'excel', className: 'btn btn-default',text: 'Download as Excel' },
]
}
});
});
</script>
</body>
</html>