<?php $__env->startSection('content'); ?>
    <div class="side-title">
        <h3><?php echo e($head ?? ''); ?></h3>
    </div>


    <div class="border-item">
        <ul class="nav nav-pills bg-nav-pills nav-justified mb-3">
            <li class="nav-item">
                <a href="#user_info" data-toggle="tab" aria-expanded="false" class="nav-link rounded-0 active">
                    <i class="mdi mdi-home-variant d-lg-none d-block mr-1"></i>
                    <span class="d-none d-lg-block"><?php echo e(__('orders.user_info')); ?></span>
                </a>
            </li>
            <li class="nav-item">
                <a href="#store_info" data-toggle="tab" aria-expanded="false" class="nav-link rounded-0">
                    <i class="mdi mdi-home-variant d-lg-none d-block mr-1"></i>
                    <span class="d-none d-lg-block"><?php echo e(__('orders.store_info')); ?></span>
                </a>
            </li>
            <li class="nav-item">
                <a href="#details" data-toggle="tab" aria-expanded="false" class="nav-link rounded-0">
                    <i class="mdi mdi-home-variant d-lg-none d-block mr-1"></i>
                    <span class="d-none d-lg-block"><?php echo e(__('orders.details')); ?></span>
                </a>
            </li>
            <li class="nav-item">
                <a href="#payment_info" data-toggle="tab" aria-expanded="false" class="nav-link rounded-0">
                    <i class="mdi mdi-home-variant d-lg-none d-block mr-1"></i>
                    <span class="d-none d-lg-block"><?php echo e(__('orders.payment_info')); ?></span>
                </a>
            </li>
            <li class="nav-item">
                <a href="#address" data-toggle="tab" aria-expanded="false" class="nav-link rounded-0">
                    <i class="mdi mdi-home-variant d-lg-none d-block mr-1"></i>
                    <span class="d-none d-lg-block"><?php echo e(__('orders.address_details')); ?></span>
                </a>
            </li>
            <li class="nav-item">
                <a href="#products" data-toggle="tab" aria-expanded="false" class="nav-link rounded-0">
                    <i class="mdi mdi-home-variant d-lg-none d-block mr-1"></i>
                    <span class="d-none d-lg-block"><?php echo e(__('orders.products')); ?></span>
                </a>
            </li>
            <li class="nav-item">
                <a href="#rates" data-toggle="tab" aria-expanded="false" class="nav-link rounded-0">
                    <i class="mdi mdi-home-variant d-lg-none d-block mr-1"></i>
                    <span class="d-none d-lg-block"><?php echo e(__('orders.rates')); ?></span>
                </a>
            </li>
            <li class="nav-item">
                <a href="#complaints" data-toggle="tab" aria-expanded="false" class="nav-link rounded-0">
                    <i class="mdi mdi-home-variant d-lg-none d-block mr-1"></i>
                    <span class="d-none d-lg-block"><?php echo e(__('orders.complaints')); ?></span>
                </a>
            </li>

        </ul>
        <section class="form-row" >


            <div class="tab-content col-lg-12">
                <div class="tab-pane active" id="user_info">
                    <div class="row">
                        <div class="col-lg-12">
                            <h3>
                                <?php echo e(__('orders.user_info')); ?>

                            </h3>
                            <hr>
                        </div>
                        <div class="form-group col-lg-6">
                            <label><?php echo e(__('orders.user_name')); ?> </label>
                            <p class="form-control" style="height: auto"><?php echo e($order->user->name ?? ''); ?></p>
                        </div>
                        <div class="form-group col-lg-6">
                            <label><?php echo e(__('orders.user_phone')); ?> </label>
                            <p class="form-control" style="height: auto"><?php echo e($order->user->phone ?? ''); ?></p>
                        </div>

                    </div>
                </div>
                <div class="tab-pane" id="store_info">
                    <div class="row">
                        <div class="col-lg-12">
                            <h3>
                                <?php echo e(__('orders.store_info')); ?>

                            </h3>
                            <hr>
                        </div>
                        <div class="form-group col-lg-6">
                            <label><?php echo e(__('orders.store.name')); ?> </label>
                            <p class="form-control" style="height: auto"><?php echo e($order->store->name ?? ''); ?></p>
                        </div>
                        <div class="form-group col-lg-6">
                            <label><?php echo e(__('orders.store.branch')); ?> </label>
                            <p class="form-control" style="height: auto"><?php echo e($order->branch->name ?? ''); ?></p>
                        </div>
                        <div class="form-group col-lg-6">
                            <label><?php echo e(__('orders.status')); ?> </label>
                            <p class="form-control" style="height: auto"><?php echo e(__('orders.statuses.'.$order->status)); ?></p>
                        </div>
                        <div class="form-group col-lg-6">
                            <label><?php echo e(__('orders.order_date')); ?> </label>
                            <p class="form-control" style="height: auto"><?php echo e($order->date ?? ''); ?></p>
                        </div>
                        <div class="form-group col-lg-6" >
                            <h4><?php echo e(__('orders.store.logo')); ?> </h4>
                            <img style="width: 100%;height: 30pc" src="<?php echo e(asset($order->store->logo)); ?>"/>
                        </div>

                    </div>
                </div>
                <div class="tab-pane " id="details">
                    <div class="row">
                        <form class="form-row" method="post" onsubmit="saveForm(this)" action="<?php echo e($action); ?>" enctype="multipart/form-data">
                            <?php echo method_field('PUT'); ?>
                            <?php echo csrf_field(); ?>
                            <div class="col-lg-12">
                                <h3>
                                    <?php echo e(__('orders.details')); ?>

                                </h3>
                                <hr>
                            </div>
                            <div class="form-group col-lg-6">
                                <label><?php echo e(__('orders.status')); ?> </label>
                                <select name="status" class="form-control">
                                    <?php $__currentLoopData = $statuses; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $row): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                        <option <?php echo e($order->status == $row ? 'selected' : ''); ?> value="<?php echo e($row); ?>"><?php echo e(__('orders.statuses.'.$row)); ?></option>
                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                </select>
                            </div>
                            <div class="form-group col-lg-6">
                                <label><?php echo e(__('orders.id')); ?> </label>
                                <p class="form-control" style="height: auto"><?php echo e($order->id); ?></p>
                            </div>
                            <div class="form-group col-lg-6">
                                <label><?php echo e(__('orders.date')); ?> </label>
                                <p class="form-control" style="height: auto"><?php echo e($order->date); ?></p>
                            </div>

                            <div class="form-group col-lg-6">
                                <label><?php echo e(__('orders.payment_status')); ?> </label>
                                <p class="form-control" style="height: auto"><?php echo e(__('orders.payment_statuses.'.$order->payment_status)); ?></p>
                            </div>

                            <div class="form-group col-lg-6">
                                <label><?php echo e(__('orders.note')); ?> </label>
                                <p class="form-control" style="height: auto"><?php echo e($order->note); ?></p>
                            </div>

                            <div class="text-center mt-5 col-12">
                            <button class="butn"><span><?php echo e(__('dashboard.save')); ?></span></button>
                        </div>
                        </form>
                    </div>

                </div>
                <div class="tab-pane " id="payment_info">
                    <div class="row">
                        <div class="col-lg-12">
                            <h3>
                                <?php echo e(__('orders.payment_info')); ?>

                            </h3>
                            <hr>
                        </div>
                        <div class="form-group col-lg-6">
                            <label><?php echo e(__('orders.total_tax')); ?> </label>
                            <p class="form-control" style="height: auto"><?php echo e($order->total_tax ?? ''); ?></p>
                        </div>
                        <div class="form-group col-lg-6">
                            <label><?php echo e(__('orders.shipping_cost')); ?> </label>
                            <p class="form-control" style="height: auto"><?php echo e($order->shipping_cost ?? ''); ?></p>
                        </div>
                        <div class="form-group col-lg-6">
                            <label><?php echo e(__('orders.on_hand_cost')); ?> </label>
                            <p class="form-control" style="height: auto"><?php echo e($order->on_hand_cost ?? ''); ?></p>
                        </div>
                        <div class="form-group col-lg-6">
                            <label><?php echo e(__('orders.total_products')); ?> </label>
                            <p class="form-control" style="height: auto"><?php echo e($order->total_products ?? ''); ?></p>
                        </div>
                        <div class="form-group col-lg-6">
                            <label><?php echo e(__('orders.discount')); ?> </label>
                            <p class="form-control" style="height: auto"><?php echo e($order->discount ?? ''); ?></p>
                        </div>
                        <div class="form-group col-lg-6">
                            <label><?php echo e(__('orders.total')); ?> </label>
                            <p class="form-control" style="height: auto"><?php echo e($order->total ?? ''); ?></p>
                        </div>

                    </div>
                </div>
                <div class="tab-pane" id="address">
                    <div class="row">
                        <div class="col-lg-12">
                            <h3>
                                <?php echo e(__('orders.address_details')); ?>

                            </h3>
                            <hr>
                        </div>
                        <div class="form-group col-lg-6">
                            <label><?php echo e(__('web.address_name')); ?> </label>
                            <p class="form-control" style="height: auto"><?php echo e($order->address->name); ?></p>
                        </div>
                        <div class="form-group col-lg-6">
                            <label><?php echo e(__('orders.address')); ?> </label>
                            <p class="form-control" style="height: auto"><?php echo e($order->address->address); ?></p>
                        </div>
                        <div class="form-group col-lg-6">
                            <label><?php echo e(__('orders.city')); ?> </label>
                            <p class="form-control" style="height: auto"><?php echo e($order->address->city->currentDescription->title); ?></p>
                        </div>
                        <div class="form-group col-lg-6">
                            <label><?php echo e(__('orders.area')); ?> </label>
                            <p class="form-control" style="height: auto"><?php echo e($order->address->area->currentDescription->title); ?></p>
                        </div>
                        <div class="form-group col-lg-12">
                            <iframe
                                style='width:100%'
                                height="250"
                                frameborder="0"
                                scrolling="no"
                                marginheight="0"
                                marginwidth="0"
                                src="https://maps.google.com/maps?q=<?php echo e($order->address->latitude.', '.$order->address->longitude); ?>&z=15&output=embed"
                            >
                            </iframe>
                        </div>


                    </div>
                </div>
                <div class="tab-pane" id="products">
                    <div class="row">
                        <div class="col-lg-12">
                            <h3>
                                <?php echo e(__('orders.products')); ?>

                            </h3>
                            <hr>
                        </div>
                        <div class="col-lg-12">
                            <?php $__currentLoopData = $order->products; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key=>$row): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                <div class="col-lg-12 pricing-list-item border-item mb-4"  style="background-color: rgba(21,97,203,0.1);height:auto">
                                    <div class="row">
                                        <div class="form-group col-lg-6">
                                            <label><?php echo e(__('orders.product_name')); ?> </label>
                                            <p class="form-control" style="height: auto"><?php echo e($row->product->currentDescription->title); ?> <?php echo e($row->item_id ? (' - '.$row->item->currentDescription->title ) : ''); ?></p>
                                        </div>
                                        <div class="form-group col-lg-6">
                                            <label><?php echo e(__('orders.product_main_category')); ?> </label>
                                            <p class="form-control" style="height: auto"><?php echo e($row->product->category->currentDescription->title); ?></p>
                                        </div>
                                        
                                        <div class="form-group col-lg-6">
                                            <label><?php echo e(__('orders.count')); ?> </label>
                                            <p class="form-control" style="height: auto"><?php echo e($row->count); ?></p>
                                        </div>
                                        <div class="form-group col-lg-6">
                                            <label><?php echo e(__('orders.product_cost')); ?> </label>
                                            <p class="form-control" style="height: auto"><?php echo e($row->total); ?></p>
                                        </div>
                                        <?php if(count($row->additions)): ?>
                                            <div class="col-lg-12 row">
                                                <div class="form-group col-lg-6">
                                                    <h4><?php echo e(__('orders.additions')); ?> </h4>
                                                </div>
                                                <div class="form-group col-lg-6"></div>
                                                <?php $__currentLoopData = $row->additions; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $add): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                    <div class="form-group col-lg-6">
                                                        <p class="form-control" style="height: auto"><?php echo e($add->addition->currentDescription->title); ?></p>
                                                    </div>
                                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                            </div>
                                        <?php endif; ?>

                                    </div>
                                </div>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                        </div>

                    </div>
                </div>
                <div class="tab-pane" id="rates">
                    <div class="row">
                        <div class="col-lg-12">
                            <h3>
                                <?php echo e(__('orders.rates')); ?>

                            </h3>
                            <hr>
                        </div>
                        <div class="col-lg-12">
                            <?php $__currentLoopData = $order->rates; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key=>$row): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                <div class="col-lg-12 pricing-list-item border-item mb-4"  style="background-color: rgba(21,97,203,0.1);height:auto">
                                    <div class="row">
                                        <div class="form-group col-lg-6">
                                            <label><?php echo e(__('orders.rate')); ?> </label>
                                            <p class="form-control" style="height: auto"><?php echo e($row->rate); ?></p>
                                        </div>
                                        <div class="form-group col-lg-6">
                                            <label><?php echo e(__('orders.comment')); ?> </label>
                                            <p class="form-control" style="height: auto"><?php echo e($row->comment); ?></p>
                                        </div>
                                        <div class="form-group col-lg-6">
                                            <label><?php echo e(__('orders.date')); ?> </label>
                                            <p class="form-control" style="height: auto"><?php echo e($row->date); ?></p>
                                        </div>

                                    </div>
                                </div>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                        </div>
                        <?php if(!$order->rateStore && $order->status == \Modules\Order\Enums\OrderStatusEnum::RECEIVED->value): ?>
                            <div class="col-lg-12">
                                <form class="form-row" method="post" onsubmit="saveForm(this)" action="<?php echo e(route('order.rate',$order->id)); ?>" enctype="multipart/form-data">
                                    <?php echo method_field('PUT'); ?>
                                    <?php echo csrf_field(); ?>

                                    <div class="form-group col-lg-6">
                                        <label><?php echo e(__('orders.rate')); ?> </label>
                                        <select name="rate" class="form-control">
                                            <?php for($i=1;$i<=5;$i++): ?>
                                                <option value="<?php echo e($i); ?>"><?php echo e($i); ?></option>
                                            <?php endfor; ?>
                                        </select>
                                    </div>
                                    <div class="form-group col-lg-6">
                                        <label><?php echo e(__('orders.comment')); ?> </label>
                                        <input type="text" name="comment" class="form-control" placeholder="<?php echo e(__('orders.comment')); ?>">
                                    </div>

                                    <div class="text-center mt-5 col-12">
                                        <button class="butn"><span><?php echo e(__('dashboard.save')); ?></span></button>
                                    </div>
                                </form>
                            </div>
                        <?php endif; ?>
                    </div>
                </div>
                <div class="tab-pane" id="complaints">
                    <div class="row">
                        <div class="col-lg-12">
                            <h3>
                                <?php echo e(__('orders.complaints')); ?>

                            </h3>
                            <hr>
                        </div>
                        <div class="col-lg-12">
                            <?php $__currentLoopData = $order->complaints; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key=>$row): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                <div class="col-lg-12 pricing-list-item border-item mb-4"  style="background-color: rgba(21,97,203,0.1);height:auto">
                                    <div class="row">
                                        <div class="form-group col-lg-6">
                                            <label><?php echo e(__('orders.description')); ?> </label>
                                            <p class="form-control" style="height: auto"><?php echo e($row->description); ?></p>
                                        </div>
                                        <div class="form-group col-lg-6">
                                            <label><?php echo e(__('orders.reason')); ?> </label>
                                            <p class="form-control" style="height: auto"><?php echo e($row->reason->currentDescription->title); ?></p>
                                        </div>

                                    </div>
                                </div>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                            <?php if(!$order->complaintStore && $order->status == \Modules\Order\Enums\OrderStatusEnum::RECEIVED->value): ?>
                                    <div class="col-lg-12">
                                        <form class="form-row" method="post" onsubmit="saveForm(this)" action="<?php echo e(route('order.complaint',$order->id)); ?>" enctype="multipart/form-data">
                                            <?php echo method_field('PUT'); ?>
                                            <?php echo csrf_field(); ?>

                                            <div class="form-group col-lg-6">
                                                <label><?php echo e(__('orders.reason_id')); ?> </label>
                                                <select name="reason_id" class="form-control">
                                                    <?php $__currentLoopData = $reasons; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $row): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                        <option  value="<?php echo e($row->id); ?>"><?php echo e($row->title); ?></option>
                                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                                </select>
                                            </div>
                                            <div class="form-group col-lg-6">
                                                <label><?php echo e(__('orders.description')); ?> </label>
                                                <input type="text" name="description" class="form-control" placeholder="<?php echo e(__('orders.description')); ?>">
                                            </div>

                                            <div class="text-center mt-5 col-12">
                                                <button class="butn"><span><?php echo e(__('dashboard.save')); ?></span></button>
                                            </div>
                                        </form>
                                    </div>
                                <?php endif; ?>

                        </div>

                    </div>
                </div>



            </div>
        </section>
    </div>

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

<?php $__env->startSection('inner_js'); ?>
    <!-- Editor JS orders -->
    <script src="<?php echo e(asset('/assets/admin/js/lib/tinymce.min.js')); ?>"></script>-
    <script>
        var route_prefix = "<?php echo e(url(config('lfm.prefix'))); ?>";
        var url = "<?php echo e(url('/')); ?>/";
    </script>
    <script src="<?php echo e(asset('assets/admin/js/editor.js')); ?>"></script>
    <script src="<?php echo e(asset('assets/admin/js/lfm.js')); ?>"></script>

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

<?php echo $__env->make('store.layouts.container', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/omaralyomhost/public_html/made/resources/views/store/order/form.blade.php ENDPATH**/ ?>