<?php $__env->startSection('title'); ?> Create Security <?php $__env->stopSection(); ?>

<?php $__env->startSection('content'); ?>

<div class='col-lg-4 col-lg-offset-4'>

    <h1><i class='fa fa-user'></i> Add Security</h1>

    <?php echo Form::open(['role' => 'form', 'action' => array('SecurityController@store')]); ?>


    <div class='form-group'>
        <?php echo Form::label('username', 'Username'); ?>

        <?php echo Form::text('username', null, ['placeholder' => 'Username', 'class' => 'form-control', 'required']); ?>


        <?php if($errors->has('username')): ?>
        <div class='bg-danger alert'><?php echo $errors->first('username'); ?></div>
        <?php endif; ?>
    </div>

    <div class='form-group'>
        <?php echo Form::label('password', 'Password'); ?>

        <?php echo Form::text('password', null, ['placeholder' => 'Password', 'class' => 'form-control', 'required']); ?>


        <?php if($errors->has('password')): ?>
        <div class='bg-danger alert'><?php echo $errors->first('password'); ?></div>
        <?php endif; ?>
    </div>

    <div class='form-group'>
        <?php echo Form::label('name', 'Name'); ?>

        <?php echo Form::text('name', null, ['placeholder' => 'Name', 'class' => 'form-control', 'required']); ?>


        <?php if($errors->has('name')): ?>
        <div class='bg-danger alert'><?php echo $errors->first('name'); ?></div>
        <?php endif; ?>
    </div>

    <?php if($buildings->isEmpty()): ?>
        <h3>No Buildings</h3>
    <?php else: ?>
        <h3>Buildings</h3>

        <?php if($errors->has('buildings')): ?>
        <div class='bg-danger alert'><?php echo $errors->first('buildings'); ?></div>
        <?php endif; ?>

        <div class="form-group">
            <?php foreach($buildings as $building): ?>
                <?php echo Form::checkbox('building_group[]', $building->id, null,
                    array('id' => 'building' . $building->id)); ?>

                <?php echo Form::label('building' . $building->id, $building->address); ?>

                <br>
            <?php endforeach; ?>
        </div>
    <?php endif; ?>

    <div class='form-group'>
        <?php echo Form::submit('Create Security', ['class' => 'btn btn-primary']); ?>

    </div>

    <?php echo Form::close(); ?>


</div>

<?php $__env->stopSection(); ?>
<?php echo $__env->make('layouts.master', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>