public function init() { parent::init(); $this->registry = Zend_Registry::getInstance(); $this->initView(); //cms $this->view->setScriptPath('./application/views/scripts/'); $this->view->setHelperPath('./application/views/helpers/', 'Helper'); $this->view->addHelperPath('./library/Zcms/View/helper/', 'Zcms_View_Helper'); $this->view->addBasePath('./html/', ''); //Zsurforce $this->view->addHelperPath('./library/Zsurforce/View/Helper/', 'Zsurforce_View_Helper'); $this->view->baseUrl = $this->_request->getBaseUrl(); $this->view->basePath = $this->registry->get('base_path'); Zend_Loader::loadClass('Configuracion'); $this->view->user = Zend_Auth::getInstance()->getIdentity(); $this->info = $this->registry->get('personalizacion'); $this->view->title = $this->info->sitio->index->index->titulo; $this->session = $this->registry->get('session'); $this->view->session = $this->session; $this->debug = $this->registry->get('debug'); $this->view->debug = $this->debug; /* información de sitios y subsitios */ $this->view->sitios = Sitios::getAll(null, null, "orden")->toArray(); if (isset($this->session->sitio->id)) { $this->view->configuracion = Configuracion::getConfiguracion($this->session->sitio->id); } else { $this->view->configuracion = Configuracion::getConfiguracionDefault(); $this->session->sitio = Sitios::getSitioDefault(); } $this->registrarSitio(); $this->cargarMenuHorizontal(); $this->_loadBreadcrumItems(); }
public static function init() { if (!self::$db) { try { $cfg = Configuracion::getConfiguracion('basedatos'); $dsn = $cfg['dsn']; self::$db = new PDO($dsn, $cfg['usuario'], $cfg['clave']); //Crea un nuevo objeto PDO (PHP Data Object) self::$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); //Indica que lanza una excepción si existe algún error. self::$db->setAttribute(PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_ASSOC); //Establece la propiedad de asociacion para los resultados // de consulta } catch (PDOException $exc) { die('Error de conexion a la base de datos! ' . $exc->getMessage()); } } return self::$db; }
public function accesofb($social) { $cfg = Configuracion::getConfiguracion('social_login'); $app_id = ''; $app_secret = ''; $app_cb = ''; $url = ''; $oauthObj = null; if (isset($social) && $social == 'face') { $app_id = $cfg['FB_APP_ID']; $app_secret = $cfg['FB_APP_SECRET']; $app_cb = $cfg['FB_APP_CB']; $url = $cfg['FB_APP_INFO']; $oauthObj = new Facebook($app_id, $app_secret, $app_cb); } else { if (isset($social) && $social == 'twitter') { $app_id = $cfg['TW_APP_ID']; $app_secret = $cfg['TW_APP_SECRET']; $app_cb = $cfg['TW_APP_CB']; $url = $cfg['TW_APP_INFO']; $oauthObj = new Twitter($app_id, $app_secret, $app_cb); } else { if (isset($social) && $social == 'google') { $app_id = $cfg['GO_APP_ID']; $app_secret = $cfg['GO_APP_SECRET']; $app_cb = $cfg['GO_APP_CB']; $url = $cfg['GO_APP_INFO']; $oauthObj = new Google($app_id, $app_secret, $app_cb); } } } $scope = array('email'); $oauthObj->setScope($scope); if ($oauthObj->validateAccessToken()) { try { $response = $oauthObj->makeRequest($url); $this->verificarAutenticacion($social, $response); } catch (Exception $e) { echo $e; } } }
public function descargarPlanillas() { try { if ($this->verificarSession()) { $idDocente = $_SESSION['idUsuario']; $cfg = Configuracion::getConfiguracion('colegio'); $colegio = $cfg['NOMBRE']; $reporte = new Reportes(); if ($colegio == "galois") { } elseif ($colegio == "santaTeresita") { $reporte->planillasDocenteSantateresita($idDocente); } } } catch (Exception $exc) { echo 'Error de aplicacion: ' . $exc->getMessage(); } }
public function imprimirInformePorSalon($idSalon) { $cfg = Configuracion::getConfiguracion('colegio'); $colegio = $cfg['NOMBRE']; $reporte = new Reportes(); if ($colegio == "galois") { $reporte->informePorSalon($idSalon); } elseif ($colegio == "santaTeresita") { } }