|
Server : Apache/2.4.62 System : FreeBSD fbsdweb2.web.rcn.net 14.1-RELEASE FreeBSD 14.1-RELEASE releng/14.1-n267679-10e31f0946d8 GENERIC amd64 User : www ( 80) PHP Version : 8.3.8 Disable Function : NONE Directory : /domains/logicswapweb/aplicaciones/admon/noticias/tb_noticias/ |
Upload File : |
<?
include("../../generales/config_panel.php");
include("../../generales/config_permisos.php");
include("../../generales/operabd.php");
include("met_noticias.php");
include("../tb_noticiaimagenes/met_noticiaimagenes.php");
$num_paginas = numpaginas($numlineas);
if(!isset($pagina)) $pagina=1;
if(!isset($campo)) $campo='noticia_id ';
if(!isset($orden)) $orden=' desc';
else
if($orden=='desc') $orden='asc';
else $orden='desc';
?>
<?
//elimina la noticia de la base de datos
if(isset($accion))
if ($accion!=0){
$resultado=eli_noticia($accion);
if($resultado){
$resultado=eli_noticiaimgs($accion);
if($resultado){
echo "<script> alert ('La noticia ha sido eliminada');</script>";
$url='noticias.php';
echo "<script> window.location.href='$url';</script>";
}
}
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Administra noticias</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="../../css/panel2.css" rel="stylesheet" type="text/css">
<link href="../../css/panel2Contenido.css" rel="stylesheet" type="text/css">
<link href="../../css/scrollbar2.css" rel="stylesheet" type="text/css">
<script src="js/SortTable.js"></script>
</head>
<body>
<table align="left" width="610" border="0" cellpadding="0" cellspacing="1" >
<tr valign="top" bgcolor="#FFFFFF">
<td width="100%" height="20" bgcolor="#CCCCCC" class="migasactivo">
<a id="iniMenu" class="migas" href="../menu.php" style="cursor:hand; " onMouseOver="javascript: mgOver(this);" onMouseOut="javascript: mgOut(this);" title="Indice de Aplicaciones">Beginning</a>
<span class="migas">/</span>
<a id="op1Menu" class="migas" href="../menu.php" style="cursor:hand; " onMouseover="javascript: mgOver(this);" onMouseOut="javascript: mgOut(this);;" title="Men� de Noticias">Menu</a>
<span class="migas">/</span> Noticias
</td>
</tr>
<tr>
<td height="30" colspan="4"><? btn_aplnoticias($apl_permisos);?></td>
</tr>
<tr>
<td colspan="4"><div class="texto1">Seleccione la noticia para: insertar imagen, modificar, eliminar o visualizar </div></td>
</tr>
<form name="form1" action="<?=$PHP_SELF?>" method="post" id="form1">
<tr>
<td >
<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
<tr align="center" class="filatitulo">
<td width="2%" bgcolor="#000099"><div align="left" class="nombreColum"><b><a onClick="javascript: document.location.href= '../menu.php'" title="Volver" style="cursor:hand; width:40"><img src="../../img/atras.gif" style="cursor:hand "></a></b></div></td>
<td width="50%" bgcolor="#000099" class="titular1" ><a class="titular1" href="javascript: document.location.href= 'noticias.php?orden=<? echo $orden ?>&campo=<? echo 'noticia_titulo' ?>'" title="Ordenar por T�tulo">T�tulo</a></td>
<td width="50%" bgcolor="#000099" class="titular1" ><a class="titular1" href="javascript: document.location.href= 'noticias.php?orden=<? echo $orden ?>&campo=<? echo 'tema' ?>'" title="Ordenar por T�tulo">Tema</a></td>
<td width="20%" bgcolor="#000099" class="titular1">Seleccionar</td>
</tr class='texto1'>
<?
listar_noticias($pagina, $numlineas, $campo.' ' .$orden);
?>
<input name="accion" type="hidden" id="accion" value="0">
<tr align="center" class="filatitulo">
<td width="2%" bgcolor="#000099"><div align="left" class="nombreColum"><b></b></div></td>
<td width="50%" bgcolor="#000099"> </td>
<td width="20%" bgcolor="#000099"> </td>
<td width="28%" bgcolor="#000099"> </td>
</tr>
</table>
</td>
</tr>
</form>
<tr>
<td height="25" align="left" valign="bottom" >
<?
btn_opernoticias($arrpermisos);
?>
</td>
</tr>
<?
if ($num_paginas>1){
?>
<tr>
<td colspan="4" align="center">
<div><form name="form2"><p class="normal">
<img src="../../img/iconosAndres/inicio1.gif" width="20" height="20" title="Inicio" onClick="window.location.href = 'noticias.php?pagina=1'" <? if($pagina==1) echo " disabled";?>>
<img src="../../img/iconosAndres/atras1.gif" width="20" height="20" title="Atras" onClick="window.location.href = 'noticias.php?pagina=<? echo $pagina-1;?>'" <? if($pagina==1) echo " disabled";?>> pg
<input type="text" class="listado" name="pagina" size="3" maxlength="4" style="text-align:center " value="<? echo $pagina;?>" onKeyPress="return acceptNum(event, <? echo $num_paginas;?> );" <? if($num_paginas == 0) echo "disabled";?>>
<font class="texto1">de <? echo $num_paginas;?></font>
<img src="../../img/iconosAndres/adelante1.gif" width="20" height="20" title="Siguiente" onClick="window.location.href = 'noticias.php?pagina=<? echo $pagina+1;?>'" <? if($pagina==$num_paginas || $num_paginas==1) echo " disabled";?>>
<img src="../../img/iconosAndres/ultimo1.gif" width="20" height="20" title="Ultimo" onClick="window.location.href = 'noticias.php?pagina=<? echo $num_paginas;?>'" <? if($pagina==$num_paginas || $num_paginas==1) echo " disabled";?>>
</p>
</form></div>
</td>
</tr>
<?
}//fin de if ($num_paginas>1)
?>
<tr>
<td colspan="4" align="center"> </td>
</tr>
</table>
</body>
<script src="../../generales/genjavascript.js" language="javascript"></script>
<script src="../../generales/SortTable.js" language="javascript"></script>
<script>
function acceptNum(evt, num_pag){
// NOTE: Backspace = 8, Enter = 13, '0' = 48, '9' = 57
var nav4 = window.Event ? true : false;
var key = nav4 ? evt.which : evt.keyCode;
if(key==13) //Enter
{
if(document.form2.pagina.value > num_pag || document.form2.pagina.value=="" || document.form2.pagina.value <= 0){
alert("El n�mero de p�gina no es v�lido");
document.form2.pagina.focus();
return false;
}
window.location.href = '';
}
return (key <= 13 || (key >= 48 && key <= 57));
}
function llama_pagina(opcion){
if(opcion==6) window.location.href='bsq_noticias.php';
if(opcion==1) window.location.href='adi_noticias.php';
if(opcion==2 || opcion==3 || opcion==4 || opcion==5){
notid=getRadioValue();
if(notid==null) alert('Debe seleccionar una noticia');
else{
if(opcion==2) window.location.href='../tb_noticiaimagenes/adi_noticiaimgs.php?noticia_id='+notid;
else if(opcion==3) window.location.href='mod_noticias.php?noticia_id='+notid;
else if(opcion==4) window.location.href='eli_noticias.php?noticia_id='+notid;
else if(opcion==5){
nombre='../../../../noticias.php?seleccion='+notid;
//propiedades='height=600, width=800, align="center", valign="middle"';
window.open(nombre, 'imagen','' );
}
}
}
}
function valseleccion2(radioObject){
var valor = getRadioValue();
if(valor == null){
alert("Debe Seleccionar la noticia a eliminar");
return false;
}
else
if(confirm("Se perderan todos los datos de la noticia, �Desea continuar?")){
document.form1.accion.value = valor;
document.form1.submit();
}
else
return false;
}
function getRadioValue() {
var value = null;
var objeto = document.form1.seleccion;
if(objeto.length > 1){
if (objeto == null) return null;
for (var i=0; i < objeto.length; i++) {
if (objeto[i].checked) {
value = objeto[i].value;
break;
}
}
}else{
value=document.form1.seleccion.value;
}
return value;
}
</script>
</html>