cell.php 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. <?php /** Created by Anton on 04.03.2020. */
  2. use app\models\entity\Companies;
  3. use app\models\entity\TmcStorage;
  4. require '../yiiInit.php';
  5. $title = (string)$_GET['id'];
  6. list($companyId, $warehouse, $stack, $cell) = explode('.', $title);
  7. $company = Companies::findOne($companyId);
  8. $cell = TmcStorage::findOne(['title' => $title]);
  9. $tmc = $cell->getTmc();
  10. ?>
  11. <!doctype html>
  12. <html lang="ru">
  13. <head>
  14. <meta charset="UTF-8">
  15. <meta name="viewport"
  16. content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
  17. <meta http-equiv="X-UA-Compatible" content="ie=edge">
  18. <link rel="stylesheet" href="../../ProSysNew/bootstrap.css">
  19. <title>Камера <?= $deviceId ?></title>
  20. </head>
  21. <body>
  22. <div class="container" style="max-width: 400px">
  23. <table class="table text-center">
  24. <thead>
  25. <tr>
  26. <td colspan="2">
  27. <h3>Ячейка <?= $cell->title ?></h3>
  28. </td>
  29. </tr>
  30. </thead>
  31. <tr>
  32. <td>Компания</td>
  33. <td><?= $company->name ?></td>
  34. </tr>
  35. </table>
  36. <?php if ($tmc): ?>
  37. <table class="table text-center">
  38. <thead>
  39. <tr>
  40. <td colspan="2">
  41. <h3>Устройство <?= $tmc->title ?></h3>
  42. </td>
  43. </tr>
  44. </thead>
  45. <tr>
  46. <td>Инвентарный номер</td>
  47. <td><?= $tmc->inventory_num ?></td>
  48. </tr>
  49. <tr>
  50. <td>Описание</td>
  51. <td><?= $tmc->desc ?></td>
  52. </tr>
  53. </table>
  54. <?php else: ?>
  55. <table class="table text-center">
  56. <thead>
  57. <tr>
  58. <td colspan="2">
  59. <h3>Ячейка пуста</h3>
  60. </td>
  61. </tr>
  62. </thead>
  63. </table>
  64. <?php endif; ?>
  65. </div>
  66. </body>
  67. </html>