<?php
include 'side_nav.php';
include 'main.php';
require 'db_connection.php';
if (!$connect->set_charset('utf8')) {
	//	printf("Error loading character set utf8: %s\n", $conn->error);
	//	exit;
	}
	$sql="SELECT * FROM kapaleshwar" ;
	$result = $connect-> query($sql) ;
?>
<!DOCTYPE html>
<html>
<head>
	<title>All Clients</title>
	<link rel="stylesheet" type="text/css" href="css/style.css">
	<link rel="stylesheet" type="text/css" href="css/disptable.css">
</head>
<body>
	<div class="header">
		<h2>Bhajan List</h2>
	</div>
	<form>
	<div class="dataTable_wrapper">
		<table class="table-content">
			<thead>
				<tr>
					<th>Sr.No</th>
					<th>Bhajan Name</th>
					<th>Type</th>
					<th>Action</th>
				</tr>
			</thead>
<?php
if ($result -> num_rows > 0) {
	while ($row = $result-> fetch_assoc()) { ?>
		<tbody>
			<tr>
				<td><?php echo $row['id']; ?></td>
				<td><?php echo $row['title']; ?></td>
				<td><?php echo $row['type']; ?></td>
				<td><a href='edit_bhajan.php?edit=$row[id]' ><img src="images/edit.jpg" style = "height: 30px; width: 30px; border-radius:15px; margin-left: 10px; padding-right: 20px" /></a><a href="delete_bhajan.php?delete=<?php $row['id'] ?>"><img src="images/erase.png" style = "height: 30px; width: 30px; padding-left: 20px; border-radius:50%"/></a></td>
			</tr>
			</tbody>
	<?php   
		}
	}
	else{ ?>
		<h1 align="center">0 result found :(</h1>
	</table>
</div>
	<?php
	}
	$connect-> close();
	?>
	</div>
	<script src="css/datatable/js/jquery.dataTables.min.js"></script>
    <script src="css/datatable/dataTables.bootstrap.min.js"></script>
</body>
</html>