Beispiel #1
0
  					<input type="text" name="titulo" class="form-control" placeholder="Titulo de tu tarea...">
				</div>
				<div class="form-group">
  					<textarea name="texto" class="form-control" placeholder="Escribe acá"></textarea>
				</div>
				<input type="submit" class="form-control btn btn-primary" value="Crear!">
			</form>
			<table class="table">
				<thead>
					<th>Nº</th>
					<th>TITULO</th>
					<th>TEXTO</th>
					<th>FECHA</th>
				</thead>
			<?php 
$result = $datos->getTareas();
foreach ($result as $fila) {
    echo "<tr>";
    echo "<td>" . $fila['id_tarea'] . "</td>";
    print "<td>" . $fila['titulo'] . "</td>";
    print "<td>" . $fila['texto'] . "</td>";
    print "<td>" . $fila['realizada'] . "</td>";
    echo "<td><a href=detalle_tarea.php?id_tarea=" . $fila["id_tarea"] . ">Ver</a></td>";
    echo "<td><a href=editar_tarea.php?op=Editar&id_tarea=" . $fila["id_tarea"] . "&titulo=" . $fila["titulo"] . "&texto=" . $fila["texto"] . ">Editar</a></td>";
    echo "<td><a href=tareas.php?op=del&id_tarea=" . $fila["id_tarea"] . ">Eliminar</a></td>";
    echo "</tr>";
}
?>
			</table>
		</div>
		<!-- Latest compiled and minified JavaScript -->
 /**
  * reponder llamadas ajax de reportes estados de officetrack
  * POST reporte/estadoofficetrack
  *
  * @return Response
  */
 public function postEstadosot()
 {
     //recibir los parametros y enviarlos al modelo, ahi ejecutar el query
     $accion = Input::get('accion');
     if ($accion == 'tecnicosofficetrack') {
         $reporte = Tecnico::getTecnicosOfficetrackAll();
     } elseif ($accion == 'pendientes') {
         $fechaAgen = Input::get('fecha_agen');
         $empresaId = Input::get('empresaId');
         $celulaId = Input::get('celulaId');
         $estados = Input::get('estados');
         $carnets = Input::get('carnets');
         $pendientes = '';
         $tecnico = Tecnico::getTecnico($empresaId, $celulaId);
         if (count($tecnico) > 0) {
             $reporte = Tarea::getAgendasAll($fechaAgen, $estados, $carnets);
         }
     } elseif ($accion == 'tecnicosot') {
         $fechaIni = Input::get('fechaIni');
         $fechaFin = Input::get('fechaFin');
         $empresaId = Input::get('empresaId');
         $celulaId = Input::get('celulaId');
         //$carnets = Input::get('carnets');
         $reporte = Tarea::getTareas($fechaIni, $fechaFin . " 23:59:59 ", $empresaId, $celulaId);
     }
     if (Input::get("excel") == '1') {
         $filename = $accion;
         $filename = Helpers::convert_to_file_excel($filename);
         header('Content-Type: application/octet-stream');
         header('Content-Disposition: attachment; filename=' . $filename);
         header('Expires: 0');
         header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
         header("Content-Transfer-Encoding: binary");
         header('Pragma: public');
         $n = 1;
         foreach ($reporte as $data) {
             //Encabezado
             if ($n == 1) {
                 foreach ($data as $key => $val) {
                     echo $key . "\t";
                 }
                 echo $val . "\r\n";
             }
             //Datos
             foreach ($data as $val) {
                 $val = str_replace(array("\r\n", "\n", "\n\n", "\t", "\r"), array("", "", "", "", ""), $val);
                 echo $val . "\t";
             }
             echo "\r\n";
             $n++;
         }
     } else {
         return Response::json(array('rst' => 1, 'datos' => $reporte));
     }
 }