KGRKJGETMRETU895U-589TY5MIGM5JGB5SDFESFREWTGR54TY
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 :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /domains/logicswapweb/aplicaciones/admon/noticias/tb_noticias/mod_noticias.php
<?            
	 include("../../generales/config_panel.php");
	 include("../../generales/config_permisos.php");
	 include("../../generales/operabd.php");
	 include("../../generales/chequeaURL.php");
	include("met_noticias.php");
	include("../tb_noticiaimagenes/met_noticiaimagenes.php");
	
	include_once('./../../fnc/parametro.php');
	include_once('./../../fnc/vinculo.php');
	include_once('./../../fnc/UsuarioPanel.php');
	include_once('./../../fnc/bitacora.php');
	include_once('./../../fnc/aplicacion.php');
	include_once('./../../fnc/panel.php');
	include_once('./../../fnc/utileria.php');
	include_once('./../fnc/noticia.php');
	
	session_start('PanelAzulDigial');
	
	if(!session_is_registered("panel")){
		echo "<div style=\"	font-family: Verdana, Arial, Helvetica, sans-serif;	color: #0066CC;	font-size: 16px;font-weight: bolder;\">Usuario Invalido</div>";
	}
	
	$panel->reactivarDB();
	$panel->setFilesPanel(2);
	$tipo_u=$panel->usuario->tipo;
	$user_u=$panel->usuario->id;
	$estado_u=$panel->usuario->estado;
	$util= new Utileria();
	
	if(isset($modificar)){
		if($url!=''){ 
			// URL VALIDATION CONSTRUCTOR
			$URL = new mrsnk_URL_validation(
				$url,
				MRSNK_URL_DO_PRINT_ERRORS,
				MRSNK_URL_DO_NOT_CONNECT_2_URL);
			// URL VALIDATION PUBLIC METHODS
			$valid = $URL->isValid();
			if(!$valid){
				echo "<script> alert ('Direcci�n Web no v�lida');</script>";
				$modificar = 0;
			}
		}
		if($modificar==1){
			$fechapublic= 	$nuevo_anoInic.'-'.$nuevo_mesInic.'-'.$nuevo_diaInic;
			$fechafin=		$nuevo_anoFin.'-'.$nuevo_mesFin.'-'.$nuevo_diaFin; 
			$indicador=		chkmaxnotact($fechapublic, $fechafin); 
			if($indicador=='FALSE' )
				mod_noticia($noticia_id,$fechapublic, $fechafin, $titulo, $user_id, $url, $resumen,$contenido,$tema);
			else			
				echo "<script> alert ('se excede el m�ximo de noticias activas, MODIFICACI�N NO REALIZADA');</script>";
		}//fin de if(modificar==1)
		if($modificar==2){//inserta imagen que no existen
			if (isset($dat['fotohome']) && $dat['fotohome'] != ''){
				$resins=ins_noticiaimgs($noticia_id, 'fotohome', "home");
				if($resins[0]) 	echo "<script> alert ('Home: ".$resins[1]."');</script>";
				else 			echo "<script> alert ('Home: ".$resins[1]."');</script>";
			}
			if (isset($dat['fotoppal']) && $dat['fotoppal']  != ''){
				$resins=ins_noticiaimgs($noticia_id, 'fotoppal', "principal");
				if($resins[0]) 	echo "<script> alert ('Principal: ".$resins[1]."');</script>";
				else 			echo "<script> alert ('Principal: ".$resins[1]."');</script>";
			}
			$maxnumimg = selmaximg();
			for($i=3;$i<=$maxnumimg;$i++){ 
				$imagen_url = 'foto'.$i;
				if (isset($dat[$imagen_url]) && $dat[$imagen_url] != '' ){
					$resins=ins_noticiaimgs($noticia_id, $imagen_url, "general");
					if($resins[0]) 	echo "<script> alert ('Foto".$i.": ".$resins[1]."');</script>";
					else 			echo "<script> alert ('Foto".$i.": ".$resins[1]."');</script>";
				}
			}
			$url='../tb_noticias/noticias.php';
			echo "<script> window.location.href='$url';</script>";
		}
	}
	else{
	//inicializa variables 
		$consulta = "select  * from noticias  where noticia_id = '$noticia_id'";
		$resultado = consultar($consulta); 
		$filas = mysql_fetch_assoc($resultado);
		$tema=$filas['noticia_tema'];
		$titulo=$filas['noticia_titulo'];
		$resumen=$filas['noticia_resumen'];
		$contenido=$filas['noticia_contenido'];
		$url=$filas['noticia_url'];
		list($nuevo_anoInic, $nuevo_mesInic, $nuevo_diaInic)= explode('-', $filas['noticia_fechapublic']);
		list($nuevo_anoFin, $nuevo_mesFin, $nuevo_diaFin)	= explode('-', $filas['noticia_fechafin']);
	}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Modificar Noticia</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>

