public function guardarNuevaConsulta($sendFrom, $consulta)
 {
     $message = new Mensaje();
     $message2 = new Mensaje();
     $message3 = new Mensaje();
     $listaReceptor = self::getReceptor();
     $listaConsulta = self::getConsultas();
     if (count($listaConsulta) >= 1) {
         $ultimoReceptor = $message3->getUsuarioFromId($listaConsulta[0]['idSendTo']);
         //sendTo ahora es un id y no texto para comprara con usuario,
         for ($i = 0; $i < count($listaConsulta); $i++) {
             if ($listaReceptor[$i]['usuario'] == $ultimoReceptor[0]['usuario']) {
                 if ($listaReceptor[$i + 1]['usuario'] != '') {
                     $receptor = $listaReceptor[$i + 1]['usuario'];
                 } else {
                     $receptor = $listaReceptor[0]['usuario'];
                 }
             }
         }
     } else {
         $receptor = $listaReceptor[0]['usuario'];
     }
     $idSendFrom = $message->getUsuario($sendFrom);
     $idSendTo = $message2->getUsuario($receptor);
     $query = "insert into mensajes(idSendFrom,idSendTo,asunto,mensaje,fecha,hora,estado,tipo)\n\t\t\t\t\tvalues('" . $idSendFrom[0]['idusuario'] . "','" . $idSendTo[0]['idusuario'] . "','CONSULTA','{$consulta}',now(),now(),'sin leer','consulta')";
     $result = $this->mysqli->query($query);
     if (!$result) {
         return false;
     } else {
         return true;
     }
 }
 public function buscarMensaje($id)
 {
     $obj = new Mensaje();
     $arreglo = $obj->getAll();
     $lista = array();
     foreach ($arreglo as $mensaje) {
         if ($mensaje->get_mensajeId() == $id) {
             $lista[] = $mensaje;
         }
     }
     return $lista;
 }
 public function sendMessage($job, $data)
 {
     $id = $job->getJobId();
     try {
         for ($i = 0; $i < count($data); $i++) {
             Mensaje::crear($id, $data[$i]);
             $Outbound = new Outbound();
             $request = array('message' => array('message_id' => $data[$i]['message_id'], 'status' => 'delivered'));
             $response = $Outbound->setMessageStatus($request);
             $pos = strpos($data[$i]['body'], 'completed');
             $pos2 = strpos($data[$i]['body'], 'suspended');
             $pos3 = strpos($data[$i]['body'], 'notdone');
             $pos4 = strpos($data[$i]['body'], 'canceled');
             $activityId = '';
             $codactud = explode("appt_number>", $data[$i]['body']);
             $codactu = explode("<", $codactud[1]);
             if ($activityId != '' and $codactu[0] != '') {
                 if ($pos !== false) {
                     $this->completarOfsc($activityId, $codactu[0]);
                 } elseif ($pos2 !== false) {
                     $this->suspenderOfsc($activityId, $codactu[0]);
                 } elseif ($pos3 !== false) {
                     $this->norealizadoOfsc($activityId, $codactu[0]);
                 } elseif ($pos4 !== false) {
                     //$this->cancelarOfsc($activityId,$codactu);
                 }
             }
         }
     } catch (Exception $e) {
     }
     $job->delete();
 }
 function __construct()
 {
     $this->miConfigurador = Configurador::singleton();
     $this->miInspectorHTML = InspectorHTML::singleton();
     $this->ruta = $this->miConfigurador->getVariableConfiguracion("rutaBloque");
     $this->miMensaje = Mensaje::singleton();
     $this->miSesion = Sesion::singleton();
 }
 public static function singleton($salidaTipo = '', $lenguaje = '')
 {
     if (!isset(self::$instance)) {
         $className = __CLASS__;
         self::$instance = new $className($salidaTipo, $lenguaje);
     }
     return self::$instance;
 }
 private function mostrarMensajeRedireccion($mensaje, $tipoMensaje = '', $url)
 {
     if ($tipoMensaje == '') {
         $this->cuadroMensaje->mostrarMensajeRedireccion($mensaje, self::ERROR, $url);
     } else {
         $this->cuadroMensaje->mostrarMensajeRedireccion($mensaje, $tipoMensaje, $url);
     }
 }
	public static function singleton()
	{
		if (!isset(self::$instance)) {
			$className = __CLASS__;
			self::$instance = new $className;
		}
		return self::$instance;
	}
