

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

<?php $__env->startPush('styles'); ?>
    <link href="plugins/custom/datatables/datatables.bundle.css" rel="stylesheet" type="text/css"/>
    <link href="css/daterangepicker.min.css" rel="stylesheet" type="text/css"/>
    <style>
        .table thead,
        .table th,
        .table td {
            text-align: center;
            font-family: 'Font Awesome 5 Free';
        }

        table.table-bordered.dataTable th,
        table.table-bordered.dataTable td {
            font-family: 'Font Awesome 5 Free' !important;
            font-size: 16px !important;
        }

        #dataTable tbody td {
            /*border: 1px solid #dddddd; !* Add a 1px solid border with a light gray color *!*/
            padding: 8px;
            text-align: center;
            /* Adjust text alignment as needed */
        }

        .table-striped > tbody > tr:nth-child(odd) > td {
            background-color: rgba(248, 234, 234, 0.93);
        }

        .test-width {
            display: grid;
            grid-template-columns: repeat(1, minmax(0, 1fr));
            gap: 5px;
        }

        .tag-width {
            display: grid;
            grid-template-columns: repeat(4, minmax(0, 1fr));
            gap: 5px;
        }

        .img-size {
            /* 	padding: 0;
             margin: 0; */
            height: 450px;
            width: 337px;
            background-size: cover;
            overflow: hidden;
        }

        .modal-content {
            width: 700px;
            border: none;
        }

        .modal-body {
            padding: 0;
        }

        .carousel-control-prev-icon {
            background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23009be1' viewBox='0 0 8 8'%3E%3Cpath d='M5.25 0l-4 4 4 4 1.5-1.5-2.5-2.5 2.5-2.5-1.5-1.5z'/%3E%3C/svg%3E");
            width: 30px;
            height: 48px;
        }

        .carousel-control-next-icon {
            background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23009be1' viewBox='0 0 8 8'%3E%3Cpath d='M2.75 0l-1.5 1.5 2.5 2.5-2.5 2.5 1.5 1.5 4-4-4-4z'/%3E%3C/svg%3E");
            width: 30px;
            height: 48px;
        }

        /* Order Stats */
        .order-stats {
            font-family: 'Font Awesome 5 Free';
            background-color: #dfdfe6;
            border-radius: 10px;
            padding: 10px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            transition: all 0.3s ease;
        }

        .order-stats2 {
            max-width: 23%;
            background-color: #efedeb;
            border-radius: 10px;
            padding: 5px;
            margin-bottom: 15px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            transition: all 0.3s ease;
        }

        .order-stats__content {
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .order-stats__title {
            /*color: #0661cb;*/
            font-size: 20px;
            font-weight: 700;
        }

        .order-stats__subtitle {
            font-weight: 600;
            font-size: 15px;
            color: #334257;
            margin-bottom: 0;
        }

        .disabled-link {
            pointer-events: none;
            cursor: not-allowed;
            color: black;
        }
    </style>
<?php $__env->stopPush(); ?>

<?php $__env->startSection('content'); ?>
    <div class="d-flex flex-column-fluid zoom-container">
        <div class="container-fluid">
            <!--begin::Notice-->
            <div class="card card-custom gutter-b">
                <div class="card-header flex-wrap py-5">
                    <div class="card-title">
                        <h3 class="card-label"><i class="<?php echo e($page_icon); ?> text-primary"></i> <?php echo e($sub_title); ?></h3>
                    </div>
                </div>
            </div>
            <!--end::Notice-->
            <!--begin::Card-->
            <div class="card card-custom">
                <div class="card-header flex-wrap py-5">
                    <div class="filter-toggle btn-group float-right" style="margin-bottom: 1rem;margin-left: auto;">
                        <div class="btn btn-primary btn-sm today-btn data-btn mr-1" data-start_date="<?php echo e(date('Y-m-d')); ?>" data-end_date="<?php echo e(date('Y-m-d')); ?>">Today</div>
                        <div class="btn btn-primary btn-sm yesterday-btn data-btn mr-1" data-start_date="<?php echo e(date('Y-m-d', strtotime('yesterday'))); ?>"
                             data-end_date="<?php echo e(date('Y-m-d', strtotime('yesterday'))); ?>">Yesterday
                        </div>
                        <div class="btn btn-primary btn-sm week-btn data-btn mr-1" data-start_date="<?php echo e(date('Y-m-d',strtotime('-7 day'))); ?>" data-end_date="<?php echo e(date('Y-m-d')); ?>">
                            This Week
                        </div>
                        <div class="btn btn-primary btn-sm month-btn data-btn mr-1" data-start_date="<?php echo e(date('Y-m').'-01'); ?>" data-end_date="<?php echo e(date('Y-m-d')); ?>">This Month</div>
                        <div class="btn btn-primary btn-sm year-btn data-btn mr-1" data-start_date="<?php echo e(date('Y').'-01-01'); ?>" data-end_date="<?php echo e(date('Y').'-12-31'); ?>">This Year
                        </div>
                    </div>
                    <form method="POST" id="form-filter" class="col-md-12 px-0">
                        <div class="row">
                            <?php if (isset($component)) { $__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4 = $component; } ?>
<?php $component = $__env->getContainer()->make(Illuminate\View\AnonymousComponent::class, ['view' => 'components.form.textbox','data' => ['labelName' => 'Mobile Number','name' => 'phone','col' => 'col-md-3']]); ?>
<?php $component->withName('form.textbox'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php $component->withAttributes(['labelName' => 'Mobile Number','name' => 'phone','col' => 'col-md-3']); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4)): ?>
<?php $component = $__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4; ?>
<?php unset($__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4); ?>
<?php endif; ?>
                            <?php if (isset($component)) { $__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4 = $component; } ?>
