Esempio n. 1
0
 public static function toEntity(SalonDTO $salonDTO)
 {
     $salon = new Salon();
     $salon->setId($salonDTO->getId());
     $salon->setSalonNombre($salonDTO->getSalonNombre());
     return $salon;
 }
Esempio n. 2
0
 /**
  * Notifie le pseudo de buzzer au salon et aux autres buzzers connectés au même salon
  */
 public function notifPseudo()
 {
     $msg = json_encode(array('idConnection' => $this->getConnectionId(), 'msgType' => 'changePseudo', 'error' => 0, 'errorMsg' => '', 'idBuzzer' => $this->getId(), 'pseudo' => $this->getPseudoApparent()));
     if (!is_null($this->salon)) {
         $this->salon->send($msg);
         $this->salon->getBuzzers()->send($msg);
     }
 }
Esempio n. 3
0
 public function imprimir($imprimir = true, $clase = '', $defecto = false, $front = false)
 {
     $dias = ($this->fecha_fin - $this->fecha_inicio) / dias(1);
     /*NUMERO DE DIAS A IMPRIMIR*/
     $clases_format = array();
     switch ($this->classe) {
         case 'ubicacion':
             $ubicacion = new Ubicacion($this->data_tipo);
             $clases_format = $ubicacion->get_clases($this->fecha_inicio, $this->fecha_fin, true);
             break;
         case 'salon':
             $salon = new Salon($this->data_tipo);
             $clases_format = $salon->get_clases(true, $this->fecha_inicio, $this->fecha_fin);
             break;
         case 'de_instructor':
             $instructor = new Instructor($this->data_tipo);
             $clases_format = $instructor->get_clases($this->fecha_inicio, $this->fecha_fin, true);
             if (!$clases_format) {
                 return;
             }
             break;
         default:
             return;
             break;
     }
     $html = '';
     $id_c = isset($this->ID) && $this->ID != false ? 'id="' . $this->ID . '"' : '';
     $html .= '<div ' . $id_c . ' class="calendario calendario_' . $this->tipo . ' ' . $clase . '">';
     for ($i = 0; $i < $dias; $i++) {
         /*IMPRIMIMOS TODOS LOS DIAS :)*/
         $html .= $this->print_dia($i, $clases_format, $imprimir, $defecto, $front);
     }
     $html .= '</div>';
     if ($imprimir) {
         echo $html;
     } else {
         return $html;
     }
 }
 public function updateInventarioSalon(ObjetoEnInventario $entity, Salon $inventarioSalon)
 {
     $entity->setInventarioSalon($inventarioSalon->getId());
     return $this->persistenceManager->update($entity);
 }
 public function updateSalon(MonitorSalon $entity, Salon $salon)
 {
     $entity->setSalon($salon->getId());
     return $this->persistenceManager->update($entity);
 }
 public function consultaTransferencia()
 {
     try {
         $idPersona = isset($_POST['idPersona']) ? $_POST['idPersona'] : NULL;
         $persona = new Persona();
         $estudiante = $persona->leerPorId($idPersona);
         $matricula = new Matricula();
         $mat = $matricula->leerMatriculaPorId($idPersona);
         $salon = new Salon();
         $sal = $salon->leerSalonePorId($mat->getIdSalon());
         $salones = $salon->leerSalonePorIdGrado($sal->getIdGrado());
         if ($estudiante == NULL) {
             $this->setVista('mensaje');
             $msj = "El Número de Documento no existe en el sistema";
             $this->vista->set('msj', $msj);
         } else {
             $rol = new Rol();
             $roles = $rol->leerRoles($idPersona);
             $band = 0;
             foreach ($roles as $ro) {
                 if ($ro->getIdRol() == 'E') {
                     $band = 1;
                 }
             }
             if ($band != 1) {
                 $this->setVista('mensaje');
                 $msj = "El Número de Documento ingresado no corresponde al de un estudiante";
                 $this->vista->set('msj', $msj);
             } elseif ($mat != NULL) {
                 $this->vista->set('estudiante', $estudiante);
                 $this->vista->set('salones', $salones);
                 $this->vista->set('idSalon', $mat->getIdSalon());
             } else {
                 $this->setVista('mensaje');
                 $msj = "El estudiante NO se encuentra matriculado";
                 $this->vista->set('msj', $msj);
             }
         }
         return $this->vista->imprimir();
     } catch (Exception $exc) {
         $this->setVista('mensaje');
         $msj = "Error en la aplicación, Colocarse en contacto con el Desarrollador";
         $this->vista->set('msj', $msj);
         return $this->vista->imprimir();
     }
 }
