first commit
This commit is contained in:
188
resources/views/content/users/courses/create.blade.php
Normal file
188
resources/views/content/users/courses/create.blade.php
Normal file
@@ -0,0 +1,188 @@
|
||||
@extends('layouts/contentLayoutMaster')
|
||||
|
||||
@section('title', 'Add Course')
|
||||
|
||||
@section('vendor-style')
|
||||
<!-- vendor css files -->
|
||||
<link rel="stylesheet" href="{{ asset(mix('vendors/css/extensions/toastr.min.css')) }}">
|
||||
<link rel="stylesheet" href="{{ asset(mix('vendors/css/forms/select/select2.min.css')) }}">
|
||||
|
||||
@endsection
|
||||
|
||||
@section('page-style')
|
||||
<!-- Page css files -->
|
||||
<link rel="stylesheet" href="{{ asset(mix('css/base/plugins/extensions/ext-component-toastr.css')) }}">
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/daterangepicker/daterangepicker.css" />
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<section id="dropzone-examples">
|
||||
<form action="{{ route('course.store') }}" name="usersForm" method="post" enctype="multipart/form-data">
|
||||
@csrf
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h4 class="card-title">Course Details</h4>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<input type="hidden" name="student_id" value="{{$user->id}}">
|
||||
<div class="row">
|
||||
<div class="col-lg-6 col-sm-6 mb-1">
|
||||
<label for="category" class="form-label">Select Category</label>
|
||||
<select name="category"
|
||||
class="form-select select2 category @error('category') is-invalid @enderror"
|
||||
id="category">
|
||||
@foreach($categories as $category)
|
||||
<option value="{{$category->id}}" data-day="{{ $category->duration_in_days }}">{{$category->name}}</option>
|
||||
@endforeach
|
||||
|
||||
</select>
|
||||
@error('category')
|
||||
<span class="invalid-feedback" role="alert">
|
||||
<strong>{{ $message }}</strong>
|
||||
</span>
|
||||
@enderror
|
||||
</div>
|
||||
<div class="col-lg-6 col-sm-6 mb-1">
|
||||
<label for="fee" class="form-label">Total Fee</label>
|
||||
<input
|
||||
type="number"
|
||||
id="fee"
|
||||
class="form-control @error('fee') is-invalid @enderror"
|
||||
name="fee"
|
||||
placeholder="10.00"
|
||||
value="{{ old('fee') }}"
|
||||
required
|
||||
/>
|
||||
@error('fee')
|
||||
<span class="invalid-feedback" role="alert">
|
||||
<strong>{{ $message }}</strong>
|
||||
</span>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-lg-6 col-sm-6 mb-1">
|
||||
<label for="start_date" class="form-label">Start Date</label>
|
||||
<input
|
||||
type="date"
|
||||
id="start_date"
|
||||
class="form-control @error('start_date') is-invalid @enderror"
|
||||
name="start_date"
|
||||
value="{{ Carbon\Carbon::now()->format('Y-m-d') }}"
|
||||
required
|
||||
/>
|
||||
@error('start_date')
|
||||
<span class="invalid-feedback" role="alert">
|
||||
<strong>{{ $message }}</strong>
|
||||
</span>
|
||||
@enderror
|
||||
</div>
|
||||
<div class="col-lg-6 col-sm-6 mb-1">
|
||||
<label for="end_date" class="form-label">End Date</label>
|
||||
<input
|
||||
type="date"
|
||||
id="end_date"
|
||||
class="form-control @error('end_date') is-invalid @enderror"
|
||||
name="end_date"
|
||||
value="{{ Carbon\Carbon::now()->addDays($categories[0]['duration_in_days'])->format('Y-m-d') }}"
|
||||
required
|
||||
/>
|
||||
@error('end_date')
|
||||
<span class="invalid-feedback" role="alert">
|
||||
<strong>{{ $message }}</strong>
|
||||
</span>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-6 col-sm-6 mb-1">
|
||||
<label for="note" class="form-label">Note</label>
|
||||
<textarea
|
||||
id="note"
|
||||
class="form-control @error('note') is-invalid @enderror"
|
||||
name="note"
|
||||
placeholder="note"
|
||||
>{{ old('note') }}</textarea>
|
||||
@error('note')
|
||||
<span class="invalid-feedback" role="alert">
|
||||
<strong>{{ $message }}</strong>
|
||||
</span>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<button type="submit" class="btn btn-primary me-1"
|
||||
onclick="this.disabled=true;this.form.submit();">Submit
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</section>
|
||||
@endsection
|
||||
|
||||
@section('vendor-script')
|
||||
<script src="{{ asset(mix('vendors/js/forms/cleave/cleave.min.js'))}}"></script>
|
||||
<script src="{{ asset(mix('vendors/js/extensions/toastr.min.js')) }}"></script>
|
||||
<script src="{{ asset(mix('vendors/js/forms/select/select2.full.min.js')) }}"></script>
|
||||
@endsection
|
||||
|
||||
@section('page-script')
|
||||
<script src="{{ asset(mix('js/scripts/forms/form-input-mask.js')) }}"></script>
|
||||
<script src="{{ asset(mix('js/scripts/forms/form-select2.js')) }}"></script>
|
||||
|
||||
<script type="text/javascript" src="https://cdn.jsdelivr.net/momentjs/latest/moment.min.js"></script>
|
||||
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/daterangepicker/daterangepicker.min.js"></script>
|
||||
|
||||
<script>
|
||||
var days=parseInt($("#category option:selected").attr("data-day"));
|
||||
$(function () {
|
||||
$(".category").change(function () {
|
||||
days = parseInt($("#category option:selected").attr("data-day"));
|
||||
var startDate=$("#start_date").val();
|
||||
calEndDate(startDate,days);
|
||||
//console.log(days);
|
||||
});
|
||||
|
||||
$("#start_date").change(function () {
|
||||
var startDate=$(this).val();
|
||||
calEndDate(startDate,days);
|
||||
//console.log(startDate);
|
||||
});
|
||||
|
||||
//calculate end date
|
||||
function calEndDate(startDate, days) {
|
||||
var endDate = moment(startDate).add(days,'days').format('YYYY-MM-DD');
|
||||
$("#end_date").val(endDate);
|
||||
}
|
||||
|
||||
})
|
||||
</script>
|
||||
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
{{--$('.select2').select2({--}}
|
||||
{{-- placeholder: '{{__('Select an option')}}',--}}
|
||||
{{-- allowClear: true--}}
|
||||
{{--});--}}
|
||||
|
||||
toastr.options.timeOut = 10000;
|
||||
@if(session()->has('error'))
|
||||
toastr.error('{{ session('error') }}');
|
||||
@elseif(session()->has('success'))
|
||||
toastr.success('{{ session('success') }}');
|
||||
@endif
|
||||
});
|
||||
</script>
|
||||
@endsection
|
||||
|
||||
Reference in New Issue
Block a user