<?php $component = $__env->getContainer()->make(Illuminate\View\AnonymousComponent::class, ['view' => 'components.form.textbox','data' => ['labelName' => 'Invoice No.','name' => 'invoice_no','col' => 'col-md-3']]); ?>
<?php $component->withName('form.textbox'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php $component->withAttributes(['labelName' => 'Invoice No.','name' => 'invoice_no','col' => 'col-md-3']); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4)): ?>
<?php $component = $__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4; ?>
<?php unset($__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4); ?>
<?php endif; ?>
                            <div class="form-group col-md-3">
                                <label for="name">Choose Your Date</label>
                                <div class="input-group">
                                    <input type="text" class="form-control daterangepicker-filed">
                                    <input type="hidden" id="start_date" name="start_date">
                                    <input type="hidden" id="end_date" name="end_date">
                                </div>
                            </div>
                            <?php if(Auth::user()->warehouse_id): ?>
                                <input type="hidden" name="warehouse_id" id="warehouse_id"
                                       value="<?php echo e(Auth::user()->warehouse_id); ?>">
                            <?php else: ?>
                                <?php if (isset($component)) { $__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4 = $component; } ?>
<?php $component = $__env->getContainer()->make(Illuminate\View\AnonymousComponent::class, ['view' => 'components.form.selectbox','data' => ['labelName' => 'Showroom','name' => 'warehouse_id','col' => 'col-md-3','class' => 'selectpicker']]); ?>
<?php $component->withName('form.selectbox'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php $component->withAttributes(['labelName' => 'Showroom','name' => 'warehouse_id','col' => 'col-md-3','class' => 'selectpicker']); ?>
                                    <?php if(!$warehouses->isEmpty()): ?>
                                        <?php $__currentLoopData = $warehouses; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $value): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                            <option value="<?php echo e($value->id); ?>"><?php echo e($value->name); ?></option>
                                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                    <?php endif; ?>
                                 <?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4)): ?>
<?php $component = $__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4; ?>
<?php unset($__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4); ?>
<?php endif; ?>
                            <?php endif; ?>
                            <?php if (isset($component)) { $__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4 = $component; } ?>
<?php $component = $__env->getContainer()->make(Illuminate\View\AnonymousComponent::class, ['view' => 'components.form.selectbox','data' => ['labelName' => 'Customer','name' => 'customer_id','col' => 'col-md-3','class' => 'selectpicker']]); ?>
<?php $component->withName('form.selectbox'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php $component->withAttributes(['labelName' => 'Customer','name' => 'customer_id','col' => 'col-md-3','class' => 'selectpicker']); ?>
                                <?php if(!$customers->isEmpty()): ?>
                                    <?php $__currentLoopData = $customers; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $value): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                        <option value="<?php echo e($value->id); ?>">
                                            <?php echo e($value->name . ($value->mobile ? ' - ' . $value->mobile : '')); ?></option>
                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                <?php endif; ?>
                             <?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4)): ?>