Exemple #8
0
 public static function getStatus($idMensaje)
 {
     $mensaje = Mensaje::Where('message_id', $idMensaje)->first();
     if (isset($mensaje)) {
         return array('code' => "OK", 'desc' => $mensaje->estado);
     } else {
         return array('code' => "NOT FOUND", 'desc' => '');
     }
 }
    public function save_msj()
    {
        $nombre = Input::get('nombre');
        $lastName = Input::get('apellido');
        $email = Input::get('email');
        $country = Input::get('country');
        $mensaje = Input::get('mensaje');
        $contacto = new Mensaje();
        $contacto->nombre = $nombre . ' ' . $lastName;
        $contacto->email = $email;
        $contacto->pais = $country;
        $contacto->mensaje = $mensaje;
        $contacto->fecha = Carbon::now();
        $contacto->leido = 0;
        $contacto->save();
        $destinatario = "vazquezreyes@gmail.com ";
        $asunto = "Mensaje contacto de durangobariatricsurgery.com";
        $cuerpo = ' 
		<html> 
		<head> 
		   <title>Durango Bariatric Surgery</title> 
		</head> 
		<body> 
		<p>' . $mensaje . '</p> 
		<p>Pais:' . $country . '</p>
		</body> 
		</html> 
		';
        //para el envío en formato HTML
        $headers = "MIME-Version: 1.0\r\n";
        $headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
        //dirección del remitente
        $headers .= "From:" . $nombre . ' ' . $lastName . "<" . $email . ">\r\n";
        //dirección de respuesta, si queremos que sea distinta que la del remitente
        //$headers .= "Reply-To: mariano@desarrolloweb.com\r\n";
        //ruta del mensaje desde origen a destino
        //$headers .= "Return-path: holahola@desarrolloweb.com\r\n";
        //direcciones que recibián copia
        //$headers .= "Cc: maria@desarrolloweb.com\r\n";
        //direcciones que recibirán copia oculta
        //$headers .= "Bcc: pepe@pepe.com,juan@juan.com\r\n";
        mail($destinatario, $asunto, $cuerpo, $headers);
        return Redirect::to('contact');
    }
 function generarReporteMovimiento()
 {
     $idMovimiento = $this->objParam->getParametro('id_movimiento');
     $this->objParam->addParametroConsulta('filtro', ' mov.id_movimiento = ' . $idMovimiento);
     $this->objFunc = $this->create('MODMovimiento');
     $obj = $this->objFunc->listarReporteMovimiento($this->objParam);
     $data = $obj->getDatos();
     //var_dump($data);exit;
     $dataSource = new DataSource();
     $dataSource->setDataSet($data);
     $reporte = new RMovimiento();
     $reporte->setDataSource($dataSource);
     $nombreArchivo = 'movimiento_af.pdf';
     $reportWriter = new ReportWriter($reporte, dirname(__FILE__) . '/../../reportes_generados/' . $nombreArchivo);
     $reportWriter->writeReport(ReportWriter::PDF);
     $mensajeExito = new Mensaje();
     $mensajeExito->setArchivoGenerado($nombreArchivo);
     $this->res = $mensajeExito;
     $this->res->imprimirRespuesta($this->res->generarJson());
 }
Exemple #11
0
 function __construct()
 {
     $this->miConfigurador = Configurador::singleton();
     $this->miInspectorHTML = InspectorHTML::singleton();
     $this->ruta = $this->miConfigurador->getVariableConfiguracion("rutaBloque");
     $this->miMensaje = Mensaje::singleton();
     $this->miSesion = Sesion::singleton();
     $this->enlace = $this->miConfigurador->getVariableConfiguracion("host") . $this->miConfigurador->getVariableConfiguracion("site") . "?" . $this->miConfigurador->getVariableConfiguracion("enlace");
     $conexion = "master";
     $this->miRecursoDB = $this->miConfigurador->fabricaConexiones->getRecursoDB($conexion);
 }
