repair.php 1.9 KB

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