<?php

namespace App\Controllers\Owner;
use App\Controllers\BaseController;
use App\Models\ProductLimitModel;

class ProductLimit extends BaseController
{
    public function index()
    {
        $model = new ProductLimitModel();
        $data['limit'] = $model->getLimitHarian();
        return view('owner/product/limit', $data);
    }

    public function update()
    {
        $model = new ProductLimitModel();
        $model->saveSetting('max_produksi_harian', $this->request->getPost('limit'));
        return redirect()->back()->with('success', 'Batas produksi berhasil diupdate.');
    }
}