function jsaGetUInfo($user) { $xUsr = new cSystemUser($user, false); $xUsr->init(); $VD = $xUsr->getDatosInArray(); //getSAFEUserInfoByName($user); $tab = new TinyAjaxBehavior(); if (isset($VD["idusuarios"])) { //$tab -> add(TabSetValue::getBehavior('idNombreCompleto', $VD["nombres"] )); //$tab -> add(TabSetValue::getBehavior('idApellidoPaterno', $VD["apellidopaterno"] )); //$tab -> add(TabSetValue::getBehavior('idApellidoMaterno', $VD["apellidomaterno"] )); $tab->add(TabSetValue::getBehavior('idNivelAcceso', $VD["niveldeacceso"])); $tab->add(TabSetValue::getBehavior('idSucursal', $VD["sucursal"])); $tab->add(TabSetValue::getBehavior('idUsuario', $VD["idusuarios"])); $tab->add(TabSetValue::getBehavior('idPuesto', $VD["puesto"])); $tab->add(TabSetValue::getBehavior('idsocio', $xUsr->getClaveDePersona())); } else { $tab->add(TabSetValue::getBehavior('idUsuario', 0)); } return $tab->getString(); }
/** * Funcion que Retorna una Ficha Descriptiva por el recibo * @param boolean $fieldset * @param string $trTool * @param string $wTable * @return string */ function getFicha($fieldset = false, $trTool = "", $extend = false) { $this->init(); $xLg = new cLang(); $personaAsoc = $this->getPersonaAsociada(); //$fichaEmpresa = ""; if ($this->mReciboIniciado == false) { $exoFicha = "<div class='error'>" . $xLg->get(MSG_NO_DATA) . "</div>"; } else { $xLg = new cLang(); $tool = $trTool; if ($extend == true) { $xUsr = new cSystemUser($this->getCodigoDeUsuario()); $xUsr->init(); $xSoc = new cSocio($this->getCodigoDeSocio()); $xSoc->init(); $tool .= "<tr><th class='izq'>" . $xLg->getT("TR.persona") . "</th>"; $tool .= "<td>" . $xSoc->getNombreCompleto() . "</td>"; $tool .= "<th class='izq'>" . $xLg->getT("TR.Documento") . "</th>"; $tool .= "<td>" . $this->getCodigoDeDocumento() . "</td>"; $tool .= "<tr><th class='izq'>" . $xLg->getT("TR.Elabora") . "</th>"; $tool .= "<td>" . $xUsr->getNombreCompleto() . "</td>"; if ($this->isDeEmpresa() == true) { $xEmp = new cEmpresas($personaAsoc); $xEmp->init(); $tool .= "<th class='izq'>" . $xLg->getT("TR.Empresa") . "</th>"; $tool .= "<td>" . $xEmp->getNombre() . "</td>"; } $tool .= "</tr>"; } if ($this->isDivisaExtranjera() == true) { $tool .= "<tr><th class='izq'>" . $xLg->getT("TR.Moneda") . "</th>"; $tool .= "<td>" . $this->getMoneda() . "</td>"; $tool .= "<th class='izq'>" . $xLg->getT("TR.Original") . "</th>"; $tool .= "<td>" . $this->getUnidadesOriginales() . "</td>"; $tool .= "</tr>"; } $xF = new cFecha(0); $exoFicha = "\n\t\t\t\t<table id=\"ficharecibo\">\n\t\t\t\t<tbody>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<th class='izq'>Numero de Recibo</th>\n\t\t\t\t\t\t<td class='mny'>" . $this->mCodigoDeRecibo . "</td>\n\t\t\t\t\t\t<th class='izq'>Tipo de Recibo</th>\n\t\t\t\t\t\t<td>" . $this->mTipoDescripcion . "</td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<th class='izq'>Fecha de Recibo</th>\n\t\t\t\t\t\t<td>" . $xF->getFechaCorta($this->mFechaDeOperacion) . "</td>\n\t\t\t\t\t\t<th class='izq'>Recibo Fiscal</th>\n\t\t\t\t\t\t<td>" . $this->mReciboFiscal . "</td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<th class='izq'>Tipo de Pago</th>\n\t\t\t\t\t\t<td>" . strtoupper($this->mTipoDePago) . "</td>\n\t\t\t\t\t\t<th class='izq'>Total</th>\n\t\t\t\t\t\t<td>" . getFMoney($this->mTotalRecibo) . "</td>\n\n\t\t\t\t\t</tr>\n\n\t\t\t\t\t{$tool}\n\t\t\t\t</tbody>\n\t\t\t\t</table>"; if ($fieldset == true) { $exoFicha = "<fieldset>\n\t\t\t\t\t\t\t\t<legend> INFORMACIÓN DEL RECIBO </legend>\n\t\t\t\t\t\t\t\t{$exoFicha}\n\t\t\t\t\t\t\t</fieldset>"; } } return $exoFicha; }
function setPolizaPorRecibo($recibo, $generador = false) { $sucess = false; $QL = new MQL(); $xLogg = new cCoreLog(); //$arrEquivEfvo = //if (GENERAR_CONTABILIDAD == true){ $xLogg->add("=======\tGENERAR POLIZA POR RECIBO NUM {$recibo}\r\n", $xLogg->DEVELOPER); $xT = new cCatalogoOperacionesDeCaja(); $centro_de_costo = DEFAULT_CENTRO_DE_COSTO; //($generador == GENERAR_POLIZAS_AL_CIERRE) AND if (setNoMenorQueCero($recibo) > 0) { $xRec = new cReciboDeOperacion(false, false, $recibo); if ($xRec->init() == true) { $sucess = true; //Obten datos del recibo para la Poliza $sqlRec = "SELECT\r\n\t\t\t\t\t\t\t`operaciones_recibos`.*,\r\n\t\t\t\t\t\t\t`operaciones_recibostipo`.`tipo_poliza_generada`,\r\n\t\t\t\t\t\t`operaciones_recibostipo`.`afectacion_en_flujo_efvo`\r\n\t\t\t\t\t\tFROM\r\n\t\t\t\t\t\t\t`operaciones_recibos` `operaciones_recibos`\r\n\t\t\t\t\t\t\t\tINNER JOIN `operaciones_recibostipo`\r\n\t\t\t\t\t\t\t\t`operaciones_recibostipo`\r\n\t\t\t\t\t\t\t\tON `operaciones_recibos`.`tipo_docto` =\r\n\t\t\t\t\t\t\t\t`operaciones_recibostipo`.\r\n\t\t\t\t\t\t\t\t`idoperaciones_recibostipo`\r\n\t\t\t\t\t\tWHERE\r\n\t\t\t\t\t\t\t(`operaciones_recibos`.`idoperaciones_recibos` = {$recibo})\r\n\t\t\t\t\t\tLIMIT 0,1 "; $dRec = obten_filas($sqlRec); $tipo_de_pago = $xRec->getTipoDePago(); //Corrige los cargos de la PolizaS $total_poliza = 0; $SQLSumCargos = "SELECT SUM(monto) AS 'total' FROM contable_polizas_proforma\r\n\t\t\t\t\t\t\t\t\t\t\t\tWHERE contable_operacion = '" . TM_CARGO . "'\r\n\t\t\t\t\t\t\t\t\t\t\t\tAND numero_de_recibo={$recibo} "; $TMPCargos = mifila($SQLSumCargos, "total"); $SQLSumAbonos = "SELECT SUM(monto) AS 'total' FROM contable_polizas_proforma\r\n\t\t\t\t\t\t\t\t\t\t\t\tWHERE contable_operacion = '" . TM_ABONO . "'\r\n\t\t\t\t\t\t\t\t\t\t\t\tAND numero_de_recibo={$recibo} "; $TMPAbonos = mifila($SQLSumAbonos, "total"); if ($TMPCargos > $TMPAbonos) { $diferencia = $TMPAbonos - $TMPCargos; $diferencia = $diferencia < 0 ? $diferencia * -1 : $diferencia; $total_poliza = $TMPCargos; setPolizaProforma($recibo, $xT->getTipoOperacionByTipoPago($tipo_de_pago), $diferencia, 1, 1, TM_ABONO); $xLogg->add("OK\tCUADRAR\tABONO\tOperacion Agregada por DESCUADRE en {$tipo_de_pago} por {$diferencia}\r\n", $xLogg->DEVELOPER); //$xLogg->add( , $xLogg->DEVELOPER); } elseif ($TMPCargos < $TMPAbonos) { $diferencia = $TMPCargos - $TMPAbonos; $diferencia = $diferencia < 0 ? $diferencia * -1 : $diferencia; $total_poliza = $TMPAbonos; setPolizaProforma($recibo, $xT->getTipoOperacionByTipoPago($tipo_de_pago), $diferencia, 1, 1, TM_CARGO); $xLogg->add("OK\tCUADRAR\tCARGOS\tOperacion Agregada por DESCUADRE en {$tipo_de_pago} por {$diferencia}\r\n", $xLogg->DEVELOPER); } else { $total_poliza = $TMPCargos; } //tipos de Poliza 1=ingreso, 2=egreso, 3 Diario, 4=orden 5 $xD = new cFecha(0, $xRec->getFechaDeRecibo()); $numero_de_recibo = $recibo; $tipo_de_poliza = $xRec->getOTipoRecibo()->getTipoPolizaContable(); $fecha_de_poliza = $xRec->getFechaDeRecibo(); $ejercicio_de_poliza = $xD->anno(); $periodo_de_poliza = $xD->mes(); $recibo_fiscal = strlen($xRec->getReciboFiscal()) > 2 ? ";RF:" . $xRec->getReciboFiscal() : ""; $observacion_recibo = $xRec->getObservaciones(); $cheque = strlen($xRec->getNumeroDeCheque()) > 2 ? ";Ch:" . $xRec->getNumeroDeCheque() : ""; $concepto_poliza = substr("R:" . $numero_de_recibo . $recibo_fiscal . $cheque . ";" . $xRec->getObservaciones(), 0, 80); $flujo_efectivo = $xRec->getOTipoRecibo()->getAfectacionEnEfvo(); $socio = $xRec->getCodigoDeSocio(); $propietario = $xRec->getCodigoDeUsuario(); $xLogg->add("=====\tRECIBO TIPO: " . $xRec->getTipoDeRecibo() . " SUMA: " . $xRec->getTotal() . " \r\n", $xLogg->DEVELOPER); //------------------ Agregar Poliza $xPol = new cPoliza($tipo_de_poliza, false, $ejercicio_de_poliza, $periodo_de_poliza); $xPol->add($concepto_poliza, $fecha_de_poliza, false, 0, 0, $propietario, $centro_de_costo, $recibo); $numero_de_poliza = $xPol->get(); $xLogg->add("=====\tPOLIZA NUM: {$numero_de_poliza} | TIPO: {$tipo_de_poliza} | EJERCICIO: {$ejercicio_de_poliza} | PERIODO: {$periodo_de_poliza}\r\n", $xLogg->DEVELOPER); $sucess = $xPol->mRaiseError == true ? false : true; //------------------ Leer la PROFORMA $sqlMvtosToPoliza = "SELECT\r\n\t\t\t\t\t`contable_polizas_proforma`.*,\r\n\t\t\t\t\t`operaciones_tipos`.*\r\n\t\t\r\n\t\t\t\t\tFROM\r\n\t\t\t\t\t`operaciones_tipos` `operaciones_tipos`\r\n\t\t\t\t\t\tINNER JOIN `contable_polizas_proforma`\r\n\t\t\t\t\t\t`contable_polizas_proforma`\r\n\t\t\t\t\t\tON `operaciones_tipos`.`idoperaciones_tipos` =\r\n\t\t\t\t\t\t`contable_polizas_proforma`.`tipo_de_mvto`\r\n\t\t\t\t\t\tAND `contable_polizas_proforma`.`numero_de_recibo` = {$numero_de_recibo}\r\n\t\t\t\t\tORDER BY\r\n\t\t\t\t\t\t`contable_polizas_proforma`.`contable_operacion` DESC,\r\n\t\t\t\t\t\t`contable_polizas_proforma`.`socio`,\r\n\t\t\t\t\t\t`contable_polizas_proforma`.`tipo_de_mvto`\t\t\t\t\r\n\t\t\t\t\t"; if ($sucess == true) { $rs = $QL->getDataRecord($sqlMvtosToPoliza); foreach ($rs as $rw) { $cuenta = CUENTA_DE_CUADRE; $nombre = ""; $socio = $rw["socio"]; if (CONTABLE_CUENTAS_POR_SOCIO == true) { $xSoc = new cSocio($socio, true); $nombre = $xSoc->getNombreCompleto(); } $documento = $rw["documento"]; $monto_movimiento = $rw["monto"]; $tipoOp = $rw["tipo_de_mvto"]; $tipo_movimiento = $rw["contable_operacion"]; $RecUsr = $rw["idusuario"]; $cuenta_bancaria = $rw["banco"]; $cargo_movimiento = 0; $abono_movimiento = 0; if ($tipo_movimiento == TM_CARGO) { $cargo_movimiento = $monto_movimiento; $abono_movimiento = 0; } else { $cargo_movimiento = 0; $abono_movimiento = $monto_movimiento; } $formula = $rw["cuenta_contable"]; //Corregir de urgencia: OK: 06Oct2011 $sForms = new cValorarFormulas(); $cuenta = $sForms->getCuentaContable($socio, $documento, $formula, $RecUsr, $xRec->getNumeroDeCheque(), $cuenta_bancaria); $xLogg->add($sForms->getMessages(), $xLogg->DEVELOPER); //tipo de cuenta es Abonos a efectivo if ($cuenta != "NO_CONTABILIZAR") { $xCuenta = new cCuentaContable($cuenta); $xCuenta->init(); $cuenta = $xCuenta->get(); //Carga los datos del Oficial if ($xCuenta->getEsCuentaDeCirculante() == true) { $xOf = new cSystemUser($RecUsr); $xOf->init(); $nombre = $xOf->getNombreCompleto(); $xLogg->add("OK\tCUENTA_ADD\tLa Cuenta {$cuenta} de Carga por Usuario [ {$nombre} ]\r\n", $xLogg->DEVELOPER); } else { $xLogg->add("OK\tCUENTA\tLa Cuenta de Trabajo es {$cuenta} Originado del Socio {$socio}\r\n", $xLogg->DEVELOPER); } //verifica para dar de alta a la cuenta $Existentes = $xCuenta->getCountCuenta(); if ($Existentes == false) { $xLogg->add("WARN\tCUENTA_ADD\tLa Cuenta de Trabajo {$cuenta} NO EXISTE, se AGREGA\r\n", $xLogg->DEVELOPER); $cuenta = $xCuenta->add($nombre); if ($xCuenta->mRaiseError == true) { //$msg .= "ERROR\tLa Cuenta de Trabajo $cuenta NO EXISTE\r\n"; //$msg = $xCuenta->getMessages(); } } $xCuenta->init(); $xPol->addMovimiento($cuenta, $cargo_movimiento, $abono_movimiento, "{$socio}", "{$documento}:{$tipoOp}", false, $fecha_de_poliza); //$xLogg->add("WARN\tNO_CONT\tAGREGAR $cuenta, $cargo_movimiento, $abono_movimiento\r\n" , $xLogg->DEVELOPER); $xLogg->add($xCuenta->getMessages(), $xLogg->DEVELOPER); } else { $xLogg->add("WARN\tNO_CONT\tEl Movimiento de {$socio} | {$documento} | {$tipoOp} de Monto {$monto_movimiento} se OMITE\r\n", $xLogg->DEVELOPER); } } $xPol->setFinalizar(); } //sucess $xLogg->add($xPol->getMessages(), $xLogg->DEVELOPER); $this->mIDDePoliza = $xPol->getCodigo(); } } //END VALUE.- GENERAR AL FINAL //} //END VALUE.- GENERAR CONTABILIDAD $this->mMessages .= $xLogg->getMessages(); return $xLogg->getMessages(); }
function getImportarDesdeAsociada($tipo) { $result = true; $svc = new MQLService("", ""); $cmd = $svc->getEncryptData($tipo); $xTu = new cSystemUser(TASK_USR, false); $xTu->init(); $ctx = $xTu->getCTX(); $data = $svc->getEncryptData($this->mCodigo); $host = SVC_ASOCIADA_HOST; switch ($tipo) { case TPERSONAS_GENERALES: $dpersona = $svc->getService($host . "svc/exportar.svc.php?ctx={$ctx}&data={$data}&cmd={$cmd}"); if (is_array($dpersona)) { $xSoc = new cSocios_general($dpersona); if (setNoMenorQueCero($xSoc->codigo()->v()) > 0) { $xSoc->query()->insert()->save(); $result = true; } } break; case TPERSONAS_DIRECCIONES: $ddomicilio = $svc->getService($host . "svc/exportar.svc.php?ctx={$ctx}&data={$data}&cmd={$cmd}"); if (is_array($ddomicilio)) { $xDom = new cSocios_vivienda($ddomicilio); if (setNoMenorQueCero($xDom->idsocios_vivienda()->v())) { $xDom->query()->insert()->save(); $result = true; } } break; case TPERSONAS_ACTIVIDAD_ECONOMICA: $dtrabajo = $svc->getService($host . "svc/exportar.svc.php?ctx={$ctx}&data={$data}&cmd={$cmd}"); if (is_array($dtrabajo)) { $xTrab = new cSocios_aeconomica($dtrabajo); if (setNoMenorQueCero($xTrab->idsocios_aeconomica()->v())) { $xTrab->query()->insert()->save(); $result = true; } } break; case TCATALOGOS_EMPRESAS: $dempresa = $svc->getService($host . "svc/exportar.svc.php?ctx={$ctx}&data={$data}&cmd={$cmd}"); if (is_array($dempresa)) { $xEmp = new cSocios_aeconomica_dependencias($dempresa); if (setNoMenorQueCero($xEmp->idsocios_aeconomica_dependencias()->v())) { $xEmp->query()->insert()->save(); $result = true; } } break; } return $result; }
$jxc->exportFunction('jsaGetLog', array('idDateValue'), "#tcalendar-task"); $jxc->exportFunction('jsaGetRecibosEmitidos', array('idDateValue'), "#tcalendar-task"); $jxc->exportFunction('jsaSetCumplido', array('id-KeyEditable')); $jxc->exportFunction('jsaGetIngresosDeldia', array('idDateValue'), "#tcalendar-task"); $jxc->exportFunction('jsaGetIngresosDelMes', array('idDateValue'), "#tcalendar-task"); $jxc->exportFunction('jsaGetIngresosMensualesPorDependencias', array('idDateValue'), "#tcalendar-task"); $jxc->exportFunction('jsaRespaldarDB', array('idDateValue'), "#avisos"); $jxc->exportFunction('jsaActualizarIdioma', array('idDateValue'), "#avisos"); //jsaRespaldarDB $jxc->process(); $x = new jsBasicForm("", iDE_CREDITO, "."); $xHP->init(); $xFRM = new cHForm("frmcalendartask"); $xUsr = new cSystemUser(); $alerts = ""; $xUsr->init(); if ($xUsr->getNivel() >= USUARIO_TIPO_CAJERO or OPERACION_LIBERAR_ACCIONES == true) { //$xFRM->addToolbar($xBtn->getBasic("Ingresos del Dia", "jsGetChart()", "grafico", "idcharts", false) ); } $xFRM->addToolbar($xBtn->getBasic("TR.Tareas", "jsGetInformes()", "tarea", "idtareas", false)); $xFRM->addToolbar("<input type=\"date\" id=\"idDateValue\" value=\"" . $xF->get(FECHA_FORMATO_MX) . "\" />"); if ($xUsr->getNivel() != USUARIO_TIPO_OFICIAL_AML) { if ($xUsr->getNivel() >= USUARIO_TIPO_OFICIAL_CRED or MODO_DEBUG == true or OPERACION_LIBERAR_ACCIONES == true) { $xFRM->addToolbar($xBtn->getBasic("TR.Letras Creditos Simples", "jsaGetLetrasAVencer()", "reporte", "idletrav", false)); $xFRM->addToolbar($xBtn->getBasic("TR.Letras Pendientes", "jsaGetLetrasAVencerTodas()", "reporte", "idletrave", false)); $xFRM->addToolbar($xBtn->getBasic("TR.Creditos Simples", "jsaGetCreditosSimplesMinistrados()", "lista", "idsimplev", false)); $xFRM->addToolbar($xBtn->getBasic("TR.Creditos Por Autorizar", "jsaGetCreditosPorAutorizar()", "lista", "idcredaut", false)); $xFRM->addToolbar($xBtn->getBasic("TR.Creditos Por Ministrar", "jsaGetCreditosPorMinistrar()", "lista", "idcrednpoaut", false)); $xFRM->OButton("TR.Recibos Emitidos", "jsaGetRecibosEmitidos()", $xBtn->ic()->REPORTE); } if ($xUsr->getNivel() >= USUARIO_TIPO_GERENTE or OPERACION_LIBERAR_ACCIONES == true) {
function getTipoDeUsuario() { $xUsr = new cSystemUser(); $xUsr->init(); return $xUsr->getNivel(); }
} $xFRM->addHTML("<p class='aviso'>" . $xColonia->getMessages(OUT_HTML) . "</p>"); $xFRM->addHTML("<h3>DATOS FISCALES</h3>"); $xFRM->addHTML("<p class='aviso'>RFC evaluado : " . $xSoc->getRFC(true) . "</p>"); $xFRM->addHTML("<p class='aviso'>RFC evaluado/ret: " . $xSoc->getRFC(true, true) . "</p>"); $xFRM->addHTML("<p class='aviso'>RFC : " . $xSoc->getRFC() . "</p>"); //Iniciar por CURP if ($xSoc->initByIDLegal("RACD-890730- KC3") == true) { $xFRM->addHElem("<p>El Nombre es por CURP ES " . $xSoc->getNombreCompleto() . "</p>"); $xID = new cIDLegal($xSoc->getCURP()); $xFRM->addHElem("<p>La fecha por CURP es " . $xID->getFechaCreacion() . "</p>"); } $xLoc = new cDomicilioLocalidad(false); $xLoc->setBuscar("MERXICA", 4, 1, "MX"); $xFRM->addAviso($xLoc->getNombre()); //$xC = new cSocios_general(); /*$query = $xC->query()->select(); $query->where("codigo > 0"); $rs = $query->exec(); foreach ($rs as $rows){ $xC->setData($rows); echo $xC->nombrecompleto()->v(); }*/ $xFRM->addHElem("<hr />"); $xUS = new cSystemUser(TASK_USR, false); $xUS->init(); $xFRM->addHElem("<p class='aviso'>USER SYSTEM: " . $xUS->getNombreCompleto() . "</p>"); echo $xFRM->get(); echo $xP->setBodyEnd(); echo $xP->end(); //=====================================================================================================
$jscallback = parametro("callback"); $tiny = parametro("tiny"); $form = parametro("form"); $action = parametro("action", SYS_NINGUNO); $xHP->init(); if ($action == SYS_UNO) { // $oficial = trim(substr($_POST["cOficialDeApertura"], 0, 15)); // $pwd = trim( md5( substr($_POST["cOficialClave"],0,20) ) ); $oficial_s = parametro("oficial", "", MQL_RAW); $pwd = parametro("password", "", MQL_RAW); $fondos = parametro("fondodecaja", 0, MQL_FLOAT); $pwd = strtolower($pwd); //Definir bien los PWD $cUsr = new cSystemUser($oficial_s, false); $sucess = $cUsr->getCompareData("contrasenna", $pwd); $cUsr->init(); if ($sucess == true) { $IOficial = $cUsr->getID(); if ($fondos <= 0) { $msg .= "ERROR\tFondos menores a los establecido {$fondos} \r\n"; } else { $cCj = new cCaja(); $ropen = $cCj->setOpenBox($IOficial, $fondos); if ($ropen == true) { $msg .= "OK\tLa Caja esta abierta\r\n"; } else { if (MODO_DEBUG == true) { setLog($cCj->getMessages()); } $msg .= "ERROR\tProblemas al iniciar la Caja\r\n"; }
function getCuentaPorCajero($cajero = false) { $xUsr = new cSystemUser($cajero); $xUsr->init(); return $xUsr->getCuentaContableDeCaja(); }
function setProcesarProgramacion($id, $arrVars = false, $data = false, $fecha = false) { $xF = new cFecha(); $xT = new cTipos(); $xLog = new cCoreLog(); $arrVars = $arrVars == false ? $this->mArrVars : $arrVars; //idprograma, nombre_del_aviso, forma_de_creacion, programacion, destinatarios, microformato, tipo_de_medios, intent_check, intent_command $sql = "SELECT *\tFROM sistema_programacion_de_avisos WHERE idprograma={$id} LIMIT 0,1"; $d = $data == false ? obten_filas($sql) : $data; $mOb = new cSistema_programacion_de_avisos(); $mOb->setData($d); $emails = array(); $tels = array(); $enviar = false; $fecha = $fecha == false ? fechasys() : $fecha; $nombredia = $xF->getDayName(); $diadelmes = date("j", $xF->getInt()); $EnviarNota = true; $EnviarMail = true; $EnviarSMS = false; $xLoc = new cLocal(); //procesar cuerpo del contenido $arrVars["fecha"] = !isset($arrVars["fecha"]) ? $fecha : $arrVars["fecha"]; $arrVars["fecha_dia_siguiente"] = $xF->setSumarDias(1, $fecha); $arrVars["fecha_inicio_de_semana"] = $xF->getFechaDeInicioDeSemana($fecha); $arrVars["fecha_inicio_de_mes"] = $xF->getDiaInicial($fecha); //Dia de la semana inicial $arrVars["hora"] = date("H"); $arrVars["usuario"] = $xLoc->getNombreUsuario(); $arrVars["clave_de_usuario"] = !isset($arrVars["clave_de_usuario"]) ? getUsuarioActual() : $arrVars["clave_de_usuario"]; //interpretar DIA if (strtoupper($mOb->forma_de_creacion()->v()) == SYS_ALERTA_POR_EVENTO) { $enviar = true; } else { //if($mOb->programacion()) $programacion = strtoupper($mOb->programacion()->v()); $periodo = explode(":", $programacion); //INTERPRETAR DIA if ($periodo[0] == "PROGRAMACION_SEMANAL") { if (strpos($nombredia, $programacion) !== false) { $enviar = true; } } else { if ($periodo[0] == "PROGRAMACION_DIARIA") { $enviar = true; } else { if (isset($periodo[1])) { $dias = explode(",", $periodo[1]); foreach ($dias as $dias => $iddia) { $mes = $xF->mes(); $anno = $xF->anno(); if (date("Y-m-d", strtotime("{$anno}-{$mes}-{$iddia}")) == $fecha) { $enviar = true; } } } } } } //1.- extraer emails $destinatarios = explode("|", $mOb->destinatarios()->v()); foreach ($destinatarios as $key => $cnt) { if (trim($cnt) != "") { //1.1 Desfragmentar destinos $DS = explode(":", $cnt); $mdestino = isset($DS[0]) ? strtoupper($DS[0]) : ""; switch ($mdestino) { case "OFICIALES": if (isset($DS[1])) { $oficiales = explode(",", $DS[1]); foreach ($oficiales as $ofc => $ofkey) { $xOf = new cOficial($ofkey); $xOf->init(); $mail = $xOf->getEmail(); $emails[] = $mail; $xLog->add("OK\tOFICIAL\tAgregar mail {$mail} \r\n", $xLog->DEVELOPER); } } break; case "EMPRESAS": if (isset($DS[1])) { $empresas = explode(",", $DS[1]); foreach ($empresas as $emp => $empkey) { $xEmp = new cEmpresas($empkey); $xEmp->init(); //$mail = $xEmp->getEmailsDeEnvio(); //$emails[] = $mail; $emails = array_merge($emails, $xEmp->getEmailsDeEnvio()); $xLog->add("OK\tEMPRESAS\tAgregar mail de la empresa {$empkey} \r\n", $xLog->DEVELOPER); } } break; case "PERSONAS": if (isset($DS[1])) { $personas = explode(",", $DS[1]); foreach ($personas as $ofc => $ofkey) { $xSoc = new cSocio($ofkey); $xSoc->init(); $mail = $xSoc->getCorreoElectronico(); $emails[] = $mail; $xLog->add("OK\tPERSONA\tAgregar mail {$mail} \r\n", $xLog->DEVELOPER); if ($xT->cNumeroTelefonico($xSoc->getTelefonoPrincipal()) != false) { $EnviarSMS = true; $tels[] = $xT->cNumeroTelefonico($xSoc->getTelefonoPrincipal()); } } } break; case "CORREO": if (isset($DS[1])) { $personas = explode(",", $DS[1]); foreach ($personas as $ofc => $ofkey) { if (filter_var($ofkey, FILTER_VALIDATE_EMAIL)) { $emails[] = $ofkey; } $xLog->add("OK\tCORREO\tAgregar mail {$ofkey} \r\n", $xLog->DEVELOPER); } } break; } //1.1.1 Validar oficiales, empresas, personas //if(strpos("OFICIALES:", $needle)) } } $this->mMessages .= $xLog->getMessages(); $texto = $mOb->microformato()->v(); foreach ($arrVars as $variable => $valor) { $texto = str_replace("{" . $variable . "}", $valor, $texto); } if ($enviar == true) { $url = $mOb->intent_command()->v(OUT_TXT); //2 procesado del comando if (trim($url) == "") { $titulo = strtoupper($mOb->nombre_del_aviso()->v()); $xNot = new cNotificaciones(); //enviar mail normal if ($EnviarSMS == true) { foreach ($tels as $pitm => $ptel) { $xNot->sendSMS($ptel, $texto); } } if ($EnviarMail == true) { foreach ($emails as $itm => $pmail) { $xNot->sendMail($titulo, $texto, $pmail); } } } else { //execute command //rpttesoreria/corte_de_caja.rpt.php?on=2014-5-3&off=2014-5-3&cajero=todas&dependencia=todas $smail = ""; $xHO = new cHObject(); foreach ($arrVars as $variable => $valor) { $url = str_replace("{" . $variable . "}", $valor, $url); } foreach ($emails as $id => $rmail) { //$smail .= ($smail == "") ? "email$id=$rmail" : "&email$id=$rmail"; $smail .= "&email{$id}={$rmail}"; } //Iniciar session en contexto &on=$fecha&off=$fecha $xSysUser = new cSystemUser(); $xSysUser->init(); $url = $url . $smail . "&ctx=" . $xSysUser->getCTX(); if (MODO_DEBUG == true) { setLog($url); } $xHO->navigate($url); } } else { $this->mMessages .= "OK\tNo e envia el reporte\r\n"; } setLog($this->mMessages); $this->mObProgAv = $mOb; //return $this->mObProgAv; }
$permiso = getSIPAKALPermissions($theFile); if ($permiso === false) { header("location:../404.php?i=999"); } $_SESSION["current_file"] = addslashes($theFile); //<===== FIN_H //===================================================================================================== $xInit = new cHPage("", HP_SERVICE); $txt = ""; $svc = new MQLService("", ""); $ql = new MQL(); $data = isset($_REQUEST["data"]) ? $_REQUEST["data"] : null; $command = isset($_REQUEST["cmd"]) ? $svc->getDecryptData($_REQUEST["cmd"]) : null; //$context = (isset($_REQUEST["ctx"])) ? $svc->getDecryptData($_REQUEST["ctx"]) : null; $xTu = new cSystemUser(TASK_USR, false); $xTu->init(); $ctx = $xTu->getCTX(); $cmd = $svc->getEncryptData($command); switch ($command) { case TPERSONAS_GENERALES: $dpersona = $svc->getService(SVC_ASOCIADA_HOST . "svc/exportar.svc.php?ctx={$ctx}&data={$data}&cmd={$cmd}"); if (is_array($dpersona)) { $xSoc = new cSocios_general($dpersona); $xSoc->query()->insert()->save(); //Iniciar Cuenta de Captacion } break; case TPERSONAS_DIRECCIONES: $ddomicilio = $svc->getService(SVC_ASOCIADA_HOST . "svc/exportar.svc.php?ctx={$ctx}&data={$data}&cmd={$cmd}"); if (is_array($ddomicilio)) { $xDom = new cSocios_vivienda($ddomicilio);