Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <form method="POST" action="/New/temperatura">
- {{csrf_field()}}
- <tbody>
- <tr>
- @foreach ($ip as $i)
- <td>
- <input style="padding:-4px;" name="txtsitio" type="text" value="{{$i[sitio_id]}}">
- </td>
- <td >
- <input style="padding:-4px;" name="txtip" type="text" value="{{$i->ip}}">
- </td>
- <td>
- <?php
- $ip = $i->ip;
- $mi_oid_temperatura = ".1.3.6.1.4.1.1918.2.13.10.100.30.0";
- $device = snmpget($ip, "public", $mi_oid_temperatura);
- ?>
- <td>
- </tr>
- @endforeach
- </tbody>
- </div>
- <button type="submit" class="btn btn-primary">Crear</button>
- </div>
- </form>
- public function creartemp(Request $request)
- {
- foreach ($request->all() as $req){
- $it = new Temperatura();
- $it->sitio_id_ip =$req['sitio_id_ip'];;
- $it->ip_sitio =$req['sitio_ip'];;
- $it->temperatura =$req['temepratura'];;
- $it->save();
- return redirect('/New/sitios');
- }
- public function sitio()
- {
- return $this->belongsTo(ip::class);
- }
- protected $fillable = ['sitio_id_ip', 'ip_sitio', 'temperatura'];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement