@extends('web.layouts.master')
@section('content')
        <section class="bg-half-170 d-table w-100" style="background-color: #efefef; height:100vh; padding:121px 0px 5px;">
            <div class="container mb-2">
                <div class="row align-items-center p-3">
                    <div class="col-md-12">
                        <div class="row">
                            <div class="col-md-10" style="width:83%;">
                                <div class="content_header ml-0">
                                    <div class="right">
                                        <h6 style="font-weight:bold !important; margin: 0px; color: #141639c4;">MY APPLICATION</h6>
                                    </div>
                                </div>
                            </div>
                            <!-- <div class="col-md-2 text-right">
                                <button class="submit_button" style="margin-left:2.6rem;">Add New</button>
                            </div> -->
                        </div>
                    </div>
                    @if(count($student_proposal) > 0 )
                    <div class="col-md-12">
                        <div class="scrolled_content_part">
                            @foreach($student_proposal as $key=>$row)
                            <div class="single_ad_pref_item mb-4">
                                <div class="p-2" style="display:flex;">
                                    <div class="left" style="width:50%;">
                                        <div class="uni_details" style="display:flex;">
                                             

                                            @if(cn($row,'teacher_details.university')) 
                                            <img class="img-responsive listFlag" style="border-radius: 20px; padding: 0px;height: 37px;width: 37px;" src="{{ asset('/assets/img/flags/4x3').'/'.strtolower(cn($row,'teacher_details.university.country.iso_3166_2','')).'.svg' }}" alt="Flag" data-toggle="tooltip" title="" data-placement="top">
                                            @else
                                            <div class="inner_left mt-1" style="border: 1px solid black; border-radius: 20px; padding: 6px; height: 37px; width: 37px;">
                                                <i class="fa fa fa-university ms-1"></i>
                                            </div>
                                            @endif
                                            <div class="alert" style="background-color:white; padding: 3px 7px; margin-bottom: 0px;">
                                                <strong style="font-size:13px;">{{ cn($row,'teacher_details.first_name','')}} {{ cn($row,'teacher_details.last_name','')}}</strong></br>
                                                    <span style="font-size:10px; font-weight:400;"> {{cn($row,'teacher_details.designation','')}} </span>
                                                    <span>.</span>
                                                    @if(isset($row->teacher_details->department_name))
                                                        <span style="font-size:10px; font-weight:400;"> {{cn($row,'teacher_details.department_name.name','')}}</span>
                                                    @else
                                                        <span style="font-size:10px; font-weight:400;">{{cn($row,'teacher_details.others_department','')}}</span>
                                                    @endif
                                                    <span>.</span>
                                                    <span style="font-size:10px; font-weight:400;"> {{cn($row,'teacher_details.university_name','')}} </span>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="text-end" style="width:50%;">
                                        <span style="font-size:11px;">Apply Reference</span><br>
                                        <span class="label_badge_radius" style="background-color: #141639c4; color: white; border-radius: 4px; font-size:11px !important; font-weight:800;">{{$row->student_apply_ref ?? ''}}</span>
                                    </div>
                                </div>
                                <div class="p-2" style="display:flex; border-top: 1px solid #eee;">
                                    <div class="left" style="width:50%;">
                                        <div class="uni_details" style="display:flex;">
                                            <div class="inner_right ms-5">
                                                <strong style="font-size:13px; font-weight: 400;">{{cn($row,'proposal.title','')}}</strong></br>
                                                    <div style="margin-top: -2px;">
                                                        <span style="font-size:10px;">{{cn($row,'proposal.proposal_ref','')}}</span>
                                                        <span>.</span>
                                                        <span style="font-size:10px;">{{cn($row,'proposal.methology','')}}</span>
                                                        <span>.</span>
                                                        <span style="font-size:10px;">{{cn($row,'proposal.department','')}}</span>
                                                        <span>.</span>
                                                        <span style="font-size:10px;">{{cn($row,'proposal.status','')}}</span>
                                                    </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <div class="p-2" style="display:flex; border-top: 1px solid #eee;">
                                    <div class="left" style="width:50%;">
                                        <div class="uni_details" style="display:flex;">
                                            <div class="inner_right ms-5">
                                                <span style="font-size:11px;">Preferred Start Date : <br><strong>{{ date('M Y', strtotime($row->created_at))}}</strong></span><br>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="text-end" style="width:50%;">
                                        <span style="font-size:11px;">Application Status </span><br>
                                        <span class="label_badge_radius" style="background-color: #d8fdd8; color: green; border-radius: 5px; font-weight: bold;">Applied</span>

                                    </div>
                                </div>
                                 <div class="p-2" style="display:flex; border-top: 1px solid #eee;">
                                    <div class="left">
                                        <div class="uni_details" style="display:flex;">
                                            <div class="inner_right ms-5">
                                                <span style="font-size:11px; color: red;">{{ $row->feedback_msg ?? ""}}</span><br>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            @endforeach
                        </div>
                        @else
                        <div class="alert  mt-2 mb-3" style="background-color: #ffff; border-color: #e9f0f3; font-size: 12px !important; color: #dc3545; border-radius: 30px; padding: 8px 15px;">
                            <span>No Application available.</span>
                        </div>
                        @endif
                    </div>
                </div>
            </div><!--end container-->
        </section>
@endsection
