function processPetition()
 {
     if ($this->issetViewVariable('status')) {
         $status = $this->getViewVariable('status');
     } else {
         $status = 'main';
         $status = $this->setViewVariable('status', 'main');
     }
     //$this->addNavElement(Util::format_URLPath('secretariatPage/index.php'), 'Página de Secretaría');
     switch ($status) {
         case 'main':
         default:
             //Presentación de mensajería
             $arrMessages = $this->obj_data->getNewUserMessages(Session::getValue('USERINFO_USER_ID'));
             $this->setViewVariable('arrMessages', $arrMessages);
             //Presentación de tablón de anuncios
             $NoticeArray = $this->obj_data->getNotices();
             $this->setViewVariable('notice_array', $NoticeArray);
             //Presentación de candidatos
             $CandidatesArray = $this->obj_data->getCandidates();
             $this->setViewVariable('candidates_array', $CandidatesArray);
             break;
     }
     $this->setPageTitle("miguel Secretariat Page");
     $this->setMessage('');
     $this->setHelp("");
 }
 function processPetition()
 {
     if ($this->issetViewVariable('status')) {
         $status = $this->getViewVariable('status');
     } else {
         $status = 'main';
         $status = $this->setViewVariable('status', 'main');
     }
     switch ($status) {
         case 'main':
         default:
             //Presentación de mensajería
             $arrMessages = $this->obj_data->getNewUserMessages(Session::getValue('USERINFO_USER_ID'));
             $this->setViewVariable('arrMessages', $arrMessages);
             //Presentación de tablón de anuncios
             $NoticeArray = $this->obj_data->getNotices();
             $this->setViewVariable('notice_array', $NoticeArray);
             break;
     }
     $this->clearNavBarr();
     $this->addNavElement(Util::format_URLPath('alumnPage/index.php'), agt('Inicio'));
     $this->setPageTitle('miguel Alumn Page');
     $this->setMessage('');
     $this->setHelp('');
 }
 function processPetition()
 {
     if ($this->issetViewVariable('status')) {
         $status = $this->getViewVariable('status');
     } else {
         $status = 'main';
         $status = $this->setViewVariable('status', 'main');
     }
     //$this->addNavElement(Util::format_URLPath('teacherPage/index.php'), 'Página del Profesor');
     switch ($status) {
         case 'main':
         default:
             //Presentación de mensajería
             $arrMessages = $this->obj_data->getNewUserMessages(Session::getValue('USERINFO_USER_ID'));
             $this->setViewVariable('arrMessages', $arrMessages);
             //Presentación de tablón de anuncios
             $NoticeArray = $this->obj_data->getNotices();
             $this->setViewVariable('notice_array', $NoticeArray);
             break;
     }
     //Establecer el título de la página
     $this->setPageTitle("miguel Teacher Page");
     $this->setMessage('');
     //Establecer cual va a ser el archivo de la ayuda on-line, este se obtiene del directorio help/
     $this->setHelp("");
 }
Esempio n. 4
0
 public function login()
 {
     if (Session::getValue("ID-ASPIRANTE")) {
         header('Location: ' . URL . 'Aspirante/perfil');
         //echo '<script> window.location.href="'.URL.'Aspirante/perfil"</script>';
     }
     $this->view->render($this, "index");
 }
 function getNewUserMessages()
 {
     $iMyId = Session::getValue('USERINFO_USER_ID');
     $ret_val = $this->SelectMultiTable('message,receiver_message,user', 'user.user_alias, message.sender,message.subject,message.body,message.date,receiver_message.status,message.id', "user.user_id = receiver_message.id_receiver AND receiver_message.id_message = message.id AND receiver_message.id_receiver = {$iMyId} AND receiver_message.status < 1");
     if ($this->hasError()) {
         $ret_val = null;
     }
     return $ret_val;
 }
 function updateCourseCard($course_id, $objectives, $descripton, $contents)
 {
     $iMyId = Session::getValue('USERINFO_USER_ID');
     //Atención: Los mensajes con estado 2 no se verán afectados.
     $ret_val = $this->Update('course_card', ' objectives, description, contents', array($objectives, $descripton, $contents), "course_id = {$course_id}");
     if ($this->hasError()) {
         $ret_val = null;
     }
     return $ret_val;
 }