Exemple #12
0
 function __construct()
 {
     $this->miConfigurador = \Configurador::singleton();
     $this->ruta = $this->miConfigurador->getVariableConfiguracion("rutaBloque");
     $this->miMensaje = \Mensaje::singleton();
     $conexion = "aplicativo";
     $this->miRecursoDB = $this->miConfigurador->fabricaConexiones->getRecursoDB($conexion);
     if (!$this->miRecursoDB) {
         $this->miConfigurador->fabricaConexiones->setRecursoDB($conexion, "tabla");
         $this->miRecursoDB = $this->miConfigurador->fabricaConexiones->getRecursoDB($conexion);
     }
 }
 /**
  * Returns the data model based on the primary key given in the GET variable.
  * If the data model is not found, an HTTP exception will be raised.
  */
 public function loadModel()
 {
     if ($this->_model === null) {
         if (isset($_GET['id'])) {
             $this->_model = Mensaje::model()->findbyPk($_GET['id']);
         }
         if ($this->_model === null) {
             throw new CHttpException(404, Yii::t('App', 'The requested page does not exist.'));
         }
     }
     return $this->_model;
 }
Exemple #14
0
 function __construct()
 {
     $this->miConfigurador = Configurador::singleton();
     $this->miInspectorHTML = InspectorHTML::singleton();
     $this->ruta = $this->miConfigurador->getVariableConfiguracion("rutaBloque");
     $this->miMensaje = Mensaje::singleton();
     $this->miSesion = Sesion::singleton();
     $conexion = $this->miSesion->getValorSesion('dbms');
     $this->miRecursoDB = $this->miConfigurador->fabricaConexiones->getRecursoDB($conexion);
     $this->masterResource = $this->miConfigurador->fabricaConexiones->getRecursoDB("master");
     $this->commerce = $this->miSesion->getValorSesion('commerce');
 }
    function __construct($lenguaje = '') {

        $this->miConfigurador = \Configurador::singleton ();

        $this->miConfigurador->fabricaConexiones->setRecursoDB ( 'principal' );
        
		$this->mensaje =  \Mensaje::singleton();
        $this->lenguaje = $lenguaje;

          $this->cliente  = new Modelo();

    }
Exemple #16
0
 public function inicio()
 {
     switch (Auth::user()->tipo) {
         case 0:
             $mensajes = Mensaje::all();
             $users = User::where('tipo', '>', 0)->get();
             return View::make('admin.home', array('mensajes' => $mensajes, 'users' => $users));
             break;
         case 2:
             return Redirect::to('inicio');
             break;
     }
 }
Exemple #17
0
 function iniciar_sesion()
 {
     $m_usuario = new \application\model\M_Usuario();
     $m_data = new \application\model\M_Data();
     $c_forming = new C_Forming();
     $post = $m_data->getAllPost();
     $data = $c_forming->crearInput("usuario", $post);
     $usuario = $m_usuario->logUsuario($data);
     //var_dump($usuario);
     $mv_mensaje = new Mensaje();
     if (sizeof($usuario) > 0) {
         $usuario = $usuario[0];
         $m_sesion = new application\model\M_Sesion();
         $usuario = $m_usuario->getUsuario($usuario)[0];
         unset($usuario->clave);
         $m_sesion->create_session($usuario);
         //var_dump($m_sesion->get_session());
         $mv_mensaje->mensaje_correcto("Bienvenido");
     } else {
         $mv_mensaje->mensaje_error("Los datos ingresados son probablemente incorrectos... Intentelo denuevo");
     }
 }
