예제 #1
0
 public function update_crop()
 {
     $id = $_POST['id'];
     $common_name = $_POST['common-name'];
     $scientific_name = $_POST['scientific-name'];
     $harvest_time = $_POST['harvest-time'];
     $months = $_POST['months'];
     $details = $_POST['details'];
     Crop::update($id, $common_name, $scientific_name, $harvest_time, $months, $details);
     $crops = Crop::all();
     require_once 'views/crops/admin.php';
 }
예제 #2
0
 public function edit($id)
 {
     $product = Product::find($id);
     $crop = Crop::all()->lists('crop_name', 'id');
     return View::make('products.edit')->with('product', $product)->with('title', "Edit Product")->with('crop', $crop);
 }
예제 #3
0
 public function index()
 {
     $crop = Crop::all();
     return View::make('crops.index')->with('crop', $crop)->with('title', "Crop Details");
 }