12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- <?php
- /** @var string $act */
- if (!$logged_me_in_successfully234) {
- return;
- }
- $query = new \yii\db\Query();
- $query->select('tlog.tmc, ttmc.title, ts.title as status, ta.name, t.employee, tlog.issue_date')
- ->from(\app\models\entity\UserDevice::tableName() . ' t')
- ->leftJoin(\app\models\entity\Log::tableName() . ' tlog', 'tlog.id = t.phone or tlog.id = t.camera or tlog.id = t.oil_meter')
- ->leftJoin(\app\models\entity\Tmc::tableName() . ' ttmc', 'ttmc.id = tlog.tmc')
- ->leftJoin(\app\models\entity\TmcStatus::tableName() . ' ts', 'ts.id = ttmc.status')
- ->leftJoin(\app\models\entity\Accounts::tableName() . ' ta', 'ta.id = t.employee')
- ;
- $userDevices = $query->all();
- $usersWithDevice = [];
- foreach ($userDevices as $userDevice) {
- $usersWithDevice[$userDevice['employee']][] = $userDevice;
- }
- ?>
- <link href="/tmc/css/main.min.css" rel="stylesheet">
- <style type="text/css">
- .main_content {
- padding: 0;
- display: inline-flex;
- }
- </style>
- <div class="menuTask loco-scrol-blue scroller">
- <div class="menuTaskHeader">Список устройств у сотрудников</div>
- <div class="boxB4">
- <div class="inpBox">
- <input class="js-search" type="text" placeholder="Поиск">
- <img src="/images/find.svg">
- </div>
- </div>
- <div class="boxB5">
- <div class="tmc-content">
- <?php foreach ($usersWithDevice as $userId => $devices): ?>
- <a href="tmc\detail\user.php?id=<?= $userId ?>" class="loco_list">
- <div>
- <h5><?= $devices[0]['name'] ?></h5>
- <?php foreach ($devices as $device): ?>
- <p>
- <t class="loco_grey"><?= $device['title'] ?></t>
- <t class="loco_grey" style="float:right"><?= $device['issue_date'] ?></t>
- </p>
- <?php endforeach; ?>
- </div>
- </a>
- <?php endforeach; ?>
- </div>
- </div>
- <div role="log" aria-live="assertive" aria-relevant="additions" class="ui-helper-hidden-accessible"></div>
- </div>
- <?php if ($act == 'tmc/give') {
- require dirname(__DIR__) . '/tmc/forms/give.php';
- }?>
- <script type="application/javascript" src="tmc/js/search.js"></script>
|