|
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{
$seleccion = (array_key_exists('seleccion', $_REQUEST)) ? $_REQUEST['seleccion']: NULL;
$panel->reactivarDB();
$panel->setFilesPanel(2);
$tipo_u=$panel->usuario->tipo;
$user_u=$panel->usuario->id;
$estado_u=$panel->usuario->estado;
$inf=explode("|",$seleccion);
$row= $panel->aplicativo->getNewsletter($inf[0]);
$vec = explode("-",$row['fecha_env']);
$ct = $panel->aplicativo->cantidadTemas("newsletters");
$cantBol = $panel->aplicativo->cantBoletines($inf[0]);
$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">
<link href="css/calendar.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>
<!-- These styles are here only as an example of how you can over-ride the default
styles that are included in the script itself. -->
<script>
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");
}
</script>
<script src="js/validaciones.js"></script>
<SCRIPT language=JavaScript id=js18>
var cal18 = new CalendarPopup();
cal18.setCssPrefix("TEST");
cal18.setReturnFunction("setMultipleValues3");
function setMultipleValues3(y,m,d) {
document.frmPpal.anio.value=y;
document.frmPpal.mes.selectedIndex=m;
document.frmPpal.dia.selectedIndex=d;
}
google_ad_client = "pub-9155030588311591";
google_ad_width = 120;
google_ad_height = 600;
google_ad_format = "120x600_as";
google_color_border = "006666";
google_color_bg = "FFFFFF";
google_color_link = "006666";
google_color_url = "006666";
google_color_text = "000000";
function chkFecha(frm){
if(frm.envio[0].checked){
return true;
}
var d = parseInt(frm.dia.options[frm.dia.selectedIndex].value);
var m = parseInt(frm.mes.options[frm.mes.selectedIndex].value) - 1;
var a = frm.anio.value;
if(noNumero(a)){
alert("Debe ingresar un a�o v�lido, sin espacios o caracteres diferentes a n�meros.");
return false;
}
a = parseInt(a);
var eleccion = new Date(a,m,d);
var hoy = new Date();
var year = hoy.getFullYear();
var day = hoy.getDate();
var month = hoy.getMonth();
var ind = frm.dia.selectedIndex;
if(ind==0){
alert('Debe seleccionar el d�a de env�o!');
frm.dia.focus();
return false;
}
var ind = frm.mes.selectedIndex;
if(ind==0){
alert('Debe seleccionar el mes de env�o!');
frm.mes.focus();
return false;
}
var ind = frm.anio.value;
if(ind.length<4 || !sin_espacios(ind)){
alert('Debe ingresar un a�o v�lido!');
frm.anio.focus();
return false;
}
if( hoy >= eleccion ){
alert('Debe seleccionar una fecha posterior a la actual!');
frm.anio.focus();
return false;
}
frm.fecha.value=a+"-"+(m+1)+"-"+d;
return true;
}
function chkFrm(forma){
if (chkFecha(forma)){
if(contarChek()){
vmin = parseInt(forma.edad_minima.value,10);
vmax = parseInt(forma.edad_maxima.value,10);
if((forma.edad_minima.value!="cualquiera")&&(forma.edad_maxima.value!="cualquiera")&&(vmin>vmax)){
alert("Incongruencia en la seleccion de edades. \nLa edad minima no puede ser mayor que la edad maxima.");
forma.edad_minima.focus();
return false;
}else{
return true;
}
}else{
return false;
}
}else{
return false;
}
}
function contarChek(){
var cu = 0;
var ct = 0;
var elm = document.getElementsByTagName("input");
if(elm["sexoAc"].checked) cu++;
if(elm["edad_minimaAc"].checked) cu++;
if(elm["edad_maximaAc"].checked) cu++;
for(i=0; i<elm.length; i++){
if(elm[i].type=="checkbox" && ( elm[i].name.indexOf("tema_") == 0 ) && elm[i].checked){
ct++;
}
}
if(!document.frmPpal.generalUp.checked){
if(ct==0){
var ms= "Si no seleccion� alg�n 'Tema' y/o 'Caracter�sticas de Usuario' en especial, \n";
ms+="el env�o llegar� a todos los usuarios activos del newsletter,\n";
ms+="Desea continuar?";
if(!confirm(ms)){
return false;
}else{
document.frmPpal.general.value="ninguno";
return true;
}
}else{
if(!document.frmPpal.generalUp.checked){
document.frmPpal.general.value="alguno";
}
return true;
}
}else{
return true;
}
}
function habilitar(campo, estado){
var elm = document.getElementsByTagName('select');
elm[campo].disabled=estado;
}
function setValue(campo,obj){
var elm = document.getElementsByTagName('input');
if(obj!='cualquiera'){
elm[campo].value=obj.options[obj.selectedIndex].value;
}else{
elm[campo].value=obj;
}
}
function setValueGeneral(check){
var elm = document.getElementsByTagName("input");
if(check){
document.frmPpal.general.value = "ninguno";
}else{
document.frmPpal.general.value = "todos";
}
for(i=0; i<elm.length; i++){
if(elm[i].type=="checkbox" && ( elm[i].name.indexOf("tema_") == 0 )){
elm[i].disabled=!check;
}
}
}
function setValueLabel(campo,valor){
var elm = document.getElementsByTagName('input');
elm[campo].value=valor;
}
function selEnvio(id,estado){
var elm = document.getElementsByTagName("div");
if(estado=="programar"){
elm[id].style.display = "inline";
}else{
elm[id].style.display = "none";
}
}
function checkBoletines(nbol){
if(nbol<1){
alert("<? echo $panel->aplicativo->getMensaje("[158]","confirmacion");?>");
document.frmPpal.adicionar.style.disabled = "true" ;
document.location.href="addNews.php?seleccion=<?=$inf[0]?>";
}
}
</SCRIPT>
</head>
<body onLoad="javascript: checkBoletines(<?=$cantBol?>)">
<table width="610" border="0" cellspacing="2" cellpadding="2" class="texto1" align="left">
<tr bgcolor="#cccccc">
<td width="1078" colspan="2" align="left"><div align="left" 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);">Gastion Newsletter</a> / <span class="migasactivo">Programar Newsletter</span>
</div></td>
</tr>
<tr>
<td><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="Parameters" <?=$userAdministrar?>></td>
</tr>
<tr>
<td align="left"><form action="fnc/main.php?tarea=sendNews" id="frmPpal" method="post" name="frmPpal" onSubmit="return chkFrm(this);">
<table width="100%" border=0 align="left" cellpadding=0 cellspacing=1 bgcolor="##000099" class="texto1" id="campos">
<tbody>
<tr>
<td bgcolor=#0099CC>
<table cellspacing=0 cellpadding=0 width="100%" border=0 align="left">
<tbody>
<tr bgcolor="#000099">
<td width="9%" align="left" class="titular1">
<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="91%" align="left" class="titular1">Datos de envío de Newsletter</td>
</tr>
</tbody>
</table></td>
</tr>
<tr>
<td bgcolor=#ffffff valign="top">
<table cellspacing=0 cellpadding=0 width="100%" align="left" border=0>
<!--DWLayoutTable-->
<tbody>
<tr>
<td align=left width="10"> </td>
<td width="147" height="22" class="texto1">Asunto:</td>
<td colspan="2" class="texto1"><?=$row['titulo']?></td>
</tr>
<tr>
<td align=left> </td>
<td class="texto1">Envío:</td>
<td colspan="2" class="texto1">Ahora mismo
<input name="envio" type="radio" onClick="javascript: selEnvio('rowProgramar','ahora');" value="ahora" checked>
Programar fecha
<input name="envio" type="radio" onClick="javascript: selEnvio('rowProgramar','programar');" value="programar"></td>
</tr>
<tr>
<td align=left> </td>
<td align=left> </td>
<td class="texto1" align="left"><div align="left" id="rowProgramar" style="display:none ">
<? echo $panel->aplicativo->util->Select("dia","dia","class=\"listado\"","0||- - -",$vec[2]);?>
<? echo $panel->aplicativo->util->Select("mes","mes","class=\"listado\"","0||- - -",$vec[1]);?>
<input name="anio" type="text" class="listado" size="5" maxlength="5" value="<?=,$vec[0]?>" style="text-align:center ">
<a name="anchor18" class="usuario" id="anchor18" onclick="cal18.showCalendar('anchor18'); return false;"><<mostrar almanaque>></a></div></td>
</tr>
<tr>
<td align=left> </td>
<td class="texto1"><!--DWLayoutEmptyCell--> </td>
<td width="369" class="texto1"><!--DWLayoutEmptyCell--> </td>
<td width="9" class="texto1">
</td>
</tr>
<tr>
<td align=left> </td>
<td colspan="2" class="texto1">
<fieldset>
<legend>Características del usuario</legend>
<table class="texto1" width="100%">
<tr>
<td><input name="sexoAc" id="sexoAc" type="checkbox" class="listado" onClick="javascript: if(this.checked){habilitar('sexoUp',false);setValue('sexo',document.frmPpal.sexoUp);}else{habilitar('sexoUp',true); setValue('sexo','cualquiera');}"></td>
<td>Sexo</td>
<td><select name="sexoUp" class="listado" onChange="javascript: setValue('sexo',this);" disabled>
<option value="cualquiera">Cualquiera</option>
<option value="M">Masculino</option>
<option value="F">Femenino</option>
</select><input type="hidden" id="sexo" name="sexo" value="cualquiera"></td>
</tr>
<tr>
<td><input name="edad_minimaAc" id="edad_minimaAc" type="checkbox" class="listado" onClick="javascript: if(this.checked){habilitar('edad_minimaUp',false);setValue('edad_minima',document.frmPpal.edad_minimaUp);}else{habilitar('edad_minimaUp',true); setValue('edad_minima','cualquiera');}"></td>
<td>Mayores de</td>
<td><? echo $panel->aplicativo->util->SelectEdad("edad_minimaUp","class=\"listado\" onChange=\"javascript: setValue('edad_minima',this);\" disabled",70,10,"cualquiera||Cualquiera",false);?> años de edad
<input type="hidden" name="edad_minima" id="edad_minima" value="cualquiera"></td>
</tr>
<tr>
<td><input name="edad_maximaAc" id="edad_maximaAc" type="checkbox" class="listado" onClick="javascript: if(this.checked){habilitar('edad_maximaUp',false);setValue('edad_maxima',document.frmPpal.edad_maximaUp);}else{habilitar('edad_maximaUp',true); setValue('edad_maxima','cualquiera');}"></td>
<td>Menores de</td>
<td><? echo $panel->aplicativo->util->SelectEdad("edad_maximaUp","class=\"listado\" onChange=\"javascript: setValue('edad_maxima',this);\" disabled",70,10,"cualquiera||Cualquiera",false);?> años de edad <input type="hidden" name="edad_maxima" id="edad_maxima" value="cualquiera"></td>
</tr>
<tr>
<td colspan="3"> <label for="filtro_usuario1" title="(ej. cumple condicion1 Y condicion2 Y condicion3)">Unión reductiva(Y)</label>
<input type="radio" id="filtro_usuario1" name="filtro_usuario" value="conjuncion" title="(ej. cumple condicion1 Y condicion2 Y condicion3)">
<label for="filtro_usuario2" title="(ej. cumple condicion1 O condicion2 O condicion3)">Unión extensiva(O)</label>
<input type="radio" id="filtro_usuario2" name="filtro_usuario" value="disyuncion" title="(ej. cumple condicion1 O condicion2 O condicion3)" checked>
</td>
</tr>
</table>
</fieldset>
</td>
<td class="texto1"><!--DWLayoutEmptyCell--> </td>
</tr>
<tr>
<td align=left> </td>
<td colspan="3" class="texto1"><!--DWLayoutEmptyCell--> </td>
</tr>
<tr>
<td align=left> </td>
<td colspan="3" class="texto1">
<fieldset><legend>Intereses del usuario</legend>
<? $panel->aplicativo->showListTemasCol("145px","100%","texto1",false,3,"Newsletter");?>
<br>
<div class="texto1"><input type="text" id="generalLabel" class="texto1" style="border:0 " value="Cualquier tema" onKeyPress="this.blur()" onFocus="this.blur()"> <input type="checkbox" name="generalUp" id="generalUp" onClick="javascript: if(!this.checked){setValueGeneral(true);}else{setValueGeneral(false);}"><input type="hidden" name="general" id="general" value="ninguno">
<label for="filtro_tema" title="(ej. gusta tema1 Y gusta tema2 Y .... gusta del temaN seleccionado)">Unión reductiva(Y)</label>
<input type="radio" id="filtro_tema" name="filtro_tema" value="conjuncion" onClick="javascript: setValueLabel('generalLabel','Todos los temas')" title="(ej. gusta tema1 Y gusta tema2 Y .... gusta del temaN seleccionado)"> <label for="filtro_tema2" title="(ej. gusta tema1 O gusta tema2 O .... gusta del temaN seleccionado)">Unión extensiva(O)</label>
<input type="radio" id="filtro_tema2" name="filtro_tema" value="disyuncion" checked onClick="javascript: setValueLabel('generalLabel','Cualquier Tema')" title="(ej. gusta tema1 O gusta tema2 O .... gusta del temaN seleccionado)">
</div>
</fieldset>
</td>
</tr>
<tr>
<td align=left> </td>
<td colspan="3" class="texto1"><!--DWLayoutEmptyCell--> </td>
</tr>
<tr>
<td align=left> </td>
<td colspan="3"><div align="center">
<input name="cantidad_temas" type="hidden" value="<?=$ct?>">
<input name="seleccion" type="hidden" value="<?=$row['id']?>"><input name="fecha" type="hidden">
<input name="adicionar" type="submit" class="boton1" value="Aceptar">
<input name="cancelar" type="button" class="boton1" onClick="document.location.href='listNews.php'" value="Cancel">
</div></td>
</tr>
<tr>
<td align=left> </td>
<td colspan="3"><!--DWLayoutEmptyCell--> </td>
</tr>
</tbody>
</table></td>
</tr>
</tbody>
</table>
</form></td>
</tr>
</table>
<iframe src="" name="_fraUsr" id="_fraUsr" width="0" height="0"></iframe>
</body>
</html>
<? }?>