<?php
    if($create){
        $title = __('adminforms.users.title_insert');
        $formpar = array('route' => 'admin.user.store');
    } else {
        $title = __('adminforms.users.title_update');
        $formpar = array('route' => array('admin.user.update', $user->id), 'method' => 'PUT');
    }

    $tr = [
        'brand name'      => __('adminforms.users.brand_name'),
        'brand title'     => __('adminforms.users.brand_title'),
        'brand_metadesc'  => __('adminforms.users.brand_metadesc'),
        'brand keyw'      => __('adminforms.users.brand_keyw'),

        'id'           => __('adminforms.users.id'),
        'name'         => __('adminforms.users.name'),
        'lname'        => __('adminforms.users.lname'),
        'email'        => __('adminforms.users.email'),
        'phone'        => __('adminforms.users.phone'),
        'address'      => __('adminforms.users.address'),
        'zip city'      => __('adminforms.users.zip_city'),
        'password'      => __('adminforms.users.password'),
        'company info' => __('adminforms.users.company_info'),
        'com id'       => __('adminforms.users.com_id'),
        'com name'     => __('adminforms.users.com_name'),
        'active'       => __('adminforms.users.active'),
        'verified'     => __('adminforms.users.verified'),
        'created_at'   => __('adminforms.users.created_at'),
    ];
?>

<?php $__env->startSection('title'); ?><?php echo e($title); ?><?php $__env->stopSection(); ?>
<?php $__env->startSection('header'); ?><?php echo e($title); ?><?php $__env->stopSection(); ?>
<?php $__env->startSection('header_desc'); ?> <?php $__env->stopSection(); ?>
<?php $__env->startSection('breadcumbs'); ?> <?php $__env->stopSection(); ?>

