git-svn-id: https://192.168.0.254/svn/Proyectos.ClaveAudio_Web/trunk@2 44ade383-bb54-5b4f-835b-923f7702b206
75 lines
2.9 KiB
PHP
75 lines
2.9 KiB
PHP
<?php
|
|
session_start();
|
|
include('../db.php');
|
|
|
|
if (!session_is_registered("clave_audio")) {
|
|
include("../login.php");
|
|
if (!$continuar) exit;
|
|
}
|
|
|
|
//cleanData();
|
|
|
|
if(isset($_REQUEST['op'])){
|
|
$operacion = $_REQUEST['op'];
|
|
|
|
// here I read the variables passed by the calling page.
|
|
|
|
if (!get_magic_quotes_gpc()) {
|
|
$articulo_id = addslashes($_REQUEST['articulo_id']);
|
|
$articulo_tipo = addslashes($_REQUEST['articulo_tipo']);
|
|
$articulo_padre = addslashes($_REQUEST['articulo_padre']);
|
|
$articulo_seccion = addslashes($_REQUEST['articulo_seccion']);
|
|
$articulo_titular = addslashes($_REQUEST['articulo_titular']);
|
|
$articulo_entradilla= addslashes($_REQUEST['articulo_entradilla']);
|
|
$articulo_texto = addslashes($_REQUEST['articulo_texto']);
|
|
$articulo_enlace = addslashes($_REQUEST['articulo_enlace']);
|
|
$articulo_fecha_pub = addslashes($_REQUEST['articulo_fecha_pub']);
|
|
$articulo_embargado = addslashes($_REQUEST['articulo_embargado']);
|
|
$articulo_views = addslashes($_REQUEST['articulo_views']);
|
|
$articulo_orden = addslashes($_REQUEST['articulo_orden']);
|
|
} else {
|
|
$articulo_id = $_REQUEST['articulo_id'];
|
|
$articulo_tipo = $_REQUEST['articulo_tipo'];
|
|
$articulo_padre = $_REQUEST['articulo_padre'];
|
|
$articulo_seccion = $_REQUEST['articulo_seccion'];
|
|
$articulo_titular = $_REQUEST['articulo_titular'];
|
|
$articulo_entradilla= $_REQUEST['articulo_entradilla'];
|
|
$articulo_texto = $_REQUEST['articulo_texto'];
|
|
$articulo_enlace = $_REQUEST['articulo_enlace'];
|
|
$articulo_fecha_pub = $_REQUEST['articulo_fecha_pub'];
|
|
$articulo_embargado = $_REQUEST['articulo_embargado'];
|
|
$articulo_views = $_REQUEST['articulo_views'];
|
|
$articulo_orden = $_REQUEST['articulo_orden'];
|
|
}
|
|
|
|
if(db_connect()) {
|
|
switch($operacion) {
|
|
case "add":
|
|
$sql = 'INSERT INTO edito_articulos(articulo_tipo, articulo_titular, articulo_entradilla, articulo_texto, articulo_enlace, articulo_fecha_pub, articulo_orden)
|
|
VALUES("' . $articulo_tipo . '", "' . $articulo_titular . '", "' . $articulo_entradilla . '", "' . $articulo_texto . '", "' . $articulo_enlace . '", NOW(), ' . ($articulo_orden ? $articulo_orden : 0) . ');';
|
|
break;
|
|
|
|
case "edit":
|
|
$sql = 'UPDATE edito_articulos SET
|
|
articulo_tipo="' . $articulo_tipo . '",
|
|
articulo_titular="' . $articulo_titular . '",
|
|
articulo_entradilla="' . $articulo_entradilla . '",
|
|
articulo_texto="' . $articulo_texto . '",
|
|
articulo_enlace="' . $articulo_enlace . '",
|
|
articulo_orden=' . ($articulo_orden ? $articulo_orden : 0) . '
|
|
WHERE articulo_id = ' . $_REQUEST['id'];
|
|
break;
|
|
|
|
case "del":
|
|
$sql = 'DELETE FROM edito_articulos WHERE articulo_id = ' . $_REQUEST['id'];
|
|
break;
|
|
|
|
default:
|
|
break;
|
|
}
|
|
$result = mysql_query($sql);
|
|
// or header('Location: ../error.php');
|
|
header('Location: articulos.php');
|
|
}
|
|
}
|
|
?>
|