create.blade.php 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. @extends('admin.layout')
  2. <style type="text/css">
  3. </style>
  4. @section('header')
  5. @endsection
  6. @section('content')
  7. <div id="sg-main-container-sg">
  8. <div class="wrapper wrapper-content animated fadeInRight">
  9. <div class="row">
  10. <div class="col-sm-12">
  11. <div class="ibox float-e-margins">
  12. <div class="ibox-title">
  13. <h5>{{ '添加' . $model_name }}</h5>
  14. <div class="ibox-tools">
  15. <a class="collapse-link"> <i class="fa fa-chevron-up"></i>
  16. </a>
  17. </div>
  18. </div>
  19. <div class="ibox-content">
  20. <div class="row">
  21. <div class="col-sm-12 pull-right">
  22. <a href="{{ $pre_uri . 'index?student_id=' . $student->id }}" class="btn btn-sm btn-primary pull-right">返回列表</a>
  23. </div>
  24. </div>
  25. <form class="form-horizontal" method="POST" action="{{ $pre_uri . 'store' }}">
  26. {{ csrf_field() }}
  27. <input type="hidden" name="data[student_id]" value="{{ $student->id }}">
  28. <div class="form-group row">
  29. <label class="col-sm-2 col-sm-offset-1 control-label">合同编号</label>
  30. <div class="col-sm-8">
  31. <input type="text" name="data[number]" class="form-control" placeholder="请输入合同编号" value="{{ isset(old('data')['number']) ? old('data')['number'] : '' }}" required>
  32. </div>
  33. @if($errors->has('number'))
  34. <span class="help-block">{{ $errors->first('number') }}</span>
  35. @endif
  36. </div>
  37. <div class="form-group row">
  38. <label class="col-sm-2 col-sm-offset-1 control-label">课程种类</label>
  39. <div class="col-sm-8">
  40. <select class="form-control" name="data[course_id]">
  41. @foreach($courses as $course)
  42. <option value="{{ $course->id }}" {{ isset(old('data')['course_id']) && old('data')['course_id'] == $course->id ? 'selected' : '' }}>{{ $course->name }}</option>
  43. @endforeach
  44. </select>
  45. </div>
  46. @if($errors->has('course_id'))
  47. <span class="help-block">{{ $errors->first('course_id') }}</span>
  48. @endif
  49. </div>
  50. <div class="form-group row">
  51. <label class="col-sm-2 col-sm-offset-1 control-label">报名日期</label>
  52. <div class="col-sm-8">
  53. <input type="text" name="data[apply_date]" class="form-control datepicker" placeholder="请输入报名日期" value="{{ isset(old('data')['apply_date']) ? old('data')['apply_date'] : \Carbon\Carbon::now()->toDateString() }}" readonly>
  54. </div>
  55. @if($errors->has('apply_date'))
  56. <span class="help-block">{{ $errors->first('apply_date') }}</span>
  57. @endif
  58. </div>
  59. <div class="form-group row">
  60. <label class="col-sm-2 col-sm-offset-1 control-label">课程持续时间</label>
  61. <div class="col-sm-8">
  62. <input type="text" name="data[duration]" class="form-control" placeholder="请输入课程持续时间" value="{{ isset(old('data')['duration']) ? old('data')['duration'] : '' }}">
  63. </div>
  64. @if($errors->has('duration'))
  65. <span class="help-block">{{ $errors->first('duration') }}</span>
  66. @endif
  67. </div>
  68. <div class="form-group row">
  69. <label class="col-sm-2 col-sm-offset-1 control-label">讲师分配</label>
  70. <div class="col-sm-8">
  71. <label class="checkbox-inline">
  72. <input type="checkbox" class="sg-checkbox" id="check-all-teachers" name="assign_teacher" value="1">所有讲师
  73. </label>
  74. @foreach($teachers as $teacher)
  75. <label class="checkbox-inline">
  76. <input type="checkbox" class="sg-checkbox teachers-checkbox" name="teachers[]" value="{{ $teacher->id }}">{{ $teacher->name }}
  77. </label>
  78. @endforeach
  79. </div>
  80. </div>
  81. <div class="form-group row">
  82. <div class="col-sm-8 col-sm-offset-3">
  83. <button type="submit" class="btn btn-sm btn-primary">提交</button>
  84. </div>
  85. </div>
  86. </form>
  87. </div>
  88. </div>
  89. </div>
  90. </div>
  91. </div>
  92. </div>
  93. @endsection
  94. @section('footer')
  95. <script type="text/javascript">
  96. $(function () {
  97. })
  98. </script>
  99. @endsection