
<?php $__env->startSection('subtitle'); ?>
Game Administration
<?php $__env->stopSection(); ?>

<?php $__env->startSection('content'); ?>

<div class="row">
    <div class="col-lg-12">
        <h1><?php echo $game -> id; ?> <small>Administration</small></h1>
        <ol class="breadcrumb">
            <li>
                <i class="fa fa-dashboard"></i>
                <a href="<?php echo route('adminDashboard'); ?>">
                    Dashboard
                </a>
            </li>
            <li>
                <i class="icon-file-alt"></i>
                <a href="<?php echo route('admin.game.index'); ?>">
                    Games
                </a>
            </li>
            <li class="active">
                <i class="icon-file-alt"></i> <?php echo $game -> id; ?>
            </li>
        </ol>
    </div>
</div><!-- /.row -->

<div class="row">
    <div class="col-lg-12">
        <h3> Weapons <a href="<?php echo action('WeaponController@create', array('game_id' => $game -> id)); ?>" class="btn btn-sm btn-success"><span class="glyphicon glyphicon-plus"></span></a></h3>
        <table class="table tablesorter">
            <thead>
                <tr>
                    <th> ID <i class="fa fa-sort"></i></th>
                    <th> Name <i class="fa fa-sort"></i></th>
                    <th> Attachments <i class="fa fa-sort"></i></th>
                    <th> Loadouts <i class="fa fa-sort"></i></th>
                    <th> Image_URL <i class="fa fa-sort"></i></th>
                    <th> Min Attachments </th>
                    <th> Max Attachments </th>
                    <th> Type </th>
                    <th> Created at <i class="fa fa-sort"></i></th>
                    <th> Updated at <i class="fa fa-sort"></i></th>
                    <th> Actions </th>
                </tr>
            </thead>
            <tbody>
                <?php foreach($weapons as $weapon): ?>
                <tr>
                    <td>
                        <?php echo $weapon -> id; ?>
                    </td>
                    <td>
                        <a href="<?php echo route('weaponLoadouts', array('id' => $game -> id, 'name' => $weapon -> name)); ?>">
                            <?php echo $weapon -> name; ?>
                        </a>
                    </td>
                    <td>
                        <?php echo count($weapon -> attachments); ?>
                    </td>
                    <td>
                        <?php echo count(Loadout::where('weapon_id', $weapon -> id) -> get()); ?>
                    </td>
                    <td>
                        <a href="<?php echo asset($weapon -> image_url); ?>">
                            <img src="<?php echo asset($weapon -> thumb_url); ?>" alt="thumb URL" class="thumbnail" />
                        </a>
                    </td>
                    <td>
                        <?php echo $weapon -> min_attachments; ?>
                    </td>
                    <td>
                        <?php echo $weapon -> max_attachments; ?>
                    </td>
                    <td>
                        <?php echo $weapon -> type; ?>
                    </td>
                    <td>
                        <?php echo $weapon -> created_at; ?>
                    </td>
                    <td>
                        <?php echo $weapon -> updated_at; ?>
                    </td>
                    <td>
                        <a href="<?php echo route('weaponEdit', array('id' => $game -> id, 'name' => $weapon -> name)); ?>" class="btn btn-default">
                            <span class="glyphicon glyphicon-pencil"></span>
                        </a>
                        &nbsp;
                        <a href="<?php echo route('weaponDelete', array('id' => $game -> id, 'name' => $weapon -> name)); ?>" class="btn btn-danger">
                            <span class="glyphicon glyphicon-trash"></span>
                        </a>
                    </td>
                </tr>
                <?php endforeach; ?>
            </tbody>
        </table>
    </div>
</div><!-- /.row -->

<div class="row">
    <div class="col-lg-12">
        <h3> Attachments <a href="<?php echo action('AttachmentController@create', array('game_id' => $game -> id)); ?>" class="btn btn-sm btn-success"><span class="glyphicon glyphicon-plus"></span></a></h3>
        <table class="table tablesorter">
            <thead>
                <tr>
                    <th> ID <i class="fa fa-sort"></i></th>
                    <th> Name <i class="fa fa-sort"></i></th>
                    <th> Slot <i class="fa fa-sort"></i></th>
                    <th> Image_URL <i class="fa fa-sort"></i></th>
                    <th> Created at <i class="fa fa-sort"></i></th>
                    <th> Updated at <i class="fa fa-sort"></i></th>
                    <th> Actions </th>
                </tr>
            </thead>
            <tbody>
                <?php foreach($attachments as $attachment): ?>
                <tr>
                    <td>
                        <?php echo $attachment -> id; ?>
                    </td>
                    <td>
                        <?php echo $attachment -> name; ?>
                    </td>
                    <td>
                        <?php echo $attachment -> slot; ?>
                    </td>
                    <td>
                        <a href="<?php echo asset($attachment -> image_url); ?>">
                            <img src="<?php echo asset($attachment -> thumb_url); ?>" alt="Image URL" class="thumbnail" />
                        </a>
                    </td>
                    <td>
                        <?php echo $attachment -> created_at; ?>
                    </td>
                    <td>
                        <?php echo $attachment -> updated_at; ?>
                    </td>
                    <td>
                        <a href="<?php echo route('attachmentEdit', array('id' => $game -> id, 'name' => $attachment -> id)); ?>" class="btn btn-default">
                            <span class="glyphicon glyphicon-pencil"></span>
                        </a>
                        &nbsp;
                        <a href="<?php echo route('attachmentDelete', array('id' => $game -> id, 'name' => $attachment -> id)); ?>" class="btn btn-danger">
                            <span class="glyphicon glyphicon-trash"></span>
                        </a>
                    </td>
                </tr>
                <?php endforeach; ?>
            </tbody>
        </table>
    </div>
</div><!-- /.row -->

<?php $__env->stopSection(); ?>

<?php $__env->startSection('page-scripts'); ?>

<script src="<?php echo asset('js/tablesorter/jquery.tablesorter.js'); ?>"></script>
<script src="<?php echo asset('js/tablesorter/tables.js'); ?>"></script>

<?php $__env->stopSection(); ?>

<?php echo $__env->make('admin.layout', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>