- CodeIgniter 4 framework setup with SQL Server database config - Models: Control, Test, Dept, Result, Daily/ Monthly entry models - Controllers: Dashboard, Control, Test, Dept, Entry, Report, API endpoints - Views: CRUD pages with modal dialogs, dashboard, reports - Database: Migrations for control test and daily/monthly result tables - Legacy v1 PHP application preserved in /v1 directory - Documentation: AGENTS.md, VIEWS_RULES.md for development guidelines
37 lines
1012 B
PHP
37 lines
1012 B
PHP
<?php
|
|
|
|
namespace App\Controllers;
|
|
|
|
use App\Models\DictControlModel;
|
|
use App\Models\ControlTestModel;
|
|
use App\Models\DictDeptModel;
|
|
use App\Models\DictTestModel;
|
|
|
|
class Control extends BaseController
|
|
{
|
|
protected $dictControlModel;
|
|
protected $controlTestModel;
|
|
protected $dictDeptModel;
|
|
protected $dictTestModel;
|
|
|
|
public function __construct()
|
|
{
|
|
$this->dictControlModel = new DictControlModel();
|
|
$this->controlTestModel = new ControlTestModel();
|
|
$this->dictDeptModel = new DictDeptModel();
|
|
$this->dictTestModel = new DictTestModel();
|
|
}
|
|
|
|
public function index(): string
|
|
{
|
|
return view('control/index', [
|
|
'title' => 'Control Dictionary',
|
|
'controls' => $this->dictControlModel->getWithDept(),
|
|
'depts' => $this->dictDeptModel->findAll(),
|
|
'tests' => $this->dictTestModel->getWithDept(),
|
|
'active_menu' => 'control',
|
|
'page_title' => 'Control Dictionary'
|
|
]);
|
|
}
|
|
}
|