<?php

namespace App\Controllers\Owner;

use App\Controllers\BaseController;
use App\Models\InventoryModel;

class Inventory extends BaseController
{
    protected $inventory;

    public function __construct()
    {
        $this->inventory = new InventoryModel();
    }

    public function index()
    {
        $data = [
            'title' => 'Inventory',
            'inventories' => $this->inventory
                ->select('inventories.*, products.nama_product')
                ->join('products', 'products.id_product = inventories.id_product')
                ->findAll()
        ];

        return view('owner/inventory/index', $data);
    }
}