ClaveAudio_Web/admin/shoop/categorias.php
2011-05-06 11:33:27 +00:00

97 lines
3.0 KiB
PHP

<?php
session_start();
if (!session_is_registered("clave_audio")) {
include("../login.php");
if (!$continuar) exit;
}
include('../db.php');
if(isset($_REQUEST['op'])) {
$op = $_REQUEST['op'];
} else {
$op = "list";
}
// this code is for the "paginator"
$start = (isset($$_REQUEST['start']) ? $$_REQUEST['start'] : 0);
$limit = 25;
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>categorias</title>
<link href="../sformi.css" rel="stylesheet" type="text/css">
</head>
<body>
<!-- CONTENT -->
<?php
if(0){
?>
<table border="0" cellspacing="0" cellpadding="0">
<tr><td><a href="secciones_edit.php?op=add" class="button">[ a&ntilde;adir una nueva secci&oacute;n ]</a></td></tr>
<tr><td><img src="../_imgs/d.gif" width="200" height="5"></td></tr>
</table>
<?php
}
?>
<table border="0" cellspacing="0" cellpadding="0">
<?php
// include("../login.php");
// if (!$continuar) exit;
$conn = db_connect();
if($conn) {
$query = "SELECT seccion_code, seccion_nombre, cat_nombre, cat_codigo FROM shoop_secciones, shoop_categorias WHERE cat_seccion=seccion_code ORDER BY seccion_orden, cat_orden";
$result = mysql_query($query, $conn);
$num_results = mysql_num_rows($result);
?>
<tr>
<td width="30" valign="top" class="hdr">&nbsp;</td>
<td width="50" valign="top" class="hdr">C&oacute;digo</td>
<td width="500" valign="top" class="hdr">Categor&iacute;a</td>
<td width="70" class="hdr">&nbsp;</td>
</tr>
<?php
$curSeccion='';
for ($i=0; $i <$num_results; $i++)
{
$row = mysql_fetch_array($result);
$seccion_code = $row['seccion_code'];
$seccion_nombre = $row['seccion_nombre'];
if($seccion_nombre != $curSeccion){
$curSeccion = $seccion_nombre;
?>
<tr>
<td colspan="4" valign="top" class="data"><b><?php echo $seccion_nombre; ?></b>&nbsp;(<?php echo $seccion_code; ?>)&nbsp;&nbsp;<a href="categorias_edit.php?op=add&seccion=<?php echo $seccion_code; ?>" class="button">[
a&ntilde;adir una categor&iacute;a]</a><img src="../_imgs/d.gif" width="15" height="20"></td>
</tr>
<?php
}
$cat_nombre = $row['cat_nombre'];
$cat_descripcion = $row['cat_descripcion'];
$cat_codigo = $row['cat_codigo'];
?>
<tr>
<td width="30" valign="top" class="data"></td>
<td width="50" valign="top" class="data"><?php echo $cat_codigo; ?></td>
<td width="500" valign="top" class="data"><?php echo $cat_nombre; ?><br><?php echo $cat_descripcion; ?></td>
<td valign="top" class="data"><a href="categorias_edit.php?op=edit&cat=<?php echo $cat_codigo; ?>&seccion=<?php echo $seccion_code; ?>" class="button">[ editar ]</a></td>
</tr>
<tr>
<td bgcolor="#DBDEE6" colspan=4><img src="../_imgs/d.gif" width="5" height="1"></td>
</tr>
<?php
} // FOR
} else { // IF CONN
echo '<p>An error has occurred while accessing the database: ' . mysql_error();
}
?>
</table>
<!-- END OF CONTENT -->
</body>
</html>