Esempio n. 7
0
 public function __construct($route = NULL)
 {
     /**
      * If this is a redirect signal
      * reset the $_POST data.
      */
     if (($data = Session::getValue('POST_DATA')) && ($_POST = array_merge($_POST, (array) $data))) {
         Session::removeValue('POST_DATA');
     }
     $this->parent = static::active();
     return $this->route = $route;
 }
 function insertPost($topic_id, $forum_id, $text, $ip, $title, $parent_id = 0)
 {
     $now = date("Y-m-d H:i:s");
     $iMyId = Session::getValue('USERINFO_USER_ID');
     $post_id = $this->Insert('forum_post', 'forum_topic_id, forum_id, forum_post_text, forum_post_poster, forum_post_time, forum_post_ip, forum_post_title, forum_post_parent', array($topic_id, $forum_id, $text, $iMyId, $now, $ip, $title, $parent_id));
     if ($parent_id == 0) {
         $this->Update('forum_post', 'forum_post_parent', "{$post_id}", "forum_post_id = {$post_id}");
     }
     if ($this->hasError()) {
         $post_id = null;
     }
     //Actualizamos el último mensaje del foro
     $this->Update('forum_topic', 'last_post_id', "{$post_id}", "forum_id = {$forum_id}");
     return $post_id;
 }
Esempio n. 9
0
 public static function getMessages($status)
 {
     $messages = array();
     switch ($status) {
         case Log::MESSAGE:
             $messages = (array) Session::getValue('messages');
             Session::removeValue('messages');
             break;
         case Log::ALERT:
             $messages = (array) Session::getValue('alerts');
             Session::removeValue('alerts');
             break;
         case Log::ERROR:
             $messages = (array) Session::getValue('errors');
             Session::removeValue('errors');
             break;
     }
     return $messages;
 }
Esempio n. 10
0
 function grabarUsuario()
 {
     header('Content-Type: application/json');
     if ($_POST['id_personal'] == '') {
         $error['id'] = 0;
         $error['mensaje'] = "Seleccione al personal";
         echo json_encode($error);
     } else {
         if ($_POST['nom_usuario'] == '') {
             $error['id'] = 0;
             $error['mensaje'] = "Ingrese un nombre de usuario valido";
             echo json_encode($error);
         } else {
             if ($_POST['password'] == '') {
                 $error['id'] = 0;
                 $error['mensaje'] = "Ingrese una Contraseña";
                 echo json_encode($error);
             } else {
                 $funcion = new funciones();
                 Session::init();
                 $dataUsuario['id_usuario'] = $funcion->model->getLastID('s_usuario', 5);
                 $dataUsuario['id_personal'] = $_POST['id_personal'];
                 $dataUsuario['nom_usuario'] = $_POST['nom_usuario'];
                 $dataUsuario['password'] = Hash::create(ALGO, $_POST["password"], HASH_KEY);
                 $dataUsuario['id_estado'] = '01';
                 $dataUsuario['id_usuario_crea'] = Session::getValue('ID');
                 $dataUsuario['fecha_crea'] = Date::invertDate2(Date::today()) . ' ' . Date::now();
                 if ($this->model->grabarUsuario($dataUsuario)) {
                     echo 1;
                 } else {
                     $error['id'] = 0;
                     $error['mensaje'] = "No se registró";
                     echo json_encode($error);
                 }
             }
         }
     }
 }
Esempio n. 11
0
<header> 
  <div class="row" style="margin-bottom: 0px;">
  <nav class="blue darken-4 z-depth-1" >
    <div class="nav-wrapper">
      <a href="<?php 
echo URL;
?>
Management/index" class="brand-logo">&nbsp;&nbsp;<img src="<?php 
echo URL;
?>
public/images/logo.png" alt="" class=" responsive-img"></a>
      <a href="#" data-activates="mobile-demo" class="button-collapse"><i class="material-icons">menu</i></a>
      <div class="col l10">
      <ul class="right hide-on-med-and-down">
        <?php 
