Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <title>VIEW LETTER RECORDS</title>
- </head>
- <script type="text/javascript">
- var checked=false;
- var frmname='';
- function checkedAll(frmname){
- var valus=document.getElementById(frmname);
- checked = (checked==false);
- for(var i=0; i<valus.elements.length; i++)
- {
- valus.elements[i].checked=checked;
- }
- }
- </script>
- <?php
- $conn = mysql_connect("localhost","root","") or die('Couldn\'t Connect To Server<br>Reason: ' . mysql_error());
- mysql_select_db("pmo") or die('Couldn\'t Select Database<br>Reason: ' . mysql_error( $conn ));
- $per_page=10;
- $total_results = mysql_num_rows($result);
- $total_pages = ceil($total_results / $per_page);
- if (isset($_GET['page']) && is_numeric($_GET['page'])){
- $show_page = (int)$_GET['page'];
- } else {
- $show_page = 1;
- }
- if ($show_page > 1 && $show_page <= $total_pages){
- $start = ($show_page -1) * $per_page;
- $end = $start + $per_page;
- }else{
- $start = 0;
- $end = $per_page;
- }
- $result=mysql_query("SELECT * FROM letter LIMIT {$start},{$end}")or die( mysql_error( $conn ));
- echo "<p><b>View Page:</b> ";
- for ($i = 1; $i <= $total_pages; $i++){
- echo "<a href='paginated.php?page=$i'>$i</a> ";
- }
- echo "</p>";
- echo "<br>";
- echo "<p><b>VIEW ALL LETTER DETAILS</b>";
- echo "<table border='3' cellpadding='5'>";
- echo "<tr> <th><input type='checkbox' name='checkall' onclick=' checkedAll(\"cbexample\");' ></th> <th>BIL</th> <th>SUBJECT</th> <th>DATE IN</th> <th>DATE OUT</th> <th>REFERENCE</th> <th>REMARKS</th> <th>FORMAT</th> <th>UPLOADER</th> <th></th> <th></th> </tr>";
- $resultColumns = Array('bil','subject','dateIn','dateOut','reference','remarks','format','uploader');
- while($row = mysql_fetch_assoc($result) ){
- echo '<tr>';
- echo '<form id="cbexample">';
- // These need to be renamed to be usefull.
- echo '<td><center><input type="checkbox" name="check1"></center>';
- echo '<center><input type="checkbox" name="check2"></center>';
- foreach($resultColumns as $col){
- echo '<td>' . $row[$col] . '</td>';
- }
- echo '<td><a href="edit2.php?bil=' . $row['bil'] . '">Edit</a></td>';
- echo '<td><a href="delete1.php?bil=' . $row['bil'] . '">Delete</a></td>';
- echo "</tr>";
- }
- echo "</table>";
- ?>
- <div align="bottom"><form method="link" action="suratFile.html"><input type="submit" value="CANCEL"></form></div>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement