123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687 |
- <?php
- if (!$logged_me_in_successfully234) {
- return;
- }
- $query = new \yii\db\Query();
- $query->select('ta.id, ta.name, tt.title, tlog.tmc, tlog.issue_date')
- ->from(\app\models\entity\UserDevice::tableName() . ' tu')
- ->leftJoin(\app\models\entity\Log::tableName() . ' tlog',
- 'tlog.id = tu.camera OR tlog.id = tu.oil_meter OR tlog.id = tu.phone')
- ->leftJoin(\app\models\entity\Accounts::tableName() . ' ta', 'ta.id = tlog.employee')
- ->leftJoin(\app\models\entity\Tmc::tableName() . ' tt', 'tt.id = tlog.tmc')
- ;
- $result = $query->all();
- //[userId => deviceInfo[]]
- $userDevices = [];
- foreach ($result as $device) {
- $userDevices[$device['id']][] = $device;
- }
- ?>
- <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 ($userDevices as $userId => $devices): ?>
- <a href="#" 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>
- <div class="divContentScroll loco-scrol-blue">
- <div id="contentBox" class="contentBox">
- <p class="crumbs">Список устройств у сотрудников » Принять устройство</p>
- <h2 class="contentHeader">Введите данные для принятия устройства</h2>
- <form action="/tmc/api/take_tmc.php" method="post">
- <input type="hidden" name="_csrf" value=""><fieldset>
- Сотрудник:
- <select class="" name="userId">
- <option value="0">Выберите сотрудника...</option>
- <?php foreach ($userDevices as $userId => $devices): ?>
- <option value="<?= $userId ?>"><?= $devices[0]['name'] ?></option>
- <? endforeach; ?>
- </select>
- <br clear="all">
- <br>
- Выданные устройства:
- <div class="issued-devices">
- </div>
- <!--Заполняется ajax запросом-->
- <br>
- </fieldset>
- </form>
- <div>
- <br>
- </div>
- </div>
- </div>
- <script type="application/javascript" src="tmc/js/take.js"></script>
- <script type="application/javascript" src="tmc/js/search.js"></script>
|