Exemple #18
0
function error_handler($errno, $errstr, $errfile, $errline)
{
    if ($errno == '8' || $errno == '2048' || strpos($errstr, 'Query failed') > 0 || ($errno == '8' || $errno == '2048') && strpos($errstr, 'Query failed') > 0) {
        //if($errno=='8' || $errno=='2048' || strpos($errstr,'Query failed')>0){
        //RAC, JRR	 31102011
        //if(($errno=='8' || $errno=='2048' )&& strpos($errstr,'Query failed')>0){
        return;
    }
    $_SESSION["_CANTIDAD_ERRORES"]++;
    if ($_SESSION['_CANTIDAD_ERRORES'] < 4) {
        if ($_SESSION['_CANTIDAD_ERRORES'] < 3) {
            $bdlog = new MODLogError('ERROR_WEB', $errstr, $errfile . ' Linea: ' . $errline);
            $bdlog->guardarLogError();
        }
        $men = new Mensaje();
        if ($_SESSION["_ESTADO_SISTEMA"] == 'desarrollo') {
            $mensaje = $errstr;
        } else {
            $mensaje = 'Ha ocurrido un error en el servidor Web, consulte con el administrador';
        }
        $mensaje = htmlentities($mensaje);
        $men->setMensaje('ERROR', $errfile . ' Linea: ' . $errline, $mensaje, 'Codigo de error:' . $errno, 'control', '', '', 'OTRO', '');
        //rac 21092011
        $men->imprimirRespuesta($men->generarJson());
        exit;
    } else {
        header("HTTP/1.1 406 Not Acceptable");
        echo '{"ROOT":{"error":true,"detalle":{
					"mensaje":"Error en el servidor Web probable falta de conexión al Servidor de Base de Datos (Comuniquese con el Administrador)",
					"mensaje_tec":"' . $mensaje . '",
					"origen":"Errores.php",
					"capa":"control",
					"consulta":""}}}';
        exit;
    }
}
 function __construct($tabla = null, $esquema = 'public', $conexion = '')
 {
     $this->miConfigurador = \Configurador::singleton();
     $this->mensaje = \Mensaje::singleton();
     if ($conexion != '') {
         $this->conexion = $conexion;
     } else {
         $this->conexion = self::CONEXION;
     }
     //Recupera parametros de la base de datos
     $this->recuperarObjetos();
     if (!is_null($tabla) && $tabla != "") {
         $this->setAmbiente($tabla);
     }
 }
 function __construct($usuario = ''){
 	
 	$this->registrador = new \DAL();
 	$this->mensaje =  \Mensaje::singleton();
 	
 	
 	//configurar usuario
 	if($usuario ==''){
 		$this->usuario = $_REQUEST['usuario'];
 		$this->registrador->setUsuario($this->usuario);
 		
 	}else{
 		$this->usuario = $usuario;
 		$this->registrador->setUsuario($this->usuario);
 	}
 	
 }
    function __construct($lenguaje,$objetoId = '') {

    	$this->objetoId = $objetoId;
        $this->miConfigurador = \Configurador::singleton ();

        $this->miConfigurador->fabricaConexiones->setRecursoDB ( 'principal' );
        
        if(isset($_REQUEST['usuario'])) $_REQUEST['usuarioDefinitivo'] = $_REQUEST['usuario'];
        
        $this->tablasPaso =  array();

        $this->lenguaje = $lenguaje;
        $this->mensaje =  \Mensaje::singleton();
        $this->cliente  = new Modelo();
        $this->objeto = $this->cliente->getListaObjetos();
        $this->columnas = $this->cliente->getDatosColumnas();
    }
