?
Current Path : /home1/savoy/www/savoysadmin/ |
Linux gator3171.hostgator.com 4.19.286-203.ELK.el7.x86_64 #1 SMP Wed Jun 14 04:33:55 CDT 2023 x86_64 |
Current File : /home1/savoy/www/savoysadmin/contact_reg.php |
<?php include_once 'auth.php'; $path_to_root = $_SESSION['path_to_root']; include '../db.php'; $page_name="contact_reg.php"; $start=$_GET['start']; // To take care global variable if OFF if(!($start > 0)) { // This variable is set to zero for the first page $start = 0; } $eu = ($start -0); $limit = 8; // No of records to be shown per page. $this1 = $eu + $limit; $back = $eu - $limit; $next = $eu + $limit; include_once 'header.php'; ?> <div id="c-col"> <?php $order1="datetime"; $query0 = "SELECT * FROM contactus order by $order1 DESC"; $result0 = mysql_query($query0) or Die("Query not found"); $nume0=mysql_num_rows($result0); echo "<br><table align='center' border='1' class='heading' cellpadding='0' cellspacing='0'>"; echo "<tr><th align='center'>Sl No</th><th align='center'>Name</th><th align='center'>Email</th><th align='center'>Contact No</th> <th align='center'>Subject</th><th align='center'>Message</th><th align='center'>Date</th></tr>"; ?> <?php $count=0;$count1=0; $query3=" SELECT * FROM contactus order by $order1 DESC limit $eu, $limit "; $result3=mysql_query($query3); while($row3 = mysql_fetch_array($result3)) { extract($row3); ?> <tr> <?php print "<td>" . ++$x . "</td>"; print "<td>" . $row3['name'] . "</td>"; print "<td>" . $row3['email'] . "</td>"; print "<td>" . $row3['contactno'] . "</td>"; print "<td>" . $row3['subject'] . "</td>"; print "<td>" . $row3['comments'] . "</td>"; print "<td>" . $row3['datetime'] . "</td>"; ?> </tr> <?php } echo "</table>"; ///// Variables set for advance paging/////////// $p_limit=8; // This should be more than $limit and set to a value for whick links to be breaked $p_f=$_GET['p_f']; // To take care global variable if OFF if(!($p_f > 0)) { // This variable is set to zero for the first page $p_f = 0; } $p_fwd=$p_f+$p_limit; $p_back=$p_f-$p_limit; //////////// End of variables for advance paging /////////////// /////////////// Start the buttom links with Prev and next link with page numbers ///////////////// echo "<table align = 'center' width='50%'><tr>"; if($p_f<>0) { print "<a href='$page_name?start=$p_back&p_f=$p_back'><font face='Verdana' size='1'>Prev</font></a>"; } echo "<td align='left' width='10%'>"; //// if our variable $back is equal to 0 or more then only we will display the link to move back //////// if($back >=0 and ($back >=$p_f)) { print "<a href='$page_name?start=$back&p_f=$p_f'><font face='Verdana' size='1'>Prev</font></a>"; } //////////////// Let us display the page links at center. We will not display the current page as a link /////////// echo "</td><td align=center width='0%'>"; echo "</td><td align='right' width='5%'>"; ///////////// If we are not in the last page then Next link will be displayed. Here we check that ///// if($this1 < $nume0 and $this1 <($p_f+$p_limit)) { print "<a href='$page_name?start=$next&p_f=$p_f'><font face='Verdana' size='1'>Next</font></a>";} echo "</td>"; if($p_fwd < $nume0) { print "<a href='$page_name?start=$p_fwd&p_f=$p_fwd'><font face='Verdana' size='1'>Next</font></a>"; } echo "</tr></table>"; ?> <a href="logout.php">Logout</a> </div> <div id="lh-col"><br /> </div> <div id="rh-col"><br /> </div> </body> </html>