ClaveAudio_Web/admin/edito/comentarios_edit.php

106 lines
3.6 KiB
PHP
Raw Normal View History

<?php
session_start();
include('../db.php');
if (!session_is_registered("clave_audio")) {
include("../login.php");
if (!$continuar) exit;
}
?>
<html>
<head>
<title>comentarios</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'];
$id = $_REQUEST['id'];
} else {
$operacion = "add";
}
?>
<?php
switch($operacion)
{
case "add";
$comentario_articulo_id = "";
$comentario_autor_id = "";
$comentario_autor_name = "";
$comentario_texto = "";
$comentario_fecha = "";
break;
case "edit";
$conn = db_connect();
if($conn) {
$query = "SELECT comentario_articulo_id, comentario_articulo_id, comentario_autor_id, comentario_autor_name, comentario_texto, comentario_fecha FROM edito_comentarios WHERE comentario_articulo_id = " . $id;
$result = mysql_query($query, $conn);
if (mysql_num_rows($result)) {
$row = mysql_fetch_array($result);
$comentario_articulo_id = $row['comentario_articulo_id'];
$comentario_autor_id = $row['comentario_autor_id'];
$comentario_autor_name = $row['comentario_autor_name'];
$comentario_texto = $row['comentario_texto'];
$comentario_fecha = $row['comentario_fecha'];
} else {
$comentario_articulo_id = "";
$comentario_autor_id = "";
$comentario_autor_name = "";
$comentario_texto = "";
$comentario_fecha = "";
}
}
break;
}
?>
<form method="post" action="comentarios_db.php" name="formulario">
<input name="op" type="hidden" value="<?php echo $operacion; ?>">
<input name="id" type="hidden" value="<?php echo $id; ?>">
<table border="0" cellspacing="0" cellpadding="0">
<tr><td width="200" class= "lbl">Comentario Articulo Id</td></tr>
<tr><td width="" class="data"><input name="comentario_articulo_id" type="text" size="10" maxlength="10" value="<?php echo $comentario_articulo_id; ?>"></td></tr>
<tr><td><img src="_imgs/d.gif" width="100" height="10"></td></tr>
<tr><td width="200" class= "lbl">Comentario Autor Id</td></tr>
<tr><td width="" class="data"><input name="comentario_autor_id" type="text" size="10" maxlength="10" value="<?php echo $comentario_autor_id; ?>"></td></tr>
<tr><td><img src="_imgs/d.gif" width="100" height="10"></td></tr>
<tr><td width="200" class= "lbl">Comentario Autor Name</td></tr>
<tr><td width="" class="data"><input name="comentario_autor_name" type="text" size="100" maxlength="100" value="<?php echo $comentario_autor_name; ?>"></td></tr>
<tr><td><img src="_imgs/d.gif" width="100" height="10"></td></tr>
<tr><td width="200" class= "lbl">Comentario Texto</td></tr>
<tr><td width="" class="data"><input name="comentario_texto" type="text" size="80" maxlength="" value="<?php echo $comentario_texto; ?>"></td></tr>
<tr><td><img src="_imgs/d.gif" width="100" height="10"></td></tr>
<tr><td width="200" class= "lbl">Comentario Fecha</td></tr>
<tr><td width="" class="data"><input name="comentario_fecha" type="text" size="10" maxlength="10" value="<?php echo $comentario_fecha; ?>"></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>
<a href="javascript:history.go(-1)" class="button">[ back ]</a>&nbsp;&nbsp;
<a href="javascript:doSubmit();" class="button">[ <?php echo $operacion; ?> ]</a>
</td>
</tr>
</table>
</form>
</body>
</html>