Esempio n. 7
0
 public function updateSalonNombre(Salon $entity, $salonNombre)
 {
     $entity->setSalonNombre($salonNombre);
     return $this->persistenceManager->update($entity);
 }
Esempio n. 8
0
 public function eliminar()
 {
     /*AÑADIR ELIMINACION DE SALONES*/
     $salones = $this->get_salones();
     if ($salones) {
         foreach ($salones as $salon) {
             $s = new Salon($salon);
             $s->eliminar();
         }
     }
     eliminar($this->ID);
 }
 /**
  * Listar algunos Reserva dado el $reservaSalonId
  * 
  * @param $reservaSalonId
  * @param $performSize
  * @param $firstResultNumber
  * @param $numResults
  */
 public function listReservasByReservaSalonId($reservaSalonId, $performSize = false, $firstResultNumber = null, $numResults = null, $orderBy = null, $orderPriority = SQL_ASCENDING_ORDER)
 {
     $objBean = new SalonBean($this->persistenceManager);
     $obj = new Salon();
     $obj->setId($reservaSalonId);
     # Validamos los campos
     if ($firstResultNumber !== null && !EntityValidator::validatePositiveNumber($firstResultNumber)) {
         throw new Exception(SALAS_COMP_ALERT_E_VALIDATION_FAIL, $this->ID + 111);
     }
     if (!EntityValidator::validateGlobalOrderPriority($orderPriority)) {
         throw new Exception(SALAS_COMP_ALERT_E_VALIDATION_FAIL, $this->ID + 113);
     }
     if (!EntityValidator::validateId($reservaSalonId)) {
         throw new Exception(SALAS_COMP_ALERT_E_VALIDATION_FAIL, $this->ID + 115);
     }
     # Verificamos que la entidad exista
     if (!$objBean->getSalon($obj)) {
         throw new Exception(SALAS_COMP_ALERT_E_ENTITY_NOT_FOUND_FAIL, $this->ID + 117);
     }
     # Listamos las entidades
     if ($performSize) {
         $this->lastRequestSize = $this->reservaBean->countGetReservasByReservaSalon($obj);
     }
     return ReservaDTO::loadFromEntities($this->reservaBean->listReservasByReservaSalon($obj, $firstResultNumber, $numResults, $orderBy, $orderPriority));
 }
