flightrecordForm.blade.php 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. @extends("base")
  2. @section("content")
  3. @if ($obj->id)
  4. <form action="/flightrecord/edit/{{$obj->id}}" method="post">
  5. @else
  6. <form action="/flightrecord/create/" method="post">
  7. @endif
  8. <div class="form-group">
  9. <label for="flight_id">Полет</label>
  10. <select id="flight_id" name="flight_id" class="form-control">
  11. @foreach($flights as $flight)
  12. <option value="{{$flight->id}}">{{$flight}}</option>
  13. @endforeach
  14. </select>
  15. <label for="client_id">Клиент</label>
  16. <select id="client_id" name="client_id" class="form-control">
  17. @foreach($clients as $client)
  18. <option value="{{$client->id}}">{{$client}}</option>
  19. @endforeach
  20. </select>
  21. <label for="tariff_id">Тариф</label>
  22. <select id="tariff_id" name="tariff_id" class="form-control">
  23. @foreach($tariffs as $tariff)
  24. <option value="{{$tariff->id}}">{{$tariff}}</option>
  25. @endforeach
  26. </select>
  27. </div>
  28. <div>
  29. @if (count($errors) > 0)
  30. <div class="alert alert-danger">
  31. <ul>
  32. @foreach ($errors->all() as $error)
  33. <li>{{ $error }}</li>
  34. @endforeach
  35. </ul>
  36. </div>
  37. @endif
  38. </div>
  39. <button type="submit" class="btn btn-primary">Submit</button>
  40. @csrf
  41. </form>
  42. @stop