<?php[url=http://www.arg-2011.com.ar/admin.gif][/url]
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
if (PHP_VERSION < 6) {
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
}
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}
mysql_select_db($database_cnx, $cnx);
$query_Recordset1 = "SELECT * FROM tablamodelo ORDER BY id DESC";
$Recordset1 = mysql_query($query_Recordset1, $cnx) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 = mysql_num_rows($Recordset1);
$currentPage = $_SERVER["PHP_SELF"];
$maxRows_Recordset1 = 10;
$pageNum_Recordset1 = 0;
if (isset($_GET['pageNum_Recordset1'])) {
$pageNum_Recordset1 = $_GET['pageNum_Recordset1'];
}
$startRow_Recordset1 = $pageNum_Recordset1 * $maxRows_Recordset1;
mysql_select_db($database_cnx, $cnx);
$query_Recordset1 = "SELECT * FROM tablamodelo ORDER BY id ASC";
$query_limit_Recordset1 = sprintf("%s LIMIT %d, %d", $query_Recordset1, $startRow_Recordset1, $maxRows_Recordset1);
$Recordset1 = mysql_query($query_limit_Recordset1, $cnx) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
if (isset($_GET['totalRows_Recordset1'])) {
$totalRows_Recordset1 = $_GET['totalRows_Recordset1'];
} else {
$all_Recordset1 = mysql_query($query_Recordset1);
$totalRows_Recordset1 = mysql_num_rows($all_Recordset1);
}
$startRow_Recordset1 = $pageNum_Recordset1 * $maxRows_Recordset1;
$queryString_Recordset1 = "";
if (!empty($_SERVER['QUERY_STRING'])) {
$params = explode("&", $_SERVER['QUERY_STRING']);
$newParams = array();
foreach ($params as $param) {
if (stristr($param, "pageNum_Recordset1") == false &&
stristr($param, "totalRows_Recordset1") == false) {
array_push($newParams, $param);
}
}
if (count($newParams) != 0) {
$queryString_Recordset1 = "&" . htmlentities(implode("&", $newParams));
}
}
$queryString_Recordset1 = sprintf("&totalRows_Recordset1=%d%s", $totalRows_Recordset1, $queryString_Recordset1);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Documento sin título</title>
</head>
<body>
<h1>Administrador</h1>
<table width="475" height="119" border="1">
<tr>
<td width="148" align="center" bgcolor="#0099FF">titulo</td>
<td width="121" align="center" bgcolor="#0099FF">fotos</td>
<td width="81" align="center" bgcolor="#0099FF">descripcion</td>
<td width="97" align="center" bgcolor="#0099FF">modificar</td>
<td width="97" align="center" bgcolor="#0099FF">borrar</td>
</tr>
<?php do { ?>
<tr>
<td align="center" bgcolor="#009900"><?php echo $row_Recordset1['titulo']; ?></td>
<td ><img src="<?php echo $row_Recordset1['fotos']; ?>" alt="fotos" name="fotos" width="100" height="100" id="fotos" /></td>
<td bgcolor="#009900"><form id="form1" name="form1" method="post" action="">
<textarea name="descripcion" id="descripcion" cols="35" rows="5"><?php echo $row_Recordset1['descripcion']; ?></textarea>
</form></td>
<td bgcolor="#009900"><a href="modificar.php?id=<?php echo $row_Recordset1['id']; ?>">modificar</a></td>
<td bgcolor="#009900"><a onclick="return confirm('¿estas seguro de borrar?')" href="imagenes/borrar_con_foto.php?id=<?php echo $row_Recordset1['id']; ?>">borrar</a></td>
</tr>
<?php } while ($row_Recordset1 = mysql_fetch_assoc($Recordset1)); ?>
</table>
<p> </p>
</body>
</html>
<?php
mysql_free_result($Recordset1);
?>