Esempio n. 10
0
 function reservaciones_salon($id_salon = false)
 {
     if (!$id_salon) {
         return;
     }
     $salon = new Salon($id_salon);
     $html = '<div class="instructor_incoming_calendar">';
     /*SETEAMOS LOS CALENDARIOS*/
     $calendario = new Calendario(array('tipo' => 'back_end', 'data_tipo' => $salon->ID, 'ID' => 'semana_1'));
     $calendario2 = new Calendario(array('tipo' => 'back_end', 'data_tipo' => $salon->ID, 'ID' => 'semana_2', 'fecha_inicio' => strtotime(date_i18n('Y-m-d')) + dias(7)));
     $html .= '<div class="nueva_cabe_fer">';
     $html .= '<span class="titulo_fer_n">Reservaciones</span>';
     $html .= $calendario->imprimir_cabecera_back('semana_1', true);
     $html .= $calendario2->imprimir_cabecera_back('semana_1', true);
     $html .= '</div>';
     /*CABECERA DIAS-----*/
     $html .= $calendario->print_dias_reserva();
     $html .= '</div>';
     /*SEMANA 1*/
     $html .= '<div id="semana_1" class="calendario_back_end">';
     foreach ($salon->get_clases(true, strtotime(date_i18n('Y-m-d')), strtotime(date_i18n('Y-m-d')) + dias(7), true) as $clase) {
         $c = new Clase($clase->ID);
         $html .= $c->imprimir_reservaciones();
     }
     $html .= '</div>';
     /*SEMANA 2*/
     $html .= '<div id="semana_2" class="calendario_back_end escondido">';
     foreach ($salon->get_clases(true, strtotime(date_i18n('Y-m-d')) + dias(8), strtotime(date_i18n('Y-m-d')) + dias(15), true) as $clase) {
         $c = new Clase($clase->ID);
         $html .= $c->imprimir_reservaciones();
     }
     $html .= '</div>';
     return $html;
 }
 /**
  * Eliminar un Salon Dado el $salonId
  * 
  * @param $salonId
  */
 public function removeSalon($salonId)
 {
     $objetoEnInventarioBean = new ObjetoEnInventarioBean($this->persistenceManager);
     $objetoPerdidoBean = new ObjetoPerdidoBean($this->persistenceManager);
     $monitorSalonBean = new MonitorSalonBean($this->persistenceManager);
     $reservaBean = new ReservaBean($this->persistenceManager);
     $salon = new Salon();
     $salon->setId($salonId);
     # Validamos los campos
     if (!EntityValidator::validateId($salonId)) {
         throw new Exception(SALAS_COMP_ALERT_E_VALIDATION_FAIL, $this->ID + 54);
     }
     # Verificamos que la entidad exista.
     if (!$this->salonBean->getSalon($salon)) {
         throw new Exception(SALAS_COMP_ALERT_E_ENTITY_NOT_FOUND_FAIL, $this->ID + 55);
     }
     # Verificamos que la entidad no esté siendo utilziada en alguna otra.
     # Verificamos que la entidad no esté siendo utilziada en ObjetoEnInventario->inventarioSalon
     $objetoEnInventarios = $objetoEnInventarioBean->getObjetoEnInventariosByInventarioSalon($salon);
     if (count($objetoEnInventarios) > 0) {
         throw new Exception(SALAS_COMP_ALERT_E_PERSISTENCE_REMOVE_LINKED_FAIL, $this->ID + 50);
     }
     # Verificamos que la entidad no esté siendo utilziada en ObjetoPerdido->objetoPerdidoSalon
     $objetoPerdidos = $objetoPerdidoBean->getObjetoPerdidosByObjetoPerdidoSalon($salon);
     if (count($objetoPerdidos) > 0) {
         throw new Exception(SALAS_COMP_ALERT_E_PERSISTENCE_REMOVE_LINKED_FAIL, $this->ID + 51);
     }
     # Verificamos que la entidad no esté siendo utilziada en MonitorSalon->salon
     $monitorSalons = $monitorSalonBean->getMonitorSalonsBySalon($salon);
     if (count($monitorSalons) > 0) {
         throw new Exception(SALAS_COMP_ALERT_E_PERSISTENCE_REMOVE_LINKED_FAIL, $this->ID + 52);
     }
     # Verificamos que la entidad no esté siendo utilziada en Reserva->reservaSalon
     $reservas = $reservaBean->getReservasByReservaSalon($salon);
     if (count($reservas) > 0) {
         throw new Exception(SALAS_COMP_ALERT_E_PERSISTENCE_REMOVE_LINKED_FAIL, $this->ID + 53);
     }
     # Eliminamos la entidad
     if (!$this->salonBean->removeSalon($salon)) {
         throw new Exception(SALAS_COMP_ALERT_E_PERSISTENCE_REMOVE_FAIL, $this->ID + 56);
     }
 }
Esempio n. 12
0
<?php

