staffForm.blade.php 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. @extends("base")
  2. @section("content")
  3. @if ($obj->id)
  4. <form action="/staff/edit/{{$obj->id}}" method="post">
  5. @else
  6. <form action="/staff/create/" method="post">
  7. @endif
  8. <div class="form-group">
  9. <label for="lastname">Фамилия</label>
  10. <input type="text" class="form-control" value="{{$obj->lastname}}" name="lastname" id="lastname">
  11. <label for="firstname">Имя</label>
  12. <input type="text" class="form-control" value="{{$obj->firstname}}" name="firstname" id="firstname">
  13. <label for="middlename">Отчество</label>
  14. <input type="text" class="form-control" value="{{$obj->middlename}}" name="middlename" id="middlename">
  15. <label for="position_id">Должность</label>
  16. <select id="position_id" name="position_id" class="form-control">
  17. @foreach($positions as $position)
  18. <option value="{{$position->id}}">{{$position}}</option>
  19. @endforeach
  20. </select>
  21. <label for="air_time">Время в воздухе</label>
  22. <input type="number" class="form-control" value="{{$obj->air_time}}" name="air_time" id="air_time">
  23. <label for="passport_data">Пасспортные данные</label>
  24. <input type="text" class="form-control" value="{{$obj->passport_data}}" name="passport_data" id="passport_data">
  25. <label for="phone">Телефон</label>
  26. <input type="text" class="form-control" value="{{$obj->phone}}" name="phone" id="phone">
  27. <label for="birth_date">Дата рождения</label>
  28. <input type="date" class="form-control" value="{{$obj->birth_date}}" name="birth_date" id="birth_date">
  29. <label for="address">Адрес</label>
  30. <input type="text" class="form-control" value="{{$obj->address}}" name="address" id="address">
  31. <label for="in_flight">В полете</label>
  32. <input type="checkbox" class="form-control" value="{{$obj->in_flight}}" name="in_flight" id="in_flight">
  33. </div>
  34. <div>
  35. @if (count($errors) > 0)
  36. <div class="alert alert-danger">
  37. <ul>
  38. @foreach ($errors->all() as $error)
  39. <li>{{ $error }}</li>
  40. @endforeach
  41. </ul>
  42. </div>
  43. @endif
  44. </div>
  45. <button type="submit" class="btn btn-primary">Submit</button>
  46. @csrf
  47. </form>
  48. @stop