|
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/newsletter/ |
Upload File : |
<?php
include('./../fnc/DBConnect.php');
include('./../fnc/componente.php');
include('./../fnc/parametro.php');
include('./../fnc/vinculo.php');
include('./../fnc/UsuarioPanel.php');
include('./../fnc/bitacora.php');
include('./../fnc/aplicacion.php');
include('./../fnc/panel.php');
include('./../fnc/utileria.php');
include('./../usuariosWeb/fnc/usuarioWeb.php');
include('./fnc/newsletter.php');
session_start('PanelAzulDigial');
if(!session_is_registered("panel")){
echo "<div style=\" font-family: Verdana, Arial, Helvetica, sans-serif; color: #ff4455; font-size: 16px;font-weight: bolder;\">Usuario Invalido</div>";
echo "<div style=\" font-family: Verdana, Arial, Helvetica, sans-serif; color: #0066CC; font-size: 16px;font-weight: bolder;\"><a href=\"../../index.php\" target=\"_top\">Iniciar sesión nuevamente</a></div>";
echo "<script>window.open('../../index.php','_top')</script>";
}else{
$lastLine = (array_key_exists('lastLine', $_REQUEST)) ? $_REQUEST['lastLine']: 1;
$lastSeleccion = (array_key_exists('lastSeleccion', $_REQUEST)) ? $_REQUEST['lastSeleccion']: "1|General (todos)";
$lastBuscar = (array_key_exists('lastBuscar', $_REQUEST)) ? $_REQUEST['lastBuscar']: NULL;
$lastEstado = (array_key_exists('lastEstado', $_REQUEST)) ? $_REQUEST['lastEstado']: "todos";
$seleccion = (array_key_exists('seleccion', $_REQUEST)) ? $_REQUEST['seleccion']: NULL;
$tipo = (array_key_exists('tipo', $_REQUEST)) ? $_REQUEST['tipo']: NULL;
$valores = (array_key_exists('valores', $_REQUEST)) ? $_REQUEST['valores']: NULL;
$visualizar = (array_key_exists('visualizar', $_REQUEST)) ? $_REQUEST['visualizar']: NULL;
$selectedIndex = (array_key_exists('selectedIndex', $_REQUEST)) ? $_REQUEST['selectedIndex']: NULL;
$panel->reactivarDB();
$panel->setFilesPanel(2);
$row= $panel->aplicativo->getNewsletter($seleccion);
$panel->aplicativo->loadAplicacion(10,"cliente");
if(!empty($visualizar)){
$visual = "onload=\"javascript: visualizarNews();\"";
}elseif(!empty($selectedIndex)){
$visual = "onload=\"javascript: completar(document.frmPpal,document.frmPpal.add);\"";
}else{$visual = "";}
$tipo_u=$panel->usuario->tipo;
$user_u=$panel->usuario->id;
$estado_u=$panel->usuario->estado;
$inicio = $panel->inicioPagina($ini_line);
$pbloq="";
$pacti="";
if($estado=="bloqueado"){
$pbloq ="style=\"display:none\"";
}
if($estado=="activo"){
$pacti ="";
}
$userModificar = "";
$userEliminar = "";
$userAdicionar = "";
$userAdministrar="";
if($panel->usuario->tipo==3 && $panel->usuario->vinculo->modificar=="NO" && $panel->usuario->vinculo->administrador=="NO"){
$userModificar = "disabled";
}
if($panel->usuario->tipo==3 && $panel->usuario->vinculo->eliminar=="NO" && $panel->usuario->vinculo->administrador=="NO"){
$userEliminar= "disabled";
}
if($panel->usuario->tipo==3 && $panel->usuario->vinculo->adicionar=="NO" && $panel->usuario->vinculo->administrador=="NO"){
$userAdicionar= "disabled";
}
if($panel->usuario->tipo==3 && $panel->usuario->vinculo->administrador=="NO"){
$userAdministrar= "disabled";
}
?>
<html>
<head>
<link href="css/panel2.css" rel="stylesheet" type="text/css">
<link href="css/panel2Contenido.css" rel="stylesheet" type="text/css">
<link href="css/scrollbar.css" rel="stylesheet" type="text/css">
<link href="css/scrollbar2.css" rel="stylesheet" type="text/css">
<SCRIPT language='javascript' src="js/CalendarPopup.js"></SCRIPT>
<!-- This javascript is only used for the show/hide source on my example page.
It is not used by the Calendar Popup script -->
<SCRIPT language='javascript' src="js/common.js"></SCRIPT>
<!-- This prints out the default stylehseets used by the DIV style calendar.
Only needed if you are using the DIV style popup -->
<SCRIPT language='javascript'>document.write(getCalendarStyles());</SCRIPT>
<script language="javascript" type="text/javascript">
if (history.forward(1)){location.replace(history.forward(1))}
function mgOver(obj){
var elm = document.getElementsByTagName("a");
elm[obj.id].setAttribute("class","migasover");
}
function mgOut(obj){
var elm = document.getElementsByTagName("a");
elm[obj.id].setAttribute("class","migas");
}
function fncAccion(est,ind) {
if(!ind){
if(est=="eliminar"){
if(sel){
if(confirm("Eliminara los Newsletter seleccionados definitivamente, desea continuar?")){
document.location.href = 'fnc/main.php?tarea=delNewsletter&seleccion='+sel+'&lastEstado=<?=$estado?>&lastSeleccion=<?=$seleccion?>&lastBuscar=<?=$buscar?>&lastLine=<?=$ini_line?>';
}else{ return false;}
}else{
alert('Debe seleccionar por lo menos un Newsletter!');
return;
}
}
if(est=="guardar" || est=="visualizar" || est=="programar" || est=="enviar" ){
document.frmPpal.tarea.value="saveNewsletter";
document.frmPpal.redireccion.value=est;
document.frmPpal.action="fnc/main.php";
if(fncCheckFormNewsletter(document.frmPpal,<?=$panel->aplicativo->parametros['longitud_contenido']?>)){
document.frmPpal.submit();
}else{ return ;}
}
}else{
if(est=="delBoletin"){
vec = ind.split("|");
if(confirm("Eliminar� el boletin '"+vec[1]+"' definitivamente, desea continuar?")){
document.frmHidden.tarea.value="delBoletin";
document.frmHidden.seleccion.value=ind;
document.frmHidden.news.value="<?=$seleccion?>";
document.frmHidden.redireccion.value="addNews";
document.frmHidden.submit();
//document.location.href = 'fnc/main.php?tarea=delBoletin&seleccion='+ind+'&news=<?=$seleccion?>&redireccion=addNews';
}
}
if(est=="delNewsletter"){
if(confirm("Eliminar� el newsletter y su contenido definitivamente, desea continuar?")){
document.location.href = 'fnc/main.php?tarea=delNewsletter&seleccion='+ind;
}
}
if(est=="delEnlace"){
if(confirm("Eliminar� el Enlace definitivamente, desea continuar?")){
document.location.href = 'fnc/main.php?tarea=delEnlace&newsletter=<?=$seleccion?>&redireccion=addNews&seleccion='+ind;
}
}
if(est=="showImagen"){
var wini = window.open('showImagen.php?newsletter=<?=$seleccion?>&seleccion='+ind,'_blank','toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,top=150,left=200');
}
}
}
function completar(frm,obj){
var ind = obj.selectedIndex;
var ac = obj.options[ind].value;
var maxb = parseInt(frm.max_boletin.value);
var next = parseInt(frm.indice.value);
if(ind!=0){
if(next<maxb){
if(ac=="generico" || ac=="encuesta"){
document.location.href="fnc/main.php?tarea=addBoletin&seleccion=<?=$seleccion?>&valores="+ac+"&tipo="+ac;
}else{
showList(ac);
}
}else{
alert("No se puede agregar otro bolet�n.\nSe alcanzo el m�ximo permitido de "+maxb+" boletines.");
return false;
}
}else{
alert("Debe seleccionar el tipo de bolet�n a adicionar!");
}
}
function completarSave(frm,obj){
var ind = obj.selectedIndex;
var ac = obj.options[ind].value;
var maxb = parseInt(frm.max_boletin.value);
var next = parseInt(frm.indice.value);
if(ind!=0){
if(next<maxb){
document.frmPpal.tarea.value="saveNewsletter";
document.frmPpal.redireccion.value=ac;
document.frmPpal.action="fnc/main.php";
if(fncCheckFormNewsletter(document.frmPpal,<?=$panel->aplicativo->parametros['longitud_contenido']?>)){
document.frmPpal.submit();
}else{ return ;}
}else{
alert("No se puede agregar otro bolet�n.\nSe alcanz� el m�ximo permitido de "+maxb+" boletines.");
return false;
}
}else{
alert("Debe seleccionar el tipo de bolet�n a adicionar!");
}
}
function showList(tipo){
var maxb = parseInt(document.frmPpal.max_boletin.value);
var ind = parseInt(document.frmPpal.indice.value);
var ft = maxb-ind;
if(ft>0){
window.open('listBoletines.php?seleccion=<?=$seleccion?>&tipo='+tipo+'&nbol='+ft,'_blank','toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,top=250,left=150,width=600 ,height=500');
}else{
alert("No se puede agregar otro boletin.\nSe alcanzo el maximo permitido de "+maxb+" boletines.");
}
}
function visualizarNews(){
window.open('showNews.php?seleccion=<?=$seleccion?>','_blank','toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,top=250,left=150,width=600 ,height=500');
}
function showImagen(dir,des){
window.open('showImagen.php?seleccion=img/boletines/'+dir+'&valor='+des,'_blank','toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,top=150,left=200');
}
function addEnlace(bol){
window.open('addEnlace.php?newsletter=<?=$seleccion?>&seleccion='+bol,'_blank','toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,top=150,left=200,width=550,height=250');
}
</script>
<script src="js/url.js"></script>
<script src="js/validaciones.js"></script>
</head>
<body <?=$visual?>>
<table width="610" border="0" cellspacing="2" cellpadding="2" class="listado" align="left">
<tr bgcolor="#cccccc">
<td width="1078" colspan="2" align="left"><div align="lleft" class="migas">
<a id="migainicio" href="../contenido.php" class="migas" style="cursor:hand" title="Indice de Aplicaciones" onMouseOver="javascript: mgOver(this);" onMouseOut="javascript: mgOut(this);">Beginning</a> / <a id="migaindex" href="menu.php" class="migas" onMouseOver="javascript: mgOver(this);" onMouseOut="javascript: mgOut(this);"><?=ucfirst($panel->aplicativo->nombre)?></a> / <a id="migalist" href="listNews.php" class="migas" onMouseOver="javascript: mgOver(this);" onMouseOut="javascript: mgOut(this);">Gestión Newsletter</a> / <span class="migasactivo">Crear Newsletter</span>
</div></td>
</tr>
<tr>
<td colspan="2"><img src="img/menu.gif" width="49" height="23" align="top"> <input name="tem" type="button" class="boton1" onClick="javascript: document.location.href= 'listTemas.php'" value="Temas">
<input name="tem2" type="button" class="boton1" onClick="javascript: document.location.href= 'listUsuarios.php'" value="Users">
<input name="tem22" type="button" class="boton1" onClick="javascript: document.location.href= 'listNews.php'" value="Newsletter">
<input name="tem222" type="button" class="boton1" onClick="javascript: document.location.href= 'valores_config/index.php'" value="Parámetros" <?=$userAdministrar?>></td></tr>
<tr>
<td colspan="2" align="left">
<table width="539" cellspacing=1 cellpadding=0 align="left" bgcolor="#000099" border=0 id="campos">
<tbody>
<tr>
<td bgcolor="#0099CC">
<table cellspacing=0 cellpadding=0 width="100%" border=0 align="left">
<tbody>
<tr bgcolor="#000099">
<td width="10%" align="left" >
<div align="left"><a onClick="javascript: document.location.href= 'listNews.php'" title="Volver" style="cursor:hand; width:40"><img src="img/atras.gif" style="cursor:hand "></a></div></td>
<td width="90%" align="letf" class="titular1">Datos del Newsletter</td>
</tr>
</tbody>
</table></td>
</tr>
<tr>
<td bgcolor=#ffffff valign="top">
<form enctype="multipart/form-data" method="post" name="frmPpal" id="frmPpal" target="_fraUsr">
<table width="610" >
<tr><td class="texto1">
<table width="100%" border=0 align="left" cellpadding=0 cellspacing=0 id="tbl_news" class="texto1">
<!--DWLayoutTable-->
<tbody>
<tr>
<td align=left width="11"> </td>
<td ><span class="texto1">Asunto: </span>
<input name="titulo" type="text" class="listado" style="width:395px " value="<?=$row['titulo']?>" maxlength="100">*</td>
</tr>
<tr>
<td height="26" align=left> </td>
<td ><span class="texto1">Plantilla: </span><? $panel->aplicativo->listPlantillas("plantilla","class=\"listado\"",$row['plantilla']);?></td>
</tr>
<tr>
<td align=left> </td>
<td ><!--DWLayoutEmptyCell--> </td>
</tr>
<? $cantidad = $panel->aplicativo->showBoletines($seleccion,$panel->aplicativo->nombre,'class="texto1"','class="listado"');?>
</tbody>
</table>
</td></tr>
<tr><td>
<table width="100%">
<tr>
<td width="4%" align=left> </td>
<td width="21%" align="right"><div align="right">
</div></td>
<td width="75%" align="right" class="texto1"> <select name="add" class="listado">
<option>- - -</option>
<option class="listado" value="generico" <? if ($selectedIndex=="generico") echo "selected";?>>Boletín en blanco</option>
<option class="listado" value="noticia" <? if ($selectedIndex=="noticia") echo "selected";?>>Noticia</option>
<option class="listado" value="evento" <? if ($selectedIndex=="evento") echo "selected";?>>Evento</option>
<option class="listado" value="encuesta" <? if ($selectedIndex=="encuesta") echo "selected";?>>Encuesta Activa</option>
</select>
<input name="Submit222" type="button" class="boton1" onClick="javascript: completarSave(document.frmPpal,document.frmPpal.add)" value="Adicionar boletin"></td>
</tr>
<tr>
<td align=left> </td>
<td colspan="2"><input type="hidden" name="max_boletin" value="<?=$panel->aplicativo->parametros['numero_boletines']?>">
<input type="hidden" name="max_enlace" value="<?=$panel->aplicativo->parametros['numero_enlaces']?>">
<input type="hidden" name="max_imagen" value="<?=$panel->aplicativo->parametros['numero_imagenes']?>">
<input type="hidden" name="MAX_FILE_SIZE" value="<?=$panel->aplicativo->parametros['peso_imagen']?>">
<input type="hidden" name="indice" value="<?=$cantidad?>"><input type="hidden" name="seleccion" value="<?=$seleccion?>">
<input type="hidden" name="tarea" value=""><input type="hidden" name="redireccion" value=""></td>
</tr>
</table>
</td></tr>
</table>
</form>
</td>
</tr>
</tbody>
</table></td>
</tr>
<tr>
<td colspan="2" valign="top" class="textos">
<div align="right">
<input name="button234" type="button" class="boton1" onClick="fncAccion('visualizar',false)" value="Visualizar" <?=$pacti?> <?=$userModificar?>>
<input name="button23" type="button" class="boton1" onClick="fncAccion('enviar',false)" value="Enviar" <?=$userModificar?>>
<input name="button233" type="button" class="boton1" onClick="fncAccion('programar',false)" value="Programar" <?=$userModificar?> style="display:none ">
<input name="button232" type="button" class="boton1" onClick="fncAccion('guardar',false)" value="Guardar" <?=$pbloq?> <?=$userModificar?>>
<input name="button22" type="button" class="boton1" onClick="fncAccion('delNewsletter','<?=$seleccion?>|<?=$row['titulo']?>')" value="Eliminar" <?=$userEliminar?>>
</div>
</td>
</tr>
</table>
<div style="display:none">
<form action="fnc/main.php" name="frmHidden" id="frmHidden" method="post">
<input name="seleccion" value="">
<input name="tarea" value="">
<input name="redireccion" value="">
<input name="news" value="">
</form>
</div>
<iframe name="_fraUsr" id="_fraUsr" src="" width="0" height="0"></iframe>
</body>
</html>
<? }?>