@extends('layouts.app', ['pageSlug' => 'weightage'])
@push('style')
 

<link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
@endpush
@section('content')
<div class="container">
    <div class="row">
        <div class="col-md-12">

          @if(session()->has('message'))
            <p class="btn btn-success btn-block btn-sm custom_message text-left">{{ session()->get('message') }}</p>
          @endif
        <div class="card">  
            <div class="card-header">
                    <h5 class="title">Add Questions</h5>
                    
                </div>
            <div class="card-body">
 <?php //print_r($categories);?>
          <form action="{{ route('addweightage') }}" method="post">
            @csrf
            <div class="form-group">
              <label for="">Questions</label>
              <input type="text" class="form-control" name="question" value="{{ old('question') }}" placeholder="Enter question" required>
              <font style="color:red"> {{ $errors->has('question') ?  $errors->first('question') : '' }} </font>
            </div>
            <div class="row">
            <div class="col-md-6">
             <div class="form-group">
              <label for="">Category</label>
              <select  class="form-control" name="category">
              <option value="">Select</option>
              @if(!empty($categories))
                                    @forelse($categories as $category)
            <option value="{{ $category->id }}">{{ $category->category_name }}</option>
                                    

                                    @empty
                                        <option value="">No data found</option>
                                    @endforelse
                                @endif
                
              </select>
              <font style="color:red"> {{ $errors->has('category') ?  $errors->first('category') : '' }} </font>
            </div>
            </div>
            <div class="col-md-6">
             <div class="form-group">
              <label for="">Question Type</label>
              <select  class="form-control" name="question_type">
              @if(!empty($questions_categories))
                                    @forelse($questions_categories as $questcat)
            <option value="{{ $questcat->id }}">{{ $questcat->question_category }}</option>
                                    

                                    @empty
                                        <option value="">No data found</option>
                                    @endforelse
                                @endif
                
              </select>
              <font style="color:red"> {{ $errors->has('question_type') ?  $errors->first('question_type') : '' }} </font>
            </div>
            </div>
            </div>
            <div class="row">
            <div class="col-md-6">
             <div class="form-group">
              <label for="">Weightage Type</label>
              <select  class="form-control" name="weightage_type">
              <option value="">Select</option>
                @if(!empty($weightages))
                                    @forelse($weightages as $weightage)
            <option value="{{ $weightage->id }}">{{ $weightage->weightage_title }}</option>
                                    

                                    @empty
                                        <option value="">No data found</option>
                                    @endforelse
                                @endif
              </select>
              <font style="color:red"> {{ $errors->has('weightage_type') ?  $errors->first('weightage_type') : '' }} </font>
            </div>
            </div>
            <div class="col-md-6">
             <div class="form-group">
              <label for="">Notes</label>
              <textarea  class="form-control" name="notes" style="border: 1px solid #2825255e;">
               
              </textarea>
               
              <font style="color:red"> {{ $errors->has('notes') ?  $errors->first('notes') : '' }} </font>
            </div>
            </div>
            </div>
            <div class="row">
            <div class="col-md-6">
             <div class="form-group">
              <label for="">Option A</label>
               <input type="text" class="form-control" name="question" value="{{ old('A') }}" placeholder="Option A" required>
              <font style="color:red"> {{ $errors->has('A') ?  $errors->first('A') : '' }} </font>
            </div>
            </div>
            <div class="col-md-6">
             <div class="form-group">
              <label for="">Option B</label>
               <input type="text" class="form-control" name="B" value="{{ old('B') }}" placeholder="Option B" required>
              <font style="color:red"> {{ $errors->has('question_type') ?  $errors->first('question_type') : '' }} </font>
            </div>
            </div>
            </div>
            <div class="row">
            <div class="col-md-6">
             <div class="form-group">
              <label for="">Option C</label>
              <input type="text" class="form-control" name="C" value="{{ old('C') }}" placeholder="Option C" required>
              <font style="color:red"> {{ $errors->has('C') ?  $errors->first('C') : '' }} </font>
            </div>
            </div>
            <div class="col-md-6">
             <div class="form-group">
              <label for="">Option D</label>
               <input type="text" class="form-control" name="D" value="{{ old('D') }}" placeholder="Enter question" required>
              <font style="color:red"> {{ $errors->has('D') ?  $errors->first('D') : '' }} </font>
            </div>
            </div>
            </div>
            <div class="form-group" style="margin-top: 24px;">
              <input type="submit" class="btn btn-primary" value="Submit">
            </div>

          </form>
          </div>
          </div>
        </div>
    </div>
</div>
@endsection