if (Session::getValue("TIP-ADMIN") == 'D') {
    echo '
        <li id="mconfiguracion" ><a href="' . URL . 'Management/configuracion">&nbsp;&nbsp;Configuración&nbsp;&nbsp;</a></li>
        <li id="mconcursos" ><a href="' . URL . 'Management/concursos">&nbsp;&nbsp;Concursos&nbsp;&nbsp;</a></li> ';
}
?>
        <li id="maspirante"><a href="<?php 
echo URL;
?>
Management/gestion_aspirante">&nbsp;&nbsp;&nbsp;&nbsp;Aspirantes</a></li>
       
        <li id="mprocess"><a href="<?php 
echo URL;
?>
Management/procesos">&nbsp;&nbsp;&nbsp;&nbsp;Procesos</a></li>
        <!--<li id="mreclutamiento"><a href="<?php 
 function processPetitionNew()
 {
     $bol_cuestion = true;
     //Comprueba el contenido de la Variable nombre. Esta se le pasa como entrada al controlador y puede venir de un formulario o un link
     if ($this->issetViewVariable('asunto') && $this->getViewVariable('asunto') != '') {
         if ($this->issetViewVariable('comentario') && $this->getViewVariable('comentario') != '') {
             //Poner control
             $bol_cuestion = false;
             $now = date("Y-m-d H:i:s");
             $strAuthor = Session::getValue('USERINFO_USER_ALIAS');
             $strSubject = $this->getViewVariable('asunto');
             $strText = $this->getViewVariable('comentario');
             //Realizamos una llamada al Modelo $this->obj_data->Método(Parámetros);
             $this->obj_data->insertSugestion($strAuthor, $strSubject, $strText, $now);
             //Enviamos a la vista la información a Mostrar
             //$this->setViewVariable('notice_nombre', $this->arr_form['nombre']);
             //$this->setViewVariable('notice_comentario', $this->arr_form['comentario']);
         }
     }
     //Si está relleno se muestra el contenido
     if (!$bol_cuestion) {
         $this->setViewVariable('author', $strAuthor);
         $this->setViewVariable('subject', $strSubject);
         $this->setViewVariable('time', $now);
         $this->setViewVariable('text', $strText);
         $this->setViewVariable('status', 'show');
     }
 }
 function processNewEvento()
 {
     if ($this->issetViewVariable('_days') && $this->issetViewVariable('_months') && $this->issetViewVariable('_years')) {
         $date = $this->getViewVariable('_years') . '-' . $this->getViewVariable('_months') . '-' . $this->getViewVariable('_days');
     }
     if ($this->issetViewVariable('hora_inicio_hours') && $this->issetViewVariable('hora_inicio_minutes')) {
         $ini_time = $this->getViewVariable('hora_inicio_hours') . ':' . $this->getViewVariable('hora_inicio_minutes') . ':00';
     }
     if ($this->issetViewVariable('hora_fin_hours') && $this->issetViewVariable('hora_fin_minutes')) {
         $fin_time = $this->getViewVariable('hora_fin_hours') . ':' . $this->getViewVariable('hora_fin_minutes') . ':00';
     }
     $bol_cuestion = true;
     //Comprueba el contenido de la Variable nombre. Esta se le pasa como entrada al controlador y puede venir de un formulario o un link
     if ($this->issetViewVariable('asunto') && $this->getViewVariable('asunto') != '') {
         if ($this->issetViewVariable('comentario') && $this->getViewVariable('comentario') != '') {
             //Poner control
             $bol_cuestion = false;
             $course_id = Session::getValue('courseinfo_course_id');
             $course_name = Session::getValue('courseinfo_course_name');
             if (empty($course_id)) {
                 $course_id = 0;
                 $course_name = '';
             }
             $event = $this->getViewVariable('tipo_de_evento');
             $subject = $this->getViewVariable('asunto');
             $content = $this->getViewVariable('comentario');
             $dt_ini = $date . ' ' . $ini_time;
             $dt_fin = $date . ' ' . $fin_time;
             $dt_aud = date("Y-m-d H:i:s");
             $user_aud = Session::getValue('userinfo_user_id');
             //Realizamos una llamada al Modelo $this->obj_data->Método(Parámetros);
             $calendar_id = $this->obj_data->insertEvent($course_id, $event, $subject, $content, $dt_ini, $dt_fin, $dt_aud, $user_aud);
         }
     }
     //Si está relleno se muestra el contenido
     if (!$bol_cuestion) {
         $this->setViewVariable('calendar', $calendar_id);
         $this->setViewVariable('course', $course_name);
         $this->setViewVariable('event', $this->obj_data->getEventTypeDescription($event));
         $this->setViewVariable('subject', $subject);
         $this->setViewVariable('content', $content);
         $this->setViewVariable('dt_ini', $dt_ini);
         $this->setViewVariable('dt_fin', $dt_fin);
         $this->setViewVariable('status', 'show');
     }
 }
