<?php $__env->startSection('title', 'Form Submission'); ?>
<?php $__env->startSection('description', null); ?>
<?php $__env->startSection('keywords', null); ?>
<?php $__env->startSection('content'); ?>
<?php
    $user_role = UserRoles::where('id',Auth::user()->user_role_id)->pluck('title');
    $country = Countries::where('country_code',Auth::user()->country_code)->pluck('country_name');
    $user_papers = Evaluations::where('user_id',Auth::user()->id)->lists('paper_id');
    $papers = Papers::whereIn('id',$user_papers)->get();
    $evaluation_results = EvaluationResults::where('user_id',Auth::user()->id)->where('url',$url)->get();
?>
    <div class="container">
        <div class="row">
            <div class="col-sm-12 content">
                <div class="panel panel-default">
                    <div class="panel-heading">
                        <h1 class="panel-title">Evaluator Details</h1>
                    </div>
                    <div class="panel-body">
                        <div class="row">
                            <div class="col-sm-12">
                                <table class="table table-bordered table-responsive">
                                    <tbody>
                                        <tr>
                                            <th scope="row" class="col-sm-3">Account Type</th>
                                            <td class="col-sm-3"><?php echo $user_role; ?></td>
                                            <th scope="row" class="col-sm-3">Email</th>
                                            <td class="col-sm-3"><?php echo strtolower(Auth::user()->email); ?> </td>
                                        </tr>
                                        <tr>
                                            <th scope="row" class="col-sm-3">Name</th>
                                            <td class="col-sm-3"><?php echo ucwords(strtolower(Auth::user()->first_name)); ?> <i><?php echo ucwords(strtolower(Auth::user()->middle_name)); ?></i></td>
                                            <th scope="row" class="col-sm-3">Last Name</th>
                                            <td class="col-sm-3"><?php echo ucwords(strtolower(Auth::user()->last_name)); ?> </td>
                                        </tr>
                                    </tbody>
                                </table>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="panel panel-default">
                    <div class="panel-heading">
                        <h1 class="panel-title">Active Papers</h1>
                    </div>
                    <div class="panel-body">
                        <div class="row">
                            <div class="col-sm-12">
                                <table class="table table-hover" id="manager-table">
                                    <thead>
                                        <tr>
                                            <th class="col-md-7">Paper Title</th>
                                            <th class="col-md-4">Corresponding Author</th>
                                            <th class="col-md-1">Evaluation</th>
                                        </tr>
                                    </thead>
                                    <tbody>
<?php foreach($papers as $paper): ?>
                                        <tr>
                                            <td><?php echo $paper->title; ?></td>
                                            <td><?php echo Users::where('id',$paper->user_id)->pluck('first_name'); ?> <?php echo Users::where('id',$paper->user_id)->pluck('last_name'); ?></td>
                                            <td>
                                                <div class="btn-group btn-group-justified" role="group">
                                                    <div class="btn-group" role="group">
                                                        <a type="button" class="btn btn-xs btn-success" href="<?php echo action('EvaluatorEvaluationController@create', [$url,$paper->id]); ?>" role="button"><span class="glyphicon glyphicon-pencil" aria-hidden="true"></span></a>
                                                    </div>
                                                </div>
                                            </td>
                                        </tr>
<?php endforeach; ?>
                                    </tbody>
                                </table>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="panel panel-default">
                    <div class="panel-heading">
                        <h1 class="panel-title">Evaluation History</h1>
                    </div>
                    <div class="panel-body">
                        <div class="row">
                            <div class="col-sm-12">
                                <table class="table table-hover" id="manager-table">
                                    <thead>
                                    <tr>
                                        <th class="col-md-5">Paper Title</th>
                                        <th class="col-md-4">Corresponding Author</th>
                                        <th class="col-md-2">Evaluation Result</th>
                                        <th class="col-md-1">Show</th>
                                    </tr>
                                    </thead>
                                    <tbody>
                                    <?php foreach($evaluation_results as $evaluation_result): ?>
                                        <tr>
                                            <td><?php echo Papers::where('id',$evaluation_result->paper_id)->pluck('title'); ?></td>
                                            <td><?php echo Users::where('id',Papers::where('id',$evaluation_result->paper_id)->pluck('user_id'))->pluck('first_name'); ?> <?php echo Users::where('id',Papers::where('id', $evaluation_result->paper_id)->pluck('user_id'))->pluck('last_name'); ?></td>
                                            <td><?php echo $evaluation_result->result; ?></td>
                                            <td>
                                                <div class="btn-group btn-group-justified" role="group">
                                                    <div class="btn-group" role="group">
                                                        <a type="button" class="btn btn-xs btn-info" href="<?php echo action('EvaluatorEvaluationController@show', [$url,$evaluation_result->id]); ?>" role="button"><span class="glyphicon glyphicon-play" aria-hidden="true"></span></a>
                                                    </div>
                                                </div>
                                            </td>
                                        </tr>
                                    <?php endforeach; ?>
                                    </tbody>
                                </table>
                                <div class="text-center">
                                <p class="label label-info"><b>1: Accept as it is / 2: Accept with minor modifications / 3: Accept with major modifications / 4: Reject unless substantially modified / 5: Reject all together</b></p>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('layout.common', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>