public function listado($idAula) { //cargo los alumnos $this->load->model("Aula_model", "Aula"); $datos_aula = $this->Aula->CargarAula($idAula); $alumnos_aula = $this->Aula->CargarAlumnos2($idAula); //carga solo estado 1 // configuramos las propiedades del documento $this->phpexcel->getProperties()->setCreator("SoftGroup Perú")->setLastModifiedBy("SoftGroup Perú")->setTitle("Office 2007 XLSX Test Document")->setSubject("Office 2007 XLSX Test Document")->setDescription("Listado de Alumnos")->setKeywords("office 2007 openxml php")->setCategory("Alumnos"); $observacion = $datos_aula[0]->edades == "" ? '' : ' - ' . $datos_aula[0]->edades; $this->phpexcel->setActiveSheetIndex(0)->setCellValue('C1', 'I.E.I. “DIVINO NIÑO JESÚS”')->setCellValue('C2', 'NÓMINA DE NIÑOS')->setCellValue('C3', strtoupper($datos_aula[0]->aula) . $observacion)->setCellValue('C4', 'AULA “' . strtoupper($datos_aula[0]->titulo) . '”'); $fila = 6; // a partir de que fila empezara el listado $f2 = $fila + 1; //asigno el tamaño de las columnas $this->phpexcel->getActiveSheet()->getColumnDimension('A')->setWidth(3); $this->phpexcel->getActiveSheet()->getColumnDimension('B')->setWidth(36); $this->phpexcel->getActiveSheet()->getColumnDimension('C')->setWidth(5); $this->phpexcel->getActiveSheet()->getColumnDimension('D')->setWidth(20); $this->phpexcel->getActiveSheet()->getColumnDimension('E')->setWidth(14); $this->phpexcel->getActiveSheet()->getColumnDimension('F')->setWidth(10); // agregamos información a las celdas $this->phpexcel->setActiveSheetIndex(0)->setCellValue('A' . $fila, 'N°')->setCellValue('B' . $fila, 'APELLIDOS Y NOMBRES')->setCellValue('C' . $fila, 'SEXO')->setCellValue('D' . $fila, 'FECHA DE NACIMIENTO')->setCellValue('E' . $fila, 'EDAD')->setCellValue('F' . $fila, 'PESO')->setCellValue('G' . $fila, 'TALLA'); $con = 1; foreach ($alumnos_aula as $alumno) { $date = str_replace('/', '-', $alumno->fecha_nacimiento); $nacimiento = date('d-m-Y', strtotime($date)); if ($nacimiento == '01-01-1970') { $nacimiento = ' '; } $this->phpexcel->setActiveSheetIndex(0)->setCellValue('A' . $f2, $con)->setCellValue('B' . $f2, $alumno->apellidos . ', ' . $alumno->nombres)->setCellValue('C' . $f2, strtoupper($alumno->genero))->setCellValue('D' . $f2, $nacimiento)->setCellValue('E' . $f2, calcular_edad($alumno->fecha_nacimiento))->setCellValue('F' . $f2, '')->setCellValue('G' . $f2, ''); $con++; $f2++; } //totales $hombres = $this->Aula->contarAlumnos2('h', $idAula); $mujeres = $this->Aula->contarAlumnos2('m', $idAula); $totales = $this->Aula->contarAlumnos2('all', $idAula); $this->phpexcel->setActiveSheetIndex(0)->setCellValue('D' . ($f2 + 1), 'HOMBRES:' . $hombres[0]->num)->setCellValue('D' . ($f2 + 2), 'MUJERES:' . $mujeres[0]->num)->setCellValue('D' . ($f2 + 3), 'TOTAL:' . $totales[0]->num); //agrego estilos $border_style = array('borders' => array('allborders' => array('style' => PHPExcel_Style_Border::BORDER_THIN, 'color' => array('argb' => '000')))); $center_style = array('alignment' => array('horizontal' => PHPExcel_Style_Alignment::HORIZONTAL_CENTER)); $sheet = $this->phpexcel->getActiveSheet(); $sheet->getStyle("A" . $fila . ":G" . ($f2 - 1))->applyFromArray($border_style); $sheet->getStyle("A" . $fila . ":G" . $fila)->applyFromArray($center_style)->getFont()->setBold(true); $sheet->getStyle("A" . $fila . ":A" . ($f2 - 1))->applyFromArray($center_style); $sheet->getStyle("C" . $fila . ":C" . ($f2 - 1))->applyFromArray($center_style); // renombro la hoja de trabajo con el nombre del aula $this->phpexcel->getActiveSheet()->setTitle($datos_aula[0]->titulo); // configuramos el documento para que la hoja // de trabajo número 0 sera la primera en mostrarse // al abrir el documento $this->phpexcel->setActiveSheetIndex(0); //redireccionamos la salida al navegador del cliente (Excel2007) header('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'); header('Content-Disposition: attachment;filename="' . $datos_aula[0]->titulo . '.xlsx"'); header('Cache-Control: max-age=0'); $objWriter = PHPExcel_IOFactory::createWriter($this->phpexcel, 'Excel2007'); $objWriter->save('php://output'); }
if ($alumno->getEstado() == 'A') { ?> <option value="A" selected="Activo">Activo</option> <option value="B">Inactivo</option> <?php } else { ?> <option value="A">Activo</option> <option value="B" selected="Inactivo">Inactivo</option> <?php } ?> </select> </td> <td><?php echo calcular_edad($alumno->getFechaNacimiento()); ?> </td> </tr> <tr> <td> </td><!-- Esto es para dejar un espacio entre filas--> <td></td> </tr> <tr> <td>Fecha de nacimiento:</td> <td>Género:</td> </tr> <tr> <td> <?php $fecha = explode('/', $alumno->getFechaNacimiento(), 3);
$estudiantes = obtener_persona($_GET["cedula"]); if (is_array($estudiantes)) { foreach ($estudiantes as $est) { $e = $est; $edad = calcular_edad($_GET["cedula"]); $e->set_correo($_GET["email"]); } } } //Una vez seleccionado el curso, se if (isset($_POST["cursos"])) { $estudiantes = obtener_persona($_GET["cedula"]); if (is_array($estudiantes)) { foreach ($estudiantes as $est) { $e = $est; $edad = calcular_edad($_GET["cedula"]); $e->set_correo($_GET["email"]); } } realizar_matricula($e, $_POST["cursos"]); $message = "Estudiante registrado con Exito!"; echo "<script type='text/javascript'>alert('{$message}');</script>"; $id_curso = $_POST["cursos"]; echo "<meta http-equiv='Refresh' content='0;url=FrmPago.php?id_curso={$id_curso}'>"; } ?> <!DOCTYPE HTML> <html> <head>
$cedula = $_POST["cedula"]; $email = $_POST["email"]; // $cursos = $_POST["cursos"]; $valor = validar_cedula($_POST["cedula"]); echo $valor["estado"]; echo "Estado de cedula: " . $valor["mensaje"]; echo "<br>POST: " . $_POST["cedula"]; echo "<br>GET: " . $_GET["ced"]; } if (isset($_GET["ced"]) && $valor["estado"] == 1) { $estudiantes = obtener_persona($_POST["cedula"]); echo "<br>"; if (is_array($estudiantes)) { foreach ($estudiantes as $est) { $e = $est; $edad = calcular_edad($_POST["cedula"]); $e->set_correo($_POST["email"]); echo "Nombre: " . $e->get_nombre() . "<br>"; echo "Apellido: " . $e->get_apellido() . "<br>"; echo "Cedula: " . $e->get_CI() . "<br>"; echo "Fecha de nacimiento: " . $e->get_fecha_nac() . "<br>"; echo "Correo: " . $e->get_correo() . "<br>"; echo "Edad: " . $edad; } } // realizar_matricula($e, $_POST["cursos"]); // $message = "Estudiante registrado con Exito!"; // echo "<script type='text/javascript'>alert('$message');</script>"; } // if(isset($_GET["matricula"])){ // $estudiantes = obtener_persona($_POST["cedula"]);
$ls_nexo=""; } $ls_dentipded2=$row["dentipded"].' (DEDUCCION FAMILIAR '.$ls_nexo.' )'; $ls_sueldobene=$row["suelbene"]; $ls_edadmin=$row["edadmin"]; $ls_edadmax=$row["edadmax"]; $ls_valorprima=$row["valprim"]; $apor_empleado=$row["aporemple"]; $apor_empresa=$row["aporempre"]; $ls_sueldoper=$row["sueper"]; $fechanac_familiar=$row["fecnacfam"]; $ld_fecact= date("Y-m-d"); $edad_familiar=calcular_edad(strtotime($fechanac_familiar),strtotime($ld_fecact)); $ls_sueldoper=$row["sueper"]; if (($ls_sueldoper>=$ls_sueldobene)&&($edad_familiar>=$ls_edadmin)&&($edad_familiar<=$ls_edadmax)) { $ls_valor_emple= round ($ls_valorprima * $apor_empleado)/100; $ls_valor_empre= round ($ls_valorprima * $apor_empresa)/100; $la_data[$li_i]=array('coddeduc'=>$ls_codtipded2,'dendeduc'=>$ls_dentipded2, 'valor'=>number_format($ls_valorprima,2,",","."), 'aporemple'=>number_format($ls_valor_emple,2,",","."), 'aporempre'=>number_format($ls_valor_empre,2,",",".")); $li_i++; $suma_total_emple= $suma_total_emple + $ls_valor_emple; $suma_total_empre= $suma_total_empre + $ls_valor_empre; } }///fin del while
</button> </h1> <ol class="breadcrumb"> <li><a href="#"><i class="fa fa-dashboard"></i> Inicio</a></li> <li><a href="#">Alumno</a></li> <li class="active">Perfil</li> </ol> </section> <!-- Main content --> <section class="content"> <div class="row"> <div class="col-sm-12 col-md-12 col-lg-3"> <?php $edad = calcular_edad($alumno[0]->fecha_nacimiento); ?> <!-- Profile Image --> <div class="col-md-6 col-lg-12"> <div class="box box-success"> <div class="box-body box-profile"> <?php switch ($alumno[0]->genero) { case 'h': $foto = 'boy.png'; break; case 'm': $foto = 'girl.png'; break; default: $foto = 'image.jpg';
$email = $_POST["email"] = ""; $cursos = $_POST["cursos"] = ""; } else { $cedula = $_POST["cedula"]; $email = $_POST["email"]; $cursos = $_POST["cursos"]; $mensaje = validar_cedula($_POST["cedula"]); echo "Estado de cedula: " . $mensaje; } if (isset($_GET["cedula"])) { $estudiantes = obtener_persona($_POST["cedula"]); echo "<br>"; // var_dump($e); foreach ($estudiantes as $est) { $e = $est; $e->set_edad(calcular_edad($_POST["cedula"])); echo "Nombre: " . $e->get_nombre() . "<br>"; echo "Apellido: " . $e->get_apellido() . "<br>"; echo "Cedula: " . $e->get_CI() . "<br>"; echo "Edad: " . $e->get_edad() . "<br>"; } } echo "<h2>Registro de cursos</h2>"; echo "<form name=form action=" . $_SERVER['PHP_SELF'] . "?cedula=1111 method='post'>"; echo "<table>"; echo "<tr><th><h4>Cedula de Identidad</th><td><input type='text' name=cedula value='{$cedula}'></td></tr>"; echo "<tr><th><h4>Correo</th><td><input type='email' name=email value='{$email}'></td></tr>"; echo "<tr><th><h4>Cursos</th><td>"; $cursos = lista_cursos(); echo "<select name=cursos>"; foreach ($cursos as $curso) {