Commit c3a0f328 by Soni Pratama Silalahi

Update terbaru

parent 00e5d3d3
...@@ -112,7 +112,7 @@ class AndalimanController extends Controller ...@@ -112,7 +112,7 @@ class AndalimanController extends Controller
public function edit($id) public function edit($id)
{ {
$andalimans = andaliman::findOrFail($id); $andalimans = andaliman::findOrFail($id);
return view('andaliman.edit', compact('andalimans')); return view('MonitoringAndaliman.edit', compact('andalimans'));
} }
......
...@@ -100,7 +100,7 @@ class KacangController extends Controller ...@@ -100,7 +100,7 @@ class KacangController extends Controller
public function show($id) public function show($id)
{ {
$kacangs = kacang::findOrFail($id); $kacangs = kacang::findOrFail($id);
return view('HalamanMonitoring.lihat', compact('kacangs')); return view('MonitoringKacang.lihat', compact('kacangs'));
} }
/** /**
...@@ -112,7 +112,7 @@ class KacangController extends Controller ...@@ -112,7 +112,7 @@ class KacangController extends Controller
public function edit($id) public function edit($id)
{ {
$kacangs = kacang::findOrFail($id); $kacangs = kacang::findOrFail($id);
return view('HalamanMonitoring.edit', compact('kacangs')); return view('MonitoringKacang.edit', compact('kacangs'));
} }
...@@ -140,7 +140,7 @@ class KacangController extends Controller ...@@ -140,7 +140,7 @@ class KacangController extends Controller
$request->file('images')->move("image/",$fileName); $request->file('images')->move("image/",$fileName);
$kacangs->images = $fileName; $kacangs->images = $fileName;
$kacangs->save(); $kacangs->save();
return redirect()->route('HalamanMonitoring.index')->with('alert-success', 'Data Berhasil Diubah.'); return redirect()->route('kacang.index')->with('alert-success', 'Data Berhasil Diubah.');
} }
/** /**
...@@ -153,6 +153,6 @@ class KacangController extends Controller ...@@ -153,6 +153,6 @@ class KacangController extends Controller
{ {
$kacangs = kacang::findOrFail($id); $kacangs = kacang::findOrFail($id);
$kacangs->delete(); $kacangs->delete();
return redirect()->route('HalamanMonitoring.index')->with('alert-success', 'Data Berhasil Dihapus.'); return redirect()->route('kacang.index')->with('alert-success', 'Data Berhasil Dihapus.');
} }
} }
...@@ -91,9 +91,9 @@ class TomatController extends Controller ...@@ -91,9 +91,9 @@ class TomatController extends Controller
*/ */
public function edit($id) public function edit($id)
{ {
$tomat = tomat::findOrFail($id); $tomats = tomat::findOrFail($id);
// return to the edit views // return to the edit views
return view('HalamanTomat.edit',compact('tomat')); return view('HalamanTomat.edit',compact('tomats'));
} }
/** /**
......
...@@ -140,7 +140,7 @@ class kentangcontroller extends Controller ...@@ -140,7 +140,7 @@ class kentangcontroller extends Controller
$request->file('images')->move("image/",$fileName); $request->file('images')->move("image/",$fileName);
$kentangs->images = $fileName; $kentangs->images = $fileName;
$kentangs->save(); $kentangs->save();
return redirect()->route('HalamanMonitoring.index')->with('alert-success', 'Data Berhasil Diubah.'); return redirect()->route('kentang.index')->with('alert-success', 'Data Berhasil Diubah.');
} }
/** /**
...@@ -153,6 +153,6 @@ class kentangcontroller extends Controller ...@@ -153,6 +153,6 @@ class kentangcontroller extends Controller
{ {
$kentangs = kentang::findOrFail($id); $kentangs = kentang::findOrFail($id);
$kentangs->delete(); $kentangs->delete();
return redirect()->route('HalamanMonitoring.index')->with('alert-success', 'Data Berhasil Dihapus.'); return redirect()->route('kentang.index')->with('alert-success', 'Data Berhasil Dihapus.');
} }
} }
...@@ -116,14 +116,6 @@ class sayurcontroller extends Controller ...@@ -116,14 +116,6 @@ class sayurcontroller extends Controller
} }
/**
* Update the specified resource in storage.
*
* @param \Illuminate\Http\Request $request
* @param int $id
* @return \Illuminate\Http\Response
*/
public function update(UpdateRequest $request, $id) public function update(UpdateRequest $request, $id)
{ {
$sayurs = sayur::findOrFail($id); $sayurs = sayur::findOrFail($id);
...@@ -135,6 +127,7 @@ class sayurcontroller extends Controller ...@@ -135,6 +127,7 @@ class sayurcontroller extends Controller
$sayurs->hama = $request->hama; $sayurs->hama = $request->hama;
$sayurs->syarat_tumbuh = $request->syarat_tumbuh; $sayurs->syarat_tumbuh = $request->syarat_tumbuh;
$sayurs->pemeliharaan = $request->pemeliharaan; $sayurs->pemeliharaan = $request->pemeliharaan;
$file = $request->file('images'); $file = $request->file('images');
$fileName = $file->getClientOriginalName(); $fileName = $file->getClientOriginalName();
$request->file('images')->move("image/",$fileName); $request->file('images')->move("image/",$fileName);
......
...@@ -104,7 +104,7 @@ class ubicontroller extends Controller ...@@ -104,7 +104,7 @@ class ubicontroller extends Controller
$ubis->syarat_tumbuh = $request->syarat_tumbuh; $ubis->syarat_tumbuh = $request->syarat_tumbuh;
$ubis->pemeliharaan = $request->pemeliharaan; $ubis->pemeliharaan = $request->pemeliharaan;
$ubis->save(); $ubis->save();
return redirect()->route('cabe.index')->with('alert-success', 'Data Berhasil Diubah.'); return redirect()->route('ubi.index')->with('alert-success', 'Data Berhasil Diubah.');
} }
/** /**
...@@ -117,6 +117,6 @@ class ubicontroller extends Controller ...@@ -117,6 +117,6 @@ class ubicontroller extends Controller
{ {
$ubis = ubi::findOrFail($id); $ubis = ubi::findOrFail($id);
$ubis->delete(); $ubis->delete();
return redirect()->route('cabe.index')->with('alert-success', 'Data Berhasil Dihapus.'); return redirect()->route('ubi.index')->with('alert-success', 'Data Berhasil Dihapus.');
} }
} }
...@@ -437,11 +437,13 @@ ...@@ -437,11 +437,13 @@
<form action="{{route('HalamanMonitoring.update', $sayurs->id)}}" method="post"> <form action="{{route('HalamanMonitoring.update', $sayurs->id)}}" method="post">
<input name="_method" type="hidden" value="PATCH"> <input name="_method" type="hidden" value="PATCH">
{{csrf_field()}} {{csrf_field()}}
<div class="form-group{{ $errors->has('foto') ? ' has-error' : '' }}"> <div class="form-group{{ $errors->has('foto') ? ' has-error' : '' }}">
<img src="http://placehold.it/100x100" id="showimages" style="max-width:200px;max-height:200px;float:left;"/> <img src="http://placehold.it/100x100" id="showimages" style="max-width:200px;max-height:200px;float:left;"/>
<input type="file" id="inputimages" name="foto"> <input type="file" id="inputimages" name="foto">
{!! $errors->first('foto', '<p class="help-block">:message</p>') !!} {!! $errors->first('foto', '<p class="help-block">:message</p>') !!}
</div> </div>
<div class="form-group{{ $errors->has('nama') ? ' has-error' : '' }}"> <div class="form-group{{ $errors->has('nama') ? ' has-error' : '' }}">
<input type="text" name="nama" class="form-control" placeholder="Nama" value="{{$sayurs->nama}}"> <input type="text" name="nama" class="form-control" placeholder="Nama" value="{{$sayurs->nama}}">
{!! $errors->first('nama', '<p class="help-block">:message</p>') !!} {!! $errors->first('nama', '<p class="help-block">:message</p>') !!}
......
...@@ -483,7 +483,7 @@ ...@@ -483,7 +483,7 @@
<div class="icon"> <div class="icon">
<i class="ion ion-pie-graph"></i> <i class="ion ion-pie-graph"></i>
</div> </div>
<a href="{{URL::to('/kentang')}}" class="small-box-footer">More info <i class="fa fa-arrow-circle-right"></i></a> <a href="{{URL::to('/kacang')}}" class="small-box-footer">More info <i class="fa fa-arrow-circle-right"></i></a>
</div> </div>
</div> </div>
<!-- ./col --> <!-- ./col -->
......
...@@ -438,7 +438,8 @@ ...@@ -438,7 +438,8 @@
<input name="_method" type="hidden" value="PATCH"> <input name="_method" type="hidden" value="PATCH">
{{csrf_field()}} {{csrf_field()}}
<div class="form-group{{ $errors->has('foto') ? ' has-error' : '' }}"> <div class="form-group{{ $errors->has('foto') ? ' has-error' : '' }}">
<input type="text" name="foto" class="form-control" placeholder="Upload Foto" value="{{$cabes->foto}}"> <img src="http://placehold.it/100x100" id="showimages" style="max-width:200px;max-height:200px;float:left;"/>
<input type="file" id="inputimages" name="foto">
{!! $errors->first('foto', '<p class="help-block">:message</p>') !!} {!! $errors->first('foto', '<p class="help-block">:message</p>') !!}
</div> </div>
<div class="form-group{{ $errors->has('nama') ? ' has-error' : '' }}"> <div class="form-group{{ $errors->has('nama') ? ' has-error' : '' }}">
......
...@@ -459,7 +459,7 @@ ...@@ -459,7 +459,7 @@
<td>{{$kacang->hama}}</td> <td>{{$kacang->hama}}</td>
<td> <td>
<form method="POST" action="{{ route('HalamanMonitoring.destroy', $kacang->id) }}" accept-charset="UTF-8"> <form method="POST" action="{{ route('kacang.destroy', $kacang->id) }}" accept-charset="UTF-8">
<input name="_method" type="hidden" value="DELETE"> <input name="_method" type="hidden" value="DELETE">
<input name="_token" type="hidden" value="{{ csrf_token() }}"> <input name="_token" type="hidden" value="{{ csrf_token() }}">
<a href="{{route('kacang.edit', $kacang->id)}}" class="btn btn-primary">Edit</a> <a href="{{route('kacang.edit', $kacang->id)}}" class="btn btn-primary">Edit</a>
......
...@@ -427,46 +427,47 @@ ...@@ -427,46 +427,47 @@
</div> </div>
<div class="box-body"> <div class="box-body">
<!--data ubi --> <!--data kentang -->
<div class="container"> <div class="container">
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-md-12">
<div class="panel panel-default"> <div class="panel panel-default">
<div class="panel-body"> <div class="panel-body">
<form action="{{route('ubi.update', $ubis->id)}}" method="post"> <form action="{{route('kentang.update', $kentangs->id)}}" method="post">
<input name="_method" type="hidden" value="PATCH"> <input name="_method" type="hidden" value="PATCH">
{{csrf_field()}} {{csrf_field()}}
<div class="form-group{{ $errors->has('foto') ? ' has-error' : '' }}"> <div class="form-group{{ $errors->has('foto') ? ' has-error' : '' }}">
<input type="text" name="foto" class="form-control" placeholder="Upload Foto" value="{{$ubis->foto}}"> <img src="http://placehold.it/100x100" id="showimages" style="max-width:200px;max-height:200px;float:left;"/>
<input type="file" id="inputimages" name="foto">
{!! $errors->first('foto', '<p class="help-block">:message</p>') !!} {!! $errors->first('foto', '<p class="help-block">:message</p>') !!}
</div> </div>
<div class="form-group{{ $errors->has('nama') ? ' has-error' : '' }}"> <div class="form-group{{ $errors->has('nama') ? ' has-error' : '' }}">
<input type="text" name="nama" class="form-control" placeholder="Nama" value="{{$ubis->nama}}"> <input type="text" name="nama" class="form-control" placeholder="Nama" value="{{$kentangs->nama}}">
{!! $errors->first('nama', '<p class="help-block">:message</p>') !!} {!! $errors->first('nama', '<p class="help-block">:message</p>') !!}
</div> </div>
<div class="form-group{{ $errors->has('family') ? ' has-error' : '' }}"> <div class="form-group{{ $errors->has('family') ? ' has-error' : '' }}">
<input type="text" name="family" class="form-control" placeholder="Family" value="{{$ubis->family}}"> <input type="text" name="family" class="form-control" placeholder="Family" value="{{$kentangs->family}}">
{!! $errors->first('family', '<p class="help-block">:message</p>') !!} {!! $errors->first('family', '<p class="help-block">:message</p>') !!}
</div> </div>
<div class="form-group{{ $errors->has('tanggal_tanam') ? ' has-error' : '' }}"> <div class="form-group{{ $errors->has('tanggal_tanam') ? ' has-error' : '' }}">
<input type="text" name="tanggal_tanam" class="form-control" placeholder="Tanggal Tanam" value="{{$ubis->tanggal_tanam}}"> <input type="text" name="tanggal_tanam" class="form-control" placeholder="Tanggal Tanam" value="{{$kentangs->tanggal_tanam}}">
{!! $errors->first('tanggal_tanam', '<p class="help-block">:message</p>') !!} {!! $errors->first('tanggal_tanam', '<p class="help-block">:message</p>') !!}
</div> </div>
<div class="form-group{{ $errors->has('usia') ? ' has-error' : '' }}"> <div class="form-group{{ $errors->has('usia') ? ' has-error' : '' }}">
<input type="text" name="usia" class="form-control" placeholder="Usia" value="{{$ubis->usia}}"> <input type="text" name="usia" class="form-control" placeholder="Usia" value="{{$kentangs->usia}}">
{!! $errors->first('usia', '<p class="help-block">:message</p>') !!} {!! $errors->first('usia', '<p class="help-block">:message</p>') !!}
</div> </div>
<div class="form-group{{ $errors->has('hama') ? ' has-error' : '' }}"> <div class="form-group{{ $errors->has('hama') ? ' has-error' : '' }}">
<input type="text" name="hama" class="form-control" placeholder="Hama" value="{{$ubis->hama}}"> <input type="text" name="hama" class="form-control" placeholder="Hama" value="{{$kentangs->hama}}">
{!! $errors->first('hama', '<p class="help-block">:message</p>') !!} {!! $errors->first('hama', '<p class="help-block">:message</p>') !!}
</div> </div>
<div class="form-group{{ $errors->has('syarat_tumbuh') ? ' has-error' : '' }}"> <div class="form-group{{ $errors->has('syarat_tumbuh') ? ' has-error' : '' }}">
<input type="text" name="syarat_tumbuh" class="form-control" placeholder="Syarat Tumbuh" value="{{$ubis->syarat_tumbuh}}"> <input type="text" name="syarat_tumbuh" class="form-control" placeholder="Syarat Tumbuh" value="{{$kentangs->syarat_tumbuh}}">
{!! $errors->first('syarat_tumbuh', '<p class="help-block">:message</p>') !!} {!! $errors->first('syarat_tumbuh', '<p class="help-block">:message</p>') !!}
</div> </div>
<div class="form-group{{ $errors->has('pemeliharaan') ? ' has-error' : '' }}"> <div class="form-group{{ $errors->has('pemeliharaan') ? ' has-error' : '' }}">
<input type="text" name="pemeliharaan" class="form-control" placeholder="Pemeliharaan" value="{{$ubis->pemeliharaan}}"> <input type="text" name="pemeliharaan" class="form-control" placeholder="Pemeliharaan" value="{{$kentangs->pemeliharaan}}">
{!! $errors->first('pemeliharaan', '<p class="help-block">:message</p>') !!} {!! $errors->first('pemeliharaan', '<p class="help-block">:message</p>') !!}
</div> </div>
...@@ -480,7 +481,7 @@ ...@@ -480,7 +481,7 @@
</div> </div>
</div> </div>
</div> </div>
<!--end data ubi --> <!--end data kentang -->
</div> </div>
<!-- /.box-body --> <!-- /.box-body -->
<div class="box-footer"> <div class="box-footer">
......
...@@ -459,7 +459,7 @@ ...@@ -459,7 +459,7 @@
<td>{{$kentang->hama}}</td> <td>{{$kentang->hama}}</td>
<td> <td>
<form method="POST" action="{{ route('HalamanMonitoring.destroy', $kentang->id) }}" accept-charset="UTF-8"> <form method="POST" action="{{ route('kentang.destroy', $kentang->id) }}" accept-charset="UTF-8">
<input name="_method" type="hidden" value="DELETE"> <input name="_method" type="hidden" value="DELETE">
<input name="_token" type="hidden" value="{{ csrf_token() }}"> <input name="_token" type="hidden" value="{{ csrf_token() }}">
<a href="{{route('kentang.edit', $kentang->id)}}" class="btn btn-primary">Edit</a> <a href="{{route('kentang.edit', $kentang->id)}}" class="btn btn-primary">Edit</a>
......
...@@ -438,7 +438,8 @@ ...@@ -438,7 +438,8 @@
<input name="_method" type="hidden" value="PATCH"> <input name="_method" type="hidden" value="PATCH">
{{csrf_field()}} {{csrf_field()}}
<div class="form-group{{ $errors->has('foto') ? ' has-error' : '' }}"> <div class="form-group{{ $errors->has('foto') ? ' has-error' : '' }}">
<input type="text" name="foto" class="form-control" placeholder="Upload Foto" value="{{$ubis->foto}}"> <img src="http://placehold.it/100x100" id="showimages" style="max-width:200px;max-height:200px;float:left;"/>
<input type="file" id="inputimages" name="foto">
{!! $errors->first('foto', '<p class="help-block">:message</p>') !!} {!! $errors->first('foto', '<p class="help-block">:message</p>') !!}
</div> </div>
<div class="form-group{{ $errors->has('nama') ? ' has-error' : '' }}"> <div class="form-group{{ $errors->has('nama') ? ' has-error' : '' }}">
......
...@@ -459,7 +459,7 @@ ...@@ -459,7 +459,7 @@
<td>{{$ubi->hama}}</td> <td>{{$ubi->hama}}</td>
<td> <td>
<form method="POST" action="{{ route('HalamanMonitoring.destroy', $ubi->id) }}" accept-charset="UTF-8"> <form method="POST" action="{{ route('ubi.destroy', $ubi->id) }}" accept-charset="UTF-8">
<input name="_method" type="hidden" value="DELETE"> <input name="_method" type="hidden" value="DELETE">
<input name="_token" type="hidden" value="{{ csrf_token() }}"> <input name="_token" type="hidden" value="{{ csrf_token() }}">
<a href="{{route('ubi.edit', $ubi->id)}}" class="btn btn-primary">Edit</a> <a href="{{route('ubi.edit', $ubi->id)}}" class="btn btn-primary">Edit</a>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment