12345678910111213141516171819202122232425262728293031323334353637383940 |
- <?php /** @var string $act */
- if (!$logged_me_in_successfully234) {
- return;
- }
- require 'tmc/functions.php';
- use app\models\entity\Accounts;
- use app\models\entity\Storage;
- use app\models\entity\Tmc;
- use app\models\entity\TmcStatus;
- use yii\db\Query;
- $query = new Query();
- $query->select('t.id, t.title, t.tmc_type, t.status, t.employee, ta.name, ts.title as storage')
- ->from(Tmc::tableName() . ' t')
- ->leftJoin(Accounts::tableName() . ' ta', 'ta.id = t.employee')
- ->leftJoin(Storage::tableName() . ' ts', 'ts.id = t.storage')
- ;
- $tmcs = $query->all();
- list($cameras, $phones, $oilMeters) = sortTmc($tmcs);
- $query = new Query();
- $statuses = $query->select('id, title')
- ->from(TmcStatus::tableName())
- ->indexBy('id')
- ->all()
- ;
- include "tmc_list.php";
- switch ($act) {
- case 'tmc/new':
- require (dirname(__DIR__) . '/tmc/forms/new.php');
- break;
- case 'tmc/detail/added':
- require (dirname(__DIR__) . '/tmc/forms/added.php');
- break;
- }
|