SHARE
TWEET

Untitled

a guest Mar 19th, 2019 45 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <form method="POST" action="/New/temperatura">
  2.         {{csrf_field()}}
  3.           <tbody>
  4.  
  5.  
  6.               <tr>
  7.                 @foreach ($ip as $i)
  8.                  <td>
  9.                     <input style="padding:-4px;"  name="txtsitio" type="text" value="{{$i[sitio_id]}}">
  10.                 </td>  
  11.  
  12.                 <td >
  13.  
  14.  
  15.  
  16.                 <input style="padding:-4px;"  name="txtip" type="text" value="{{$i->ip}}">
  17.  
  18.               </td>
  19.  
  20.  
  21.                 <td>
  22.                     <?php
  23.                   $ip = $i->ip;
  24.                   $mi_oid_temperatura = ".1.3.6.1.4.1.1918.2.13.10.100.30.0";
  25.                   $device = snmpget($ip, "public", $mi_oid_temperatura);
  26.  
  27.  
  28.  
  29.  
  30.                   ?>
  31.      
  32. <td>
  33.  
  34.  
  35.  
  36.               </tr>
  37.  
  38.               @endforeach
  39.  
  40.  
  41.             </tbody>
  42.           </div>
  43.           <button  type="submit" class="btn btn-primary">Crear</button>
  44.      </div>
  45.       </form>
  46.      
  47. public function creartemp(Request $request)
  48. {
  49.     foreach ($request->all() as $req){
  50.  
  51.           $it = new Temperatura();
  52.  
  53.  
  54.           $it->sitio_id_ip =$req['sitio_id_ip'];;
  55.           $it->ip_sitio =$req['sitio_ip'];;
  56.           $it->temperatura =$req['temepratura'];;
  57.           $it->save();
  58.  
  59.  
  60.  
  61.  
  62.     return redirect('/New/sitios');
  63.  
  64.  
  65. }
  66.      
  67. public function sitio()
  68. {
  69.     return $this->belongsTo(ip::class);
  70. }
  71.  
  72.  
  73. protected $fillable = ['sitio_id_ip', 'ip_sitio', 'temperatura'];
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top