First commit 31/12/2001
This commit is contained in:
25
common/config.inc.php
Normal file
25
common/config.inc.php
Normal file
@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
|
||||
# Appearance
|
||||
$bg_color = "#57A44D";
|
||||
$tbl_width = 600;
|
||||
$tbl_border = 1;
|
||||
$tbl_borderc = "#000000";
|
||||
|
||||
$tbl_bg = "#427B42";
|
||||
$tbl_rowscolor = "#488048";
|
||||
|
||||
#DataBase Control
|
||||
$limit = 20;
|
||||
|
||||
function MakeBox( $string )
|
||||
{
|
||||
global $tbl_border, $tbl_borderc, $tbl_width, $bg_color, $tbl_bg;
|
||||
|
||||
if ( !isset( $box_template ) )
|
||||
return "<div align=\"center\"><center><table border=\"$tbl_border\" cellpadding=\"0\" cellspacing=\"0\" width=\"$tbl_width\" bgcolor=\"$tbl_bg\" bordercolor=\"$tbl_borderc\" bordercolordark=\"$tbl_borderc\" bordercolorlight=\"$tbl_borderc\"><tr><td>$string</td></tr></table></center></div>";
|
||||
};
|
||||
|
||||
|
||||
?>
|
47
common/dbnav_bar.php
Normal file
47
common/dbnav_bar.php
Normal file
@ -0,0 +1,47 @@
|
||||
<?php
|
||||
|
||||
function CreateDBnav( $from )
|
||||
{
|
||||
global $limit,$offset,$conexion,$nav_buttons,$parse_options;
|
||||
|
||||
$qrows = "SELECT DISTINCT * FROM $from";
|
||||
$res = mysql_query( $qrows, $conexion ) or die("No puedo obtener el número de registros<br>".mysql_error($conexion));
|
||||
$numrows = mysql_num_rows( $res );
|
||||
|
||||
$nav_buttons = "<table border=\"0\" cellpadding=\"2\" cellspacing=\"0\" width=\"100%\"><tr><td width=\"100%\"><p style=\"text-align:right\">";
|
||||
if ( $offset > 1 )
|
||||
$nav_buttons .= "<a href=\"$PHP_SELF?offset=".($offset-$limit)."$parse_options\"><< Anterior</a> -";
|
||||
else
|
||||
$nav_buttons .= "<< Anterior -";
|
||||
if ( $numrows > 0 )
|
||||
{
|
||||
$pages = intval( $numrows/$limit );
|
||||
if ( $numrows%$limit ) $pages++;
|
||||
for ( $i=1;$i<=$pages;$i++)
|
||||
{
|
||||
$newoffset=$limit*($i-1);
|
||||
if ( $newoffset == $offset )
|
||||
$nav_buttons .= "[$i]-";
|
||||
else
|
||||
$nav_buttons .= "<a href=\"$PHP_SELF?offset=$newoffset$parse_options\">$i</a>-";
|
||||
}
|
||||
}
|
||||
$nav_buttons .= "</p></td><td><nobr>";
|
||||
if ( ($offset+$limit)<$numrows )
|
||||
$nav_buttons .= "<a href=\"$PHP_SELF?offset=".($offset+$limit)."$parse_options\">Siguiente >></a>";
|
||||
else
|
||||
$nav_buttons .= "Siguiente >>";
|
||||
$nav_buttons .= "</nobr></td></tr></table>";
|
||||
};
|
||||
|
||||
function ShowDBnav()
|
||||
{
|
||||
global $nav_buttons;
|
||||
echo $nav_buttons;
|
||||
};
|
||||
|
||||
function GetDBnav()
|
||||
{
|
||||
global $nav_buttons;
|
||||
return $nav_buttons;
|
||||
};
|
Reference in New Issue
Block a user