<?php

namespace App\Controllers;

use App\Models\AgentModel;
use App\Models\EmployeeModel;
use CodeIgniter\Exceptions\PageNotFoundException;
use CodeIgniter\Files\File;

class Agent extends BaseController {

    public function index() {
        $model = model(AgentModel::class);

        $data['agents_list'] = $model->getAgents();
        echo view('agents/list', $data);
    }
    
    public function agentEmployeeList($agent_id)
    {
      $model = model(EmployeeModel::class);

        $data['employee_list'] = $model->getEmployeesByFieldManagerId($agent_id);
        echo view('agents/employee_list', $data);
    }
}