예제 #1
0
 /**
  * Update the specified resource in storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function actualizar()
 {
     $id = Input::get('id');
     $uff = Ufv::find($id);
     $uff->cotizacion = Input::get('cotizacion');
     $uff->gestion = Input::get('gestion');
     $uff->save();
     return Redirect::to('cardex')->with('status', 'ok_ufv')->with('stat', 'ok_inicio');
 }
예제 #2
0
    $fechas_nacimiento = array(array('nombre' => 'Paco', 'fecha' => '2012-01-11'), array('nombre' => 'Luis', 'fecha' => '2012-02-12'), array('nombre' => 'María', 'fecha' => '2013-04-5'), array('nombre' => 'gaby', 'fecha' => '2010-11-29'));
    function ordenar($a, $b)
    {
        return strtotime($a['fecha']) - strtotime($b['fecha']);
    }
    function mostrar_array($datos)
    {
        foreach ($datos as $dato) {
            echo "{$dato['fecha']} -&gt; {$dato['nombre']}<br/>";
        }
    }
    usort($fechas_nacimiento, 'ordenar');
    mostrar_array($fechas_nacimiento);
});
Route::get("gg", function () {
    $uf = Ufv::where('gestion', '=', date('Y'))->first();
    var_dump($uf);
});
////////////////////PETICIONES PARA APP/////////////////////////////////////////
Route::get('productoPorId/{codigo}', function ($codigo) {
    $producto = Producto::where('codigo_interno', '=', $codigo)->first();
    $cuenta = Producto::find($producto->id)->cuenta;
    //echo $cuenta->nombre_cuenta;
    $p = array("codigo" => $producto->codigo_interno, "ubicacion" => $producto->ubicacion, "descripcion" => $producto->descripcion, "unidad" => $producto->unidad, "cuenta" => $cuenta->nombre_cuenta, "precio" => $producto->precio, "existencias" => $producto->existencias);
    if ($p) {
        $dato["estado"] = "1";
        $dato["product"] = $p;
        // Enviar objeto json de la meta
        echo json_encode($dato);
    } else {
        // Enviar respuesta de error general