Exemple #22
0
 public function inicio()
 {
     switch (Auth::user()->tipo) {
         case 0:
             return Redirect::to('admin');
             break;
         case 2:
             $date = getdate();
             $mes = $date['mon'];
             $cr = null;
             $co = null;
             $de = null;
             $eq = null;
             $year = $date['year'];
             $stat = Estadistica::where('mes', 'like', $mes)->where('año', 'like', $year)->orderBy('creatividad', 'DESC')->get();
             $stat2 = Estadistica::where('mes', 'like', $mes)->where('año', 'like', $year)->orderBy('conocimiento', 'DESC')->get();
             $stat3 = Estadistica::where('mes', 'like', $mes)->where('año', 'like', $year)->orderBy('desempeño', 'DESC')->get();
             $stat4 = Estadistica::where('mes', 'like', $mes)->where('año', 'like', $year)->orderBy('equipo', 'DESC')->get();
             $statf = Estadistica::where('mes', 'like', $mes)->where('año', 'like', $year)->get();
             if (count($stat) > 0) {
                 $cr = User::find($stat[0]->user_id);
             }
             if (count($stat2) > 0) {
                 $co = User::find($stat2[0]->user_id);
             }
             if (count($stat3) > 0) {
                 $de = User::find($stat3[0]->user_id);
             }
             if (count($stat4) > 0) {
                 $eq = User::find($stat4[0]->user_id);
             }
             $idf = 0;
             $last = 0;
             for ($i = 0; $i < count($statf); $i++) {
                 $sum = doubleval('' . $statf[$i]->creatividad) + doubleval('' . $statf[$i]->conocimiento);
                 if ($sum > $last) {
                     $last = $sum;
                     $idf = $statf[$i]->user_id;
                 }
             }
             $best = User::find($idf);
             $mensajes = Mensaje::orderBy('id', 'DESC')->get();
             return View::make('cursante.home', array('mensajes' => $mensajes, 'cr' => $cr, 'co' => $co, 'de' => $de, 'eq' => $eq, 'date' => $date, 'best' => $best));
             break;
     }
 }
    function __construct($lenguaje = '') {

    	
        $this->miConfigurador = \Configurador::singleton ();
        $this->miConfigurador->fabricaConexiones->setRecursoDB ( 'principal' );

        $this->mensaje = \Mensaje::singleton();
		$this->cliente  = new Modelo();
		
		if($lenguaje!='')$this->lenguaje = $lenguaje;
        
        	
			$this->objeto = $this->cliente->getListaObjetos();
           $this->columnas = $this->cliente->getListaColumnas();
        
        

    }
    function __construct($lenguaje = '',$objetoId = '') {

    	
        $this->miConfigurador = \Configurador::singleton ();
        $this->miConfigurador->fabricaConexiones->setRecursoDB ( 'principal' );

        $this->mensaje = \Mensaje::singleton();
		$this->cliente  = new Modelo();
		
		
		
		if($lenguaje!='')$this->lenguaje = $lenguaje;
		$this->tabla =  new \component\GestoHTMLCRUD\Vista\Tabla($lenguaje);
        if($objetoId!=''){
        	$this->objetoId = $objetoId;
			$this->objeto = $this->cliente->getListaObjetos();
           $this->columnas = $this->cliente->getListaColumnas();
        
        }else return false;

    }
 function __construct($conexion = 'estructura', $tabla = '', $historico = false, $usuario = '')
 {
     $this->miConfigurador = \Configurador::singleton();
     $this->miRecursoDB = $this->miConfigurador->fabricaConexiones->getRecursoDB($conexion);
     $this->mensaje = \Mensaje::singleton();
     if (!$this->miRecursoDB) {
         $this->mensaje->addMensaje("1", "errorConexion", 'error');
         return false;
     }
     $this->conexion = $conexion;
     $this->tabla = $tabla;
     $this->historico = $historico;
     if ($usuario == '' || is_null($usuario)) {
         $this->usuario = '_indefinido_';
     } else {
         $this->usuario = $usuario;
     }
     $this->mensaje = Mensaje::singleton();
     $this->saltarHistorico = false;
     $this->justificacion = '';
     $this->recuperarTablaEsquema();
 }
