Commit e9e761fa315dd8c21a4dc0782e0a7ddb1ebcedca

Authored by Andres Sucerquia Osorio
1 parent 14e4bf53

registrados

app/controllers/RegistrarAsistencia.php
... ... @@ -7,8 +7,7 @@ class RegistrarAsistencia extends \BaseController {
7 7 *
8 8 * @return Response
9 9 */
10   - public function index()
11   - {
  10 + public function index(){
12 11 //Actualiza el estado del asistente id_asistente
13 12 if(Input::get('id_asistente')!=""){
14 13 $graduando=GraduacionUsoTic::find(Input::get('id_asistente'));
... ... @@ -63,12 +62,14 @@ class RegistrarAsistencia extends \BaseController {
63 62 ->with('confirmados',$total_confirmados);
64 63 }
65 64  
66   - public function confirmados()
67   - {
  65 + public function registrados(){
68 66 //Consulto todos los posibles asistentes
69   - $asistentes = GraduacionUsoTic::where('asistio','=',true)->get();
  67 + $asistentes = GraduacionUsoTic::where('asistio','=',true)
  68 + ->orderBy('diplomas','asc')
  69 + ->orderBy('cursos','asc')
  70 + ->orderBy('apellidos','asc');
70 71  
71   - return View::make('confirmados')
  72 + return View::make('registrados')
72 73 ->with('asistentes',$asistentes);
73 74 }
74 75 /**
... ... @@ -76,8 +77,7 @@ class RegistrarAsistencia extends \BaseController {
76 77 *
77 78 * @return Response
78 79 */
79   - public function create()
80   - {
  80 + public function create(){
81 81 //
82 82 }
83 83  
... ... @@ -86,8 +86,7 @@ class RegistrarAsistencia extends \BaseController {
86 86 *
87 87 * @return Response
88 88 */
89   - public function store()
90   - {
  89 + public function store(){
91 90 //
92 91 }
93 92  
... ... @@ -97,8 +96,7 @@ class RegistrarAsistencia extends \BaseController {
97 96 * @param int $id
98 97 * @return Response
99 98 */
100   - public function show($id)
101   - {
  99 + public function show($id){
102 100 //
103 101 }
104 102  
... ... @@ -108,8 +106,7 @@ class RegistrarAsistencia extends \BaseController {
108 106 * @param int $id
109 107 * @return Response
110 108 */
111   - public function edit($id)
112   - {
  109 + public function edit($id){
113 110 //
114 111 }
115 112  
... ... @@ -119,8 +116,7 @@ class RegistrarAsistencia extends \BaseController {
119 116 * @param int $id
120 117 * @return Response
121 118 */
122   - public function update($id)
123   - {
  119 + public function update($id){
124 120 //
125 121 }
126 122  
... ... @@ -130,8 +126,7 @@ class RegistrarAsistencia extends \BaseController {
130 126 * @param int $id
131 127 * @return Response
132 128 */
133   - public function destroy($id)
134   - {
  129 + public function destroy($id){
135 130 //
136 131 }
137 132  
... ...
app/routes.php
... ... @@ -10,5 +10,5 @@
10 10 | and give it the Closure to execute when that URI is requested.
11 11 |
12 12 */
13   -
14   -Route::any('/',array('uses' => 'RegistrarAsistencia@index', 'as' => 'index' ));
15 13 \ No newline at end of file
  14 +Route::any('/',array('uses' => 'RegistrarAsistencia@index', 'as' => 'index' ));
  15 +Route::get('/registrados',array('uses' => 'RegistrarAsistencia@registrados', 'as' => 'registrados' ));
16 16 \ No newline at end of file
... ...
app/views/asistencia.blade.php
... ... @@ -6,12 +6,6 @@
6 6 <title>Registrar Asistencia</title>
7 7 <link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css">
8 8 <style type="text/css">
9   -.resultados.row:nth-child(odd) .col-md-10 .row{
10   - background-color: #def;
11   -}
12   -.resultados.row:nth-child(even) .col-md-10 .row{
13   - background-color: #fff;
14   -}
15 9 #contenido{
16 10 margin: 5em 10%;
17 11 padding: 0.5em;
... ... @@ -69,26 +63,25 @@
69 63  
70 64 <section id="contenido">
71 65 <table class="table table-striped">
72   - <tr>
73   - <th>Documento</th>
74   - <th>Nombres</th>
75   - <th>Cursos</th>
76   - <th>Diplomas</th>
77   - <th>Asistió</th>
78   - </tr>
  66 + <tr>
  67 + <th>Documento</th>
  68 + <th>Nombres</th>
  69 + <th>Cursos</th>
  70 + <th>Diplomas</th>
  71 + <th>Asistió</th>
  72 + </tr>
79 73 @foreach($asistentes as $asistente)
80   -
81   - <tr>
82   - <td class="col-md-offset-1 col-md-1">{{$asistente->documento}}</td>
83   - <td class="col-md-2">{{$asistente->nombre}} {{$asistente->apellidos}}</td>
84   - <td class="col-md-4">{{ str_replace(',','<br />', $asistente->cursos ); }} </td>
85   - <td class="col-md-1">{{$asistente->diplomas}} </td>
86   - <td class="col-md-1"><input type="checkbox" name="asistio_{{$asistente->id}}" id="asistio_{{$asistente->id}}"
87   - @if($asistente->asistio==1)
88   - checked="checked"
89   - @endif
90   - /></td>
91   - </tr>
  74 + <tr>
  75 + <td>{{$asistente->documento}}</td>
  76 + <td>{{$asistente->nombre}} {{$asistente->apellidos}}</td>
  77 + <td>{{ str_replace(',','<br />', $asistente->cursos ); }} </td>
  78 + <td>{{$asistente->diplomas}} </td>
  79 + <td><input type="checkbox" name="asistio_{{$asistente->id}}" id="asistio_{{$asistente->id}}"
  80 + @if($asistente->asistio==1)
  81 + checked="checked"
  82 + @endif
  83 + /></td>
  84 + </tr>
92 85 @endforeach
93 86 </table>
94 87 </section>
... ...
app/views/registrados.blade.php 0 → 100644
  1 +<!doctype html>
  2 +<html lang="es">
  3 +<head>
  4 + <meta charset="UTF-8">
  5 + <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6 + <title>Registrados</title>
  7 + <link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css">
  8 + <style type="text/css">
  9 +#contenido{
  10 + margin: 5em 10%;
  11 + padding: 0.5em;
  12 + border-radius: 1em;
  13 + border:solid 1px #def;
  14 +}
  15 + </style>
  16 + <script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
  17 + <script src='//netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js'></script>
  18 + <script src='js/asistencia.js'></script>
  19 +</head>
  20 +<body>
  21 + <div class="container-fluid">
  22 + <h1>Regristrados</h1>
  23 +
  24 + <section id="contenido">
  25 + <table class="table table-striped">
  26 + <tr>
  27 + <th>Número de Diplomas</th>
  28 + <th>Cursos</th>
  29 + <th>Documento</th>
  30 + <th>Apellidos</th>
  31 + <th>Nombres</th>
  32 + <th>Correo</th>
  33 + </tr>
  34 + @foreach($asistentes as $asistente)
  35 + <tr>
  36 + <td>{{$asistente->diplomas}} </td>
  37 + <td>{{ str_replace(',','<br />', $asistente->cursos ); }} </td>
  38 + <td>{{$asistente->documento}}</td>
  39 + <td>{{$asistente->apellidos}}</td>
  40 + <td>{{$asistente->nombre}}</td>
  41 + <td>{{$asistente->correo}}</td>
  42 + </tr>
  43 + @endforeach
  44 + </table>
  45 + </section>
  46 + </div>
  47 +</body>
  48 +</html>
0 49 \ No newline at end of file
... ...