$s = new Salon($id_salon);
$html .= '<header class="header_mapa_backend">';
$html .= '<div class="titulos_mapa_cal">';
$html .= '<h2>Mapa del Salón</h2>';
$html .= '</div>';
$html .= '<div id="guardar_forma_salon" class="boton v_oscuro disabled">Confirmar Cambios</div>';
$html .= '</header>';
$html .= $s->imprimir_forma();
 /**
  * @param Salon $salon
  */
 public function ajout(Salon $salon)
 {
     $this[$salon->getId()] = $salon;
 }
Esempio n. 14
0
 public function informePorSalon($idSalon)
 {
     $persona = new Persona();
     $pdf = new FPDF('P', 'cm', 'Letter');
     $personas = $persona->leerPorSalon($idSalon);
     foreach ($personas as $p) {
         $pdf->AddPage();
         $matricula = new Matricula();
         $matr = $matricula->leerMatriculaPorId($p->getIdPersona());
         $salon = new Salon();
         $sal = $salon->leerSalonePorId($matr->getIdSalon());
         $grado = new Grado();
         $grad = $grado->leerGradoPorId($sal->getIdGrado());
         $pensum = new Pensum();
         $pens = $pensum->leerPensum($matr->getIdSalon());
         $x = 1;
         $y = 1;
         $pdf->SetXY($x, $y);
         $pdf->SetFont("Times", "B", 12);
         $pdf->Cell(20, 1, 'Liceo Galois', 0, 0, "C");
         $y += 1;
         $pdf->SetXY($x, $y);
         $pdf->Cell(20, 1, utf8_decode('Reporte Académico'), 0, 0, "C");
         $y += 1;
         $pdf->SetXY($x, $y);
         $pdf->Cell(20, 1, strtoupper(utf8_decode($p->getPApellido() . " " . $p->getSApellido() . " " . $p->getNombres())), 0, 0, "C");
         $y += 1;
         $pdf->SetXY($x, $y);
         $pdf->SetFont("Times", "BI", 12);
         $pdf->Cell(5, 1, 'MATERIA', 1, 0, "C");
         $pdf->Cell(3, 1, '1er PERIODO', 1, 0, "C");
         $pdf->Cell(3, 1, '2do PERIODO', 1, 0, "C");
         $pdf->Cell(3, 1, '3er PERIODO', 1, 0, "C");
         $pdf->Cell(3, 1, '4to PERIODO', 1, 0, "C");
         $pdf->Cell(3, 1, 'PONDERADO', 1, 0, "C");
         $cont = 0;
         foreach ($pens as $pen) {
             $cont++;
             $y += 1;
             $pdf->SetXY($x, $y);
             $mat = new Materia();
             $materia = $mat->leerMateriaPorId($pen->getIdMateria());
             foreach ($materia as $mate) {
                 $pdf->Cell(5, 1, $mate->getNombreMateria(), 1, 0, "L");
             }
             $nota = new Nota();
             $not = $nota->leerNotaEstudiante($p->getIdPersona(), $pen->getIdMateria());
             $prom = round($nota->calcularDef2($not->getprimerP(), $not->getSegundoP(), $not->getTercerP(), $not->getCuartoP()), 2);
             $pdf->Cell(3, 1, $not->getPrimerP(), 1, 0, "C");
             $pdf->Cell(3, 1, $not->getSegundoP(), 1, 0, "C");
             $pdf->Cell(3, 1, $not->getTercerP(), 1, 0, "C");
             $pdf->Cell(3, 1, $not->getCuartoP(), 1, 0, "C");
             if ($prom < 30) {
                 $pdf->SetTextColor(190, 21, 34);
             } else {
                 $pdf->SetTextColor(0, 0, 0);
             }
             $pdf->Cell(3, 1, $prom, 1, 0, "C");
             $pdf->SetTextColor(0, 0, 0);
         }
     }
     $pdf->Output("REPORTE ACADEMICO GRADO " . $idSalon, "I");
 }