Exemple #26
0
 function reporteOC()
 {
     $dataSource = new DataSource();
     $this->objParam->addParametroConsulta('ordenacion', 'id_cotizacion');
     $this->objParam->addParametroConsulta('dir_ordenacion', 'ASC');
     $this->objParam->addParametroConsulta('cantidad', 1000);
     $this->objParam->addParametroConsulta('puntero', 0);
     $this->objFunc = $this->create('MODCotizacion');
     $resultOrdenCompra = $this->objFunc->reporteOrdenCompra();
     $datosOrdenCompra = $resultOrdenCompra->getDatos();
     //armamos el array parametros y metemos ahi los data sets de las otras tablas
     $dataSource->putParameter('id_proceso_compra', $datosOrdenCompra[0]['id_proceso_compra']);
     $dataSource->putParameter('desc_proveedor', $datosOrdenCompra[0]['desc_proveedor']);
     if ($datosOrdenCompra[0]['id_persona'] != '') {
         $dataSource->putParameter('direccion', $datosOrdenCompra[0]['dir_persona']);
         $dataSource->putParameter('telefono1', $datosOrdenCompra[0]['telf1_persona']);
         $dataSource->putParameter('telefono2', $datosOrdenCompra[0]['telf2_persona']);
         $dataSource->putParameter('celular', $datosOrdenCompra[0]['cel_persona']);
         $dataSource->putParameter('email', $datosOrdenCompra[0]['correo_persona']);
         $dataSource->putParameter('fax', '');
     }
     if ($datosOrdenCompra[0]['id_institucion'] != '') {
         $dataSource->putParameter('direccion', $datosOrdenCompra[0]['dir_institucion']);
         $dataSource->putParameter('telefono1', $datosOrdenCompra[0]['telf1_institucion']);
         $dataSource->putParameter('telefono2', $datosOrdenCompra[0]['telf2_institucion']);
         $dataSource->putParameter('celular', $datosOrdenCompra[0]['cel_institucion']);
         $dataSource->putParameter('email', $datosOrdenCompra[0]['email_institucion']);
         $dataSource->putParameter('fax', $datosOrdenCompra[0]['fax_institucion']);
     }
     $dataSource->putParameter('fecha_entrega', $datosOrdenCompra[0]['fecha_entrega']);
     $dataSource->putParameter('lugar_entrega', $datosOrdenCompra[0]['lugar_entrega']);
     $dataSource->putParameter('numero_oc', $datosOrdenCompra[0]['numero_oc']);
     $dataSource->putParameter('tipo_entrega', $datosOrdenCompra[0]['tipo_entrega']);
     $dataSource->putParameter('tipo', $datosOrdenCompra[0]['tipo']);
     $dataSource->putParameter('fecha_oc', $datosOrdenCompra[0]['fecha_oc']);
     $dataSource->putParameter('moneda', $datosOrdenCompra[0]['moneda']);
     //get detalle
     //Reset all extra params:
     $this->objParam->defecto('ordenacion', 'id_solicitud_det');
     $this->objParam->defecto('cantidad', 1000);
     $this->objParam->defecto('puntero', 0);
     $this->objParam->addParametro('id_solicitud', $idSolicitud);
     $modCotizacionDet = $this->create('MODCotizacionDet');
     $resultCotizacionDet = $modCotizacionDet->listarCotizacionDet();
     //$solicitudDetAgrupado = $this->groupArray($resultSolicitudDet->getDatos(), 'codigo_partida','desc_centro_costo');
     $cotizacionDetDataSource = new DataSource();
     $cotizacionDetDataSource->setDataSet($resultCotizacionDet->getDatos());
     $dataSource->putParameter('detalleDataSource', $cotizacionDetDataSource);
     //build the report
     $reporte = new ROrdenCompra();
     $reporte->setDataSource($dataSource);
     if ($datosOrdenCompra[0]['tipo'] == 'Bien') {
         $nombreArchivo = 'OrdenCompra.pdf';
     } else {
         if ($datosOrdenCompra[0]['tipo'] == 'Servicio') {
             $nombreArchivo = 'OrdenServicio.pdf';
         } else {
             $nombreArchivo = 'OrdenCompraServicio.pdf';
         }
     }
     $reportWriter = new ReportWriter($reporte, dirname(__FILE__) . '/../../reportes_generados/' . $nombreArchivo);
     $reportWriter->writeReport(ReportWriter::PDF);
     $mensajeExito = new Mensaje();
     $mensajeExito->setMensaje('EXITO', 'Reporte.php', 'Reporte generado', 'Se generó con éxito el reporte: ' . $nombreArchivo, 'control');
     $mensajeExito->setArchivoGenerado($nombreArchivo);
     $this->res = $mensajeExito;
     $this->res->imprimirRespuesta($this->res->generarJson());
 }
