<?php

namespace App\Controllers\Owner;

use App\Controllers\BaseController;
use App\Models\OrderCustomModel;

class OrderCustom extends BaseController
{
    public function index()
    {
        $model = new OrderCustomModel();
        $data['custom_requests'] = $model->where('status', 'menunggu')->findAll();
        return view('owner/custom/index', $data);
    }

    public function approve($id)
    {
        $model = new OrderCustomModel();
        $model->update($id, ['status' => 'disetujui']);
        return redirect()->back()->with('success', 'Permintaan custom disetujui.');
    }
}