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/adi_noticias.php
<?            
	 include("../../generales/config_panel.php");
	 include("../../generales/config_permisos.php");
	 include("../../generales/operabd.php");
	 include("../../generales/chequeaURL.php");
	 include("met_noticias.php");
	 //inicializa variables para la recarga de la p�gina
	 $fechactual = date("Y-m-d"); 
	 if(!isset($tema)) 		$tema=NULL;
	 if(!isset($titulo)) 	$titulo=NULL;
	 if(!isset($resumen)) 	$resumen=NULL;
	 if(!isset($contenido)) $contenido=NULL;
	 if(!isset($nuevo_anoInic)) 	$nuevo_anoInic=NULL;
	 if(!isset($nuevo_mesInic)) 	$nuevo_mesInic=NULL;
	 if(!isset($nuevo_diaInic)) 	$nuevo_diaInic=NULL;
	 if(!isset($nuevo_anoFin)) 		$nuevo_anoFin=NULL;
	 if(!isset($nuevo_mesFin)) 		$nuevo_mesFin=NULL;
	 if(!isset($nuevo_diaFin)) 		$nuevo_diaFin=NULL;
	 if(!isset($url)) 		$url=NULL;
	 else 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>";
			$insertar = 0;
		}
	}
	 
	 //*********
	 if(isset($insertar)){
		 if($insertar==1){
			$fechapublic= 	$nuevo_anoInic.'-'.$nuevo_mesInic.'-'.$nuevo_diaInic;
			$fechafin=		$nuevo_anoFin.'-'.$nuevo_mesFin.'-'.$nuevo_diaFin; 
			$indicador=		chkmaxnotact($fechapublic, $fechafin); 
			if($indicador=='FALSE' ){
				$noticia_id=ins_noticia($fechapublic, $fechafin, $titulo, $user_id, $url, $resumen,$contenido,$tema);
				if ($dat['fotohome'] != ''){
					$resins=ins_noticiaimgsN($noticia_id, 'fotohome', "home");
					echo "<script> alert ('Home: ".$resins[1]."');</script>";
				}
				if ($dat['fotoppal']  != ''){
					$resins=ins_noticiaimgsN($noticia_id, 'fotoppal', "principal");
					echo "<script> alert ('Principal: ".$resins[1]."');</script>";
				}
			}
			else			
				echo "<script> alert ('se excede el m�ximo de noticias activas, INSERCCI�N NO REALIZADA');</script>";
		}//fin de if(insertar==1)
	}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Insertar 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">
</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="0" >
			<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>Adicionar 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 valign="top">
              <table width="100%" cellpadding="0" cellspacing="0" bordercolor="#000099">
                <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;&nbsp;&nbsp;</span><span class="titular1">Datos de la Noticia</span></td>
                </tr>
                <tr>
                  <td><table width="100%" border="0" align="left" cellpadding="1" cellspacing="0" bordercolor="#0000FF" 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"><div align="center" class="texto1"><strong>Tema</strong></div></td>
                          <td>
                            <?            
									 seltemas($tema, 1);
								?>
                            * </td>
                        </tr>
                        <tr>
                          <td width="200" height="34" valign="top"><div align="center" class="texto1"><strong>T&iacute;tulo</strong></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"><div align="center" class="texto1"><strong>Fecha de Publicaci&oacute;n</strong> </div></td>
                          <td>
                            <?            
									 selfechapublica($nuevo_anoInic, $nuevo_mesInic, $nuevo_diaInic);
								?>
                            * </td>
                        </tr>
                        <tr>
                          <td width="200" height="34" valign="top"><div align="center" class="texto1"><strong>Fecha de vigencia </strong></div></td>
                          <td>
                            <?            
									selfechavigencia($nuevo_anoFin, $nuevo_mesFin, $nuevo_diaFin);
								?>
                            * </td>
                        </tr>
                        <tr>
                          <td height="75" valign="top">
                            <div align="center" class="texto1"><strong>Descripci&oacute;n Noticia</strong> <br>
                              (m&aacute;x 200 Car&aacute;cteres)</div></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 $resumen;?></textarea>
                            * </td>
                        </tr>
                        <tr>
                          <td height="95" valign="top"><div align="center" class="texto1"><strong>Texto</strong></div></td>
                          <td width="370" valign="top"><textarea name="contenido" cols="47" rows="6" wrap="VIRTUAL" class="listado" id="contenido"><? echo $contenido;?></textarea>
                            * </td>
                        </tr>
                        <tr>
                          <td><div align="center" class="texto1"><strong>Direcci&oacute;n Web</strong><br>
                              (ampliar informaci&oacute;n)</div></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 valign="top"><div align="center" class="texto1"><strong>Im&aacute;gen Home </strong></div></td>
						  <td><input name="dat[fotohome]" type="file" id="dat[fotohome]"></td>
						</tr>
						<tr>
						   <td valign="top"><div align="center" class="texto1"><strong>Im&aacute;gen Noticia</strong></div></td>
						  <td><input name="dat[fotoppal]" type="file" id="dat[fotoppal]"></td>
						   </tr>
                        <tr>
                          <td><font size="2" face="Arial, Helvetica, sans-serif">&nbsp;</font></td>
                          <td>
                            <input name="insertar" type="hidden" id="insertar" value="0">
                            <input name="fechactual" type="hidden" id="fechactual" value="<? echo $fechactual;?>">
                          </td>
                        </tr>
                        <tr align="center">
                          <td colspan="3"><font size="3" face="Arial, Helvetica, sans-serif">
                            <input type="button" onClick = envia_datos() name="ingresar" value="Ingresar" class="boton1">
&nbsp;&nbsp;&nbsp;&nbsp;
                            <input type="reset" name="limpiar" value="Limpiar" class="boton1">
&nbsp;&nbsp;&nbsp;&nbsp;
                            <input type="button" onClick = "javascript: document.location.href ='noticias.php'" name="cancel" value="Cancelar" class="boton1">
                          </font></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 el resumen de la noticia")
		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.insertar.value = '1';
		document.form1.submit();
	}	
}
function envia_datos1()
{
	document.form1.submit();
}
  function Foco(){
    document.form1.tema.focus();
  }
</script>
</html>

Anon7 - 2021