Exemple #27
0
 function verificarCredenciales()
 {
     $this->funciones = $this->create('MODUsuario');
     $this->res = $this->funciones->ValidaUsuario();
     $this->datos = $this->res->getDatos();
     if ($this->res->getTipo() == 'Error' || $this->datos['cuenta'] == '') {
         //si no existe le mando otra vez a la portada
         $_SESSION["autentificado"] = "NO";
         $_SESSION["ss_id_usuario"] = "";
         $_SESSION["ss_id_lugar"] = "";
         $_SESSION["ss_nombre_lugar"] = "";
         $_SESSION["ss_nombre_empleado"] = "";
         $_SESSION["ss_paterno_empleado"] = "";
         $_SESSION["ss_materno_empleado"] = "";
         $_SESSION["ss_nombre_usuario"] = "";
         $_SESSION["ss_id_funcionario"] = "";
         $_SESSION["ss_nombre_basedatos"] = "";
         $_SESSION["ss_ip"] = "";
         $_SESSION["ss_mac"] = "";
         echo "{success:false,mensaje:'" . addslashes($this->res->getMensaje()) . "'}";
         exit;
     } else {
         $LDAP = TRUE;
         //preguntamos el tipo de autentificacion
         if ($this->datos['autentificacion'] == 'ldap') {
             $_SESSION["_CONTRASENA"] = md5($_SESSION["_SEMILLA"] . $this->datos['contrasena']);
             $conex = ldap_connect($_SESSION["_SERVER_LDAP"], $_SESSION["_PORT_LDAP"]) or die("No ha sido posible conectarse al servidor");
             ldap_set_option($conex, LDAP_OPT_PROTOCOL_VERSION, 3);
             if ($conex) {
                 // bind with appropriate dn to give update access
                 $r = ldap_bind($conex, trim($this->objParam->getParametro('usuario')) . '@' . $_SESSION["_DOMINIO"], addslashes(htmlentities(trim($this->objParam->getParametro('contrasena')), ENT_QUOTES)));
                 if ($r && trim($this->objParam->getParametro('contrasena')) != '') {
                     $LDAP = TRUE;
                 } else {
                     $LDAP = FALSE;
                 }
                 ldap_close($conex);
             } else {
                 $LDAP = FALSE;
             }
         }
         //si falla la autentificacion LDAP cerramos sesion
         if (!$LDAP) {
             $_SESSION["autentificado"] = "NO";
             $_SESSION["ss_id_usuario"] = "";
             $_SESSION["ss_id_lugar"] = "";
             $_SESSION["ss_nombre_lugar"] = "";
             $_SESSION["ss_nombre_empleado"] = "";
             $_SESSION["ss_paterno_empleado"] = "";
             $_SESSION["ss_materno_empleado"] = "";
             $_SESSION["ss_nombre_usuario"] = "";
             $_SESSION["ss_id_funcionario"] = "";
             $_SESSION["ss_nombre_basedatos"] = "";
             $_SESSION["ss_ip"] = "";
             $_SESSION["ss_mac"] = "";
         } else {
             $_SESSION["autentificado"] = "SI";
             $_SESSION["ss_id_usuario"] = $this->datos['id_usuario'];
             $_SESSION["ss_id_funcionario"] = $this->datos['id_funcionario'];
             $_SESSION["_SESION"]->setIdUsuario($this->datos['id_usuario']);
             //cambia el estado del Objeto de sesion activa
             $_SESSION["_SESION"]->setEstado("activa");
             if ($_SESSION["_ESTADO_SISTEMA"] == 'desarrollo') {
                 $_SESSION["mensaje_tec"] = true;
             } else {
                 $_SESSION["mensaje_tec"] = false;
             }
             $mres = new Mensaje();
             if ($_SESSION["_OFUSCAR_ID"] == 'si') {
                 $id_usuario_ofus = $mres->ofuscar($this->datos['id_usuario']);
                 $id_funcionario_ofus = $mres->ofuscar($this->datos['id_funcionario']);
             } else {
                 $id_usuario_ofus = $this->datos['id_usuario'];
                 $id_funcionario_ofus = $this->datos['id_funcionario'];
             }
             ////
             $_SESSION["_CONT_ALERTAS"] = $this->datos['cont_alertas'];
             $_SESSION["_NOM_USUARIO"] = $this->datos['nombre'] . " " . $this->datos['apellido_paterno'] . " " . $this->datos['apellido_materno'];
             $_SESSION["_ID_USUARIO_OFUS"] = $id_usuario_ofus;
             $_SESSION["_ID_FUNCIOANRIO_OFUS"] = $id_funcionario_ofus;
             $_SESSION["_AUTENTIFICACION"] = $this->datos['autentificacion'];
             $_SESSION["_ESTILO_VISTA"] = $this->datos['estilo'];
             echo "{success:true,\r\n\t\t\tcont_alertas:" . $_SESSION["_CONT_ALERTAS"] . ",\r\n\t\t\tnombre_usuario:'" . $_SESSION["_NOM_USUARIO"] . "',\r\n\t\t\tnombre_basedatos:'" . $_SESSION["_BASE_DATOS"] . "',\r\n\t\t\tid_usuario:'" . $_SESSION["_ID_USUARIO_OFUS"] . "',\r\n\t\t\tid_funcionario:'" . $_SESSION["_ID_FUNCIOANRIO_OFUS"] . "',\r\n\t\t\tautentificacion:'" . $_SESSION["_AUTENTIFICACION"] . "',\r\n\t\t\testilo_vista:'" . $_SESSION["_ESTILO_VISTA"] . "',\r\n\t\t\tmensaje_tec:'" . $_SESSION["mensaje_tec"] . "',\r\n\t\t\ttimeout:" . $_SESSION["_TIMEOUT"] . "}";
             exit;
         }
     }
 }
    function __construct() {

        $this->miConfigurador = Configurador::singleton();

        $this->miInspectorHTML = InspectorHTML::singleton();

        $this->ruta = $this->miConfigurador->getVariableConfiguracion("rutaBloque");

        $this->miMensaje = Mensaje::singleton();

        $conexion = "aplicativo";
        $this->miRecursoDB = $this->miConfigurador->fabricaConexiones->getRecursoDB($conexion);

        if (!$this->miRecursoDB) {

            $this->miConfigurador->fabricaConexiones->setRecursoDB($conexion, "tabla");
            $this->miRecursoDB = $this->miConfigurador->fabricaConexiones->getRecursoDB($conexion);
        }
        
        $this->validar = new Validador();
    }
