Commit:    28133e665c41194166ecb9c165d9b81245cb4839
Author:    Hannes Magnusson <[email protected]>         Thu, 26 Dec 2013 
22:28:48 -0800
Parents:   ce29f818f858a2fbb527f9509bb9ebe2050b6e1b
Branches:  master

Link:       
http://git.php.net/?p=web/master.git;a=commitdiff;h=28133e665c41194166ecb9c165d9b81245cb4839

Log:
Use only one table for listing users.. and remove inline styles

Changed paths:
  M  include/functions.inc
  M  manage/users.php


Diff:
diff --git a/include/functions.inc b/include/functions.inc
index b5000e3..947f19b 100644
--- a/include/functions.inc
+++ b/include/functions.inc
@@ -152,11 +152,13 @@ function array_to_url($array,$overlay=0) {
   return substr($out,5); # skip first &amp;
 }
 
-function show_prev_next($begin, $rows, $skip, $total, $extra = array())
+function show_prev_next($begin, $rows, $skip, $total, $extra = array(), $table 
= true)
 {?>
+<?php if ($table): ?>
 <table border="0" cellspacing="1" width="100%">
+<?php endif ?>
  <tr bgcolor="#eeeeee">
-  <td align="left" width="33%">
+  <td align="left">
    <?php 
      if ($begin > 0) {
        printf("<a href=\"%s?%s\">&laquo; Previous %d",
@@ -167,10 +169,14 @@ function show_prev_next($begin, $rows, $skip, $total, 
$extra = array())
    ?>
    &nbsp;
   </td>
-  <td align="center" width="33%">
+<?php if($table): ?>
+  <td align="center">
+<?php else: ?>
+  <td align="center" colspan="2">
+<?php endif; ?>
    <?php echo "Displaying ",$begin+1,"-",$begin+$rows," of $total";?>
   </td>
-  <td align="right" width="33%">
+  <td align="right">
    &nbsp;
    <?php 
      if ($begin+$rows < $total) {
@@ -182,7 +188,9 @@ function show_prev_next($begin, $rows, $skip, $total, 
$extra = array())
    ?>
   </td>
  </tr>
+<?php if ($table): ?>
 </table>
+<?php endif ?>
 <?php
 }
 
diff --git a/manage/users.php b/manage/users.php
index 9841e73..e6d94b1 100644
--- a/manage/users.php
+++ b/manage/users.php
@@ -430,9 +430,12 @@ $extra = array(
   "searchnotes" => (int)$searchnotes,
 );
 
-show_prev_next($begin,mysql_num_rows($res),$max,$total,$extra);
 ?>
-<table border="0" cellspacing="1" width="100%">
+<table>
+<thead>
+<?php show_prev_next($begin,mysql_num_rows($res),$max,$total,$extra, false); ?>
+</thead>
+<tbody>
 <tr bgcolor="#aaaaaa">
  <th><a href="<?php echo PHP_SELF,'?',array_to_url($extra,array("full" => 
$full ? 0 : 1));?>"><?php echo $full ? "&otimes;" : "&oplus;";?></a></th>
  <th><a href="<?php echo 
PHP_SELF,'?',array_to_url($extra,array("order"=>"name"));?>">name</a></th>
@@ -459,8 +462,11 @@ while ($row = mysql_fetch_array($res)) {
   $color = substr($color,2,2) == 'dd' ? '#eeeeee' : '#dddddd';
 }
 ?>
+</tbody>
+<tfooter>
+<?php show_prev_next($begin,mysql_num_rows($res),$max,$total,$extra, false); ?>
+</tfooter>
 </table>
-<?php show_prev_next($begin,mysql_num_rows($res),$max,$total,$extra); ?>
 <p><a href="<?php echo PHP_SELF;?>?id=0">add a new user</a></p>
 <?php
 foot();


--
PHP Webmaster List Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to