<?php $__env->startSection('content'); ?>
    <style type="text/css">
        h4 {
            font-size: 18px !important;
        }

        #offer_name {
            font-size: 20px;
        }

        #offer_name1 {
            font-size: 16px;
            color: #384A50;
        }
    </style>
    <!--page-content-wrapper-->
    <div class="page-content-wrapper">
        <div class="content-page">
            <?php if(Session::has('success')): ?>
                <div class="alert alert-success" role="alert">
                    <?php echo e(Session::get('success')); ?>

                </div>
            <?php endif; ?>
            <div class="content">

                <!-- Start Content-->
                <div class="container-fluid">

                    <!-- start page title -->
                    <div class="row">
                        <div class="col-12">
                            <div class="bg-flower">
                                <img src="<?php echo e(config('app.url')); ?>/public/public/assets/assets/images/flowers/img-3.png">
                            </div>

                            <div class="bg-flower-2">
                                <img src="<?php echo e(config('app.url')); ?>/public/public/assets/assets/images/flowers/img-1.png">
                            </div>
                            <div class="card radius-10">
                                <div class="card-header">
                                    <h5 class="mb-0">OFFER ID : <span class="text-danger"><?php echo e($qry->id); ?></span></h5>
                                </div>
                                <div class="card-body">
                                    <h6>Offer Details of <b style="color:#800000"><?php echo e($qry->offer_name); ?></b></h6>
                                    <h4><b>Preview Image</b></h4>
                                    <div class="alert alert-primary" role="alert"
                                        style="height: auto;width: fit-content;">
                                        <img src="<?php echo e(asset('uploads')); ?>/<?php echo e($qry->preview_url); ?>"
                                            style="height:256px;width:256px;object-fit: fill">
                                    </div>
                                    <a href="<?php echo e(url('uploads')); ?>/<?php echo e($qry->preview_url); ?>" class="btn btn-success"
                                        target='blank'>Preview Image</a>
                                    <?php if($qry->preview_link != ''): ?>
                                        <a href=" <?php echo e($qry->preview_link); ?>" class="btn btn-success" target='_blank'>Preview
                                            Link</a>
                                    <?php endif; ?>
                                    <div class="mt-3">
                                        <h4><b>Offer Name</b></h4>
                                        <div class="alert alert-primary " role="alert" style="height: auto;width:100%;">
                                            <span id="offer_name"><?php echo e($qry->offer_name); ?></span>
                                        </div>
                                    </div>

                                    <div class="mt-3">
                                        <h4><b>Offer Details</b></h4>
                                        <div class="alert border" role="alert" style="height: auto;width:100%;">
                                            <span id="offer_name1"><?php echo $qry->description; ?></span>
                                        </div>
                                    </div>
                                    <div class="mt-3">
                                        <h4><b>Follow</b></h4>
                                        <div class="alert border" role="alert" style="height: auto;width:100%;">
                                            <span id="offer_name1"><?php echo $qry->verticals; ?></span>
                                        </div>
                                    </div>

                                    <div class="mt-3">
                                        <h4><b>Offer Category</b></h4>
                                        <div class="alert alert-success" role="alert" style="height: auto;width:100%;">
                                            <span id="offer_name1"><?php echo e($qry->category->category_name); ?></span>
                                        </div>
                                    </div>

                                    <div class="mt-3">
                                        <h4><b>Offer Requirements</b></h4>
                                        <div class="alert border" role="alert" style="height: auto;width:100%;">
                                            <span id="offer_name1"><?php echo $qry->requirements; ?></span>
                                        </div>
                                    </div>

                                    <div class="mt-3">
                                        <h4><b>Offer Payout</b></h4>
                                        <div class="alert alert-primary" role="alert" style="height: auto;width:100%;">

                                            <?php if($qry->payout_type == 'revshare'): ?>
                                                <span id="offer_name">RevShare</span>
                                            <?php else: ?>
                                                <span id="offer_name">
                                                    $<?php echo e(round($qry->payout, 2)); ?></span>
                                            <?php endif; ?>

                                        </div>

                                    </div>
                                    <div class="mt-3">
                                        <h4><b>Supported Only</b></h4>
                                        <div class="alert alert-success" role="alert" style="height: auto;width:100%;">
                                            <span id="offer_name1">
                                                <?php  $device=explode('|',$qry->ua_target); ?>
                                                <?php $__currentLoopData = $device; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $d): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                    <?php if($d == 'Windows'): ?>
                                                        <i class="fab fa-microsoft" title="Windows"></i>
                                                    <?php elseif($d == 'Mac'): ?>
                                                        <i class="fadeIn animated fas fa-laptop" title="Mac"></i>
                                                    <?php elseif($d == 'Iphone'): ?>
                                                        <i class="fadeIn animated fas fa-mobile-alt" title="Iphone"></i>
                                                    <?php elseif($d == 'Ipad'): ?>
                                                        <i class="fas fa-mobile" title="Ipad"></i>
                                                    <?php elseif($d == 'Android'): ?>
                                                        <i class="fadeIn animated fab fa-android" title="Android"></i>
                                                    <?php endif; ?>
                                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                            </span>
                                        </div>
                                    </div>
                                    <div class="mt-3">
                                        <h4><b>Supported Browser</b></h4>
                                        <div class="alert alert-success" role="alert" style="height: auto;width:100%;">
                                            <span id="offer_name1">
                                                <?php  $device=explode('|',$qry->browsers); ?>
                                                <?php $__currentLoopData = $device; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $d): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                    <?php if($d == 'Firefox'): ?>
                                                        <i class="fab fa-firefox-browser" title="Firefox"></i>
                                                    <?php elseif($d == 'Chrome'): ?>
                                                        <i class="fadeIn animated fab fa-chrome" title="Chrome"></i>
                                                    <?php elseif($d == 'Safari'): ?>
                                                        <i class="fadeIn animated fab fa-safari" title="Safari"></i>
                                                    <?php elseif($d == 'EDGE'): ?>
                                                        <i class="fab fa-edge" title="EDGE"></i>
                                                    <?php elseif($d == 'Internet Explorer'): ?>
                                                        <i class="fadeIn animated fab fa-internet-explorer"
                                                            title="Internet Explorer"></i>
                                                    <?php elseif($d == 'OPERA MINI'): ?>
                                                        <i class="fadeIn animated fab fa-opera" title="OPERA MINI"></i>
                                                    <?php endif; ?>
                                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                            </span>
                                        </div>
                                    </div>

                                    <div class="mt-3">
                                        <h4><b>Offer Country</b></h4>
                                        <div class="alert alert-success" role="alert" style="height: auto;width:100%;">
                                            <span id="offer_name1"><?php echo e($qry->countries); ?></span>
                                        </div>
                                    </div>

                                    <div class="mt-3">
                                        <h4><b>Prelander</b></h4>
                                        <div style="height: auto;width:100%;">
                                            <?php if(!empty($lander)): ?>
                                                <?php $__currentLoopData = $lander; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                    <div class="row my-2">
                                                        <div class="col-lg-3">
                                                            <span>Lander Name: <?php echo e($item->prelander_name); ?></span>
                                                        </div>
                                                        <div class="col-lg-3">
                                                            <span>Lander Link: <a href="<?php echo e($item->prelaner_link); ?>"><i
                                                                        class="fas fa-eye"></i></a></span>
                                                            <!--  <span>Lander Link: <?php echo e($item->prelaner_link); ?></span> -->
                                                        </div>
                                                        <div class="col-lg-3">
                                                            <span>Preview Link: <a
                                                                    href="<?php echo e($item->prelander_pvr_link); ?>"><i
                                                                        class="fas fa-eye"></i></a></span>
                                                        </div>
                                                        <div class="col-lg-3">
                                                            <button data-id="<?php echo e($item->id); ?>" class="btn btn-danger dlt_preland">Delete</button>
                                                        </div>
                                                    </div>
                                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                            <?php else: ?>
                                                <span>No Lander Found</span>
                                            <?php endif; ?>
                                        </div>
                                    </div>

                                    <!-- Signup modal content -->
                                    <div id="add-prelander" class="modal fade" tabindex="-1" role="dialog"
                                        aria-hidden="true">
                                        <div class="modal-dialog">
                                            <div class="modal-content">
                                                <div class="modal-body">
                                                    <div class="auth-brand text-center mt-2 mb-4 position-relative top-0">
                                                        <a href="index.html" class="logo-dark">
                                                            <span><img src="assets/images/logo-dark.png" alt="dark logo"
                                                                    height="22"></span>
                                                        </a>
                                                        <a href="index.html" class="logo-light">
                                                            <span><img src="assets/images/logo.png" alt="logo"
                                                                    height="22"></span>
                                                        </a>
                                                    </div>

                                                    <form class="ps-3 pe-3" action="<?php echo e(route('offer.preland')); ?>"
                                                        method="POST">
                                                        <?php echo csrf_field(); ?>
                                                        <input type="hidden" name="offerId"
                                                            value="<?php echo e($qry->id); ?>">
                                                        <div class="mb-3">
                                                            <label for="prelanderName" class="form-label">Prelander
                                                                Name</label>
                                                            <input class="form-control" name="prelandName" type="text"
                                                                id="prelanderName" required="">
                                                        </div>

                                                        <div class="mb-3">
                                                            <label for="prelanderLink" class="form-label">Prelander
                                                                Link</label>
                                                            <input class="form-control" name="prelandLink" type="text"
                                                                id="prelanderLink" required="">
                                                        </div>

                                                        <div class="mb-3">
                                                            <label for="preview-link" class="form-label">Preview
                                                                Link</label>
                                                            <input class="form-control" name="prelandPrLink"
                                                                type="text" required="" id="preview-link">
                                                        </div>

                                                        <div class="mb-3 text-center">
                                                            <button class="btn btn-primary" type="submit">Add</button>
                                                        </div>
                                                    </form>
                                                </div>
                                            </div><!-- /.modal-content -->
                                        </div><!-- /.modal-dialog -->
                                    </div><!-- /.modal -->
                                    <!-- Button trigger modal -->
                                    <!-- Add Lander modal -->
                                    <button type="button" class="btn btn-primary" data-bs-toggle="modal"
                                        data-bs-target="#add-prelander">Add Prelander</button>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <script src="https://code.jquery.com/jquery-3.5.1.js" integrity="sha256-QWo7LDvxbWT2tbbQ97B53yJnYU3WhH/C8ycbRAkjPDc="
            crossorigin="anonymous"></script>
            <script>
                $(document).ready(function (){
                    $('.dlt_preland').on('click', function() {

                        var id = $(this).data('id');
                        Swal.fire({
                            title: 'Are you sure?',
                            text: "You want to Delete this Withdraw Request ",
                            type: 'warning',
                            showCancelButton: true,
                            confirmButtonColor: '#3085d6',
                            cancelButtonColor: '#d33',
                            confirmButtonText: 'Yes, delete it!'
                        }).then((result) => {
                            if (result.value) {
                                $.ajax({
                                    method: 'get',
                                    data: {
                                        id: id
                                    },
                                    url: "<?php echo e(route('preland.delete')); ?>",
                                    async: false,
                                    dataType: 'json',
                                    success: function(result) {

                                        // console.log(result);
                                        if (!result.status) {
                                            Swal.fire('Failed', result.message,
                                                'error');
                                        } else {
                                            Swal.fire('Success', result.message,
                                                'success');
                                            location.reload();
                                        }
                                    },
                                    error: function(xhr) {

                                        if (xhr.status == 422) {
                                            $.each(xhr.responseJSON.errors,
                                                function(k, v) {
                                                    form.find('[name="' + k +
                                                        '"]').after(
                                                        '<div class="text-danger">' +
                                                        v[0] +
                                                        '</div>');
                                                });
                                        } else if (xhr.status == 419) {
                                            window.location.href = "";
                                        }
                                        // console.log(xhr);
                                    }
                                });
                            }
                        });
                    });
                });
            </script>
            <script>
                const exampleModal = document.getElementById('exampleModal')
                exampleModal.addEventListener('show.bs.modal', event => {
                    // Button that triggered the modal
                    const button = event.relatedTarget
                    // Extract info from data-bs-* attributes
                    const recipient = button.getAttribute('data-bs-whatever')
                    // If necessary, you could initiate an AJAX request here
                    // and then do the updating in a callback.
                    //
                    // Update the modal's content.
                    const modalTitle = exampleModal.querySelector('.modal-title')
                    const modalBodyInput = exampleModal.querySelector('.modal-body input')

                    modalTitle.textContent = `New message to ${recipient}`
                    modalBodyInput.value = recipient
                });
            </script>
        <?php $__env->stopSection(); ?>
        <?php $__env->startSection('js'); ?>
        <?php $__env->stopSection(); ?>

<?php echo $__env->make('admin.layout.admin-dashboard', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/fiverrbdbse/public_html/backend/resources/views/admin/offer/offer_detail.blade.php ENDPATH**/ ?>