<?php $__env->startSection('title', 'Mi cuenta'); ?>

<?php $__env->startSection('content'); ?>
    <article id="account">
        <div class="breadcrumb">
            <div class="container d-flex align-items-center">
                <a href="<?php echo e(url('/')); ?>">Inicio</a>
                <span><?php echo $__env->yieldContent('title'); ?></span>
            </div>
        </div>
        <section>
            <div class="container">
                <?php if($errors->any()): ?>
                    <div class="alert alert-danger form-group">
                        <?php $__currentLoopData = $errors->all(); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $error): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                            <?php echo e($error); ?><br>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                    </div>
                <?php endif; ?>
                <?php if($status): ?>
                    <div class="alert alert-success form-group">
                        <?php echo e($status); ?>

                    </div>
                <?php endif; ?>
                <div class="row row-grid flex-row-reverse flex-lg-row">
                    <div class="col-lg-3">
                        <aside class="sidebar">
                            <h3>Mi cuenta</h3>
                            <ul class="list-unstyled">
                                <li>
                                    <a href="#tab-1" class="active">Pedidos <sup><?php echo e($user->orders()->confirmed()->count()); ?></sup></a>
                                </li>
                                <li>
                                    <a href="#tab-2">Datos</a>
                                </li>
                                <li>
                                    <a href="<?php echo e(route('logout')); ?>">Cerrar sesión</a>
                                </li>
                            </ul>
                        </aside>
                    </div>
                    <div class="col-lg-9">
                        <div class="tab" id="tab-1" style="display: block;">
                            <?php if($user->orders()->confirmed()->count()): ?>
                                <div class="table-responsive">
                                    <table class="table">
                                        <thead>
                                        <tr>
                                            <th>Pedido</th>
                                            <th>Fecha</th>
                                            <th>Estado</th>
                                            <th>Total</th>
                                        </tr>
                                        </thead>
                                        <tbody>
                                        <?php $__currentLoopData = $user->orders()->confirmed()->orderBy('created_at', 'desc')->get(); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $order): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                            <tr>
                                                <td>#<?php echo e($order->id); ?></td>
                                                <td><?php echo e($order->short_date); ?></td>
                                                <td><?php echo e($order->status); ?></td>
                                                <td><?php echo e(num_format($order->total)); ?></td>
                                            </tr>
                                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                        </tbody>
                                    </table>
                                </div>
                            <?php else: ?>
                                <p>Aún no realizaste ningún pedido.</p>
                            <?php endif; ?>

                        </div>
                        <div class="tab" id="tab-2">
                            <?php echo Form::model($user); ?>

                            <div class="row row-grid">
                                <div class="col-md-6">
                                    <label class="form-label">Nombre</label>
                                    <?php echo Form::text('user_data[first_name]', null, ['class' => 'form-control', 'required']); ?>

                                </div>
                                <div class="col-md-6">
                                    <label class="form-label">Apellido</label>
                                    <?php echo Form::text('user_data[last_name]', null, ['class' => 'form-control', 'required']); ?>

                                </div>
                                <div class="col-md-6">
                                    <label class="form-label">Teléfono</label>
                                    <?php echo Form::text('user_data[phone]', null, ['class' => 'form-control', 'required']); ?>

                                </div>
                                <div class="col-md-6">
                                    <label class="form-label">Email</label>
                                    <?php echo Form::text('email', null, ['class' => 'form-control', 'required']); ?>

                                </div>
                                <div class="col-12">
                                </div>
                                <div class="col-md-4">
                                    <label class="form-label">Contraseña actual</label>
                                    <?php echo Form::password('password', ['class' => 'form-control']); ?>

                                </div>
                                <div class="col-md-4">
                                    <label class="form-label">Nueva contraseña</label>
                                    <?php echo Form::password('new_password', ['class' => 'form-control']); ?>

                                </div>
                                <div class="col-md-4">
                                    <label class="form-label">Confirmar nueva contraseña</label>
                                    <?php echo Form::password('new_password_confirmation', ['class' => 'form-control']); ?>

                                </div>
                                <div class="col-12">
                                    <button type="submit" class="btn">
                                        <span>Guardar datos</span>
                                        <i class="far fa-arrow-right"></i>
                                    </button>
                                </div>
                            </div>
                            <?php echo Form::close(); ?>

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

<?php $__env->startPush('scripts'); ?>
    <script>
        $(function() {
          $('.sidebar a').on('click', function() {
            var href = $(this).attr('href');
            if(!$(href).is(':visible')) {
              $('.sidebar a').removeClass('active');
              $(this).addClass('active');
              $('.tab').hide();
              $(href).fadeIn();
            }
            return false;
          });
        });
    </script>
<?php $__env->stopPush(); ?>
<?php echo $__env->make('layouts.frontend', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/bgreen/test.bgreen.com.py/resources/views/templates/account.blade.php ENDPATH**/ ?>