@extends('modal_pages.base')

@section('main')
<form class="modal-form" action="{{ url()->current() }}" method="POST" enctype="multipart/form-data">
    {{ csrf_field() }}
    <div class="container">
        <div class="col-md-12">
            <div class="middle p-3" style="background-color:white; border-radius:6px;">
                <p style="font-size: 16px; font-weight: bold; margin: 0px;">This proposal will be sent to the following supervisor</p>
                <div class="alert" style="padding: 0px; margin: 0px">
                    <input type="hidden" name="teacher_id" value="{{$teacher->id}}">
                    <input type="hidden" name="student_id" value="{{$student->id}}">
                    <div class="d-flex">
                        @if($teacher->university) 
                            <img class="img-responsive listFlag" style="border-radius: 20px; padding: 0px;height: 37px;width: 37px;" src="{{ asset('/assets/img/flags/4x3').'/'.strtolower(cn($teacher,'university.country.iso_3166_2','')).'.svg' }}" alt="Flag" data-toggle="tooltip" title="" data-placement="top">
                        @endif
                    </div>
                         <span style="margin: 0px;">{{$teacher->first_name}} {{$teacher->last_name}}</span></br>
                    
                    <span class="text-muted" style="font-weight: 500;">{{$teacher->designation}}</span></br>
                    @if(isset($teacher->department_name))
                        <span class="text-muted" style="font-weight: 500;">{{cn($teacher,'department_name.name','')}}</span>
                    @else
                        <span class="text-muted" style="font-weight: 500;">{{$teacher->others_department}}</span>
                    @endif
                    <span>.</span>
                    <span class="text-muted" style="font-weight: 500;">{{$teacher->university_name}}</span>
                </div>
            </div>
        </div>

        <div class="middle p-3 mt-3" style="background-color:white; border-radius:6px;">
            <p style="font-size: 16px; font-weight: bold; margin-bottom: 0px !important;">Please select which proposal you want to send</p>
            <div class="alert mb-3 propose" style="padding: 0px; margin-bottom: 0px">
                <div style="width:100%;">
                    @foreach($proposal as $row)
                    <div class="p-2" style="border-bottom: 2px solid #eee;">
                        <div class="custom-control custom-radio custom-control-inline">
                            <div class="form-check mb-0">
                                <input class="form-check-input mt-2" type="radio" name="proposal_id" value="{{$row->id}}" id="flexRadioDefault1">
                                <label class="form-check-label" for="flexRadioDefault1" style="font-weight: 400 !important; font-size: 13px;">{{$row->title}}</label></br>
                                <span class="label_badge_radius" style="background-image: linear-gradient(90deg,rgba(46,17,83,.19),#f5f4fd); font-weight: 400 !important; font-size: 10px;">Ref. ({{ $row->proposal_ref}})</span>
                            </div>
                        </div>
                    </div>
                    @endforeach

                </div>
            </div>
        </div>
    </div>
    <div class="container mt-3">
        <div class="col-md-12 p-3" style="background-color:white; border-radius:6px;">
            <p style="margin:0px; font-size: 16px; font-weight: bold;">Select propose start date</p>
            <div class="row">
                <div class="col-md-6">
                    <div class="mb-1">
                            <label class="form-label"></label>
                        <div class="form-icon position-relative" style="margin-top: -10px;">
                            <select name="startdate" id="start date" class="form-control frm" required=""  style="font-size: 13px;">
                                <option disabled="" selected="" value="">Year</option>
                                @php
                                    $firstYear = (int)date('Y');
                                    $lastYear = $firstYear + 1;
                                    for($i=$firstYear;$i<=$lastYear;$i++){
                                @endphp
                                <option value="{{$i}}">{{$i}}</option>
                                @php
                                    }
                                @endphp

                            </select>
                        </div>
                    </div>
                </div>
                <div class="col-md-6">
                    <div class="mb-1">
                            <label class="form-label"></label>
                        <div class="form-icon position-relative" style="margin-top: -10px;">
                            <select name="startmonth" id="month" class="form-control frm" required="">
                                <option disabled="" selected="" value="">Month</option>
                                <option value="01">January</option>
                                <option value="02">February</option>
                                <option value="03">March</option>
                                <option value="04">April</option>
                                <option value="05">May</option>
                                <option value="06">June</option>
                                <option value="07">July</option>
                                <option value="08">August</option>
                                <option value="09">September</option>
                                <option value="10">October</option>
                                <option value="11">November</option>
                                <option value="12">December</option>
                            </select>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="col-md-12 text-end">
            <button type="submit" class="btn btn1 mt-3 mb-3" style="padding: 3px 18px;">Submit</button>
        </div>
    </div>
</form>

<script>
    $(function(){
        // $('.select2').select2();
        $('#modal_page_footer').hide();
    });
    </script>
@endsection
