<?php $__env->startSection('content'); ?>
    <link href="https://cdn.jsdelivr.net/npm/select2@4.1.0-beta.1/dist/css/select2.min.css" rel="stylesheet" />
    <!-- Select2 css -->
    <link href="<?php echo e(config('app.url')); ?>/public/public/assets/assets/vendor/select2/css/select2.min.css" rel="stylesheet"
        type="text/css" />

    


    <div class="page-content-wrapper">
    <div class="content-page">
                <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">
                            <h4><?php echo e(isset($offer) ? 'Update' : 'Add'); ?> Offer</h4>

                        </div>

                        <div class="card-body">
                            <?php
                            if (isset($offer)) {
                                $action = url('admin/update-offer');
                            } else {
                                $action = url('admin/insert-offer');
                            }
                            ?>
                            <form action="<?php echo e($action); ?>" method="POST" enctype="multipart/form-data">
                                <?php echo csrf_field(); ?>
                                <input type="hidden" name="id" value="<?php echo e(@$offer->id); ?>">
                                <input type="hidden" name="hidden_preview_image" value="<?php echo e(@$offer->preview_url); ?>">
                                <input type="hidden" name="hidden_icon_image" value="<?php echo e(@$offer->icon_url); ?>">
                                <div class="container">

                                    <div class="row form-group">
                                        <div class="col-lg-2">
                                            <label>Offer Name</label>
                                        </div>
                                        <div class="col-lg-8">
                                            <input type="text" name="offer_name" class="form-control"
                                                value="<?php echo e(@$offer->offer_name); ?>" required="">
                                        </div>
                                    </div>
                                    <div class="row mt-4 form-group">
                                        <div class="col-lg-2">
                                            <label>Advertiser</label>
                                        </div>
                                        <div class="col-lg-8">

                                            <select type="text" name="advertiser_id" class="form-control" required="">
                                                <option value="">Select Advertiser</option>

                                                <?php $__currentLoopData = $advertizer; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $q): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                    <option value="<?php echo e($q->id); ?>"
                                                        <?php echo e(isset($offer) ? ($offer->advertiser_id == $q->id ? 'selected' : null) : null); ?>>
                                                        <?php echo e($q->advertiser_name); ?></option>
                                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>

                                            </select>
                                        </div>
                                    </div>
                                    
                                    
                                    <div class="row mt-4 form-group">

                                        <div class="col-lg-2">
                                            <label>Follow</label>
                                        </div>
                                        <div class="col-lg-8">

                                            <input type="radio" name="verticals" value="Pay Per Lead" required=""
                                                <?php echo e(isset($offer) ? ($offer->verticals == 'Pay Per Lead' ? 'checked' : null) : null); ?>>
                                            Pay Per Lead

                                            <input type="radio" name="verticals" value="Pay Per Acquisition" required=""
                                                <?php echo e(isset($offer) ? ($offer->verticals == 'Pay Per Action' ? 'checked' : null) : null); ?>>
                                            Pay Per Action/Acquisition
                                            <input type="radio" name="verticals" value="Video Play" required=""
                                                <?php echo e(isset($offer) ? ($offer->verticals == 'Video Play' ? 'checked' : null) : null); ?>>
                                            Video Play
                                            <input type="radio" name="verticals" value="Pay Per Click" required=""
                                                <?php echo e(isset($offer) ? ($offer->verticals == 'Pay Per Click' ? 'checked' : null) : null); ?>>
                                            Pay Per Click

                                            <input type="radio" name="verticals" value="Pay Per Sale"
                                                <?php echo e(isset($offer) ? ($offer->verticals == 'Pay Per Sale' ? 'checked' : null) : null); ?>>
                                            Pay Per Sale
                                            <input type="radio" name="verticals" value="Pay Per Install"
                                                <?php echo e(isset($offer) ? ($offer->verticals == 'Pay Per Install' ? 'checked' : null) : null); ?>>
                                            Pay Per Install
                                        </div>
                                    </div>
                                    <div class="row mt-4 form-group">
                                        <div class="col-lg-2">
                                            <label>Verticals/Category</label>
                                        </div>
                                        <div class="col-lg-8">

                                            <select type="text" name="category_id" class="form-control" required="">
                                                <option value="">Select Category</option>

                                                <?php $__currentLoopData = $category; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $q): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                    <option value="<?php echo e($q->id); ?>"
                                                        <?php echo e(isset($offer) ? ($offer->category_id == $q->id ? 'selected' : null) : null); ?>>
                                                        <?php echo e($q->category_name); ?></option>
                                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                            </select>
                                        </div>
                                    </div>
                                    <div class="row mt-4 form-group">
                                        <div class="col-lg-2">
                                            <label>Description</label>
                                        </div>
                                        <div class="col-lg-8">

                                            <textarea name="description" id="description" class="form-control" value="<?php echo e(@$offer->description); ?>" required=""><?php echo e(@$offer->description); ?></textarea>
                                        </div>
                                    </div>

                                    <div class="row mt-4 form-group">
                                        <div class="col-lg-2">
                                            <label>Restrications</label>
                                        </div>
                                        <div class="col-lg-8">

                                            <textarea name="requirements" id="requirements" class="form-control" value="<?php echo e(@$offer->requirements); ?>"
                                                required=""><?php echo e(@$offer->requirements); ?></textarea>
                                        </div>
                                    </div>

                                    <div class="row mt-4 form-group">
                                        <div class="col-lg-2">
                                            <label>Tracking Link</label>
                                        </div>
                                        <div class="col-lg-8">


                                            <input type="text" name="link" class="form-control"
                                                value="<?php echo e(@$offer->link); ?>" required="">
                                        </div>
                                    </div>
                                    <div class="row mt-4 form-group">
                                        <div class="col-lg-2">
                                            <label>Secondary Tracking Link</label>
                                        </div>
                                        <div class="col-lg-8">


                                            <input type="text" name="secondary_link" class="form-control"
                                                value="<?php echo e(@$offer->secondary_link); ?>" />
                                        </div>
                                    </div>
                                    <div class="row mt-4 form-group">
                                        <div class="col-lg-2">
                                            <label>Upload Preview Photo (Recommended: 640px X 360px)</label>
                                        </div>

                                        <div class="col-lg-8">


                                            <input type="file" name="preview_link" class="form-control">
                                        </div>
                                    </div>
                                    <div class="row mt-4 form-group">
                                        <div class="col-lg-2">
                                            <label>Preview Link</label>
                                        </div>

                                        <div class="col-lg-8">


                                            <input type="text" name="preview_url" class="form-control" value="<?php echo e(@$offer->preview_link); ?>">
                                        </div>
                                    </div>
                                    <div class="row mt-4 form-group">
                                        <div class="col-lg-2">
                                            <label>Upload Icon (Recommended: 512px X 512px)</label>
                                        </div>

                                        <div class="col-lg-8">

                                            <input type="file" name="icon_url" class="form-control">
                                        </div>
                                    </div>
                                    <div class="row mt-4 form-group">
                                        <div class="col-lg-2">
                                            <label>Lead Quantity / Capping (0=unlimited)</label>
                                        </div>
                                        <div class="col-lg-8">

                                            <input type="number " name="lead_qty" value="<?php echo e(@$offer->lead_qty); ?>"
                                                class="form-control">
                                        </div>
                                    </div>

                                    <div class="row mt-4 form-group ">
                                        <div class="col-lg-2">
                                            <label>Do you want to Overwrite Payout Percentage </label>
                                        </div>

                                        <div class="col-lg-4">

                                            <select id="payout_percentage_status" name="payout_percentage_status"
                                                class="form-control">
                                                <option value="no">No (Recommended)</option>
                                                <option value="yes">Yes</option>
                                                
                                            </select>
                                        </div>

                                    </div>
                                    <div class="row mt-4 form-group" id="custom_payout_percenteage">
                                        <div class="col-lg-2">
                                            <label>How may % will publisher get for this offer? </label>
                                        </div>

                                        <div class="col-lg-4">

                                            <input type="number" id="payout_percentage" name="payout_percentage"
                                                value="<?php echo e(@$offer->payout_percentage); ?>" class="form-control">
                                        </div>

                                    </div>
                                    <div class="row mt-4 form-group">
                                        <div class="col-lg-2">
                                            <label>Payout Type </label>
                                        </div>
                                        <div class="col-lg-4">

                                            <select name="payout" class="form-control" id="payout" required="">
                                                <option value="fixed"
                                                    <?php echo e(isset($offer) ? ($offer->payout_type == 'fixed' ? 'selected' : null) : null); ?>>
                                                    Fixed</option>
                                                <option value="revshare"
                                                    <?php echo e(isset($offer) ? ($offer->payout_type == 'revshare' ? 'selected' : null) : null); ?>>
                                                    RevShare</option>
                                            </select>
                                        </div>
                                        <div class="col-lg-2">
                                            <label>Payout Amount </label>
                                        </div>
                                        <div class="col-lg-4">

                                            <input type="text" id="payout_amount" name="payout_amount"
                                                value="<?php echo e($offer->payout); ?>" class="form-control">
                                        </div>

                                    </div>
                                    <div class="row mt-4 form-group">
                                        <div class="col-lg-2">
                                            <label> Allowed Countries</label>
                                        </div>

                                        <div class="col-lg-8">

                                            <select class="select2 form-control select2-multiple" data-toggle="select2" name="countries[]" multiple="multiple"
                                                style="width: 100%" required="">

                                                <?php if(isset($offer)): ?>
                                                <?php    $country_name = explode('|', $offer->countries); ?>
                                                <?php endif; ?>

                                                <?php $__currentLoopData = $country_list; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $q): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                    <option value="<?php echo e($q->country_name); ?>"
                                                        <?php echo e(isset($offer) ? (in_array($q->country_name, $country_name) ? 'selected' : null) : null); ?>>
                                                        <?php echo e($q->country_name); ?></option>
                                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>

                                            </select>

                                        </div>
                                    </div>
                                    <div class="row mt-4 form-group">
                                        <div class="col-lg-2">
                                            <label>Status</label>
                                        </div>
                                        <div class="col-lg-8">

                                            <select type="text" name="status" class="form-control">
                                                <option value="Inactive"
                                                    <?php echo e(isset($offer) ? ($offer->status == 'Inactive' ? 'selected' : null) : null); ?>>
                                                    Inactive</option>
                                                <option value="Active"
                                                    <?php echo e(isset($offer) ? ($offer->status == 'Active' ? 'selected' : null) : null); ?>>
                                                    Active</option>
                                            </select>
                                        </div>
                                    </div>
                                    <div class="row mt-4 form-group">
                                        <div class="col-lg-2">
                                            <label>Offer Type</label>
                                        </div>
                                        <div class="col-lg-8">

                                            <select type="text" name="offer_type" class="form-control">
                                                <option value="public"
                                                    <?php echo e(isset($offer) ? ($offer->offer_type == 'public' ? 'selected' : null) : null); ?>>
                                                    Public</option>
                                                <option value="private"
                                                    <?php echo e(isset($offer) ? ($offer->offer_type == 'private' ? 'selected' : null) : null); ?>>
                                                    Private</option>
                                                
                                            </select>
                                        </div>
                                    </div>
                                    <div class="row mt-4 form-group divhide d-none">
                                        <div class="col-lg-2">
                                            <label>Publishers</label>
                                        </div>

                                        <div class="col-lg-8">

                                            <select class="selectpicker" id="publishers" name="publishers[]" multiple
                                                data-actions-box="true">

                                                <?php if(isset($offer)): ?>
                                                    <?php $publisher_id=explode(',',$offer->publisher_id); ?>
                                                <?php endif; ?>

                                                <?php $__currentLoopData = $publisher; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $q): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                    <option value="<?php echo e($q->id); ?>"
                                                        <?php echo e(isset($offer) ? (in_array($q->id, $publisher_id) ? 'selected' : null) : null); ?>>
                                                        <?php echo e($q->name); ?></option>
                                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                            </select>
                                        </div>
                                    </div>
                                    <div class="row mt-4 form-group">
                                        <div class="col-lg-2">
                                            <label> Device/UA Target</label>
                                        </div>

                                        <div class="col-lg-8">

                                            <select class="js-example-basic-multiple" style="width: 100%"  name="ua_target[]" multiple
                                                data-actions-box="true" required="">
                                                <?php if (isset($offer)) {
                                                    $ua = explode('|', $offer->ua_target);
                                                }
                                                ?>
                                                <option value="Windows"
                                                    <?php echo e(isset($offer) ? (in_array('Windows', $ua) ? 'selected' : null) : null); ?>>
                                                    Windows</option>
                                                <option value="Android"
                                                    <?php echo e(isset($offer) ? (in_array('Android', $ua) ? 'selected' : null) : null); ?>>
                                                    Android</option>
                                                <option value="Iphone"
                                                    <?php echo e(isset($offer) ? (in_array('Iphone', $ua) ? 'selected' : null) : null); ?>>
                                                    Iphone</option>
                                                <option value="Ipad"
                                                    <?php echo e(isset($offer) ? (in_array('Ipad', $ua) ? 'selected' : null) : null); ?>>
                                                    Ipad
                                                </option>
                                                <option value="Mac"
                                                    <?php echo e(isset($offer) ? (in_array('Mac', $ua) ? 'selected' : null) : null); ?>>
                                                    Mac
                                                </option>

                                            </select>
                                        </div>
                                    </div>

                                    <div class="row mt-4 form-group">
                                        <div class="col-lg-2">
                                            <label>Allowed Browsers</label>
                                        </div>

                                        <div class="col-lg-8">

                                            <select class="js-example-basic-multiple" style="width: 100%"  name="browser[]" multiple data-actions-box="true"
                                                required="">
                                                <?php if (isset($offer)) {
                                                    $ua = explode('|', $offer->browsers);
                                                }
                                                ?>
                                                <option value="Firefox"
                                                    <?php echo e(isset($offer) ? (in_array('Firefox', $ua) ? 'selected' : null) : null); ?>>
                                                    Firefox</option>
                                                <option value="Chrome"
                                                    <?php echo e(isset($offer) ? (in_array('Chrome', $ua) ? 'selected' : null) : null); ?>>
                                                    Chrome</option>
                                                <option value="Safari"
                                                    <?php echo e(isset($offer) ? (in_array('Safari', $ua) ? 'selected' : null) : null); ?>>
                                                    Safari</option>
                                                <option value="EDGE"
                                                    <?php echo e(isset($offer) ? (in_array('EDGE', $ua) ? 'selected' : null) : null); ?>>
                                                    EDGE
                                                </option>
                                                <option value="Internet Explorer"
                                                    <?php echo e(isset($offer) ? (in_array('Internet Explorer', $ua) ? 'selected' : null) : null); ?>>
                                                    Internet Explorer</option>
                                                <option value="OPERA MINI"
                                                    <?php echo e(isset($offer) ? (in_array('OPERA MINI', $ua) ? 'selected' : null) : null); ?>>
                                                    OPERA MINI</option>
                                                <option value="Others"
                                                    <?php echo e(isset($offer) ? (in_array('Others', $ua) ? 'selected' : null) : null); ?>>
                                                    Others</option>

                                            </select>
                                        </div>
                                    </div>

                                    <!--<div class="row mt-4 form-group">-->
                                    <!--		<div class="col-lg-2">-->
                                    <!--					<label>Incentive Allowed</label>-->
                                    <!--		</div>-->
                                    <!--	<div class="col-lg-8">-->

                                    <!--		<input type="checkbox" name="incentive" value="1" <?php echo e(isset($offer) ? ($offer->incentive_allowed == 1 ? 'checked' : null) : null); ?>>-->

                                    <!--	</div>-->
                                    <!--</div>-->
                                    <div class="row mt-4 form-group" id="smartlink_checkbox">
                                        <div class="col-lg-2">
                                            <label>Smartlink</label>
                                        </div>
                                        <div class="col-lg-8">

                                            <input type="checkbox" name="smartlink" value="1"
                                                <?php echo e(isset($offer) ? ($offer->smartlink == 1 ? 'checked' : null) : null); ?>>

                                        </div>
                                    </div>

                                    <!--<div class="row mt-4 form-group">-->
                                    <!--		<div class="col-lg-2">-->
                                    <!--					<label>Magiclink</label>-->
                                    <!--		</div>-->
                                    <!--	<div class="col-lg-8">-->

                                    <!--		<input type="checkbox" name="magiclink" value="1" <?php echo e(isset($offer) ? ($offer->magiclink == 1 ? 'checked' : null) : null); ?>>-->

                                    <!--	</div>-->
                                    <!--</div>-->
                                    <!--<div class="row mt-4 form-group">-->
                                    <!--		<div class="col-lg-2">-->
                                    <!--					<label>Native</label>-->
                                    <!--		</div>-->
                                    <!--	<div class="col-lg-8">-->

                                    <!--		<input type="checkbox" name="native" value="1" <?php echo e(isset($offer) ? ($offer->native == 1 ? 'checked' : null) : null); ?>>-->

                                    <!--	</div>-->
                                    <!--</div>-->




                                    <div class="row mt-4 form-group">
                                        <div class="col-lg-2">
                                            <label>Clicks</label>
                                        </div>
                                        <div class="col-lg-8">


                                            <input type="text" name="clicks" class="form-control"
                                                value="<?php echo e(@$offer->clicks); ?>" readonly>
                                        </div>
                                    </div>
                                    <div class="row mt-4 form-group">
                                        <div class="col-lg-2">
                                            <label>Conversion</label>
                                        </div>
                                        <div class="col-lg-8">

                                            <input type="text" name="conversion" class="form-control"
                                                value="<?php echo e(@$offer->conversion); ?>" readonly>
                                        </div>
                                    </div>

                                    <div class="row mt-4 form-group">
                                        <div class="col-lg-2">
                                            <label>Conversion Rejection</label>
                                            <div class="label">
                                                <span class="tooltip-toggle" aria-label="If you set 10%, 10 conversions from each 100 conversions will be rejected and hidden from the publisher dashboard." tabindex="0">
                                                  <svg viewBox="0 0 27 27" xmlns="http://www.w3.org/2000/svg"><g fill="#ED3E44" fill-rule="evenodd"><path d="M13.5 27C20.956 27 27 20.956 27 13.5S20.956 0 13.5 0 0 6.044 0 13.5 6.044 27 13.5 27zm0-2C7.15 25 2 19.85 2 13.5S7.15 2 13.5 2 25 7.15 25 13.5 19.85 25 13.5 25z"/><path d="M12.05 7.64c0-.228.04-.423.12-.585.077-.163.185-.295.32-.397.138-.102.298-.177.48-.227.184-.048.383-.073.598-.073.203 0 .398.025.584.074.186.05.35.126.488.228.14.102.252.234.336.397.084.162.127.357.127.584 0 .22-.043.412-.127.574-.084.163-.196.297-.336.4-.14.106-.302.185-.488.237-.186.053-.38.08-.584.08-.215 0-.414-.027-.597-.08-.182-.05-.342-.13-.48-.235-.135-.104-.243-.238-.32-.4-.08-.163-.12-.355-.12-.576zm-1.02 11.517c.134 0 .275-.013.424-.04.148-.025.284-.08.41-.16.124-.082.23-.198.313-.35.085-.15.127-.354.127-.61v-5.423c0-.238-.042-.43-.127-.57-.084-.144-.19-.254-.318-.332-.13-.08-.267-.13-.415-.153-.148-.024-.286-.036-.414-.036h-.21v-.95h4.195v7.463c0 .256.043.46.127.61.084.152.19.268.314.35.125.08.263.135.414.16.15.027.29.04.418.04h.21v.95H10.82v-.95h.21z"/></g></svg>
                                                </span>
                                            </div>
                                        </div>
                                        <div class="col-lg-8">
                                            <input type="text" name="acr_percentage" value="<?php echo e(@$offer->acr_percentage); ?>" class="form-control">
                                        </div>
                                    </div>
                                    
                                    <div class="row mt-4 form-group">
                                        <div class="col-lg-2">
                                            <label>Maximum Lead</label>
                                        </div>
                                        <div class="col-lg-8">
                                            <input type="number" name="maximum_lead" class="form-control"
                                                value="<?php echo e(@$offer->maximum_lead); ?>">
                                        </div>
                                    </div>

                                    <div class="row mt-4 form-group">
                                        <div class="col-lg-2">
                                            <label>Redirection link</label>
                                        </div>
                                        <div class="col-lg-8">
                                                <select class="form-control" name="redirection_link">
                                                    <option value='' selected disabled>Choose Option</option>
                                                    <?php $__currentLoopData = $offers; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $off): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                    <option value="<?php echo e($off->id); ?>" <?php if($off->id == $offer->redirection_link): ?> selected  <?php endif; ?>><?php echo e($off->offer_name); ?></option>
                                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                                </select>
                                        </div>
                                    </div>

                                    <div class="row mt-4 form-group">
                                        <div class="col-lg-2">
                                            <label>Pre-Landing</label>
                                        </div>
                                        <div class="col-lg-8">
                                            <select type="text" name="pre_land" class="form-control" required>
                                                <option value="">Select Pre-land use or not</option>
                                                <option value="yes">Yes</option>
                                                <option value="no" selected>No</option>
                                            </select>
                                        </div>
                                    </div>

                                    <div class="row mt-4 form-group"  id="featured_cheackbox">
                                        <div class="col-lg-2">
                                            <label>Featured</label>
                                        </div>
                                        <div class="col-lg-8">


                                            <input type="checkbox" name="lockers" class="" value="1"
                                                <?php echo e(isset($offer) ? ($offer->lockers == 1 ? 'checked' : null) : null); ?>>
                                        </div>
                                    </div>
                                    <!--<div class="row mt-4 form-group">-->
                                    <!--		<div class="col-lg-2">-->
                                    <!--				<label>Featured Offer</label>-->
                                    <!--		</div>-->
                                    <!--	<div class="col-lg-8">-->

                                    <!--		<input type="checkbox" name="featured_offer" value="1"<?php echo e(isset($offer) ? ($offer->featured_offer == 1 ? 'checked' : null) : null); ?>>-->

                                    <!--	</div>-->
                                    <!--</div>-->
                                    <div class="row mt-4 form-group">
                                        <div class="col-lg-12 text-center">
                                            <input type="submit" class="btn btn-primary" values="Submit">
                                        </div>

                                    </div>
                                </div>

                            </form>

                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('js'); ?>
    <script src="https://code.jquery.com/jquery-3.5.1.js" integrity="sha256-QWo7LDvxbWT2tbbQ97B53yJnYU3WhH/C8ycbRAkjPDc="
        crossorigin="anonymous"></script>
    

    <!-- (Optional) Latest compiled and minified JavaScript translation files -->
    
    <script type="text/javascript" src="<?php echo e(config('app.url')); ?>/public/public/vendors/datatables/jquery.mark.min.js">
    </script>
             <!--  Select2 Plugin Js -->
             <script src="<?php echo e(config('app.url')); ?>/public/public/assets/assets/vendor/select2/js/select2.min.js"></script>


    <script src="https://cdn.jsdelivr.net/npm/select2@4.1.0-beta.1/dist/js/select2.min.js"></script>
    <script type="text/javascript">
        <?php $site = DB::table('site_settings')->first(); ?>
        $(function() {

            $(function() {
                $('.selectpicker').selectpicker();
            });


            $('#description').summernote({
                height: 150
            });
            $('#requirements').summernote({
                height: 150
            });
            $('.js-example-basic-multiple').select2();

                <?php if(Session::has('success')): ?>
            Swal.fire('Success','<?php echo e(Session::get('success')); ?>','success');
        <?php endif; ?>
        <?php if(Session::has('error')): ?>
            Swal.fire('Error','<?php echo e(Session::get('error')); ?>','error');
                
            <?php endif; ?>

        var sel_val = $('select[name="offer_type"]').find(":selected").val();
            if (sel_val == 'public') {
                $('input[name="lockers"]').attr("disabled", true);
                $('input[name="smartlink"]').removeAttr("disabled");
                $('#featured_cheackbox').addClass('d-none');
            } else {
                $('input[name="smartlink"]').attr("disabled", true);
                $('input[name="lockers"]').removeAttr("disabled");
                $('#smartlink_checkbox').addClass('d-none');
            }
            $('select[name="offer_type"]').change(function() {
                var sel_val = $(this).find(":selected").val();
                if (sel_val == 'public') {
                    $('input[name="lockers"]').attr("disabled", true);
                    $('input[name="smartlink"]').removeAttr("disabled");
                    $('#featured_cheackbox').addClass('d-none');
                    $('#smartlink_checkbox').removeClass('d-none');
                } else {
                    $('input[name="smartlink"]').attr("disabled", true);
                    $('input[name="lockers"]').removeAttr("disabled");
                    $('#smartlink_checkbox').addClass('d-none');
                    $('#featured_cheackbox').removeClass('d-none');
                }
            });


            var payout = $('select[name="payout"]').find(":selected").val();
            if (payout == 'fixed') {
                $('input[name="payout_amount"]').removeAttr("readonly");
                // $('input[name="payout_amount"]').val('');
            } else {
                $('input[name="payout_amount"]').attr("readonly", true);
                $('input[name="payout_amount"]').val(0);
                
            }
            $('select[name="payout"]').change(function() {
                var payout = $(this).find(":selected").val();
                if (payout == 'fixed') {
                    $('input[name="payout_amount"]').removeAttr("readonly");
                    // $('input[name="payout_amount"]').val('');
                } else {
                $('input[name="payout_amount"]').attr("readonly", true);
                $('input[name="payout_amount"]').val(0);
                }
            });
            var payout_percent = $('select[name="payout_percentage_status"]').find(":selected").val();

            if (payout_percent == 'yes') {
                $('input[name="payout_percentage"]').removeAttr("disabled");
                $('#custom_payout_percenteage').removeClass('d-none');
            } else {
                $('input[name="payout_percentage"]').attr("disabled", true);
                $('#custom_payout_percenteage').addClass('d-none');
                
            }
            $('select[name="payout_percentage_status"]').change(function() {
                var payout_percent = $(this).find(":selected").val();
                
                if (payout_percent == 'yes') {
                    $('input[name="payout_percentage"]').removeAttr("disabled");
                    $('#custom_payout_percenteage').removeClass('d-none');
                } else {
                $('input[name="payout_percentage"]').attr("disabled", true);
                $('#custom_payout_percenteage').addClass('d-none');
                }
            });


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

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