Esempio n. 14
0
 protected function flash($name, $value)
 {
     if ($this->session->hasValue('flash')) {
         $this->session->putValue('flash', array_merge($this->session->getValue('flash'), array($name => $value)));
     } else {
         $this->session->putValue('flash', array($name => $value));
     }
 }
 /**
  * this function returns the contents
  * of the left block.  It is already wrapped
  * in a TD
  *
  * @return HTMLTag object
  */
 function right_block()
 {
     $ret_val = container();
     $hr = html_hr();
     $hr->set_tag_attribute("noshade");
     $hr->set_tag_attribute("size", 2);
     $ret_val->add($hr);
     $div = html_div("ul-big");
     $div->add(Theme::getThemeImage("edcenters.png"));
     $div->add(agt('miguel_Courses'));
     $div->add(html_br(2));
     $course = $this->getViewVariable("arr_courses");
     $ul = html_ul();
     if ($course[0]['course_id'] != '') {
         $countCourse = count($course);
         for ($i = 0; $i < $countCourse; $i++) {
             $elem = container();
             $link = html_a(Util::format_URLPath("course/index.php", "course=" . $course[$i]["course_id"]), $course[$i]["course_name"], null, "_top");
             $link->set_tag_attribute('tabindex', $i + 7);
             $elem->add($link);
             $elem->add(html_br());
             $elem->add($course[$i]["course_description"]);
             $elem->add(html_br());
             $mailLink = Theme::getMailURL($course[$i]['course_email'], Session::getValue('migueloo_userinfo_user_id'));
             $elem->add(html_b(agt('miguel_responsable') . ' '), html_a($mailLink, $course[$i]["course_responsable"]));
             $elem->add(html_br());
             $elem->add(html_a(Util::format_URLPath("unsubscribe/index.php", "course_id=" . $course[$i]["course_id"]), agt('miguel_unsubscribe'), null, '_top'));
             $ul->add($elem);
         }
         $div->add($ul);
     }
     $ret_val->add($div);
     return $ret_val;
 }
Esempio n. 16
0
 public function update_user_pass()
 {
     if (isset($_POST['PASS'])) {
         $_POST['PASS'] = "******" . md5($_POST['PASS']) . "'";
         if ($this->model->update_password_user(Session::getValue("ID-ADMIN"), $_POST['PASS'])) {
             echo json_encode(['Mensaje' => 'Contraseña reestablecida']);
         } else {
             echo json_encode(['Mensaje' => 'No se pudo reestablecer contraseña']);
         }
     } else {
         echo json_encode(['Mensaje' => 'Error sistema']);
     }
 }
