Gifari Industries - BD Cyber Security Team
Home
/
home
/
decohaslibrary
/
public_html
/
✏️
Editing: medical_update_book.php
<?php session_start(); $user = $_SESSION['username']; $log = $_SESSION['HOD-Medical-laborato']; if ($log != "log"){ header ("Location: login.php"); } $msg = ""; ?> <?php include "sql.php"; $record_per_page = 8; $page = ''; if(isset($_GET["page"])) { $page = $_GET["page"]; } else { $page = 1; } $start_from = ($page-1)*$record_per_page; $query = "SELECT * FROM medical_book order by id DESC LIMIT $start_from, $record_per_page"; $counter = 1; $result = mysqli_query($con, $query); ?> <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /> <title>DECOHAS Library System</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 = "container"> <div id="header" > </div> <div id = "bg_wrapper" > <h1 style="font-size:28px;">DECOHAS Online Library System<h1> </div> <div id ="wrapper"> <div class = "navbar"> <ul> <li><a href = "medical.php">Home</a></li> <li><a href = "add_user_lab.php"><img src = "images/add.png " width="15" style="margin-right:3px; border-radius:50%;">Add </img></a></li> <li><a href = "view_students_lab.php"><img src = "images/add.png " width="15" style="margin-right:3px; border-radius:50%;">Students </img></a></li> <li></li> <li><a href = "changepassl.php"><img src = "images/my_account.png" style="margin-right:3px;">Update password</img></a></li> <li><a href = "index.php"><img src = "images/logout.png" style="margin-right:3px; ">Logout</img></a></li> </ul> </div> <div id ="table"> <div style ="margin-top:2%; margin-left:2%; margin-bottom:2%; "> <table border = "1" width = "98%" cellpadding="5" cellspacing="5"> <tr> <th>Sno</th> <th>Title</th> <th>other</th> <th align="center">Action</th> </tr> <?php $counter = 1; while($row = mysqli_fetch_array($result)) { ?> <tr> <form action ="update.php" method = "post"> <td align = "center"> <?php echo $counter;?></td> <!-- <td><input type = "text" name = "fname" readonly = "yes" value ="<?php echo $row["image"]; ?>" style = 'width:100%;'></td> !--> <td><input type = "text" name = "mname" value ="<?php echo $row["message"]; ?>" style = 'width:100%; '></td> <td><input type = "text" name = "lname" value ="<?php echo $row["other"]; ?>" style = 'width:100%;'></td> <input type = "hidden" name = "id" value = "<?php echo $row["id"]; ?>" style = 'width:100%;'> <td><input type="submit" value="Save"></td> </tr> <?php $counter++; ?> </form> <?php } ?> </table> <div align="center"> <br /> <?php $page_query = "SELECT * FROM medical_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='medical_update_book.php?page=1'>First</a>"; echo "<a href='medical_update_book.php?page=".($page - 1)."'><<</a>"; } for($i=$start_loop; $i<=$end_loop; $i++) { echo "<a href='medical_update_book.php?page=".$i."'>".$i."</a>"; } if($page <= $end_loop) { echo "<a href='medical_update_book.php?page=".($page + 1)."'>>></a>"; echo "<a href='medical_update_book.php?page=".$total_pages."'>Last</a>"; } echo "</div>"; ?> </div> </div> </div> </div> <div id="footer" > <p>©2017 DECOHAS</p> </div> </div> </body> </html>
💾 Save
❌ Cancel