Esempio n. 15
0
 function actualizar_forma_salon($data = false)
 {
     if (!$data || !isset($data['ID']) || !isset($data['forma'])) {
         return;
     }
     $salon = new Salon($data['ID']);
     $salon->actualizar_forma($data['forma']);
     return 'El salón ha sido actualizado correctamente';
 }
 public function updateObjetoPerdidoSalon(ObjetoPerdido $entity, Salon $objetoPerdidoSalon)
 {
     $entity->setObjetoPerdidoSalon($objetoPerdidoSalon->getId());
     return $this->persistenceManager->update($entity);
 }
Esempio n. 17
0
 public function actualizarLogrosMovil()
 {
     try {
         $this->vista->set('titulo', 'ingreso de Logros');
         $idDocente = isset($_POST['idPersona']) ? $_POST['idPersona'] : NULL;
         $carga = new Carga();
         $Cargas = $carga->leerCargasPorDocente($idDocente);
         $salones = array();
         foreach ($Cargas as $carga) {
             $salon = new Salon();
             $sal = $salon->leerSalonePorId($carga->getIdSalon());
             $salones[$sal->getIdSalon()] = $sal;
         }
         $grados = array();
         $i = 0;
         foreach ($salones as $salon) {
             $grados[$i] = $salon->getIdGrado();
             $i++;
         }
         $grads = array_unique($grados);
         $gradosNetos = array();
         for ($i = 0; $i < count($grads); $i++) {
             $gra = new Grado();
             $gradosNetos[$grads[$i]] = $gra->leerGradoPorId($grads[$i]);
         }
         $this->vista->set('grados', $gradosNetos);
         return $this->vista->imprimir();
     } catch (Exception $exc) {
         echo $exc->getTraceAsString();
     }
 }
Esempio n. 18
0
 private function getParametros(Salon $salon)
 {
     $parametros = array(':idSalon' => $salon->getIdSalon(), ':idGrado' => $salon->getIdGrado(), ':grupo' => $salon->getGrupo());
     return $parametros;
 }
Esempio n. 19
0
 public function datosAcademicosMovil()
 {
     try {
         $idPersona = isset($_POST['idPersona']) ? $_POST['idPersona'] : NULL;
         $this->vista->set('titulo', 'Datos Academicos');
         $matricula = new Matricula();
         $matr = $matricula->leerMatriculaPorId($idPersona);
         $salon = new Salon();
         $sal = $salon->leerSalonePorId($matr->getIdSalon());
         $grado = new Grado();
         $grad = $grado->leerGradoPorId($sal->getIdGrado());
         $pensum = new Pensum();
         $pens = $pensum->leerPensum($matr->getIdSalon());
         $respuesta = "";
         $respuesta .= '<table >
                 <tr>
                 <td align="left" class="color-text-azul" colspan="6"><h3>Datos Academicos</h3></td>    
                 </tr>
                 </table>
                 <table style="font-size: 11px" width="98%" border="0" cellspacing="0" cellpadding="2" align="center" class="table tBlue">
                 <tr class="modo1">
                 <td width="25%"><b>Materia</td>
                 <td width="15%"><b>P.1</b></td>
                 <td width="15%"><b>P.2</b></td>
                 <td width="15%"><b>P.3</b></td>
                 <td width="15%"><b>P.4</b></td>
                 <td width="15%"><b>Prom.</b></td>
                 </tr>
                 
                 
                 ';
         $cont = 0;
         $s1 = 0;
         $s2 = 0;
         $s3 = 0;
         $s4 = 0;
         foreach ($pens as $pen) {
             $cont++;
             $respuesta .= '
                         <tr>';
             $mat = new Materia();
             $materia = $mat->leerMateriaPorId($pen->getIdMateria());
             foreach ($materia as $mate) {
                 $respuesta .= '<td width="25%"><b> ' . $mate->getNombreMateria() . '</b> </td>';
             }
             $nota = new Nota();
             $not = $nota->leerNotaEstudiante($idPersona, $pen->getIdMateria());
             $respuesta .= '<td width="15%">' . $not->getPrimerP() . '</td>';
             $respuesta .= '<td width="15%">' . $not->getSegundoP() . '</td>';
             $respuesta .= '<td width="15%">' . $not->getTercerP() . '</td>';
             $respuesta .= '<td width="15%">' . $not->getCuartoP() . '</td>';
             $prom = round($nota->calcularDef2($not->getprimerP(), $not->getSegundoP(), $not->getTercerP(), $not->getCuartoP()), 2);
             //$prom=$prom/4;
             $respuesta .= '<td width="15%" class="color-text-azul">' . $prom . '</td>';
             $respuesta .= '</tr>';
             $s1 += $not->getPrimerP();
             $s2 += $not->getSegundoP();
             $s3 += $not->getTercerP();
             $s4 += $not->getCuartoP();
         }
         $p1 = round($s1 / $cont, 2);
         $p2 = round($s2 / $cont, 2);
         $p3 = round($s3 / $cont, 2);
         $p4 = round($s4 / $cont, 2);
         //$pg = round((($p1 + $p2 + $p3 + $p4 ) /4), 2);
         $pg = round($nota->calcularDef2($p1, $p2, $p3, $p4), 2);
         $this->vista->set('grado', $grad);
         $this->vista->set('matricula', $matr);
         $this->vista->set('tabla', $respuesta);
         $this->vista->set('p1', $p1);
         $this->vista->set('p2', $p2);
         $this->vista->set('p3', $p3);
         $this->vista->set('p4', $p4);
         $this->vista->set('pg', $pg);
         return $this->vista->imprimir();
     } catch (Exception $exc) {
         echo 'Error de aplicacion: ' . $exc->getMessage();
     }
 }
