<?php
session_start();

if (!session_is_registered("clave_audio")) {
	include("../login.php");
	if (!$continuar) exit;
}

$arrTipos = array( '0' => 'En reserva',
					'50' => 'Home Parte superior',
					'348' => 'Home 2 M&oacute;dulos',
					'145' => 'Home 1 M&oacute;dulo',
					'168' => 'Vertical', 
					'528' => 'Tienda');
					
include('../db.php');
?>

<!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>banners</title>
<link href="../sformi.css" rel="stylesheet" type="text/css">
</head>
<body>
<!-- CONTENT -->
	<table border="0" cellspacing="0" cellpadding="0">
		<tr><td><a href="banners_edit.php?op=add" class="button">[ a&ntilde;adir un nuevo banner ]</a></td></tr>
		<tr><td><img src="../_imgs/d.gif" width="200" height="5"></td>
		</tr>
	</table>

<table border="0" cellspacing="0" cellpadding="0">
<?php
	$conn = db_connect();
	if($conn) {
		$query = "SELECT banner_id, banner_texto, banner_url, banner_inserts, banner_file, banner_tipo FROM bania_banners ORDER BY banner_id";
		$result = mysql_query($query, $conn);
		$num_results = mysql_num_rows($result);
?>
	<tr>
		<td width="144" valign="top" class="hdr">T&iacute;tulo</td>
		<td width="173" valign="top" class="hdr">URL</td><td width="43" valign="top" class="hdr">Visto</td><td width="154" valign="top" class="hdr">Archivo</td><td width="39" valign="top" class="hdr">Tipo</td>
		<td width="56"></td>
	</tr>
<?php
	for ($i=0; $i <$num_results; $i++)
	{
		$row = mysql_fetch_array($result);
		$banner_id = $row['banner_id'];
		$banner_texto = $row['banner_texto'];
		$banner_url = $row['banner_url'];
		$banner_inserts = $row['banner_inserts'];
		$banner_file = $row['banner_file'];
		$banner_tipo = $row['banner_tipo'];
?>
	<tr>
		<td width="144" valign="top" class="data"><?= $banner_texto; ?></td>
        <td width="173" valign="top" class="data"><?= $banner_url; ?></td>
        <td width="43" valign="top" class="data"><?= $banner_inserts; ?></td>
        <td width="154" valign="top" class="data"><?= $banner_file; ?></td>
        <td width="180" valign="top" class="data"><?= $arrTipos[$banner_tipo]; ?></td>
		<td valign="top" class="data">&nbsp;<a href="banners_edit.php?op=edit&id=<?= $banner_id; ?>" class="button">[ editar ]</a></td>
	</tr>
	<tr>
		<td bgcolor="#DBDEE6" colspan="6"><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>