<?php $component = $__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4; ?>
<?php unset($__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4); ?>
<?php endif; ?>
                            <?php if (isset($component)) { $__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4 = $component; } ?>
<?php $component = $__env->getContainer()->make(Illuminate\View\AnonymousComponent::class, ['view' => 'components.form.selectbox','data' => ['labelName' => 'Status','name' => 'delivery_status','class' => 'selectpicker','col' => 'col-md-3']]); ?>
<?php $component->withName('form.selectbox'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php $component->withAttributes(['labelName' => 'Status','name' => 'delivery_status','class' => 'selectpicker','col' => 'col-md-3']); ?>
                                <option value="1">NEW ORDER</option>
                                <option value="2">PENDING</option>
                                <option value="3">PENDING PAYMENT</option>
                                <option value="4">CONFIRM</option>
                                <option value="5">HOLD</option>
                                <option value="6">PROCESSING</option>
                                <option value="7">SEND TO COURIER</option>
                                <option value="8">ASSIGN TO RIDER</option>
                                <option value="9">DELIVERED</option>
                                <option value="10">RETURNED</option>
                                <option value="11">EXCHANGE</option>
                                <option value="12">CANCEL</option>
                             <?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4)): ?>
<?php $component = $__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4; ?>
<?php unset($__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4); ?>
<?php endif; ?>
                            <?php if (isset($component)) { $__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4 = $component; } ?>
<?php $component = $__env->getContainer()->make(Illuminate\View\AnonymousComponent::class, ['view' => 'components.form.selectbox','data' => ['labelName' => 'Print Status Filter','name' => 'print_status','col' => 'col-md-3']]); ?>
<?php $component->withName('form.selectbox'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php $component->withAttributes(['labelName' => 'Print Status Filter','name' => 'print_status','col' => 'col-md-3']); ?>
                                <option value="0">No Print</option>
                                <option value="2">Double Print</option>
                             <?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4)): ?>
<?php $component = $__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4; ?>
<?php unset($__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4); ?>
<?php endif; ?>

                            <?php if (isset($component)) { $__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4 = $component; } ?>
<?php $component = $__env->getContainer()->make(Illuminate\View\AnonymousComponent::class, ['view' => 'components.form.selectbox','data' => ['labelName' => 'Payment Status','name' => 'payment_status','col' => 'col-md-3','class' => 'selectpicker']]); ?>
<?php $component->withName('form.selectbox'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php $component->withAttributes(['labelName' => 'Payment Status','name' => 'payment_status','col' => 'col-md-3','class' => 'selectpicker']); ?>
                                <?php $__currentLoopData = PAYMENT_STATUS; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $value): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                    <option value="<?php echo e($key); ?>"><?php echo e($value); ?></option>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                             <?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4)): ?>
<?php $component = $__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4; ?>
<?php unset($__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4); ?>
<?php endif; ?>
                            <?php if (isset($component)) { $__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4 = $component; } ?>
<?php $component = $__env->getContainer()->make(Illuminate\View\AnonymousComponent::class, ['view' => 'components.form.selectbox','data' => ['labelName' => 'Courier Status','name' => 'courier_status','col' => 'col-md-3','class' => 'selectpicker']]); ?>
<?php $component->withName('form.selectbox'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php $component->withAttributes(['labelName' => 'Courier Status','name' => 'courier_status','col' => 'col-md-3','class' => 'selectpicker']); ?>
                                <?php $__currentLoopData = $courier; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $value): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                    <option value="<?php echo e($value->id); ?>"><?php echo e($value->name); ?></option>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                             <?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4)): ?>
<?php $component = $__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4; ?>
<?php unset($__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4); ?>
<?php endif; ?>
                            <?php if (isset($component)) { $__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4 = $component; } ?>