Exemple #29
0
 function generarDocumento()
 {
     $pPlantilla = $this->objParam->getParametro('nombre_archivo_plantilla');
     $this->objFunc = $this->create('MODTipoDocumento');
     include_once dirname(__FILE__) . '/../../sis_workflow/reportes/RTipoDocumento.php';
     //Obtiene los datos de la vista
     $datos = $this->res = $this->objFunc->generarDocumento($this->objParam);
     //var_dump($datos);exit;
     //Setea los valores en el datasource
     $dataSource = new DataSource();
     $dat = $datos->getDatos();
     foreach ($dat as $valor) {
         foreach ($valor as $clave => $valor1) {
             $dataSource->putParameter($clave, $valor1);
         }
     }
     //Generar el reporte
     $documento = new RTipoDocumento($pPlantilla);
     $documento->setDataSource($dataSource);
     //Obtiene el nombre del reporte
     $aux = strrchr($pPlantilla, '/');
     if ($aux != '') {
         $nombreArchivo = substr($aux, 1, strpos($aux, '.') - 1);
     } else {
         $nombreArchivo = substr($pPlantilla, 0, strpos($pPlantilla, '.'));
     }
     $nombreArchivo = $nombreArchivo . '_' . rand(0, 99999) . '.docx';
     //echo dirname(__FILE__).'/../../reportes_generados/'.$nombreArchivo;exit;
     $documento->write(dirname(__FILE__) . '/../../../reportes_generados/' . $nombreArchivo);
     $mensajeExito = new Mensaje();
     $mensajeExito->setMensaje('EXITO', 'Documento.php', 'Documento generado', 'Se generó con éxito el documento: ' . $nombreArchivo, 'control');
     $mensajeExito->setArchivoGenerado($nombreArchivo);
     $this->res = $mensajeExito;
     $this->res->imprimirRespuesta($this->res->generarJson());
 }
Exemple #30
0
 private function mostrarMensajeError($mensaje)
 {
     $this->miConfigurador->setVariableConfiguracion("error", true);
     $this->cuadroMensaje->mostrarMensaje($mensaje, "error");
 }