<?php
	session_start();

	include("auth.inc.php");
	include "conn.inc.php";

	if ($_POST["accion_news".$_POST["id_news"]] == "e") {
		$q_delete = "DELETE FROM noticias WHERE id='".$_POST["id_news"]."'";
		$r_delete = mysql_query($q_delete, $conn);

	} else {
		$q_update = "UPDATE noticias SET titulo='".$_POST["titulo".$_POST["id_news"]]."',
					 texto='".$_POST["texto".$_POST["id_news"]]."',
					 fecha_not='".date(Y."-".n."-".j)."',
	                 link='".$_POST["link".$_POST["id_news"]]."'
	                 WHERE id='".$_POST["id_news"]."'";
		$r_update = mysql_query($q_update, $conn);
	}

	header("Location: ../inicio.php");
?>