add.blade.php 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346
  1. @extends('admin.layout.index')
  2. @push('css-head')
  3. @endpush
  4. @section('content')
  5. <!-- Page header -->
  6. <div class="page-header page-header-light">
  7. <div class="breadcrumb-line breadcrumb-line-light header-elements-md-inline">
  8. <div class="d-flex">
  9. <div class="breadcrumb">
  10. <a href="{{url('/admin')}}" class="breadcrumb-item"><i class="icon-home2 mr-2"></i> Dashboard</a>
  11. <a href="{{url('/admin/courses')}}" class="breadcrumb-item"> Courses</a>
  12. <span class="breadcrumb-item active">Create New</span>
  13. </div>
  14. </div>
  15. </div>
  16. </div>
  17. <!-- /page header -->
  18. <!-- Content area -->
  19. <div class="content">
  20. <div class="card">
  21. <div class="card-body">
  22. @if (count($errors) > 0)
  23. <div class="alert alert-danger alert-no-border alert-txt-colored alert-close alert-dismissible fade show" role="alert">
  24. <button type="button" class="close" data-dismiss="alert" aria-label="Close">
  25. <span aria-hidden="true">×</span>
  26. </button>
  27. <strong>Whoops!</strong> There were some problems with your input.
  28. <ul>
  29. @foreach ($errors->all() as $error)
  30. <li>{{ $error }}</li>
  31. @endforeach
  32. </ul>
  33. </div>
  34. @endif
  35. {!!Form::open(array('url'=>'admin/courses/store','method'=>'POST'))!!}
  36. <div class="row">
  37. <div class="col-md-4">
  38. <div class="form-group">
  39. <label>Destination:</label>
  40. <select class="form-control destination" name="destination_id" required="">
  41. <option disabled="" selected="" value="">Choose One..</option>
  42. @foreach($destinations as $row)
  43. <option value="{{$row['id']}}::{{$row['name']}}">{{$row['name']}}</option>
  44. @endforeach
  45. </select>
  46. </div>
  47. </div>
  48. <div class="col-md-8" id="instituteDiv">
  49. <div class="form-group">
  50. <label>Institute:</label>
  51. <select class="form-control select2 institute" name="institute_id" required="">
  52. <option disabled="" selected="" value="">Choose One..</option>
  53. </select>
  54. </div>
  55. </div>
  56. <div class="col-md-4 d-none" id="campusDiv">
  57. <div class="form-group">
  58. <label>Campus:</label>
  59. <select class="form-control campus select2" multiple name="campuses[]">
  60. <option disabled="">Choose One..</option>
  61. </select>
  62. </div>
  63. </div>
  64. </div>
  65. <div class="row">
  66. <div class="col-md-4">
  67. <div class="form-group">
  68. <label>Course Level:</label>
  69. <select class="form-control level" name="level_id" required="">
  70. <option disabled="" selected="" value="">Choose One..</option>
  71. </select>
  72. </div>
  73. </div>
  74. <div class="col-md-4">
  75. <div class="form-group">
  76. <label>Department:</label>
  77. <input type="text" class="form-control" name="department" id="department" required="">
  78. </div>
  79. </div>
  80. <div class="col-md-4">
  81. <div class="form-group">
  82. <label>Intake:</label>
  83. <select class="form-control select2 intake" multiple name="intakes[]" >
  84. <option disabled="">Choose One..</option>
  85. </select>
  86. </div>
  87. </div>
  88. </div>
  89. <div class="row">
  90. <div class="col-md-4">
  91. <div class="form-group">
  92. <label>Course Name:</label>
  93. <input type="text" class="form-control" name="courseName" id="courseName" required="">
  94. </div>
  95. </div>
  96. <div class="col-md-4">
  97. <div class="form-group">
  98. <label>Course Length (month):</label>
  99. <input type="number" class="form-control" name="courseLength" id="courseLength" required="">
  100. </div>
  101. </div>
  102. <div class="col-md-4">
  103. <div class="form-group">
  104. <label>Tution Fee:</label>
  105. <input type="number" class="form-control" name="tutionFee" id="tutionFee" required="">
  106. </div>
  107. </div>
  108. </div>
  109. <div class="row">
  110. <div class="col-md-3">
  111. <div class="form-group">
  112. <label>IELTS:</label>
  113. <input type="text" class="form-control" name="ielts" id="ielts">
  114. </div>
  115. </div>
  116. <div class="col-md-3">
  117. <div class="form-group">
  118. <label>TOEFL:</label>
  119. <input type="text" class="form-control" name="toefl" id="toefl">
  120. </div>
  121. </div>
  122. <div class="col-md-3">
  123. <div class="form-group">
  124. <label>Duolingo:</label>
  125. <input type="text" class="form-control" name="duolingo" id="duolingo">
  126. </div>
  127. </div>
  128. <div class="col-md-3">
  129. <div class="form-group">
  130. <label>PTE:</label>
  131. <input type="text" class="form-control" name="pte" id="pte">
  132. </div>
  133. </div>
  134. </div>
  135. <div class="row">
  136. <div class="col-md-3">
  137. <div class="form-group">
  138. <label>Scolarship:</label>
  139. <input type="text" class="form-control" name="scholarship" id="scholarship">
  140. </div>
  141. </div>
  142. <div class="col-md-3">
  143. <div class="form-group">
  144. <label>Deposit Required:</label>
  145. <input type="text" class="form-control" name="depositRequired" id="depositRequired" >
  146. {{-- <div class="input-group">
  147. <input type="number" min="0" max="100" class="form-control" name="depositRequired" id="depositRequired" >
  148. <span class="input-group-addon mt-2">%</span>
  149. </div> --}}
  150. </div>
  151. </div>
  152. <div class="col-md-3">
  153. <div class="form-group">
  154. <label>SOP:</label>
  155. <select class="form-control" name="sop" required="">
  156. <option value="0">No</option>
  157. <option selected="" value="1">Yes</option>
  158. </select>
  159. </div>
  160. </div>
  161. <div class="col-md-3">
  162. <div class="form-group">
  163. <label>CV:</label>
  164. <select class="form-control" name="cv" required="">
  165. <option value="0">No</option>
  166. <option selected="" value="1">Yes</option>
  167. </select>
  168. </div>
  169. </div>
  170. {{-- <div class="col-md-3">
  171. <div class="form-group">
  172. <label>UCAS Fee:</label>
  173. <select class="form-control" name="ucasFee" required="">
  174. <option selected="" value="0">No</option>
  175. <option value="1">Yes</option>
  176. </select>
  177. </div>
  178. </div> --}}
  179. </div>
  180. <div class="row">
  181. {{-- <div class="col-md-3">
  182. <div class="form-group">
  183. <label>Minimum GPA:</label>
  184. <input type="number" step=".1" min="0" max="9" class="form-control" name="minGpa" id="minGpa" >
  185. </div>
  186. </div> --}}
  187. <div class="col-md-9">
  188. <div class="form-group">
  189. <label>Keywords</label>
  190. <input type="text" class="form-control tokenfield" name="tags" value="">
  191. </div>
  192. </div>
  193. <div class="col-md-3">
  194. <div class="form-group">
  195. <label>Reference:</label>
  196. <select class="form-control" name="reference" required="">
  197. <option selected="" value="0">N/A</option>
  198. <option value="1">1</option>
  199. <option value="2">2</option>
  200. </select>
  201. </div>
  202. </div>
  203. </div>
  204. <div class="row">
  205. <div class="col-md-12">
  206. <div class="form-group">
  207. <label>Entry Requirements</label>
  208. <textarea class="form-control summernote" name="entry_requirement"></textarea>
  209. </div>
  210. </div>
  211. </div>
  212. <div class="text-right">
  213. <a href="{{ url('admin/courses/create') }}" class="btn btn-secondary pull-left">
  214. Refresh
  215. <i class="icon-reload-alt ml-2"></i>
  216. </a>
  217. <button type="submit" class="btn btn-primary">Submit <i class="icon-paperplane ml-2"></i></button>
  218. </div>
  219. {!! Form::close() !!}
  220. </div>
  221. </div>
  222. </div>
  223. <!-- /content area -->
  224. @endsection
  225. @push('scripts')
  226. <script type="text/javascript" src="{{ asset('assets/global/js/plugins/forms/selects/select2.min.js')}}"></script>
  227. <script type="text/javascript" src="{{ asset('assets/global/js/plugins/forms/tags/tagsinput.min.js')}}"></script>
  228. <script type="text/javascript" src="{{ asset('assets/global/js/plugins/forms/tags/tokenfield.min.js')}}"></script>
  229. <script type="text/javascript" src="{{ asset('assets/global/js/plugins/editors/summernote/summernote.min.js')}}"></script>
  230. <script type="text/javascript">
  231. $(document).ready(function(){
  232. $('.select2').select2();
  233. $('.tokenfield').tokenfield();
  234. $('.summernote').summernote();
  235. });
  236. $('.destination').on('change', function(){
  237. var destination = $('.destination option:selected').val();
  238. var select_tag = $('.institute');
  239. $.get("{{ route('admin.ajax-get', ['name'=>'sams_institutes']) }}", {
  240. destination : destination, type : 'all'
  241. }).done(function(res){
  242. select_tag.empty().append('<option disabled="" selected="" value="">Choose One..</option>');
  243. res.forEach(function(row){
  244. select_tag.append(
  245. $('<option></option>').val(row.institute_id+'::'+row.institute_name).html(row.institute_name)
  246. );
  247. });
  248. });
  249. $('.institute').empty().append('<option disabled="" selected="" value="">Choose One..</option>');
  250. $('.level').empty().append('<option disabled="" selected="" value="">Choose One..</option>');
  251. $('.campus').empty().append('<option disabled="">Choose One..</option>');
  252. $('.intake').empty().append('<option disabled="">Choose One..</option>');
  253. });
  254. $('.institute').on('change', function(){
  255. var institute = $('.institute option:selected').val();
  256. var select_tag = $('.level');
  257. $.get("{{ route('admin.ajax-get', ['name'=>'sams_levels']) }}", {
  258. institute : institute, group : 0
  259. }).done(function(res){
  260. select_tag.empty().append('<option disabled="" selected="" value="">Choose One..</option>');
  261. res.forEach(function(row){
  262. select_tag.append(
  263. $('<option></option>').val(row.id+'::'+row.name).html(row.name)
  264. );
  265. });
  266. });
  267. $.get("{{ route('admin.ajax-get', ['name'=>'sams_campuses']) }}", {
  268. institute : institute
  269. }).done(function(campuses){
  270. var select_tag = $('.campus');
  271. select_tag.empty().append('<option disabled="">Choose One..</option>');
  272. if(campuses.length > 0){
  273. campuses.forEach(function(row){
  274. select_tag.append(
  275. $('<option></option>').val(row.id+'::'+row.name).html(row.name)
  276. );
  277. });
  278. $('#instituteDiv').removeClass('col-md-8');
  279. $('#instituteDiv').addClass('col-md-4');
  280. $('#campusDiv').removeClass('d-none');
  281. }else{
  282. $('#instituteDiv').addClass('col-md-8');
  283. $('#instituteDiv').removeClass('col-md-4');
  284. $('#campusDiv').addClass('d-none');
  285. }
  286. });
  287. $.get("{{ route('admin.ajax-get', ['name'=>'sams_intakes']) }}", {
  288. institute : institute
  289. }).done(function(intakes){
  290. var select_tag = $('.intake');
  291. select_tag.empty().append('<option disabled="">Choose One..</option>');
  292. if(intakes.length > 0){
  293. intakes.forEach(function(row){
  294. select_tag.append(
  295. $('<option></option>').val(row.intake).html(getMonthName(row.intake))
  296. );
  297. });
  298. }else{
  299. select_tag.empty().append('<option disabled="">Choose One..</option>');
  300. }
  301. });
  302. });
  303. $('.level').on('change', function(){
  304. var institute = $('.institute option:selected').val();
  305. var level = $('.level option:selected').val();
  306. var select_tag = $('.intake');
  307. $.get("{{ route('admin.ajax-get', ['name'=>'sams_intakes']) }}", {
  308. institute : institute, level : level
  309. }).done(function(intakes){
  310. select_tag.empty().append('<option disabled="">Choose One..</option>');
  311. if(intakes.length > 0){
  312. intakes.forEach(function(row){
  313. select_tag.append(
  314. $('<option></option>').val(row.intake).html(getMonthName(row.intake))
  315. );
  316. });
  317. }else{
  318. select_tag.empty().append('<option disabled="">Choose One..</option>');
  319. }
  320. });
  321. });
  322. function getMonthName(monthNumber) {
  323. var months = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'];
  324. return months[monthNumber - 1];
  325. }
  326. </script>
  327. @endpush