Esempio n. 17
0
 /**
  * On-server dev handler
  *
  * @param [string] $value  Connection mode, "git" or "sftp"
  * @param [string] $commit Should be the commit message to use if committing
  *   on server changes
  * @return [array] $data['data']
  */
 public function onServerDev($value = null, $commit = null)
 {
     $path = sprintf('environments/%s/on-server-development', $this->get('id'));
     if ($commit) {
         $path = sprintf('%s/commit', $path);
         $data = array('message' => $commit, 'user' => Session::getValue('user_uuid'));
         $options = array('body' => json_encode($data), 'headers' => array('Content-type' => 'application/json'));
         $data = \TerminusCommand::request('sites', $this->site->get('id'), $path, 'POST', $options);
     } else {
         if ($value == null) {
             $data = \TerminusCommand::request('sites', $this->site->get('id'), $path, 'GET');
         } else {
             $enabled = $value == 'sftp';
             $data = array('enabled' => $enabled);
             $options = array('body' => json_encode($data), 'headers' => array('Content-type' => 'application/json'));
             $data = \TerminusCommand::request('sites', $this->site->get('id'), $path, 'PUT', $options);
         }
     }
     if (empty($data)) {
         return false;
     }
     return $data['data'];
 }
 /**
  * Contiene la funcionalidad del controlador.
  * Se debe sobreescribir por las clases que heredan de esta.
  */
 function processPetition()
 {
     $arr_menuElem[] = array('url' => app_URLPath('index.php'), 'name' => Session::getValue('siteName'));
 }
Esempio n. 19
0
<?php