function archivos()
{
	document.location.href = "listarArchivos.php?id_not=<?=$noticia_id?>";
}

function idiomas()
{
	document.location.href = "listarIdiomas.php?id_not=<?=$noticia_id?>";
}

</script>
</head>
<body onLoad="Foco();">
<table width="610" border="0" align="left" cellpadding="0" cellspacing="0" >
	<tr>
		<td>
		<table width="100%" border="0" align="left" cellpadding="0" cellspacing="1" >
			<tr valign="top" bgcolor="#FFFFFF">
				<td width="100%" height="20" bgcolor="#CCCCCC" class="migasactivo">
		  			<a id="iniMenu" class="migas" href="../../contenido.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>
		  			<a id="op2Menu" class="migas" href="noticias.php" style="cursor:hand; " onMouseover="javascript: mgOver(this);" onMouseOut="javascript: mgOut(this);;" title="Men� de Noticias">Noticias</a>
				  <span class="migas">/</span>Modificar Noticia
				</td>
			</tr>
	<tr>
	  <td height="30" colspan="4"><? btn_aplnoticias($apl_permisos);?></td>
  </tr>
          <tr>
            <td height="30" colspan="4" align="left" valign="bottom" class='texto1'><? dis_parametros();?></td>
          </tr>
		</table>
		</td>
	</tr>
	<tr>
		<td>
			<table width="100%" border=0 align="left" cellpadding=0 cellspacing=1 bgcolor=000099 class="texto1" id="campos">
			<tbody>
				<tr>
					<td align="left" valign="top" bgcolor=#ffffff>
<table width="100%" border="0" align="left" cellpadding="0" cellspacing="0" >
    <tr>
        <td colspan="3" valign="top">
			<table width="100%" cellpadding="0" cellspacing="0" >
				<tr>
				<td bgcolor="#000099" class="nombreColum"><span class="filatitulo"><a onClick="javascript: document.location.href= 'noticias.php'" title="Volver" style="cursor:hand; width:40"><img src="../../img/atras.gif" style="cursor:hand "></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="titular1">&nbsp;&nbsp;Datos de la Noticia</span></td>
				</tr>
				<tr>
					<td><table width="100%" border="0" cellpadding="0" cellspacing="0" align="left" bgcolor="#ffffff">
                        <form method="post" enctype="multipart/form-data" name="form1">
                            <tr>
                                <td height="19" valign="top">&nbsp;</td>
                                <td>&nbsp;</td>
                            </tr>
                            <tr>
                              <td height="34" valign="top" class="texto1" align="center" ><strong>Tema</strong></td>
                              <td>
								<?            
									 seltemas($tema, 1);
								?>
*							  </td>
                            </tr>
                            <tr>
                                <td width="200" height="34" valign="top" class="texto1" align="center" ><strong>T&iacute;tulo</strong> </font></div></td>
                                <td>
                                    <input name="titulo" type="text" class="listado" value="<? echo $titulo;?>" size="50" maxlength="200">*
								</td>
                            </tr>
                            <tr>
                                <td width="200" height="34" valign="top" class="texto1" align="center" ><strong>Fecha de Publicaci&oacute;n</strong></td>
                                <td>
								<?            
									 selfechapublica($nuevo_anoInic, $nuevo_mesInic, $nuevo_diaInic);
								?>
                                    *
								</td>
                            </tr>
                            <tr>
                                <td width="200" height="34" valign="top" class="texto1" align="center" ><strong>Fecha de vigencia </strong></td>
                                <td>
								<?            
									 selfechavigencia($nuevo_anoFin, $nuevo_mesFin, $nuevo_diaFin);
								?>
                                    *
								</td>
                            </tr>
                            <tr>
                                <td height="75" valign="top" class="texto1" align="center" ><strong>Descripci&oacute;n Noticia</strong> <br>(m&aacute;x 200 Car&aacute;cteres)</td>
                                <td width="370" valign="top">
                                    <textarea name="resumen" cols="47" rows="4" wrap="VIRTUAL" class="listado" id="resumen" onKeyPress="return(limitetxtarea(this, event, '200'));" ><? echo $util->outInput($resumen);?></textarea>
                * </td>
                            </tr>
                            <tr>
                                <td height="95" valign="top" class="texto1" align="center" ><strong>Texto</strong></td>
                                <td width="370" valign="top" ><textarea name="contenido" cols="47" rows="6" wrap="VIRTUAL" class="listado" id="contenido"><? echo  $util->outInput($contenido);?></textarea>
                * </td>
                            </tr>
                            <tr>
                                <td class="texto1" align="center" ><strong>Direcci&oacute;n Web </strong><br>(ampliar informaci&oacute;n)</td>
                                <td>
									<table width="200" border="0">
                                      <tr>
                                        <td class="texto1"><strong> HTTP://</strong></td>
                                        <td><input name="url" type="text" class="listado" value="<? echo $url;?>" size="50"></td>
                                      </tr>
                                    </table>
								</td>
                          </tr>
                            <tr>
                                <td><font size="2" face="Arial, Helvetica, sans-serif">&nbsp;</font></td>
                                <td><input name="modificar" type="hidden" id="modificar" value="0">
                                </td>
                            </tr>
                            <tr align="center">
                                <td colspan="3">
								<font size="3" face="Arial, Helvetica, sans-serif">
								<? echo '<input type="button" onClick = "archivos()" name="Archivos" value="Archivos" class="boton1">&nbsp;&nbsp;&nbsp;&nbsp;';?>
								<? echo '<input type="button" onClick = "idiomas()" name="Idiomas" value="Idiomas" class="boton1">&nbsp;&nbsp;&nbsp;&nbsp;';?>
                                    <input type="button" onClick = envia_datos() name="Modificar" value="Modificar" class="boton1">&nbsp;&nbsp;&nbsp;&nbsp;                                    &nbsp;&nbsp;&nbsp;&nbsp;                
									<input type="button" onClick = "javascript: document.location.href ='noticias.php'" name="cancel" value="Cancelar" class="boton1">
								</font></td>
                            </tr>
                            <tr align="center">
                              <td colspan="3">&nbsp;</td>
                            </tr>
                            <tr align="center" >
                              <td colspan="3"><? $cantidad_registros=disimgelivis($noticia_id, 1)?></td>
                            </tr>
                            <tr align="center">
                              <td colspan="3">&nbsp;</td>
                            </tr>
                        </form>
					    </table>
					</td>
				</tr>
			</table>
		</td>
    </tr>
