<?php $__env->startSection('content'); ?>
    <div class="panel panel-primary">
       <?php if(Auth::check() && Auth::user()->role == 'admin'): ?> <div class="panel-heading">Vytvořit nového administrátora</div>
        <?php else: ?>
            <div class="panel-heading">Registrovat se</div>
        <?php endif; ?>
        <div class="panel-body">
            <form class="form-horizontal" method="POST" action="<?php echo e(route('register')); ?>">
            <?php echo e(csrf_field()); ?>


            <!-- NAME -->
                <div class="form-group<?php echo e($errors->has('name') ? ' has-error' : ''); ?>">
                    <label for="name" class="col-md-4 control-label">Jméno</label>

                    <div class="col-md-6">
                        <input id="name" type="text" class="form-control" name="name"
                               value="<?php echo e(old('name')); ?>" >

                        <?php if($errors->has('name')): ?>
                            <span class="help-block">
                                <strong><?php echo e($errors->first('name')); ?></strong>
                            </span>
                        <?php endif; ?>
                    </div>
                </div>

                <div class="form-group<?php echo e($errors->has('lname') ? ' has-error' : ''); ?>">
                    <label for="lname" class="col-md-4 control-label">Příjmení</label>

                    <div class="col-md-6">
                        <input id="lname" type="text" class="form-control" name="lname"
                               value="<?php echo e(old('lname')); ?>" >

                        <?php if($errors->has('lname')): ?>
                            <span class="help-block">
                                <strong><?php echo e($errors->first('lname')); ?></strong>
                            </span>
                        <?php endif; ?>
                    </div>
                </div>

                <!-- EMAIL -->
                <div class="form-group<?php echo e($errors->has('email') ? ' has-error' : ''); ?>">
                    <label for="email" class="col-md-4 control-label">E-mail</label>

                    <div class="col-md-6">
                        <input id="email" type="email" class="form-control" name="email"
                               value="<?php echo e(old('email')); ?>">

                        <?php if($errors->has('email')): ?>
                            <span class="help-block">
                                <strong><?php echo e($errors->first('email')); ?></strong>
                            </span>
                        <?php endif; ?>
                    </div>
                </div>

                <!-- TELEPHONE NUMBER -->
                <div class="form-group<?php echo e($errors->has('phone_number') ? ' has-error' : ''); ?>">
                    <label for="phone_number" class="col-md-4 control-label">Telefonní číslo</label>

                    <div class="col-md-6">
                        <input id="phone_number" type="text" class="form-control" name="phone_number"
                               value="<?php echo e(old('phone_number')); ?>">

                        <?php if($errors->has('phone_number')): ?>
                            <span class="help-block">
                                <strong><?php echo e($errors->first('phone_number')); ?></strong>
                            </span>
                        <?php endif; ?>
                    </div>
                </div>

                <!-- ROLE -->
                <div class="form-group">
                    <?php if(Auth::check() && Auth::user()->role == 'admin'): ?>
                        <input id="role" type="hidden" class="form-control" name="role"
                           value="admin" required>
                        <?php else: ?>
                        <input id="role" type="hidden" class="form-control" name="role"
                               value="acco_admin" required>
                    <?php endif; ?>
                </div>


                <!-- PASSWORD -->
                <div class="form-group<?php echo e($errors->has('password') ? ' has-error' : ''); ?>">
                    <label for="password" class="col-md-4 control-label">Heslo</label>

                    <div class="col-md-6">
                        <input id="password" type="password" class="form-control" name="password" required>

                        <?php if($errors->has('password')): ?>
                            <span class="help-block">
                                <strong><?php echo e($errors->first('password')); ?></strong>
                            </span>
                        <?php endif; ?>
                    </div>
                </div>

                <!-- PASSWORD -->
                <div class="form-group">
                    <label for="password-confirm" class="col-md-4 control-label">Potvrzení hesla</label>

                    <div class="col-md-6">
                        <input id="password-confirm" type="password" class="form-control"
                               name="password_confirmation" required>
                    </div>
                </div>

                <div class="form-group">
                    <div class="col-md-6 col-md-offset-4">
                        <button type="submit" class="btn btn-primary">
                            <?php if(Auth::check() && Auth::user()->role == 'admin'): ?> Vytvořit administrátora
                                <?php else: ?> Registrovat se
                                <?php endif; ?>
                        </button>
                    </div>
                </div>
            </form>
        </div>
    </div>

<?php $__env->stopSection(); ?>

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