@extends('layouts.app')
@section('content')
<div class="content">
    <div class="row">
        <div class="col-3">
            @include('side_menu')
        </div>
        <div class="col-9">
            <div class="col-md-12 welcome-header">
                Dear <strong>[ {{ Auth::user()->name }} ]</strong>, logged in as <strong>[ {{ $userRole->role }} ]</strong> from <strong>[ {{ $institution->institution_name }} ]</strong>
            </div>
            <div class="row">
                <div class="col-2">
                    <img src="/images/stake_left.jfif" width="120px" alt="SRC" style="float: right;" />
                </div>
                <div class="col-md-9">
                    <p>
                        + Welcome to the SRC Compliance Management System.
                    </p>
                    <p>
                        In this regard, the commission carries out self evaluation surveys and questionnaires among its stakeholders periodically.
                    </p>
                    @if($user->user_role_id == 2)
                    @if(count($answers) == 0)
                    <p>
                        Kindly fill in all the required data to the best of best of your
                        knowledge and cross check before submission.<br /><br />
                        Thank you!<br /><br />
                        SRC
                    </p>
                    <div class="row">
                        <div class="col-6">
                            <a href="/stakeholders/questionnaire" style="float: left;">
                                <button class="btn float-right search-bt">
                                    Start Questionnaire
                                </button>
                            </a>
                        </div>
                        <div class="col-6">
                            <a href="#" style="float: right;padding-top: 10px;">
                                Download System User Guide
                            </a>
                        </div>
                    </div>
                    </p>
                    @else
                    @if($answers->first()->answered_by == $user->user_id && $answers->first()->returned_for_review == 1)
                    <p>Your reviewer has returned the questionnaire to you with the suggestions below:</p>

                    @if($answers->first()->review_comments != null)
                    <?php echo $answers[0]->review_comments; ?>
                    @else
                    No Comments. Please liaise with your reviewer for clarifications. Thank you.
                    @endif
                    @endif
                    @endif
                    @elseif($user->user_role_id == 3)
                    @if($answers != null)
                    <p>
                        A questionnaire has been submitted by your clerk for your review and submission to the commission.
                        Please review and guide your clerk for any correction before submitting to the commission.<br /><br />
                        Thank you!<br /><br />
                        SRC
                    <div>
                        <a href="/stakeholders/questionnaire/review">
                            <button class="btn float-right search-bt">
                                Review
                            </button>
                        </a>
                    </div>
                    </p>
                    @else
                    <p>No questionnaire is pending review. You can liaise with your clerk
                        to ensure that no questionnaire from the commission is pending for action
                        by your institution. <br /><br />Thank you.<br /><br />SRC</p>
                    @endif
                    @endif
                </div>
                <div class="col-1">
                    <img src="/images/stake_right.jfif" width="100px" alt="SRC" />
                </div>
            </div>
            <div class="col-md-12" style="border-top: 2px solid #888;"></div>
        </div>

    </div>
</div>
@endsection