<?php $__env->startSection('content'); ?>
    <!-- Main content -->
    <section class="content">



        <div class="row">

            <div class="col-xs-12">
                <?php if(session('error')): ?>
                    <div class="alert alert-danger alert-dismissible">
                        <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
                        <i class="icon fa fa-exclamation-triangle"></i> <strong>Info: </strong> &nbsp;  &nbsp;
                        <?php echo e(session('error')); ?>

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

            <?php echo Form::open($formpar); ?>


            <div class="col-xs-12">

                <?php if($create == 0): ?>
                <div class="panel panel-default">
                    <div class="panel-heading">
                        <h3 class="panel-title"><i class="fa fa-list-alt"></i> <?php echo e(__('adminforms.users.title_info')); ?></h3>
                    </div><!-- /. panel-heading -->

                    <div class="panel-body">
                        <div class="row">

                            <div class="col-xs-12">
                                <table class="table ">
                                    <tr>
                                        <th><?php echo e(ucfirst(__('adminforms.users.id'))); ?></th>
                                        <th><?php echo e(ucfirst(__('adminforms.users.name'))); ?> i <?php echo e(ucfirst(__('adminforms.users.lname'))); ?></th>
                                        <th><?php echo e(ucfirst(__('adminforms.users.email'))); ?></th>
                                        <th><?php echo e(ucfirst(__('adminforms.users.phone'))); ?></th>
                                        <th><?php echo e(ucfirst(__('adminforms.users.address'))); ?></th>
                                        <th><?php echo e(ucfirst(__('adminforms.users.created_at'))); ?></th>
                                    </tr>
                                    <tr>
                                        <td><?php echo e($user->id); ?></td>
                                        <td><?php echo e($user->name); ?> <?php echo e($user->lname); ?></td>
                                        <td><?php echo e($user->email); ?></td>
                                        <td><?php echo e($user->phone); ?></td>
                                        <td><?php echo e($user->address); ?></td>
                                        <td><?php echo e(sr_date($user->created_at)); ?></td>
                                    </tr>
                                    <tr>
                                        <td colspan="5">
                                            &nbsp;
                                        </td>
                                    </tr>
                                    <tr>
                                        <td colspan="5"><strong><?php echo e(ucfirst(__('adminforms.users.company_info'))); ?> : </strong></td>
                                    </tr>
                                    <tr>
                                        <td colspan="5"><?php echo e($user->company_info); ?></td>
                                    </tr>
                                </table>
                            </div>

                        </div> <!-- /.row -->
                    </div> <!-- /.panel-body -->
                </div> <!-- /.panel panel-default-->

                <br><br>

                <?php endif; ?>

                <div class="panel panel-default">
                    <div class="panel-heading">
                        <h3 class="panel-title"><i class="fa fa-list-alt"></i> <?php echo e(($create) ? __('adminforms.users.title_create') : __('adminforms.users.title_edit')); ?></h3>
                    </div><!-- /. panel-heading -->

                    <div class="panel-body">
                        <div class="row">
                            
                            
                            

                            <?php if($create): ?>

                            <div class="col-xs-12 col-sm-6 col-md-3 pbb">
                                <?php echo e(Form::label('name', ucfirst(__('adminforms.users.name').':'))); ?>

                                <?php echo e(Form::text('name', old('name', $user->name ), ['class' => 'form-control'])); ?>

                                <small class="error"><?php echo e(strtr($errors->first('name'),$tr)); ?></small>
                            </div>


                            <div class="col-xs-12 col-sm-6 col-md-3 pbb">
                                <?php echo e(Form::label('lname', ucfirst(__('adminforms.users.lname').':'))); ?>

                                <?php echo e(Form::text('lname', old('lname', $user->lname ), ['class' => 'form-control'])); ?>

                                <small class="error"><?php echo e(strtr($errors->first('lname'),$tr)); ?></small>
                            </div>


                            <div class="col-xs-12 col-sm-6 col-md-3 pbb">
                                <?php echo e(Form::label('phone', ucfirst(__('adminforms.users.phone').':'))); ?>

                                <?php echo e(Form::text('phone', old('phone', $user->phone ), ['class' => 'form-control'])); ?>

                                <small class="error"><?php echo e(strtr($errors->first('phone'),$tr)); ?></small>
                            </div>


                            <div class="col-xs-12 col-sm-6 col-md-3 pbb">
                                <?php echo e(Form::label('address', ucfirst(__('adminforms.users.address').':'))); ?>

                                <?php echo e(Form::text('address', old('address', $user->address ), ['class' => 'form-control'])); ?>

                                <small class="error"><?php echo e(strtr($errors->first('address'),$tr)); ?></small>
                            </div>


                            <div class="col-xs-12 col-sm-6 col-md-3 pbb">
                                <?php echo e(Form::label('zip_city', ucfirst(__('adminforms.users.zip_city').':'))); ?>

                                <?php echo e(Form::text('zip_city', old('zip_city', $user->zip_city ), ['class' => 'form-control'])); ?>

                                <small class="error"><?php echo e(strtr($errors->first('zip_city'),$tr)); ?></small>
                            </div>


                            <div class="col-xs-12 col-sm-6 col-md-3 pbb">
                                <?php echo e(Form::label('email', ucfirst(__('adminforms.users.email').':'))); ?>

                                <?php echo e(Form::text('email', old('email', $user->email ), ['class' => 'form-control'])); ?>

                                <small class="error"><?php echo e(strtr($errors->first('email'),$tr)); ?></small>
                            </div>


                            <div class="col-xs-12 col-sm-6 col-md-3 pbb">
                                <?php echo e(Form::label('password', ucfirst(__('adminforms.users.password').':'))); ?>

                                <?php echo e(Form::text('password', old('password', $user->password ), ['class' => 'form-control'])); ?>

                                <small class="error"><?php echo e(strtr($errors->first('password'),$tr)); ?></small>
                            </div>


                            <div class="col-xs-12 col-sm-6 col-md-3 pbb">
                                <?php echo e(Form::label('password-confirm', ucfirst(__('adminforms.users.password_confirmation').':'))); ?>

                                <?php echo e(Form::text('password_confirmation', old('password_confirmation', NULL ), ['class' => 'form-control'])); ?>

                                <small class="error"><?php echo e(strtr($errors->first('password_confirmation'),$tr)); ?></small>
                            </div>

                            <?php endif; ?>
                            
                            



                            <div class="col-xs-12 col-sm-6 col-md-6 pbb">
                                <?php $cgId = old('com_id', $user->com_id); ?>
                                <?php echo e(Form::label('com_id', ucfirst(__('adminforms.users.com_id').':'))); ?>

                                <?php echo e(Form::select('com_id', $companies, $cgId, ['placeholder' => __('adminforms.users.select_company'), 'class' => 'form-control', 'id' => 'com-select'])); ?>

                                <small class="error"><?php echo e(strtr($errors->first('com_id'),$tr)); ?></small>
                            </div>

                            <div class="col-xs-12 col-sm-6 col-md-3 pbb">
                                <?php $cgId = old('active', $user->active); ?>
                                <?php echo e(Form::label('active', ucfirst(__('adminforms.users.active').':'))); ?>

                                <?php echo e(Form::select('active', $boleans, $cgId, ['class' => 'form-control', 'id' => 'act-select'])); ?>

                                <small class="error"><?php echo e(strtr($errors->first('active'),$tr)); ?></small>
                            </div>
                            
                            
                            


                            <br clear="all">
                            <hr>
                            <div class="col-xs-12">
                                <?php $btntext = ($create) ? __('adminforms.users.btn_insert') : __('adminforms.users.btn_update')?>
                                <?php echo e(Form::submit($btntext, ['class' => 'btn btn-success pull-right'])); ?>

                            </div>

                        </div> <!-- /.row -->
                    </div> <!-- /.panel-body -->
                </div> <!-- /.panel panel-default-->

            </div> <!-- /.col -->



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


        </div>
        <!-- /.row -->

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

<?php $__env->startPush('css'); ?>
<?php $__env->stopPush(); ?>


<?php $__env->startPush('scripts'); ?>
<?php $__env->stopPush(); ?>
<?php echo $__env->make('layouts.admin', \Illuminate\Support\Arr::except(get_defined_vars(), array('__data', '__path')))->render(); ?>