Esempio n. 20
0
<?php

$s = new Salon($id_salon);
$calendario = $s->get_calendar('calendario_semana_1');
$calendario2 = $s->get_calendar('calendario_semana_2', 7);
$semana = isset($_POST['semana']) ? $_POST['semana'] : 'calendario_semana_1';
$activa1 = $semana == 'calendario_semana_1' ? 'semana_activa' : '';
$activa2 = $semana == 'calendario_semana_2' ? 'semana_activa' : '';
$html .= '<header class="header_cal_backend v_oscuro">';
$html .= '<div class="titulos_cab_cal">';
$html .= $calendario->imprimir_cabecera_back($semana);
$html .= $calendario2->imprimir_cabecera_back($semana);
$html .= '</div>';
$html .= '<div class="botones_cab_cal">';
/*
$html.= '<span class="boton_calendario '.$activa1.'" data-calendario="calendario_semana_1">Semana 1</span>';
$html.= '<span class="boton_calendario '.$activa2.'" data-calendario="calendario_semana_2">Semana 2</span>';
*/
$html .= '</div>';
$html .= '</header>';
/*SEMANA 1*/
$html .= $calendario->imprimir(false, $activa1, $defecto);
/*SEMANA 2*/
$html .= $calendario2->imprimir(false, $activa2, $defecto);
Esempio n. 21
0
 public function updateReservaSalon(Reserva $entity, Salon $reservaSalon)
 {
     $entity->setReservaSalon($reservaSalon->getId());
     return $this->persistenceManager->update($entity);
 }
Esempio n. 22
0
 public function consolidadoSecundaria()
 {
     try {
         if ($this->verificarSession()) {
             $this->vista->set('titulo', 'estudiantes Secundaria');
             $limI = '6';
             $limS = '11';
             $salones = new Salon();
             $secundaria = $salones->leerSalonesJornada($limI, $limS);
             $this->vista->set('secundaria', $secundaria);
             return $this->vista->imprimir();
         }
     } catch (Exception $exc) {
         echo 'Error de aplicacion: ' . $exc->getMessage();
     }
 }