Gifari Industries - BD Cyber Security Team
Home
/
home
/
decohaslibrary
/
public_html
/
✏️
Editing: nurse_student.php
<body> <?php //include "config.php"; if(isset($_POST['delete'])) { $deleteQuery= "DELETE FROM nursing_book WHERE id='$_POST[hidden]'"; mysqli_query($con,$deleteQuery); }; $record_per_page = 3; $page = ''; if(isset($_GET["page"])) { $page = $_GET["page"]; } else { $page = 1; } $start_from = ($page-1)*$record_per_page; $query = "SELECT * FROM nursing_book order by id DESC LIMIT $start_from, $record_per_page"; $result = mysqli_query($con, $query); ?> <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /> <title></title> <link rel="stylesheet" type="text/css" href="css/style.css" /> <style type="text/css" media="all"> @import url("css/style.css"); </style> <style> #page a { padding:8px 16px; border:1px solid #ccc; color:#333; font-weight:bold; } </style> </head> <body> <div id ="table"> <div style ="margin-top:2%; margin-left:2%; margin-bottom:2%; "> <h5><a href = "nurse_update_book.php">update table</a></h5> <table border = "1" width = "98%" cellpadding="5" cellspacing="5"> <tr> <th>Sno</th> <th>Book-Name</th> <th>Book-Title</th> <th>Other Informations</th> <th align="center">option</th> </tr> <?php $counter = 1; while($row = mysqli_fetch_array($result)) { ?> <tr> <form action ="" method = "post"> <td align = "center"> <?php echo $counter;?></td> <td><?php echo $row["image"]; ?></td> <td><?php echo $row["message"]; ?></td> <td><?php echo $row["other"]; ?></td> <td><input type="submit" name="delete" value="Delete"></td> <input type="hidden" name="hidden" value="<?php echo $row["id"]; ?>"> </tr> <?php $counter++; ?> </form> <?php } ?> </table> <div align="center"> <br /> <?php $page_query = "SELECT * FROM nursing_book ORDER BY id DESC"; $page_result = mysqli_query($con, $page_query); $total_records = mysqli_num_rows($page_result); $total_pages = ceil($total_records/$record_per_page); $start_loop = $page; $difference = $total_pages - $page; if($difference <= 5) { $start_loop = $total_pages - 5; } echo"<div id = 'page'>"; $end_loop = $start_loop + 4; if($page > 1) { echo "<a href='nurse.php?page=1'>First</a>"; echo "<a href='nurse.php?page=".($page - 1)."'><<</a>"; } for($i=$start_loop; $i<=$end_loop; $i++) { echo "<a href='nurse.php?page=".$i."'>".$i."</a>"; } if($page <= $end_loop) { echo "<a href='nurse.php?page=".($page + 1)."'>>></a>"; echo "<a href='nurse.php?page=".$total_pages."'>Last</a>"; } echo"</div>"; ?> </div> </div> </div> <div id="footer" > <p>©2017 DECOHAS</p> </div> </div> </div> </body> </html>
💾 Save
❌ Cancel