write-off.php 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <?php /** Created by Anton on 11.02.2020. */
  2. /** @var string $act */
  3. $query = new \yii\db\Query();
  4. $query->select('t.id, t.title, t.write_off_date, tlog.note')
  5. ->from(\app\models\entity\Tmc::tableName() . ' t')
  6. ->leftJoin(\app\models\entity\Log::tableName() . ' tlog', 'tlog.tmc = t.id')
  7. ->where('t.status = ' . \app\models\entity\TmcStatus::TMC_STATUS_DECOMMISSION)
  8. ;
  9. $devices = $query->all();
  10. ?>
  11. <link href="/tmc/css/main.min.css" rel="stylesheet">
  12. <style type="text/css">
  13. .main_content {
  14. padding: 0;
  15. display: inline-flex;
  16. }
  17. </style>
  18. <div class="menuTask loco-scrol-blue scroller">
  19. <div class="menuTaskHeader">Список списанных устройств</div>
  20. <div class="boxB4">
  21. <div class="inpBox">
  22. <input class="js-search" type="text" placeholder="Поиск">
  23. <img src="/images/find.svg">
  24. </div>
  25. </div>
  26. <div class="boxB5">
  27. <div class="tmc-content">
  28. <?php foreach ($devices as $device): ?>
  29. <a href="?act=tmc/detail/added&id=<?= $device['id'] ?>" class="loco_list">
  30. <div>
  31. <h5><?= $device['title'] ?></h5>
  32. <p>
  33. <t class="loco_grey"><?= $device['write_off_date'] ?></t>
  34. </p>
  35. <p>
  36. <t class="loco_grey"><?= $device['note'] ?></t>
  37. </p>
  38. </div>
  39. </a>
  40. <?php endforeach; ?>
  41. </div>
  42. </div>
  43. </div>
  44. <?php if ($act == 'tmc/write') {
  45. require (dirname(__DIR__) . '/tmc/forms/write-off.php');
  46. }?>
  47. <div role="log" aria-live="assertive" aria-relevant="additions" class="ui-helper-hidden-accessible"></div>
  48. <script type="application/javascript" src="tmc/js/search.js"></script>