Commit c3a0f328 by Soni Pratama Silalahi

Update terbaru

parent 00e5d3d3
......@@ -112,7 +112,7 @@ class AndalimanController extends Controller
public function edit($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
public function show($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
public function edit($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
$request->file('images')->move("image/",$fileName);
$kacangs->images = $fileName;
$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
{
$kacangs = kacang::findOrFail($id);
$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
*/
public function edit($id)
{
$tomat = tomat::findOrFail($id);
$tomats = tomat::findOrFail($id);
// 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
$request->file('images')->move("image/",$fileName);
$kentangs->images = $fileName;
$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
{
$kentangs = kentang::findOrFail($id);
$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
}
/**
* Update the specified resource in storage.
*
* @param \Illuminate\Http\Request $request
* @param int $id
* @return \Illuminate\Http\Response
*/
public function update(UpdateRequest $request, $id)
{
$sayurs = sayur::findOrFail($id);
......@@ -135,6 +127,7 @@ class sayurcontroller extends Controller
$sayurs->hama = $request->hama;
$sayurs->syarat_tumbuh = $request->syarat_tumbuh;
$sayurs->pemeliharaan = $request->pemeliharaan;
$file = $request->file('images');
$fileName = $file->getClientOriginalName();
$request->file('images')->move("image/",$fileName);
......
......@@ -104,7 +104,7 @@ class ubicontroller extends Controller
$ubis->syarat_tumbuh = $request->syarat_tumbuh;
$ubis->pemeliharaan = $request->pemeliharaan;
$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
{
$ubis = ubi::findOrFail($id);
$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 @@
<form action="{{route('HalamanMonitoring.update', $sayurs->id)}}" method="post">
<input name="_method" type="hidden" value="PATCH">
{{csrf_field()}}
<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;"/>
<input type="file" id="inputimages" name="foto">
{!! $errors->first('foto', '<p class="help-block">:message</p>') !!}
</div>
<div class="form-group{{ $errors->has('nama') ? ' has-error' : '' }}">
<input type="text" name="nama" class="form-control" placeholder="Nama" value="{{$sayurs->nama}}">
{!! $errors->first('nama', '<p class="help-block">:message</p>') !!}
......
......@@ -483,7 +483,7 @@
<div class="icon">
<i class="ion ion-pie-graph"></i>
</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>
<!-- ./col -->
......
......@@ -438,7 +438,8 @@
<input name="_method" type="hidden" value="PATCH">
{{csrf_field()}}
<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>') !!}
</div>
<div class="form-group{{ $errors->has('nama') ? ' has-error' : '' }}">
......
......@@ -459,7 +459,7 @@
<td>{{$kacang->hama}}</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="_token" type="hidden" value="{{ csrf_token() }}">
<a href="{{route('kacang.edit', $kacang->id)}}" class="btn btn-primary">Edit</a>
......
......@@ -427,46 +427,47 @@
</div>
<div class="box-body">
<!--data ubi -->
<!--data kentang -->
<div class="container">
<div class="row">
<div class="col-md-12">
<div class="panel panel-default">
<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">
{{csrf_field()}}
<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>') !!}
</div>
<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>') !!}
</div>
<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>') !!}
</div>
<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>') !!}
</div>
<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>') !!}
</div>
<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>') !!}
</div>
<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>') !!}
</div>
<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>') !!}
</div>
......@@ -480,7 +481,7 @@
</div>
</div>
</div>
<!--end data ubi -->
<!--end data kentang -->
</div>
<!-- /.box-body -->
<div class="box-footer">
......
......@@ -459,7 +459,7 @@
<td>{{$kentang->hama}}</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="_token" type="hidden" value="{{ csrf_token() }}">
<a href="{{route('kentang.edit', $kentang->id)}}" class="btn btn-primary">Edit</a>
......
......@@ -438,7 +438,8 @@
<input name="_method" type="hidden" value="PATCH">
{{csrf_field()}}
<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>') !!}
</div>
<div class="form-group{{ $errors->has('nama') ? ' has-error' : '' }}">
......
......@@ -459,7 +459,7 @@
<td>{{$ubi->hama}}</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="_token" type="hidden" value="{{ csrf_token() }}">
<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