create.blade.php 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. @extends('layouts.main')
  2. @section('content')
  3. <!-- CONTENT HEADER -->
  4. <section class="content-header">
  5. <div class="container-fluid">
  6. <div class="row mb-2">
  7. <div class="col-sm-6">
  8. <h1>{{ __('Ticket') }}</h1>
  9. </div>
  10. <div class="col-sm-6">
  11. <ol class="breadcrumb float-sm-right">
  12. <li class="breadcrumb-item"><a href="{{ route('home') }}">{{ __('Dashboard') }}</a></li>
  13. <li class="breadcrumb-item"><a class="text-muted"
  14. href="{{ route('ticket.index') }}">{{ __('Ticket') }}</a>
  15. </li>
  16. </ol>
  17. </div>
  18. </div>
  19. </div>
  20. </section>
  21. <!-- END CONTENT HEADER -->
  22. <!-- MAIN CONTENT -->
  23. <section class="content">
  24. <div class="container-fluid">
  25. <form action="{{route('ticket.new.store')}}" method="POST" class="ticket-form">
  26. @csrf
  27. <div class="row">
  28. <div class="col-lg-6">
  29. <div class="card">
  30. <div class="card-header">
  31. <h5 class="card-title">
  32. <i class="fas fa-money-check-alt mr-2"></i>{{__('Open a new ticket')}}
  33. </h5>
  34. </div>
  35. <div class="card-body">
  36. <div class="form-group col-sm-12 {{ $errors->has('title') ? ' has-error' : '' }}">
  37. <label for="title" class="control-label">Title</label>
  38. <input id="title" type="text" class="form-control" name="title" value="{{ old('title') }}">
  39. @if ($errors->has('title'))
  40. <span class="help-block">
  41. <strong>{{ $errors->first('title') }}</strong>
  42. </span>
  43. @endif
  44. </div>
  45. <div class="form-group col-sm-12 {{ $errors->has('server') ? ' has-error' : '' }}">
  46. <label for="server" class="control-label">{{__("Server")}}</label>
  47. <select id="server" type="server" class="form-control" name="server">
  48. <option value="">{{ __("No Server") }}</option>
  49. @if ($servers->count() >= 1)
  50. @foreach ($servers as $server)
  51. <option value="{{ $server->id }}">{{ $server->name }}</option>
  52. @endforeach
  53. @endif
  54. </select>
  55. @if ($errors->has('category'))
  56. <span class="help-block">
  57. <strong>{{ $errors->first('ticketcategory') }}</strong>
  58. </span>
  59. @endif
  60. </div>
  61. <div class="form-group col-sm-12 {{ $errors->has('ticketcategory') ? ' has-error' : '' }}">
  62. <label for="ticketcategory" class="control-label">{{__("Category")}}</label>
  63. <select id="ticketcategory" type="ticketcategory" class="form-control" required name="ticketcategory">
  64. <option value="" disabled selected>{{__("Select Category")}}</option>
  65. @foreach ($ticketcategories as $ticketcategory)
  66. <option value="{{ $ticketcategory->id }}">{{ $ticketcategory->name }}</option>
  67. @endforeach
  68. </select>
  69. @if ($errors->has('category'))
  70. <span class="help-block">
  71. <strong>{{ $errors->first('ticketcategory') }}</strong>
  72. </span>
  73. @endif
  74. </div>
  75. <div class="form-group col-sm-12 {{ $errors->has('priority') ? ' has-error' : '' }}">
  76. <label for="priority" class="control-label">Priority</label>
  77. <select id="priority" type="" class="form-control" name="priority">
  78. <option value="" disabled selected>{{__("Select Priority")}}</option>
  79. <option value="Low">{{__("Low")}}</option>
  80. <option value="Medium">{{__("Medium")}}</option>
  81. <option value="High">{{__("High")}}</option>
  82. </select>
  83. @if ($errors->has('priority'))
  84. <span class="help-block">
  85. <strong>{{ $errors->first('priority') }}</strong>
  86. </span>
  87. @endif
  88. </div>
  89. @if (app(App\Settings\GeneralSettings::class)->recaptcha_enabled)
  90. <div class="input-group mb-3">
  91. {!! htmlScriptTagJsApi() !!}
  92. {!! htmlFormSnippet() !!}
  93. @error('g-recaptcha-response')
  94. <span class="text-danger" role="alert">
  95. <small><strong>{{ $message }}</strong></small>
  96. </span>
  97. @enderror
  98. </div>
  99. @endif
  100. </div>
  101. <div class="card-footer">
  102. <button type="submit" class="btn btn-primary ticket-once">
  103. {{__('Open Ticket')}}
  104. </button>
  105. </div>
  106. </div>
  107. </div>
  108. <div class="col-lg-6">
  109. <div class="card">
  110. <div class="card-header">
  111. <h5 class="card-title">
  112. <i class="fas fa-money-check-alt mr-2"></i>{{__('Ticket details')}}
  113. </h5>
  114. </div>
  115. <div class="card-body">
  116. <div class="form-group col-sm-12 {{ $errors->has('message') ? ' has-error' : '' }}">
  117. <label for="message" class="control-label">Message</label>
  118. <textarea rows="8" id="message" class="form-control" name="message">{{old("message")}}</textarea>
  119. @if ($errors->has('message'))
  120. <span class="help-block">
  121. <strong>{{ $errors->first('message') }}</strong>
  122. </span>
  123. @endif
  124. </div>
  125. </div>
  126. </div>
  127. </div>
  128. </div>
  129. </form>
  130. </div>
  131. </section>
  132. <!-- END CONTENT -->
  133. <script type="text/javascript">
  134. $(".ticket-form").submit(function (e) {
  135. $(".ticket-once").attr("disabled", true);
  136. return true;
  137. })
  138. </script>
  139. @endsection