<?php $component = $__env->getContainer()->make(Illuminate\View\AnonymousComponent::class, ['view' => 'components.form.selectbox','data' => ['labelName' => 'Created By','name' => 'created_by','col' => 'col-md-3','class' => 'selectpicker']]); ?>
<?php $component->withName('form.selectbox'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php $component->withAttributes(['labelName' => 'Created By','name' => 'created_by','col' => 'col-md-3','class' => 'selectpicker']); ?>
                                <?php $__currentLoopData = $created_by; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $value): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                    <option value="<?php echo e($value->created_by); ?>"><?php echo e($value->user_name); ?></option>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                             <?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4)): ?>
<?php $component = $__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4; ?>
<?php unset($__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4); ?>
<?php endif; ?>

                            <div class="col-md-2">
                                <div style="margin-top:28px;">
                                    <button id="btn-reset" class="btn btn-danger btn-sm btn-elevate btn-icon" type="button"
                                            data-toggle="tooltip" data-theme="dark" title="Reset">
                                        <i class="fas fa-undo-alt"></i></button>

                                    <button id="btn-filter" class="btn btn-primary btn-sm btn-elevate btn-icon mr-2"
                                            type="button" data-toggle="tooltip" data-theme="dark" title="Search">
                                        <i class="fas fa-search"></i></button>
                                </div>
                            </div>
                        </div>
                    </form>
                    <div class="row order-stats w-100">
                        <div class="col-md-3 order-stats2">
                            <a class="disabled-link" href="#">
                                <div class="order-stats__content" style="text-align: left;">
                                    <h6 class="order-stats__subtitle">New Order</h6>
                                </div>
                                <h6 class="order-stats__subtitle" id="new_order">0</h6>
                            </a>
                            <span class="order-stats__title text-info" id="new_order_value">0 ৳</span>
                        </div>
                        <div class="col-md-3 order-stats2">
                            <a class="disabled-link" href="#">
                                <div class="order-stats__content" style="text-align: left;">
                                    <h6 class="order-stats__subtitle">Pending</h6>
                                </div>
                                <h6 class="order-stats__subtitle" id="pending_order">0</h6>
                            </a>
                            <span class="order-stats__title text-danger" id="pending_order_value">0 ৳</span>
                        </div>
                        <div class="col-md-3 order-stats2">
                            <a class="disabled-link" href="#">
                                <div class="order-stats__content" style="text-align: left;">
                                    <h6 class="order-stats__subtitle">Pending Payment</h6>
                                </div>
                                <h6 class="order-stats__subtitle" id="pending_payment">0</h6>
                            </a>
                            <span class="order-stats__title text-primary" id="pending_payment_value">0 ৳</span>
                        </div>
                        <div class="col-md-3 order-stats2">
                            <a class="disabled-link" href="#">
                                <div class="order-stats__content" style="text-align: left;">
                                    <h6 class="order-stats__subtitle">Confirmed</h6>
                                </div>
                                <h6 class="order-stats__subtitle" id="confirm_order">0</h6>
                            </a>
                            <span class="order-stats__title text-success" id="confirm_order_value">0 ৳</span>
                        </div>

                        <div class="col-md-3 order-stats2">
                            <a class="disabled-link" href="#">
                                <div class="order-stats__content" style="text-align: left;">
                                    <h6 class="order-stats__subtitle">Hold</h6>
                                </div>
                                <h6 class="order-stats__subtitle" id="hold_order">0</h6>
                            </a>
                            <span class="order-stats__title text-warning" id="hold_order_value">0 ৳</span>
                        </div>
                        <div class="col-md-3 order-stats2">
                            <a class="disabled-link" href="#">
                                <div class="order-stats__content" style="text-align: left;">
                                    <h6 class="order-stats__subtitle">Processing</h6>
                                </div>
                                <h6 class="order-stats__subtitle" id="processing_order">0</h6>
                            </a>
                            <span class="order-stats__title text-info" id="processing_order_value">0 ৳</span>
                        </div>
                        <div class="col-md-3 order-stats2">
                            <a class="disabled-link" href="#">
                                <div class="order-stats__content" style="text-align: left;">
                                    <h6 class="order-stats__subtitle">Send to Courier</h6>
                                </div>
                                <h6 class="order-stats__subtitle" id="send_to_courier">0</h6>
                            </a>
                            <span class="order-stats__title text-primary" id="send_to_courier_value">0 ৳</span>
                        </div>
                        <div class="col-md-3 order-stats2">
                            <a class="disabled-link" href="#">
                                <div class="order-stats__content" style="text-align: left;">
                                    <h6 class="order-stats__subtitle">Assign to Rider</h6>
                                </div>
                                <h6 class="order-stats__subtitle" id="assign_to_rider">0</h6>
                            </a>
                            <span class="order-stats__title text-info" id="assign_to_rider_value">0 ৳</span>
                        </div>

                        <div class="col-md-3 order-stats2">
                            <a class="disabled-link" href="#">
                                <div class="order-stats__content" style="text-align: left;">
                                    <h6 class="order-stats__subtitle">Delivered</h6>
                                </div>
                                <h6 class="order-stats__subtitle" id="delivered_order">0</h6>
                            </a>
                            <span class="order-stats__title text-success" id="delivered_order_value">0 ৳</span>
                        </div>
                        <div class="col-md-3 order-stats2">
                            <a class="disabled-link" href="#">
                                <div class="order-stats__content" style="text-align:left;">
                                    <h6 class="order-stats__subtitle">Returned</h6>
                                </div>
                                <h6 class="order-stats__subtitle" id="returned_order">0</h6>
                            </a>
                            <span class="order-stats__title text-warning" id="returned_order_value">0 ৳</span>
                        </div>
                        <div class="col-md-3 order-stats2">
                            <a class="disabled-link" href="#">
                                <div class="order-stats__content">
                                    <h6 class="order-stats__subtitle">Exchange</h6>
                                </div>
                                <h6 class="order-stats__subtitle" id="exchange_order">0</h6>
                            </a>
                            <span class="order-stats__title text-info" id="exchange_order_value">0 ৳</span>
                        </div>
                        <div class="col-md-3 order-stats2">
                            <a class="disabled-link" href="#">
                                <div class="order-stats__content">
                                    <h6 class="order-stats__subtitle">Cancel</h6>
                                </div>
                                <h6 class="order-stats__subtitle" id="cancel_order">0</h6>
                            </a>
                            <span class="order-stats__title text-danger" id="cancel_order_value">0 ৳</span>
                        </div>
                        <div class="col-md-3 order-stats2">
                            <a class="disabled-link" href="#">
                                <div class="order-stats__content">
                                    <h4 class="order-stats__subtitle">No of Print</h4>
                                </div>
                            </a>
                            <span class="order-stats__title text-danger" id="no_of_print">0</span>
                        </div>
                    </div>
                </div>
                <div class="card-body">
                    <!--begin: Datatable-->
                    <div id="kt_datatable_wrapper" class="dataTables_wrapper dt-bootstrap4 no-footer">
                        <div class="row">
                            <div class="col-sm-12">
                                <table id="dataTable" class="table table-bordered table-hover">
                                    <thead class="bg-primary">
                                    <tr>
                                        <th width="1%">Invoice No.</th>
                                        <th width="12%">Products</th>
                                        <th width="1%">Status</th>
                                    </tr>
                                    </thead>
                                    <tbody></tbody>
                                </table>
                            </div>
                        </div>
                    </div>
                    <!--end: Datatable-->
                </div>
            </div>
            <!--end::Card-->
        </div>
    </div>

    <?php echo $__env->make('sale::lending_order.modal', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
    <?php echo $__env->make('sale::lending_order.courierModal', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
    <?php echo $__env->make('sale::lending_order.note', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>

    <section style="opacity: 0;">

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

<?php $__env->startPush('scripts'); ?>
    <script src="plugins/custom/datatables/datatables.bundle.js" type="text/javascript"></script>
    <script src="js/moment.js"></script>
    <script src="js/knockout-3.4.2.js"></script>
    <script src="js/daterangepicker.min.js"></script>
    <script>
        $('.daterangepicker-filed').daterangepicker({
            callback: function (startDate, endDate, period) {
                var start_date = startDate.format('YYYY-MM-DD');
                var end_date = endDate.format('YYYY-MM-DD');
                var title = start_date + ' To ' + end_date;
                $(this).val(title);
                $('input[name="start_date"]').val(start_date);
                $('input[name="end_date"]').val(end_date);
            }
        });
        var table;
        $(document).ready(function () {
            table = $('#dataTable').DataTable({
                "processing": true, //Feature control the processing indicator
                "serverSide": true, //Feature control DataTable server side processing mode
                "order": [], //Initial no order
                'ordering': false,
                "responsive": false, //Make table responsive in mobile device
                "bInfo": true, //TO show the total number of data
                "bFilter": false, //For datatable default search box show/hide
                "lengthMenu": [
                    [5, 10, 15, 25, 50, 100, 1000, 10000, -1],
                    [5, 10, 15, 25, 50, 100, 1000, 10000, "All"]
                ],
                "pageLength": 25, //number of data show per page
                "language": {
                    processing: `<i class="fas fa-spinner fa-spin fa-3x fa-fw text-primary"></i> `,
                    emptyTable: '<strong class="text-danger">No Data Found</strong>',
                    infoEmpty: '',
                    zeroRecords: '<strong class="text-danger">No Data Found</strong>'
                },
                "ajax": {
                    "url": "<?php echo e(route('lendingOrder.datatable.data')); ?>",
                    "type": "POST",
                    "data": function (data) {
                        data.invoice_no = $("#form-filter #invoice_no").val();
                        data.warehouse_id = $("#form-filter #warehouse_id").val();
                        data.start_date = $("#form-filter #start_date").val();
                        data.end_date = $("#form-filter #end_date").val();
                        data.customer_id = $("#form-filter #customer_id").val();
                        data.delivery_status = $("#form-filter #delivery_status").val();
                        data._token = _token;
                    }
                },
                "columnDefs": [{
                    'text': 'center',
                },
                ],
                "dom": "<'row'<'col-sm-12 col-md-6'l><'col-sm-12 col-md-6' <'float-right'B>>>" +
                    "<'row'<'col-sm-12'tr>>" +
                    "<'row'<'col-sm-12 col-md-5'i><'col-sm-12 col-md-7'<'float-right'p>>>",
                "buttons": [],
            });

            $('#btn-filter').click(function () {
                table.ajax.reload();
            });

            $('#btn-reset').click(function () {
                $('#form-filter')[0].reset();
                $('#form-filter .selectpicker').selectpicker('refresh');
                table.ajax.reload();
            });

            $(document).on('click', '.delete_data', function () {
                let id = $(this).data('id');
                let name = $(this).data('name');
                let row = table.row($(this).parent('tr'));
                let url = "<?php echo e(route('lendingOrder.delete')); ?>";
                delete_data(id, url, table, row, name);
            });

            //Show Status Change Modal
            $(document).on('click', '.change_status', function () {
                $('#approve_status_form #status_id').val($(this).data('id'));
                $('#approve_status_form #delivery_status').val($(this).data('delivery_status'));
                // $('#approve_status_form #note').val($(this).data('note'));
                // $('#approve_status_form #phone').val($(this).data('phone'));
                // $('#approve_status_form #email').val($(this).data('email'));
                $('#approve_status_form #visa_status.selectpicker').selectpicker('refresh');
                $('#approve_status_modal').modal({
                    keyboard: false,
                    backdrop: 'static',
                });
                $('#approve_status_modal .modal-title').html('<span><?php echo e(__('Change Status')); ?></span>');
                $('#approve_status_modal #status-btn').text('<?php echo e(__('Change Status')); ?>');
            });

            $(document).on('click', '#status-btn', function () {
                var status_id = $('#approve_status_form #status_id').val();
                var delivery_status = $('#approve_status_form #delivery_status').val();
                var note = $('#approve_status_form #note').val();
                // var phone = $('#approve_status_form #phone').val();
                // var email = $('#approve_status_form #email').val();
                // console.log(visa_status);
                $.ajax({
                    url: "<?php echo e(route('lendingOrder.change.status')); ?>",
                    type: "POST",
                    data: {status_id: status_id, delivery_status: delivery_status, note: note, _token: _token},
                    dataType: "JSON",
                    beforeSend: function () {
                        $('#status-btn').addClass('kt-spinner kt-spinner--md kt-spinner--light');
                    },
                    complete: function () {
                        $('#status-btn').removeClass('kt-spinner kt-spinner--md kt-spinner--light');
                    },
                    success: function (data) {
                        notification(data.status, data.message);
                        if (data.status == 'success') {
                            $('#approve_status_modal').modal('hide');
                            table.ajax.reload(null, false);
                        }
                    },
                    error: function (xhr, ajaxOption, thrownError) {
                        console.log(thrownError + '\r\n' + xhr.statusText + '\r\n' + xhr.responseText);
                    }
                });
            });

            //Show Status Courier Modal
            $(document).on('click', '.courier_status', function () {
                $('#courier_status_form #status_id').val($(this).data('id'));
                $('#courier_status_form #courier_status').val($(this).data('courier_status'));
                $('#courier_status_form #courier_status.selectpicker').selectpicker('refresh');
                $('#courier_status_modal').modal({
                    keyboard: false,
                    backdrop: 'static',
                });
                $('#courier_status_modal .modal-title').html('<span><?php echo e(__('Change Status')); ?></span>');
                $('#courier_status_modal #status-btn').text('<?php echo e(__('Change Status')); ?>');

            });

            $(document).on('click', '#status-btn', function () {
                var status_id = $('#courier_status_form #status_id').val();
                var courier_status = $('#courier_status_form #courier_status').val();
                $.ajax({
                    url: "<?php echo e(route('lendingOrder.change.courier.status')); ?>",
                    type: "POST",
                    data: {status_id: status_id, courier_status: courier_status, _token: _token},
                    dataType: "JSON",
                    beforeSend: function () {
                        $('#status-btn').addClass('kt-spinner kt-spinner--md kt-spinner--light');
                    },
                    complete: function () {
                        $('#status-btn').removeClass('kt-spinner kt-spinner--md kt-spinner--light');
                    },
                    success: function (data) {
                        notification(data.status, data.message);
                        if (data.status == 'success') {
                            $('#courier_status_modal').modal('hide');
                            table.ajax.reload(null, false);
                        }
                    },
                    error: function (xhr, ajaxOption, thrownError) {
                        console.log(thrownError + '\r\n' + xhr.statusText + '\r\n' + xhr.responseText);
                    }
                });
            });

            //Order Note Modal
            $(document).on('click', '.view_data', function () {
                let id = $(this).data('id');
                if (id) {
                    $.ajax({
                        url: "<?php echo e(route('lendingOrder.note.view')); ?>",
                        type: "POST",
                        data: {id: id, _token: _token},
                        success: function (data) {
                            $('#view_modal #view-data').html('');
                            $('#view_modal #view-data').html(data);
                            $('#view_modal').modal({
                                keyboard: false,
                                backdrop: 'static',
                            });
                        },
                        error: function (xhr, ajaxOption, thrownError) {
                            console.log(thrownError + '\r\n' + xhr.statusText + '\r\n' + xhr.responseText);
                        }
                    });
                }
            });

            $(document).on('click', '.show-image', function () {
                let id = $(this).data('id');
                let imagePath = $(this).data('image_path');
                console.log(imagePath, 'dddd');

                if (id) {
                    $.ajax({
                        url: "<?php echo e(route('lendingOrder.image.show')); ?>",
                        type: "get",
                        async: false,
                        data: {
                            id: id
                        },
                        dataType: "JSON",
                        success: function (data) {
                            if (data !== null) {
                                let html = '';
                                $('#imageList').empty();

                                $.each(data.image, function (key, filename) {
                                    let new_list = imagePath + '/' + filename;
                                    html += '<div class="carousel-item ' + (key === 0 ?
                                            'active' : '') +
                                        '"><img class="img-size" src="' + new_list +
                                        '" alt="' + filename + '" /></div>';
                                });
                                $('#imageList').append(html);
                            }
                        },
                        error: function (xhr, ajaxOption, thrownError) {
                            console.log(thrownError + '\r\n' + xhr.statusText + '\r\n' + xhr.responseText);
                        }
                    });
                }
            });
        });
    </script>
<?php $__env->stopPush(); ?>

<?php echo $__env->make('layouts.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/iconshoppercom/iconshopper/Modules/Sale/Resources/views/lending_order/index.blade.php ENDPATH**/ ?>