Created
March 8, 2017 10:11
-
-
Save davidtaubmann/7689a8eaf1c20c0deecddfb7b2f6ca59 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* HMCO File: reg_mod_Auth.php | |
* Version : 1.4 | |
* Author: David Taubmann | |
* Descr: Registro Módulo de Autorizaciones | |
* | |
*/ | |
?> | |
<?php require_once('_config.php'); ?> | |
<?php require_once('Connections/Rgstr.php'); ?> | |
<?php if (!isset($_SESSION)) { | |
session_start(); | |
} | |
$MM_authorizedUsers = "regs"; | |
$MM_donotCheckaccess = "false"; | |
$MM_restrictGoTo = "index.php?err=AccsDny"; | |
if (!((isset($_SESSION['HAM_SS_Username'])) && (isAuthorized("",$MM_authorizedUsers, $_SESSION['HAM_SS_Username'], $_SESSION['HAM_SS_UserGroup'])))) { | |
$MM_qsChar = "?"; | |
$MM_referrer = $_SERVER['PHP_SELF']; | |
if (strpos($MM_restrictGoTo, "?")) $MM_qsChar = "&"; | |
if (isset($QUERY_STRING) && strlen($QUERY_STRING) > 0) | |
$MM_referrer .= "?" . $QUERY_STRING; | |
$MM_restrictGoTo = $MM_restrictGoTo. $MM_qsChar . "accesscheck=" . urlencode($MM_referrer); | |
header("Location: ". $MM_restrictGoTo); | |
exit; | |
} | |
?> | |
<?php | |
if (!function_exists("GetSQLValueString")) { | |
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") | |
{ | |
if (PHP_VERSION < 6) { | |
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue; | |
} | |
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue); | |
switch ($theType) { | |
case "text": | |
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; | |
break; | |
case "long": | |
case "int": | |
$theValue = ($theValue != "") ? intval($theValue) : "NULL"; | |
break; | |
case "double": | |
$theValue = ($theValue != "") ? doubleval($theValue) : "NULL"; | |
break; | |
case "date": | |
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; | |
break; | |
case "defined": | |
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue; | |
break; | |
} | |
return $theValue; | |
} | |
} | |
// Crear $HAM_TMP_evto: | |
evtoEnUso(); | |
?> | |
<?php | |
$editFormAction = $_SERVER['PHP_SELF']; | |
if (isset($_SERVER['QUERY_STRING'])) { | |
$editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']); | |
} | |
//Obtener Datos para éste Id | |
$colname_Reg_sel = "-1"; | |
if (isset($_GET['id'])) { | |
$colname_Reg_sel = $_GET['id']; | |
} | |
mysql_select_db($database_Hamco, $Hamco); | |
$query_Reg_sel = sprintf("SELECT * FROM hamco_registros".$HAM_TMP_evto_tbl." WHERE Id_Registro = %s", GetSQLValueString($colname_Reg_sel, "int")); | |
$Reg_sel = mysql_query($query_Reg_sel, $Hamco) or die(mysql_error()); | |
$row_Reg_sel = mysql_fetch_assoc($Reg_sel); | |
$totalRows_Reg_sel = mysql_num_rows($Reg_sel); | |
$colname_Evento_Selecc = "-1"; | |
if (isset($HAM_TMP_evto)) { | |
$colname_Evento_Selecc = $HAM_TMP_evto; | |
} | |
mysql_select_db($database_Hamco, $Hamco); | |
$query_Evento_Selecc = sprintf("SELECT * FROM hamco_eventos WHERE Id_Evento = %s", GetSQLValueString($colname_Evento_Selecc, "int")); | |
$Evento_Selecc = mysql_query($query_Evento_Selecc, $Hamco) or die(mysql_error()); | |
$row_Evento_Selecc = mysql_fetch_assoc($Evento_Selecc); | |
$totalRows_Evento_Selecc = mysql_num_rows($Evento_Selecc); | |
$colname_MiFuncPreRegsVals = "-1"; | |
if (isset($HAM_TMP_evto)) { | |
$colname_MiFuncPreRegsVals = $HAM_TMP_evto; | |
} | |
mysql_select_db($database_Hamco, $Hamco); | |
$query_MiFuncPreRegsVals = sprintf("SELECT * FROM hamco_e_valsXfunc WHERE Id_Evento = %s AND Funcion = %s", GetSQLValueString($colname_MiFuncPreRegsVals, "int"), GetSQLValueString($row_Reg_sel['Funcion'], "text")); | |
$MiFuncPreRegsVals = mysql_query($query_MiFuncPreRegsVals, $Hamco) or die(mysql_error()); | |
$row_MiFuncPreRegsVals = mysql_fetch_assoc($MiFuncPreRegsVals); | |
$totalRows_MiFuncPreRegsVals = mysql_num_rows($MiFuncPreRegsVals); | |
// Si hay aforo/cupo limitado para ésta función ó ésta función requiere asignación de Zona por Autorizador | |
if($row_MiFuncPreRegsVals['Aforo'] or $row_Reg_sel['Zona']=="-ASIGNARA AUTORIZADOR-"){ | |
mysql_select_db($database_Hamco, $Hamco); | |
$query_RegsEnMiFuncion = "SELECT COUNT(*) , AutStatus FROM hamco_registros".$HAM_TMP_evto_tbl." WHERE Funcion = '".$row_Reg_sel['Funcion']."' AND BloCancEliminado = 0 GROUP BY AutStatus"; | |
$RegsEnMiFuncion = mysql_query($query_RegsEnMiFuncion, $Hamco) or die(mysql_error()); | |
$row_RegsEnMiFuncion = mysql_fetch_assoc($RegsEnMiFuncion); | |
$totalRows_RegsEnMiFuncion = mysql_num_rows($RegsEnMiFuncion); | |
// Crear Matriz de RegsEnMiFuncion Agrupados! | |
$DTX_RegsEnMiFuncion=array(); | |
do { | |
$DTX_RegsEnMiFuncion[$row_RegsEnMiFuncion['AutStatus']]=$row_RegsEnMiFuncion["COUNT(*)"]; | |
$DTX_RegsEnMiFuncion['TOTAL']+=$row_RegsEnMiFuncion["COUNT(*)"]; | |
} while ($row_RegsEnMiFuncion = mysql_fetch_assoc($RegsEnMiFuncion)); | |
//// Crear matriz de Tipos de Acreditaciones | |
//$Tipos_Acredits=explode('|',$row_Evento_Selecc['Acreditaciones']); | |
// Preparar Variables para muestra de envío de mail | |
$TMP_Mail=$row_Reg_sel['Email']; | |
$TMP_Reg_Nombre=explode("|",$row_Reg_sel['Nombre']); | |
$TMP_Reg_Nombre_C=implode(" ",$TMP_Reg_Nombre); | |
// Insertar la Cabecera | |
$TMP_Mensaje.=nl2br($row_MiFuncPreRegsVals['CabeceraAuthMail'])."<br /><br />"; | |
// Meter los datos basicos del Registro | |
$TMP_Mensaje.="<strong>Registro No. ".$row_Evento_Selecc['Codigo']."-".$row_Reg_sel['Id_Registro']." </strong><br />"; | |
$TMP_Mensaje.="<strong>Nombre: </strong>".$TMP_Reg_Nombre_C."<br />"; | |
if($row_MiFuncPreRegsVals['EntOrgEmpUniv']) $TMP_EntOrgEmpUniv=$row_MiFuncPreRegsVals['EntOrgEmpUniv']; else $TMP_EntOrgEmpUniv=($row_Evento_Selecc['EntOrgEmpUniv'])? $row_Evento_Selecc['EntOrgEmpUniv']: "Entidad" ; | |
$TMP_Mensaje.="<strong>".$TMP_EntOrgEmpUniv.": </strong>".$row_Reg_sel['Entidad']."<br />"; | |
$TMP_AltFunc=($row_Evento_Selecc['AltFunc'])? $row_Evento_Selecc['AltFunc']: "Funcion" ; | |
$TMP_Mensaje.="<strong>".$TMP_AltFunc.": </strong>".$row_Reg_sel['Funcion']."<br />"; | |
$TMP_Mensaje.="<strong>Zona: </strong>".$row_Reg_sel['Zona']."<br />"; | |
// Insertar la Despedida de las Vars de la Funcion | |
$TMP_Despedida.=nl2br($row_MiFuncPreRegsVals['DespedidaAuthMail']); | |
// Comienza guardado de AUTORIZACIÓN si ya se llenó la forma | |
if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] == "Autorizacion")) { | |
$updateSQL = sprintf("UPDATE hamco_registros".$HAM_TMP_evto_tbl." SET Autorizador=%s, Clave=%s, Zona=%s, AutStatus=%s WHERE Id_Registro=%s", | |
GetSQLValueString($_SESSION['HAM_SS_Username'], "text"), | |
GetSQLValueString(createRandomPassword(9), "text"), | |
GetSQLValueString($_POST['Zona'], "text"), | |
GetSQLValueString($_POST['AutStatus'], "text"), | |
GetSQLValueString($_POST['Id_Registro'], "int")); | |
mysql_select_db($database_Hamco, $Hamco); | |
$Result1 = mysql_query($updateSQL, $Hamco) or die(mysql_error()); | |
// Enviar mail automáticamente en cualquiera de los casos. | |
if($row_MiFuncPreRegsVals['authMail'] && $row_Reg_sel['Email']){ | |
$subject="Cambio en el Registro de ".$TMP_Reg_Nombre[0]; | |
$TMP_Estatus.="<strong>Estado del Registro: ".$_POST['AutStatus']."</strong><br />"; | |
// Insertar el Mensaje Completo | |
$TMP_Mensaje.=$TMP_Estatus."<br />".nl2br($_POST['MailTXT'])."<br /><br />".$TMP_Despedida; | |
include_once("_mail2.php"); | |
DTX_MAIL($row_Evento_Selecc, $TMP_Mail, $subject, $TMP_Mensaje); | |
} | |
// Actualizar la sección de la Lista de Registros donde está el vínculo | |
$HAM_iFR_Cierre="Autorización de Registro -".$_GET['id']."- realizada con Éxito"; | |
$HAM_iFR_Cierre_UPD_Id=$_GET['upd']; | |
$HAM_iFR_Cierre_UPD_HTML=($_POST['AutStatus']=='Denegado')? '<img src="imgs/icos/16/delete-16x16.png" alt="Denegado" width="16" height="16" align="absmiddle" title="Registro Denegado por '.$_SESSION['HAM_SS_Nombre'].'" />' : (($_POST['AutStatus']!='Autorizado')?'<img src="imgs/icos/16/info-icon.png" alt="Info" title="-'.$_POST['AutStatus'].'- por '.$_SESSION['HAM_SS_Nombre'].'" align="absmiddle" />' : recortar($_SESSION['HAM_SS_Nombre'].", generó ".$row_Reg_sel['Alta'],9) ); | |
$HAM_iFR_Cierre_UPD_JS="parent.location.href=parent.location.href;"; | |
// '<img src="imgs/icos/16/delete-16x16.png" alt="Denegado" width="16" height="16" align="absmiddle" title="Registro Denegado por '.$_SESSION['HAM_SS_Nombre'].'" />' | |
// '<img src="imgs/icos/16/info-icon.png" alt="Info" title="-'.$_POST['AutStatus'].'- por '.$_SESSION['HAM_SS_Nombre'].'" align="absmiddle" />'; | |
} | |
//Variables Específicas del Proyecto | |
//Variables Genericas de los Documentos | |
$DOC_proy = "Sistema de Hamco"; | |
$DOC_title = "Revisar Datos de ".$row_Reg_sel['Funcion']." <br />para Autorización de ".str_replace("|"," ",$row_Reg_sel['Nombre']); | |
$DOC_focus = 0; // Forma y Campo a preseleccionar en la carga Ej. ="'capturar','nombres'"; | |
$DOC_back = 0; // Pagina para Regresar (si es 1 lleva a "index.php") Ej. =usefile("reportes.php")."?get=1"; | |
$DOC_print = 0; // Imprimir automáticamente el archivo (debe ocultar la barra superior); | |
$DOC_print_btn = 0; // Mostrar Boton de Impresión?; | |
$DOC_hide_logotitle = 0; // Mostrar el Logo y el título de la página?; | |
?> | |
<?php include("_top.php"); ?> | |
<script language="javascript"> | |
<?php $TXTsAviso=explode('|',$row_Evento_Selecc['AutTxtAviso']); ?> | |
var TXT_Autorizado="<?php echo str_replace(array("\r\n", "\r", "\n"), "<br>", $TXTsAviso[0]); ?>".replace(/<br>/g, '\n'); | |
var TXT_Denegado="<?php echo str_replace(array("\r\n", "\r", "\n"), "<br>", $TXTsAviso[1]); ?>".replace(/<br>/g, '\n'); | |
var TXT_ListaEspera="<?php echo str_replace(array("\r\n", "\r", "\n"), "<br>", $TXTsAviso[2]); ?>".replace(/<br>/g, '\n'); | |
var TXT_Incompleto="<?php echo str_replace(array("\r\n", "\r", "\n"), "<br>", $TXTsAviso[3]); ?>".replace(/<br>/g, '\n'); | |
addLoadEvent(function() { | |
document.getElementById('MailTXT').value=eval('TXT_'+document.getElementById('AutStatus').options[document.getElementById('AutStatus').selectedIndex].value); | |
document.getElementById('EstatusNuevo').innerHTML=document.getElementById('AutStatus').options[document.getElementById('AutStatus').selectedIndex].value; | |
}); | |
</script> | |
<?php | |
// Corroboramos la existencia de Datos Importantes, si no hay alguno, dar aviso: | |
if (!trim($row_Reg_sel['Entidad']) or !trim($row_Reg_sel['Funcion'] or !trim($row_Reg_sel['Zona']))) { | |
?> | |
<center> | |
<br /> | |
<p><span class="err">Falta dato de <?php | |
if(!trim($row_Reg_sel['Entidad'])) echo "Entidad"; | |
if(!trim($row_Reg_sel['Entidad']) && !trim($row_Reg_sel['Funcion'])) echo " y de "; | |
if(!trim($row_Reg_sel['Funcion'])) echo "Función"; | |
if((!trim($row_Reg_sel['Entidad']) && !trim($row_Reg_sel['Zona'])) or (!trim($row_Reg_sel['Funcion']) && !trim($row_Reg_sel['Zona']))) echo " y de "; | |
if(!trim($row_Reg_sel['Zona'])) echo "Zona"; | |
?></span></p><br /> | |
<p>Edite y complete el registro por favor, <br />ó contacte con un Supervisor para que complete el <strong>Registro # <?php echo $_GET['id']; ?></strong></p> | |
<p> | |
<input type="button" value="CERRAR" onclick="parent.jQuery.fancybox.close();" /> | |
</p> | |
<p> </p> | |
</center> | |
<?php | |
exit(); | |
// Ponemos la forma (cuando no ha sido llenada y todos los datos están listos). | |
} else if (isset($_GET['id'])) { | |
?> | |
<script type="text/javascript" src="scripts/_scripts.js"></script> | |
<center> | |
<h3>Revisar Datos de <?php echo $row_Reg_sel['Funcion']." <br />para Autorización de ".str_replace("|"," ",$row_Reg_sel['Nombre']); ?> | |
</h3> | |
<form action="<?php echo $editFormAction; ?>" method="post" name="Autorizacion" id="Autorizacion"> | |
<table align="center"> | |
<tr valign="baseline"> | |
<td nowrap="nowrap" align="right"># Registro:</td> | |
<td><?php echo $row_Reg_sel['Id_Registro']; ?></td> | |
</tr> | |
<tr valign="baseline"> | |
<td nowrap="nowrap" align="right">Acreditacion:</td> | |
<td><?php echo $row_Reg_sel['Acreditacion']; ?></td> | |
</tr> | |
<tr valign="baseline"> | |
<td nowrap="nowrap" align="right">Nombre:</td> | |
<td><?php echo str_replace("|"," ",$row_Reg_sel['Nombre']); ?></td> | |
</tr> | |
<?php if($row_Reg_sel['Acompana']){ ?> | |
<tr valign="baseline"> | |
<td nowrap="nowrap" align="right"><strong>Acompaña a:</strong></td> | |
<td><strong><?php echo str_replace("|"," ",$row_Reg_sel['Acompana']); ?></strong></td> | |
</tr> | |
<?php } ?> | |
<?php if($row_Reg_sel['Entidad']!="-NO SE USA-"){ ?> | |
<tr valign="baseline"> | |
<td nowrap="nowrap" align="right">Entidad:</td> | |
<td><?php echo $row_Reg_sel['Entidad']; ?></td> | |
</tr> | |
<?php } ?> | |
<tr valign="baseline"> | |
<td nowrap="nowrap" align="right">Email:</td> | |
<td><?php echo ($row_Reg_sel['Acompana']!="")? "<strong>-NO USA, ES ACOMPAÑANTE-</strong>": $row_Reg_sel['Email']; ?></td> | |
</tr> | |
<?php | |
if($row_Reg_sel['Datos_Int_Registro']){ | |
$TMP_DatsIntsName=explode("|", $row_Evento_Selecc['Datos_Int_Registro']); | |
$TMP_DatsIntsVals=explode("|", $row_Reg_sel['Datos_Int_Registro']); | |
muestraDatosAcumulados($TMP_DatsIntsName,$TMP_DatsIntsVals); | |
} | |
if($row_Reg_sel['Datos_Adic']){ | |
$TMP_DatsAdsName=explode("|", $row_Evento_Selecc['Datos_Adic_Registro']); | |
$TMP_DatsAdsVals=explode("|", $row_Reg_sel['Datos_Adic']); | |
muestraDatosAcumulados($TMP_DatsAdsName,$TMP_DatsAdsVals); | |
} | |
if($row_Reg_sel['Dts_Ads_FuncPreReg']){ | |
$TMP_FuncDatsName=explode("|", $row_MiFuncPreRegsVals['Dts_Ads_FuncPreReg']); | |
$TMP_FuncDatsVals=explode("|", $row_Reg_sel['Dts_Ads_FuncPreReg']); | |
muestraDatosAcumulados($TMP_FuncDatsName,$TMP_FuncDatsVals); | |
} | |
if($row_Reg_sel['Foto']){ | |
?> | |
<tr valign="baseline"> | |
<td nowrap="nowrap" align="right">Foto:</td> | |
<td><?php echo $row_Reg_sel['Foto']; ?></td> | |
</tr> | |
<?php | |
} | |
if($row_Reg_sel['Biometria']){ | |
?> | |
<tr valign="baseline"> | |
<td nowrap="nowrap" align="right">Biometria:</td> | |
<td><?php echo $row_Reg_sel['Biometria']; ?></td> | |
</tr> | |
<?php | |
} | |
?> | |
<tr valign="baseline"> | |
<td nowrap="nowrap" align="right">Zona:</td> | |
<td><?php | |
if(!$row_Evento_Selecc['paypal_email'] && $row_Reg_sel['Zona']=="-ASIGNARA AUTORIZADOR-"){ ?> | |
<select name="Zona" ><?php | |
$Nombre_Zona = explode("|",$row_Evento_Selecc['Zonas']); | |
for($i=0;$i<count($Nombre_Zona);$i++){ ?> | |
<option value="<?php echo $Nombre_Zona[$i]; ?>"><?php echo $Nombre_Zona[$i]; ?></option> | |
<?php | |
} ?> | |
</select><?php | |
} else { | |
echo $row_Reg_sel['Zona']; ?> | |
<input type="hidden" name="Zona[]" value="<?php echo $row_Reg_sel['Zona']; ?>" /><?php | |
} | |
?></td> | |
</tr> | |
<tr valign="baseline"> | |
<td nowrap="nowrap" align="right">Funcion:</td> | |
<td><?php echo $row_Reg_sel['Funcion']; ?></td> | |
</tr> | |
<?php | |
if($row_Reg_sel['Estatus']){ | |
?> | |
<tr valign="baseline"> | |
<td nowrap="nowrap" align="right">Estatus:</td> | |
<td><?php echo $row_Reg_sel['Estatus']; ?></td> | |
</tr> | |
<?php | |
} | |
if($row_Reg_sel['Notas']){ | |
?> | |
<tr valign="baseline"> | |
<td nowrap="nowrap" align="right">Notas:</td> | |
<td><?php echo $row_Reg_sel['Notas']; ?></td> | |
</tr> | |
<?php | |
} | |
if($row_Evento_Selecc['paypal_email']){ ?> | |
<tr valign="baseline"> | |
<td nowrap="nowrap" align="right">Medio de Pago:</td> | |
<td><?php echo $row_Reg_sel['Pago_Medio']; ?></td> | |
</tr> | |
<tr valign="baseline"> | |
<td nowrap="nowrap" align="right">Id del Pago:</td> | |
<td><?php echo $row_Reg_sel['Pago_Id']; ?></td> | |
</tr> | |
<?php } ?> | |
<tr valign="baseline"> | |
<td nowrap="nowrap" align="right">Estatus Autorización:</td> | |
<td><strong><?php echo ($row_Reg_sel['AutStatus'])? $row_Reg_sel['AutStatus'] : "-SIN AUTORIZACION-"; ?></strong> </td> | |
</tr> | |
<tr valign="baseline"> | |
<td nowrap="nowrap" align="right">Autorizó:</td> | |
<td><strong><?php echo ($row_Reg_sel['Autorizador'])? $row_Reg_sel['Autorizador'] : "-SIN AUTORIZADOR-"; ?></strong> </td> | |
</tr> | |
<tr valign="baseline"> | |
<td nowrap="nowrap" align="right"> </td> | |
<td> </td> | |
</tr> | |
<tr valign="baseline"> | |
<td nowrap="nowrap" align="right">Proceder a:</td> | |
<td><select name="AutStatus" id="AutStatus" onchange="document.getElementById('MailTXT').value=eval('TXT_'+this.options[this.selectedIndex].value);document.getElementById('EstatusNuevo').innerHTML=this.options[this.selectedIndex].value;"> | |
<?php if(!$row_Evento_Selecc['paypal_email'] or ($DTX_RegsEnMiFuncion['Autorizado'] < $row_MiFuncPreRegsVals['Aforo'])){ ?> | |
<option value="Autorizado" <?php if($row_MiFuncPreRegsVals['Aforo'] && $DTX_RegsEnMiFuncion['Autorizado']>=$row_MiFuncPreRegsVals['Aforo']){ ?>disabled="disabled"<?php } ?>>Autorizar</option> | |
<?php } ?> | |
<?php if($row_MiFuncPreRegsVals['Lista_Espera'] && ($DTX_RegsEnMiFuncion['ListaEspera'] < $row_MiFuncPreRegsVals['Lista_Espera'])){ ?> | |
<option value="ListaEspera" <?php if($DTX_RegsEnMiFuncion['ListaEspera']>=$row_MiFuncPreRegsVals['Lista_Espera']){ ?>disabled="disabled"<?php } ?>>Agregar a la Lista de Espera</option> | |
<?php } | |
if($row_MiFuncPreRegsVals['authMail'] && $row_Reg_sel['Email']){ ?> | |
<option value="Incompleto">Solicitar Información Faltante</option> | |
<?php } ?> | |
<option value="Denegado">Denegar el Registro</option> | |
</select> | |
<img src="imgs/icos/16/info-icon.png" width="16" height="16" alt="Info" align="absmiddle" title="<?php echo "MONTOS EN -".$row_Reg_sel['Funcion']."-:\n"; | |
if($row_MiFuncPreRegsVals['Aforo']) echo $row_MiFuncPreRegsVals['Aforo']."-Aforo Máximo Autorizado,\n"; | |
if($row_MiFuncPreRegsVals['Lista_Espera']) echo $row_MiFuncPreRegsVals['Lista_Espera']."-Tamaño de Lista de Espera,\n"; | |
echo "==================== | |
".$DTX_RegsEnMiFuncion['TOTAL']."-REGISTROS EXISTENTES:\n | |
\t".(($DTX_RegsEnMiFuncion[''])?$DTX_RegsEnMiFuncion['']."-SIN AUTORIZAR | |
\t":"").(($DTX_RegsEnMiFuncion['Autorizado'])?$DTX_RegsEnMiFuncion['Autorizado']."-AUTORIZADOS | |
\t":"").(($DTX_RegsEnMiFuncion['ListaEspera'])?$DTX_RegsEnMiFuncion['ListaEspera']."-EN LISTA DE ESPERA | |
\t":"").(($DTX_RegsEnMiFuncion['Incompleto'])?$DTX_RegsEnMiFuncion['Incompleto']."-INCOMPLETOS | |
\t":"").(($DTX_RegsEnMiFuncion['Denegado'])?$DTX_RegsEnMiFuncion['Denegado']."-DENEGADOS | |
":"").((0)?print_r($DTX_RegsEnMiFuncion,true):"");?>" /></td> | |
</tr> | |
<?php if($row_MiFuncPreRegsVals['authMail'] && $row_Reg_sel['Email']){ ?> | |
<tr valign="baseline"> | |
<td nowrap="nowrap" align="right">Inicio del Correo:</td> | |
<td style="font-size:12px; background-color:#FFF; border: 1px solid black; border-bottom-width:0;"><?php echo $TMP_Mensaje; ?><strong>Estado del Registro: <span id="EstatusNuevo"></span></strong><br /></td> | |
</tr> | |
<tr valign="baseline"> | |
<td nowrap="nowrap" align="right">Cuerpo del Correo:</td> | |
<td style="font-size:12px; background-color:#FFF;"><textarea name="MailTXT" id="MailTXT" rows="6" style="font-size:12px; background-color:#FFF; width:98%; resize:vertical; border: 1px solid black; border-top:1px dashed gray; border-bottom: 1px dashed gray;"></textarea></td> | |
</tr> | |
<tr valign="baseline"> | |
<td nowrap="nowrap" align="right">Final del Correo:</td> | |
<td style="font-size:12px; background-color:#FFF; border: 1px solid black; border-top-width:0;"><?php echo $TMP_Despedida; ?></td> | |
</tr> | |
<?php } else { ?> | |
<tr valign="baseline"> | |
<td align="center" colspan="2"><strong>No se enviará correo de aviso pues<br /> <?php if (!$row_MiFuncPreRegsVals['authMail']) echo "no está activado el aviso de Cambios de Estado en ".$row_MiFuncPreRegsVals['Funcion']; if (!$row_MiFuncPreRegsVals['authMail'] && !$row_Reg_sel['Email']) echo " y <br />"; if(!$row_Reg_sel['Email']) echo "el registro no cuenta con correo indicado"; echo "." ?></strong> </td> | |
</tr> | |
<?php } ?> | |
<tr valign="baseline"> | |
<td nowrap="nowrap" align="right"> </td> | |
<td> </td> | |
</tr> | |
<tr valign="baseline"> | |
<td nowrap="nowrap" align="right"> </td> | |
<td><input type="submit" value="Guardar el CAMBIO" /></td> | |
</tr> | |
</table> | |
<input type="hidden" name="MM_update" value="Autorizacion" /> | |
<input type="hidden" name="Id_Registro" value="<?php echo $row_Reg_sel['Id_Registro']; ?>" /> | |
</form> | |
</center> | |
<br /> | |
<?php /*?> | |
<p> | |
<input type="button" value="CERRAR" onclick="parent.jQuery.fancybox.close();" /> | |
</p> | |
<?php */?> | |
<?php | |
// NO SE RECONOCE LA ACCION QUE SE DESEA REALIZAR | |
} else { | |
?> | |
<center> | |
<br /> | |
<p><span class="err">No se reconoce la acción</span></p> | |
<p>Contacte con el Administrador mencionando éstas líneas:<br /><strong> | |
<?php echo "HTTP_REFERER: ".$HTTP_SERVER_VARS['HTTP_REFERER']."<br />"; | |
echo "REQUEST_URI: ".$_SERVER['REQUEST_URI']; ?></strong></p> | |
<p> | |
<input type="button" value="CERRAR" onclick="parent.jQuery.fancybox.close();" /> | |
</p> | |
<p> </p> | |
</center> | |
<?php | |
} | |
// if ! aforo: (guardar el cambio) | |
} else { | |
// Comienza guardado de AUTORIZACIÓN RÁPIDA | |
$updateSQL = sprintf("UPDATE hamco_registros".$HAM_TMP_evto_tbl." SET Autorizador=%s, AutStatus=%s WHERE Id_Registro=%s", | |
GetSQLValueString($_SESSION['HAM_SS_Nombre'], "text"), | |
GetSQLValueString('Autorizado', "text"), | |
GetSQLValueString($row_Reg_sel['Id_Registro'], "int")); | |
mysql_select_db($database_Hamco, $Hamco); | |
$Result1 = mysql_query($updateSQL, $Hamco) or die(mysql_error()); | |
// Si ésta función requiere mandar aviso de autorización y hay mail | |
if($row_MiFuncPreRegsVals['authMail'] && $row_Reg_sel['Email']){ | |
// Preparar Variables para muestra de envío de mail | |
$TMP_Mail=$row_Reg_sel['Email']; | |
$TMP_Reg_Nombre=explode("|",$row_Reg_sel['Nombre']); | |
$TMP_Reg_Nombre_C=implode(" ",$TMP_Reg_Nombre); | |
// Insertar la Cabecera | |
$TMP_Mensaje.=nl2br($row_MiFuncPreRegsVals['CabeceraAuthMail'])."<br /><br />"; | |
// Meter los datos basicos del Registro | |
$TMP_Mensaje.="<strong>Registro No. ".$row_Evento_Selecc['Codigo']."-".$row_Reg_sel['Id_Registro']." </strong><br />"; | |
$TMP_Mensaje.="<strong>Nombre: </strong>".$TMP_Reg_Nombre_C."<br />"; | |
if($row_MiFuncPreRegsVals['EntOrgEmpUniv']) $TMP_EntOrgEmpUniv=$row_MiFuncPreRegsVals['EntOrgEmpUniv']; else $TMP_EntOrgEmpUniv=($row_Evento_Selecc['EntOrgEmpUniv'])? $row_Evento_Selecc['EntOrgEmpUniv']: "Entidad" ; | |
$TMP_Mensaje.="<strong>".$TMP_EntOrgEmpUniv.": </strong>".$row_Reg_sel['Entidad']."<br />"; | |
$TMP_AltFunc=($row_Evento_Selecc['AltFunc'])? $row_Evento_Selecc['AltFunc']: "Funcion" ; | |
$TMP_Mensaje.="<strong>".$TMP_AltFunc.": </strong>".$row_Reg_sel['Funcion']."<br />"; | |
$TMP_Mensaje.="<strong>Zona: </strong>".$row_Reg_sel['Zona']."<br />"; | |
// Insertar la Despedida de las Vars de la Funcion | |
$TMP_Despedida.=nl2br($row_MiFuncPreRegsVals['DespedidaAuthMail']); | |
// Enviar mail automáticamente en cualquiera de los casos. | |
$subject="Cambio en el Registro de ".$TMP_Reg_Nombre[0]; | |
$TMP_Estatus.="<strong>Estado del Registro: Autorizado </strong><br />"; | |
// Insertar el Mensaje Completo | |
$TMP_Mensaje.=$TMP_Estatus."<br /><br />".$TMP_Despedida; | |
include_once("_mail2.php"); | |
DTX_MAIL($row_Evento_Selecc, $TMP_Mail, $subject, $TMP_Mensaje); | |
} | |
// Actualizar la sección de la Lista de Registros donde está el vínculo | |
$HAM_iFR_Cierre="Autorización de Registro -".$_GET['id']."- realizada con Éxito"; | |
$HAM_iFR_Cierre_UPD_Id=$_GET['upd']; | |
$HAM_iFR_Cierre_UPD_HTML=recortar($_SESSION['HAM_SS_Nombre'].", generó ".$row_Reg_sel['Alta']."\\nEstatus de Autorización: Autorizado",9); | |
// Si corresponde poner liga de Entregas... | |
if(($row_Evento_Selecc['Acreditaciones']) and (in_array("regs(Impr)", $HAM_UserPermisos) or in_array("regs(Admin)", $HAM_UserPermisos) or ($HAM_UserPermisos[0]=="*"))) { | |
// Actualizar la sección de la Lista de Registros donde está el vínculo | |
$HAM_iFR_Cierre_UPD2_Id="PreEntrega".$row_Reg_sel['Id_Registro']; | |
/*/ | |
$HAM_iFR_Cierre_UPD2_HTML="F5"; | |
/*/ | |
$HAM_iFR_Cierre_UPD2_HTML=recortar($_GET['entr'],2,0)."\'s ".'<span id="Entrega'.$row_Reg_sel['Id_Registro'].'"><a class="iFrameCierraCH" href="'.usefile("reg_mod_Entrega.php").'?evto='.$HAM_TMP_evto.'&id='.$row_Reg_sel['Id_Registro'].'&ent='.$_GET['entr'].'&top=iframed&upd=Entrega'.$row_Reg_sel['Id_Registro'].'"><img src="imgs/icos/16/next-16x16.png" width="16" height="16" title="Capturar Entrega de PRIMER '.$_GET['entr'].'" align="absmiddle" /></a></span>'; | |
$HAM_iFR_Cierre_UPD2_JS='parent.$("a.iFrameCierraCH").fancybox({ | |
type : "iframe", | |
autoScale : true, | |
width : 500, | |
height : 500, | |
titleShow : false, | |
centerOnScroll : true | |
});'; | |
/**/ | |
} | |
// Si corresponde poner liga de Impresion... | |
if(($row_Evento_Selecc['Acr_Personalizadas']) and (in_array("regs(Impr)", $HAM_UserPermisos) or in_array("regs(Admin)", $HAM_UserPermisos) or ($HAM_UserPermisos[0]=="*"))) { | |
// Actualizar la sección de la Lista de Registros donde está el vínculo | |
$HAM_iFR_Cierre_UPD2_Id="ParaImprimir".$row_Reg_sel['Id_Registro']; | |
$HAM_iFR_Cierre_UPD2_HTML=recortar($row_Reg_sel['Acreditacion'],2,0)."\'s ".'<a href="'.usefile("regs_impr.php").'?evto='.$HAM_TMP_evto.'&id='.$row_Reg_sel['Id_Registro'].'&acred='.$row_Reg_sel['Acreditacion'].'"><img src="imgs/icos/16/b_print.png" width="16" height="16" title="Imprimir PRIMER '.$row_Reg_sel['Acreditacion'].'" align="absmiddle" /></a>'; | |
} | |
include("_top.php"); | |
} | |
if(1){ | |
echo "<!--"; | |
echo "POST:\n"; | |
echo print_r($_POST); | |
echo "\nGET:\n"; | |
echo print_r($_GET); | |
echo "\nSession:\n"; | |
echo print_r($_SESSION); | |
echo "\nHTTP_REFERER: \n".$HTTP_SERVER_VARS['HTTP_REFERER']; | |
echo "\nupdateSQL: \n".$updateSQL; | |
echo "\nupdateGoTo: \n".$updateGoTo; | |
echo "\n-->"; | |
} | |
if(0){ | |
?> | |
<script language="javascript"> | |
<!-- | |
//setTimeout("parent.jQuery.fancybox.close();",5000); | |
//history.back(); | |
//location.reload(true); | |
--> | |
</script> | |
<?php | |
} | |
?> | |
<?php include("_bott.php"); ?> | |
<?php | |
mysql_free_result($Reg_sel); | |
mysql_free_result($Evento_Selecc); | |
if($row_MiFuncPreRegsVals['Aforo']){ | |
mysql_free_result($RegsEnMiFuncion); | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment