ClaveAudio_Web/admin/shoop/marcas_edit.php

103 lines
3.3 KiB
PHP
Raw Normal View History

<?php
session_start();
if (!session_is_registered("clave_audio")) {
include("../login.php");
if (!$continuar) exit;
}
include('../db.php');
?>
<html>
<head>
<title>marcas</title>
<link href="../sformi.css" rel="stylesheet" type="text/css">
<script language="JavaScript" type="text/JavaScript">
function doSubmit() {
document.formulario.submit();
}
</script>
</head>
<body>
<?php
/*
if (!session_is_registered("sintogeo")) {
include("../login.php");
if (!$continuar) exit;
}
*/
if(isset($_REQUEST['op'])) {
$operacion = $_REQUEST['op'];
} else {
$operacion = "edit";
}
?>
<?php
$id = $_REQUEST['id'];
$fab_nombre = "";
$fab_url = "";
$fab_descripcion = "";
switch($operacion)
{
case "add";
break;
case "edit";
$conn = db_connect();
if($conn) {
$query = 'SELECT fab_nombre, fab_url, fab_descripcion FROM shoop_fabricantes WHERE fab_id = ' . $id;
$result = mysql_query($query, $conn);
if (mysql_num_rows($result)) {
$row = mysql_fetch_array($result);
$fab_nombre = $row['fab_nombre'];
$fab_url = $row['fab_url'];
$fab_descripcion = $row['fab_descripcion'];
}
}
break;
}
?>
<form method="post" action="marcas_db.php" name="formulario" enctype="multipart/form-data">
<input name="op" type="hidden" value="<?= $operacion; ?>">
<input name="id" type="hidden" value="<?= $id; ?>">
<table border="0" cellspacing="0" cellpadding="0">
<tr><td class= "lbl">Marca</td></tr>
<tr><td width="400"><input name="fab_nombre" type="text" size="32" maxlength="32" value="<?= $fab_nombre; ?>" class="data"></td></tr>
<tr><td><img src="../_imgs/d.gif" width="100" height="3"></td></tr>
<tr><td class= "lbl">Enlace</td></tr>
<tr><td width="400"><input name="fab_url" type="text" size="82" maxlength="255" value="<?= $fab_url; ?>" class="data"></td></tr>
<tr><td><img src="../_imgs/d.gif" width="100" height="3"></td></tr>
<tr><td class= "lbl">Descripci&oacute;n</td></tr>
<tr><td width="400"><textarea name="fab_descripcion" cols="80" rows="2" class="data"><?= $fab_descripcion; ?></textarea></td></tr>
<tr><td><img src="../_imgs/d.gif" width="100" height="6"></td></tr>
<tr><td class= "lbl">Logotipo</td></tr>
<tr><td>
<?php if(file_exists('../../_logos/c/' . $id . '.gif')) { ?>
<table width="81" border="1" cellspacing="0" cellpadding="2" style="border-style:solid; border-color:#444444; border:1px;">
<tr><td align="center"><img src="../../_logos/c/<?= $id; ?>.gif"></td></tr></table>
<?php } else { ?>
<p class="data">La imagen tiene que estar en formato .gif y medir 81x38px.</p>
<?php } ?>
</td></tr>
<tr><td><img src="../_imgs/d.gif" width="100" height="3"></td></tr>
<tr><td><input name="marca_imagen" type="file" style="width:450px" class="data"></td></tr>
<tr><td><img src="../_imgs/d.gif" width="100" height="10"></td></tr>
</table>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="300">
<a href="javascript:history.go(-1)" class="button">[ cancelar ]</a>&nbsp;&nbsp;
<a href="javascript:doSubmit();" class="button">[ Ok ]</a>
</td>
<td>
<a href="marcas_db.php?op=del&id=<?= $id; ?>" onClick="return confirm('Est&aacute;s seguro de querer borrar esta marca?')" class="button">[ borrar ]</a></td>
</tr>
</table>
</form>
</body>
</html>