</table>
					</td>
				</tr>
			</tbody>
			</table>		
		</td>
	</tr>
</table>

</body>
<script src="../../generales/genjavascript.js" language="javascript"></script>
<script>
function contespacios(cadena){
	contador=0;
   for (i = 0;  i < cadena.length;  i++)
	   if (cadena.charAt(i) == ' ') contador++;
	if(contador < cadena.length ) return false;
	else	return true;
}
function revisa()
{
	fechainicial=	new Date(document.form1.nuevo_anoInic.value,document.form1.nuevo_mesInic.value-1,document.form1.nuevo_diaInic.value);
	fechafinal =	new Date(document.form1.nuevo_anoFin.value,document.form1.nuevo_mesFin.value-1,document.form1.nuevo_diaFin.value);
	fechactual = 	new Date();fechactual = new Date(fechactual.getFullYear(), fechactual.getMonth(), fechactual.getDate() );
	if( document.form1.tema.value  == "99"  )
	{
		alert("Debe seleccionar el tema de la noticia")
		document.form1.tema.focus();
		return false;
	}
	else if( document.form1.titulo.value  == "" || document.form1.titulo.value  == -1 || contespacios(document.form1.titulo.value))
	{
		alert("Debe ingresar el titulo de la noticia")
		document.form1.titulo.focus();
		return false;
	}
	else if( document.form1.resumen.value  == "" || document.form1.resumen.value  == -1 || contespacios(document.form1.resumen.value))
	{
		alert("Debe ingresar la descripci�n de la noticia que aparacer� en el home")
		document.form1.resumen.focus();
		return false;		
	}
	else if( document.form1.resumen.value.length > 200 )
	{
	    alert("La descripci�n de la noticia no puede ser superior a 200 Caracteres")
		document.form1.resumen.focus();
		return false;		
	}
	else if( document.form1.contenido.value  == "" || document.form1.contenido.value  == -1  || contespacios(document.form1.contenido.value))
	{
		alert("Debe ingresar el texto de la noticia")
		document.form1.contenido.focus();
		return false;		
	}
	else if( fechactual >  fechainicial)
	{
		alert("La fecha de publicaci�n \n no puede ser menor a la fecha actual")
		document.form1.nuevo_anoInic.focus();
		return false;		
	}
	else if( fechainicial >  fechafinal)
	{
		alert("La fecha de vigencia \n no puede ser menor a la fecha de publicaci�n")
		document.form1.nuevo_anoInic.focus();
		return false;		
	}
	else
	{
		return true;
	}
}

function envia_datos()
{
	if(revisa()){
	    document.form1.resumen.value = parseo(document.form1.resumen.value);
		document.form1.contenido.value = parseo(document.form1.contenido.value);
		document.form1.modificar.value = '1';
		document.form1.submit();
	}	
}
function envia_datos1()
{
	document.form1.submit();
}
function Foco(){
document.form1.tema.focus();
}
function llama_pagina(notid){
	window.location.href='../tb_noticiaimagenes/mod_noticiaimgs.php?noticia_id='+notid;
}
function modificar_imagen(imagen_id, notid){
	window.location.href='../tb_noticiaimagenes/mod_noticiaimgs.php?noticia_id='+notid+'&imagen_id='+imagen_id;
}
function fncinsimg(opcion){
	document.form1.modificar.value = '2';
	document.form1.submit();
}
</script>
</html>

Anon7 - 2021