new.php 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <?php /** Created by Anton on 04.02.2020. */
  2. $query = new \yii\db\Query();
  3. $tmcTypes = \app\models\entity\TmcType::find()->all();
  4. $query = new \yii\db\Query();
  5. $tmcStorages = $query
  6. ->select('id, title')
  7. ->from(\app\models\entity\Storage::tableName())
  8. ->where(['tmc' => 0])
  9. ->all()
  10. ;
  11. ?>
  12. <div class="divContentScroll loco-scrol-blue">
  13. <div id="contentBox" class="contentBox">
  14. <p class="crumbs">Список устройств » Новое устройство</p>
  15. <h2 class="contentHeader">Введите данные нового устройства</h2>
  16. <form action="/tmc/api/add_tmc.php" method="post">
  17. <input type="hidden" name="_csrf" value="">
  18. <fieldset>
  19. Вид устройства:
  20. <select class="" name="tmcType">
  21. <?php foreach ($tmcTypes as $type): ?>
  22. <option value="<?= $type['id'] ?>"><?= $type['title'] ?></option>
  23. <?php endforeach; ?>
  24. </select>
  25. <br clear="all">
  26. Инвентарный номер:
  27. <br>
  28. <input name="inventoryNum" type="text" placeholder="Введете инвентарный номер">
  29. <br>
  30. IP:
  31. <br>
  32. <input name="ip" type="text" placeholder="Введете зарезервированный IP">
  33. <br>
  34. MAC-адрес:
  35. <br>
  36. <input name="mac" type="text" placeholder="Введете MAC-адрес">
  37. <br>
  38. Место хранения:
  39. <select class="" name="storage">
  40. <?php foreach ($tmcStorages as $storage): ?>
  41. <option value="<?= $storage['id'] ?>"><?= $storage['title'] ?></option>
  42. <?php endforeach; ?>
  43. </select>
  44. <br clear="all">
  45. Примечание:<br>
  46. <textarea placeholder="Описание" name="desc"></textarea>
  47. <input type="hidden" name="company" value="<?= $companyID ?>">
  48. </fieldset>
  49. <button type="submit" class="">Добавить устройство</button>
  50. </form>
  51. </div>
  52. </div>