# evaluo que efectivamente existe una sesión y la misma coincide con el usuario que quiere modificar la información de perfil
if (Session::exist() && Session::getValue('U_ID') === $usuario->getIdUsuario()) {
    include "cabecera.php";
    ?>
	<div class="container">
		<div class="row">
			<!-- Menu secundario superior de navegación -->
			<div class="">
				<ul class="nav nav-tabs">
					<li role="presentation"><a href="<?php 
    echo URL;
    ?>
GestorReqPrincipal/mostrarPerfil/<?php 
    echo $usuario->getIdUsuario();
    ?>
">Biografía</a></li>
					<li role="presentation"><a href="<?php 
    echo URL;
    ?>
GestorReqPrincipal/mostrarPosts/imagenes/1/<?php 
    echo $usuario->getIdUsuario();
    ?>
">Imagenes</a></li>
					<li role="presentation"><a href="<?php 
    echo URL;
    ?>
GestorReqPrincipal/mostrarPosts/videos/1/<?php 
    echo $usuario->getIdUsuario();
    ?>
 /**
  * this function returns the contents
  * of the left block.  It is already wrapped
  * in a TD
  *
  * @return HTMLTag object
  */
 function right_block()
 {
     $ret_val = container();
     $ret_val->add(html_h4("Inscripción - Paso 2"));
     $hr = html_hr();
     $hr->set_tag_attribute("noshade");
     $hr->set_tag_attribute("size", 2);
     $ret_val->add($hr);
     if (!Session::getValue("inscript")) {
         $ret_val->add(html_a(Util::main_URLPath('index.php'), agt('Regresar a la página principal')));
         $ret_val->add(html_br(2));
         $ret_val->add(html_a(Util::app_URLPath('auth/index.php'), agt('Nuevo Usuario')));
     } else {
         //$ret_val->add(new FormProcessor(new miguel_inscriptionForm()));
     }
     return $ret_val;
 }
 function _installStep6()
 {
     $ret_val = container();
     $div = html_div("ul-big");
     //Add install image
     $div->add($this->_addImage());
     $div->add(html_h2(agt("Instalación de miguel - Paso 6")));
     $div->add(html_h3(agt("Personalización del Campus Virtual")));
     $div->add(html_br(2));
     $div->add(agt("Estos son los parámetros de personalización de su Campus en miguel."));
     $div->add(html_br(2));
     $div2 = html_div('warncolor');
     $div2->add(agt('Imprima esta página para conservar su configuración'));
     $div->add($div2);
     $div->add(html_br(2));
     $table =& html_table($this->_width, 0, 3);
     $table->set_class("mainInterfaceWidth");
     //$table->set_style("border: 1px solid");
     $table->add($this->_addFinalRow('Sistema Gestor de la Base de Datos', Session::getValue('host_sgbd')));
     $table->add($this->_addFinalRow('Alojamiento de la Base de Datos', Session::getValue('host_name')));
     $table->add($this->_addFinalRow('Nombre de la Base de Datos', Session::getValue('ddbb_name')));
     $table->add($this->_addFinalRow('Usuario de acceso a la Base de Datos', Session::getValue('ddbb_user')));
     $table->add($this->_addFinalRow('Clave de acceso a la Base de Datos', '____________________ (*)'));
     $table->add($this->_addFinalRow('Nombre del Campus Virtual', Session::getValue('campus_name')));
     $table->add($this->_addFinalRow('Nombre de la Institución', Session::getValue('inst_name')));
     $table->add($this->_addFinalRow('URL de la Institución', Session::getValue('inst_url')));
     $table->add($this->_addFinalRow('Jefe de estudios', Session::getValue('director_name')));
     $table->add($this->_addFinalRow('Correo de contacto', Session::getValue('director_email')));
     $table->add($this->_addFinalRow('Teléfono de contacto', Session::getValue('inst_phone')));
     $table->add($this->_addFinalRow('Idioma del Campus', Session::getValue('campus_lang')));
     $table->add($this->_addFinalRow('Nombre del Administrador', Session::getValue('admin_name')));
     $table->add($this->_addFinalRow('Apellidos del administrador', Session::getValue('admin_surname')));
     $table->add($this->_addFinalRow('Usuario del administrador', Session::getValue('admin_user')));
     $table->add($this->_addFinalRow('Clave del administrador', '____________________ (*)'));
     $table->add($this->_addFinalRow('Tema visual del administrador', Session::getValue('admin_theme')));
     $table->add($this->_addFinalRow('Claves encriptadas en la base de datos', Session::getValue('cript_passwd')));
     $div->add($table);
     $div->add(html_br(2));
     $div3 = html_div('warncolor');
     $div3->add(agt('(*) Por motivos de seguridad la clave le será enviada via correo electrónico.'));
     $div->add($div3);
     $div->add($this->addForm('install', 'miguel_installNavForm'));
     $ret_val->add($div);
     return $ret_val;
 }
 function getCabecera()
 {
     if (Session::getValue("userinfo_user_alias") == null) {
         $container = container(html_img(Theme::getThemeImagePath("logo.png"), 0, 0, 0, "miguel Home"), html_br(), "&nbsp;");
     } else {
         if (Session::getValue("userinfo_user_alias") != 'guest') {
             $str_userName = Session::getValue('userinfo_treatment') . ' ' . Session::getValue("userinfo_name") . ' ' . Session::getValue("userinfo_surname");
         } else {
             $str_userName = agt("Guest");
         }
         $container = container(html_img(Theme::getThemeImagePath("logo.png"), 0, 0, 0, "miguel Home"), html_br(), agt("LoggedAs") . "&nbsp;" . $str_userName);
     }
     return $container;
 }
Esempio n. 23
0
						location.href = "<?php 
echo URL;
?>
GestorReqPrincipal/mostrarPost/"+idPost;
					});
				}
			}

			function agregarDenuncia(){
				var motivo = $('select[name=motivo]').val();
				var argumento = $('input[name=argumento]').val();
				<?php 
if (Session::exist()) {
    ?>
					var idUsuarioDenuncia = <?php 
    echo Session::getValue('U_ID');
    ?>
;
				<?php 
} else {
    ?>
					var idUsuarioDenuncia = "";
				<?php 
}
?>

				if(motivo!="Seleccionar" && argumento!=""){
					$.ajax({
						type: "POST",
						url: "<?php 
echo URL;
Esempio n. 24
0
    $gCurrentSession->addObject('gCurrentOrganization', $gCurrentOrganization);
    $gCurrentSession->setValue('ses_org_id', $gCurrentOrganization->getValue('org_id'));
    // create a language data object and assign it to the language object
    $gLanguageData = new LanguageData($gPreferences['system_language']);
    $gL10n->addLanguageData($gLanguageData);
    $gCurrentSession->addObject('gLanguageData', $gLanguageData);
    // delete old entries in session table
    $gCurrentSession->tableCleanup($gPreferences['logout_minutes']);
}
// now if auto login is done, read global user data
if ($gCurrentSession->hasObject('gCurrentUser')) {
    $gProfileFields =& $gCurrentSession->getObject('gProfileFields');
    $gCurrentUser =& $gCurrentSession->getObject('gCurrentUser');
    $gCurrentUser->mProfileFieldsData->setDatabase($gDb);
    // checks if user in database session is the same as in php session
    if ($gCurrentUser->getValue('usr_id') !== $gCurrentSession->getValue('ses_usr_id')) {
        $gCurrentUser->clear();
        $gCurrentSession->setValue('ses_usr_id', '');
    }
} else {
    // create object with current user field structure und user object
    $gProfileFields = new ProfileFields($gDb, $gCurrentOrganization->getValue('org_id'));
    $gCurrentUser = new User($gDb, $gProfileFields, $gCurrentSession->getValue('ses_usr_id'));
    // if session is created with auto login then update user login data
    // if user object is created and session has usr_id then this is an auto login
    // and we should update the login data and count logins
    if ($gCurrentSession->getValue('ses_usr_id') > 0) {
        $gCurrentUser->updateLoginData();
    }
    // save all data in session
    $gCurrentSession->addObject('gProfileFields', $gProfileFields);
 function sendMessage($arrId, $str_subject, $str_body)
 {
     //Obtiene la fecha actual, función de PHP
     $now = date("Y-m-d H:i:s");
     $iMyId = Session::getValue('USERINFO_USER_ID');
     $iMsgId = $this->Insert('message', 'sender,subject,body,date', array($iMyId, $str_subject, $str_body, $now));
     if ($this->hasError()) {
         $ret_val = null;
     } else {
         for ($i = 0; $i < count($arrId); $i++) {
             if ($arrId[$i] != '') {
                 $this->Insert('receiver_message', 'id_receiver,id_message,status', "{$arrId[$i]},{$iMsgId},0");
             }
         }
         $ret_val = $iMsgId;
     }
     //Comprueba si ha ocurrido algún error al realizar la operación
     if ($this->hasError()) {
         $ret_val = null;
     }
     return $ret_val;
 }
Esempio n. 26
0
 /**
  * Devuelve el valor del charset para el lenguaje seleccionado
  *
  * @param optional boolean $no_utf  Do not use UTF-8?
  *
  * @return string  The character set that should be used with the current
  *                 locale settings.
  * @access public
  */
 function getCharset($no_utf = false)
 {
     global $nls;
     $language = Session::getValue('language');
     /* Get cached results. */
     $cacheKey = intval($no_utf);
     $charset = NLS::_cachedCharset($cacheKey);
     if (!is_null($charset)) {
         return $charset;
     }
     $lang_charset = setlocale(LC_ALL, 0);
     if (!strstr($lang_charset, ';') && !strstr($lang_charset, '/')) {
         $lang_charset = explode('.', $lang_charset);
         if (count($lang_charset) == 2 && !empty($lang_charset[1]) && (!$no_utf || $lang_charset[1] != 'UTF-8')) {
             NLS::_cachedCharset($cacheKey, $lang_charset[1]);
             return $lang_charset[1];
         }
     }
     return !empty($nls['charsets'][$language]) ? $nls['charsets'][$language] : $nls['defaults']['charset'];
 }
 /**
  * Permite recuperar un elemento (variable) de los datos de sesión
  * @param string $str_name Nombre del elemento (variable)
  * @return mixto Valor asociado
  */
 function getSessionElement($str_name, $str_key = '')
 {
     $ret_val = null;
     if ($str_name != '') {
         if ($str_key != '') {
             $ret_val = Session::getValue("{$str_name}" . '_' . $str_key);
         } else {
             $ret_val = Session::getValue("{$str_name}");
         }
     }
     return $ret_val;
 }
Esempio n. 28
0
 function grabarAsistencia()
 {
     Session::init();
     if (sizeof($this->model->listarAsistencias("where t1.fecha='" . Date::invertDate2(Date::today()) . "' and t1.id_personal='" . $_POST['personal'] . "' and tipo_asistencia='01' ")) > 0) {
         header("location: " . URL . "personal/asistencia");
     } else {
         if (sizeof($this->model->listarAsistencias("where t1.fecha='" . Date::invertDate2(Date::today()) . "' and t1.id_personal='" . $_POST['personal'] . "' and tipo_asistencia='00' ")) > 0) {
             $data['tipo_asistencia'] = '01';
         }
         $funcion = new funciones();
         $data['id_asistencia'] = $funcion->model->getLastID('r_asistencia', 5);
         $data['id_personal'] = $_POST['personal'];
         $data['hora'] = Date::now();
         $data['fecha'] = Date::invertDate2(Date::today());
         $data['id_usuario_crea'] = Session::getValue('ID');
         $this->model->grabarAsistencia($data);
         $periodo = new periodo();
         $sem = $periodo->model->listarPeriodo(" where fin_periodo >= '" . $data['fecha'] . "' and  inicio_periodo <= '" . $data['fecha'] . "' and id_periodo >'2015200'")[0];
         $inicio = $sem['inicio_periodo'];
         $fin = $sem['fin_periodo'];
         if (sizeof($this->model->asistenciaPersonal($_POST['personal'], " and t1.fecha BETWEEN '{$inicio}' AND '{$fin}' ")) == 6) {
             $dataDom['id_asistencia'] = $funcion->model->getLastID('r_asistencia', 5);
             $dataDom['id_personal'] = $_POST['personal'];
             $dataDom['tipo_asistencia'] = '00';
             $dataDom['hora'] = '09:00:00';
             $dataDom['fecha'] = $fin;
             $dataDom['id_usuario_crea'] = Session::getValue('ID');
             $this->model->grabarAsistencia($dataDom);
             $dataDom['id_asistencia'] = $funcion->model->getLastID('r_asistencia', 5);
             $dataDom['id_personal'] = $_POST['personal'];
             $dataDom['tipo_asistencia'] = '01';
             $dataDom['hora'] = '18:00:00';
             $dataDom['fecha'] = $fin;
             $dataDom['id_usuario_crea'] = Session::getValue('ID');
             $this->model->grabarAsistencia($dataDom);
         }
         header("location: " . URL . "Personal/asistencia");
     }
 }
Esempio n. 29
0
 /**
  * Devuelve el tema a utilizar
  *
  * @public
  */
 function getURLTheme()
 {
     $theme = Session::getValue('userinfo_theme');
     if (!Theme::existTheme($theme)) {
         $theme = Session::getContextValue('theme');
     }
     return Theme::_getURLTheme($theme);
 }
 function _menuFile()
 {
     if (Session::getValue('USERINFO_USER_ID') != null) {
         $file_name = Session::getValue('menufile');
         if (empty($file_name)) {
             $file_name = 'menu_item_' . Session::getValue('USERINFO_USER_ID') . '_' . date("YmdHis") . '.js';
         }
         $menuFile = Util::formatPath(MIGUELBASE_CACHE_DIR . '/' . $file_name);
         if (file_exists($menuFile) && time() - filemtime($menuFile) < MIGUELBASE_CACHE_TIME) {
             File::Touch($menuFile);
         } else {
             //Si existe, se borra
             if (file_exists($menuFile)) {
                 File::Delete($menuFile);
             }
             //Se crea, según el perfil de usuario
             switch (Session::getValue('USERINFO_PROFILE_ID')) {
                 case 1:
                     $strFile = 'menu_admin';
                     break;
                 case 2:
                 case 3:
                     $strFile = 'menu_profesor';
                     break;
                 case 4:
                     $strFile = 'menu_alumno';
                     break;
                 case 5:
                     $strFile = 'menu_secretaria';
                     break;
                 default:
                     $strFile = 'menu';
                     break;
             }
             include_once Util::app_Path("common/control/classes/miguel_menubar.class.php");
             $menubar = new miguel_MenuBar($strFile . '.xml');
             $str_content = 'var MENU_ITEMS = [';
             for ($i = 0; $i < $menubar->countMenu(); $i++) {
                 $str_content .= $menubar->getMenuCode($i, $superior);
             }
             $str_content .= '];';
             if (file_exists($menuFile)) {
                 File::Delete($menuFile);
             }
             File::Write($menuFile, $str_content);
         }
         $this->setViewVariable('menufile', MIGUEL_URLDIR . 'var/cache/' . "{$file_name}");
         Session::setValue('menufile', $file_name);
     }
 }