<section class="pcoded-main-container">
<div class="pcoded-content">
    <div class="page-header">
        <div class="page-block">
            <div class="row align-items-center">
                <div class="col-md-12">
                    <div class="page-header-title">
                        <h5 class="m-b-10">Paper Details<?php echo $this->Html->link('<i class="feather icon-list" ></i> Paper List',array('controller'=>'Papers','action'=>'index'), array('class' => 'btn btn-primary pull-right','escape'=>false),array());?>
                        
                         <?php echo $this->Html->link('<i class="feather icon-plus-square" ></i> Add Question',array('controller'=>'Questions','action'=>'add',$paper->id), array('class' => 'btn btn-dark pull-right mr-2','escape'=>false),array());?>

                        </h5>
                    </div>                   
                </div>
            </div>
        </div>
    </div>
    <div class="row">
         <div class="col-xl-12 col-md-12">
            <div class="card">
                <div class="card-body table-border-style">
                    <div class="table-responsive panel" scroll="no" style="overflow: hidden">
                        <div class="row">
                            <div class="col-xl-6 col-md-6">
                                <table class="vertical-table table table-striped">
                                    <tr>
                                        <th scope="row"><?= __('Paper ') ?></th>
                                        <td><?= h($paper->subject) ?></td>
                                    </tr>
                                   
                                </table>
                            </div>
                            <div class="col-xl-6 col-md-6">
                                <table class="vertical-table table table-striped">
                                    <tr>
                                        <th scope="row"><?= __('Created') ?></th>
                                        <td><?= date('d M, Y',strtotime($paper->created)) ?></td>
                                    </tr>
                                   <!--  <tr>
                                        <th scope="row"><?= __('Modified') ?></th>
                                        <td><?= date('d,M,Y H:i',strtotime($paper->modified)) ?></td>
                                    </tr> -->
                                </table>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
             <?php if (!empty($paper->questions)): ?>
            <div class="card">
                <div class="card-body table-border-style">
                        <div class="table-responsive dataTables_wrapper dt-bootstrap4" scroll="no" style="overflow: hidden">
                            <h5><?= __('Related Questions') ?></h5>                           
                            <table cellpadding="0" cellspacing="0" class="table">
                                <tr>
                                    <th scope="col">#</th>                                    
                                    <th scope="col"><?= __('Question') ?></th>
                                    <th scope="col"><?= __('Created') ?></th>
                                    <th scope="col" class="actions"><?= __('Actions') ?></th>
                                </tr>
                                <?php  $i = 1; foreach ($paper->questions as $questions): ?>
                                <tr>
                                    <td><?= $i++; ?></td>                                   
                                    <td><?= h($questions->question) ?></td>
                                    <td><?= date('d M,Y',strtotime($questions->created)) ?></td>
                                
                                    <td class="actions">
                                        <?= $this->Html->link($this->Html->tag('i', '', array('class'=>"fas fa-eye btn btn-success",'traget' =>'_blank')), array('controller' => 'Questions', 'action' => 'view', $questions->id),array('escape'=>false,'target' =>'_blank')) ?>
                                    </td>
                                </tr>
                                <?php endforeach; ?>
                            </table>
                            
                        </div>
                    </div>
                </div>
                <?php endif; ?>
            </div>
        </div>
    </div>
</div>
</section>
