<?php
    $tr = [
       'name'             => __('frontside.user.name'),
       'lname'            => __('frontside.user.lname'),
       'phone'            => __('frontside.user.phone'),
       'address'          => __('frontside.user.address'),
       'zip city'         => __('frontside.user.zip_city'),
       'company'          => __('frontside.user.company'),
       'current password' => __('frontside.user.current_password'),
    ];
?>

<form class="form-horizontal" role="form" method="POST" action="<?php echo e(locRoute('user.storedata')); ?>">
    <?php echo e(csrf_field()); ?>


    <div class="form-group<?php echo e($errors->has('name') ? ' has-error' : ''); ?>">
        <label for="name" class="col-md-4 control-label"><?php echo e(__('frontside.user.name')); ?></label>

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

            <?php if($errors->has('name')): ?>
                <span class="help-block">
                                <strong><?php echo e(strtr($errors->first('name'),$tr)); ?></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"><?php echo e(__('frontside.user.lname')); ?></label>

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

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

    <div class="form-group<?php echo e($errors->has('phone') ? ' has-error' : ''); ?>">
        <label for="phone" class="col-md-4 control-label"><?php echo e(__('frontside.user.phone')); ?></label>

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

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

    <div class="form-group<?php echo e($errors->has('address') ? ' has-error' : ''); ?>">
        <label for="address" class="col-md-4 control-label"><?php echo e(__('frontside.user.address')); ?></label>

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

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

    <div class="form-group<?php echo e($errors->has('zip_city') ? ' has-error' : ''); ?>">
        <label for="address" class="col-md-4 control-label"><?php echo e(__('frontside.user.zip_city')); ?></label>

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

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

    <div class="form-group<?php echo e($errors->has('company') ? ' has-error' : ''); ?>">
        <label for="company" class="col-md-4 control-label"><?php echo e(__('frontside.user.company')); ?></label>

        <div class="col-md-6">
            
            <textarea id="company"  name="company" class="form-control" rows="3" ><?php echo e(old('company', $user->company_info)); ?></textarea>

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

    <div class="form-group<?php echo e($errors->has('current_password') ? ' has-error' : ''); ?>">
        <label for="address" class="col-md-4 control-label"><?php echo e(__('frontside.user.current_password')); ?></label>

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

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



    <div class="form-group">
        <div class="col-md-6 col-md-offset-4">
            <button type="submit" class="btn btn-primary">
                <?php echo e(__('frontside.common.update_btn')); ?>

            </button>
        </div>
    </div>
</form>