Ejemplo n.º 1
0
 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     $conex = dbase_open('C:\\Copia de depende.DBF', 0);
     $total_registros = dbase_numrecords($conex);
     for ($i = 1; $i <= $total_registros; $i++) {
         if (trim(dbase_get_record($conex, $i)[1]) != "") {
             $dependecia = new Dependencia();
             $dependecia->nombre = dbase_get_record($conex, $i)[1];
             $dependecia->es_int = 'si';
             $dependecia->save();
         }
     }
     return redirect('/');
 }
Ejemplo n.º 2
0
 /**
  * Show the form for creating a new resource.
  *
  * @return Response
  */
 public function create()
 {
     $agente = Agente::lists('nombre', 'id')->all();
     $agente = array('' => 'Seleccionar...') + $agente;
     $dependencia = Dependencia::lists('nombre', 'id')->all();
     $dependencia = array('' => 'Seleccionar...') + $dependencia;
     return view('deposito.create', compact('agente', 'dependencia'));
 }
Ejemplo n.º 3
0
 /**
  * Display the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function show($id)
 {
     $producto = Producto::findOrFail($id);
     if ($producto->tip_destino == 1) {
         $ubicacion = Deposito::findOrFail($producto->cod_destino);
     }
     if ($producto->tip_destino == 2) {
         $ubicacion = Dependencia::findOrFail($producto->cod_destino);
     }
     if ($producto->tip_destino == 3) {
         $ubicacion = Agente::findOrFail($producto->cod_destino);
     }
     if ($producto->tip_destino == 4) {
         $ubicacion = Producto::findOrFail($producto->cod_destino);
     }
     return view('producto.show', compact('producto', 'ubicacion'));
 }
Ejemplo n.º 4
0
 public function datatables()
 {
     $data = Dependencia::Datatables()->get();
     return Datatables::of(collect($data))->editColumn('nombre', function ($data) {
         return '<a href="dependencia/' . $data->id . '" >' . $data->nombre . '</a>';
     })->addColumn('action', function ($data) {
         return '<a href="dependencia/' . $data->id . '/edit" class="btn btn-xs btn-primary">Edit</a>' . ' / <form method="POST" action="http://localhost/inventario/dependencia/ ' . $data->id . '" accept-charset="UTF-8" style="display:inline"><input name="_method" type="hidden" value="DELETE"><input name="_token" type="hidden" value="' . csrf_token() . '"><button type="submit" class="btn btn-danger btn-xs">Borrar</button></form>';
     })->make(true);
 }
 private function listProduc($datas)
 {
     $data = [];
     $ubicacion = null;
     foreach ($datas as $value) {
         if ($value->tip_destino == 1) {
             $deposito = Deposito::findOrFail($value->cod_destino);
             $ubicacion = $deposito->nombre;
         } else {
             if ($value->tip_destino == 2) {
                 $dependencia = Dependencia::findOrFail($value->cod_destino);
                 $ubicacion = $dependencia->nombre;
             } else {
                 if ($value->tip_destino == 3) {
                     $agente = Agente::findOrFail($value->cod_destino);
                     $ubicacion = $agente->apellido . ' ' . $agente->nombre;
                 } else {
                     $producto = Producto::findOrFail($value->cod_destino);
                     $ubicacion = $producto->nombre;
                 }
             }
         }
         array_push($data, array('id' => $value->id, 'nombre' => $value->nombre, 'nro_serie' => $value->nro_serie, 'id_patrimonial' => $value->id_patrimonial, 'ubicacion' => $ubicacion, 'detalle' => $value->detalle));
     }
     return $data;
 }
Ejemplo n.º 6
0
 /**
  * Show the form for creating a new resource.
  *
  * @return Response
  */
 public function create()
 {
     $dependencia = Dependencia::where('es_int', 'si')->lists('nombre', 'id')->all();
     $dependencia = array('' => 'Seleccionar...') + $dependencia;
     return view('agente.create', compact('dependencia'));
 }