<?php
/**
  * @var \App\View\AppView $this
  */
?>
<nav class="large-3 medium-4 columns" id="actions-sidebar">
    <ul class="side-nav">
        <li class="heading"><?= __('Actions') ?></li>
        <li><?= $this->Html->link(__('Edit Subject'), ['action' => 'edit', $subject->id]) ?> </li>
        <li><?= $this->Form->postLink(__('Delete Subject'), ['action' => 'delete', $subject->id], ['confirm' => __('Are you sure you want to delete # {0}?', $subject->id)]) ?> </li>
        <li><?= $this->Html->link(__('List Subjects'), ['action' => 'index']) ?> </li>
        <li><?= $this->Html->link(__('New Subject'), ['action' => 'add']) ?> </li>
        <li><?= $this->Html->link(__('List Exam Topics'), ['controller' => 'ExamTopics', 'action' => 'index']) ?> </li>
        <li><?= $this->Html->link(__('New Exam Topic'), ['controller' => 'ExamTopics', 'action' => 'add']) ?> </li>
    </ul>
</nav>
<div class="subjects view large-9 medium-8 columns content">
    <h3><?= h($subject->name) ?></h3>
    <table class="vertical-table">
        <tr>
            <th scope="row"><?= __('Name') ?></th>
            <td><?= h($subject->name) ?></td>
        </tr>
        <tr>
            <th scope="row"><?= __('Id') ?></th>
            <td><?= $this->Number->format($subject->id) ?></td>
        </tr>
        <tr>
            <th scope="row"><?= __('Status') ?></th>
            <td><?= $this->Number->format($subject->status) ?></td>
        </tr>
    </table>
    <div class="related">
        <h4><?= __('Related Exam Topics') ?></h4>
        <?php if (!empty($subject->exam_topics)): ?>
        <table cellpadding="0" cellspacing="0">
            <tr>
                <th scope="col"><?= __('Id') ?></th>
                <th scope="col"><?= __('Topic') ?></th>
                <th scope="col"><?= __('Subject Id') ?></th>
                <th scope="col" class="actions"><?= __('Actions') ?></th>
            </tr>
            <?php foreach ($subject->exam_topics as $examTopics): ?>
            <tr>
                <td><?= h($examTopics->id) ?></td>
                <td><?= h($examTopics->topic) ?></td>
                <td><?= h($examTopics->subject_id) ?></td>
                <td class="actions">
                    <?= $this->Html->link(__('View'), ['controller' => 'ExamTopics', 'action' => 'view', $examTopics->id]) ?>
                    <?= $this->Html->link(__('Edit'), ['controller' => 'ExamTopics', 'action' => 'edit', $examTopics->id]) ?>
                    <?= $this->Form->postLink(__('Delete'), ['controller' => 'ExamTopics', 'action' => 'delete', $examTopics->id], ['confirm' => __('Are you sure you want to delete # {0}?', $examTopics->id)]) ?>
                </td>
            </tr>
            <?php endforeach; ?>
        </table>
        <?php endif; ?>
    </div>
</div>
