

<?php $__env->startSection('content'); ?>
<main class="main-content mt-1 border-radius-lg">
    <div class="container my-3 py-3 d-flex flex-column">
        
        <?php if($errors->get('msgError')): ?>
          <div class="m-3  alert alert-warning alert-dismissible fade show" role="alert">
            <span class="alert-text text-white">
              <?php echo e($errors->first()); ?></span>
            <button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close">
              <i class="fa fa-close" aria-hidden="true"></i>
            </button>
          </div>
          <?php endif; ?>
          <?php if(session('success')): ?>
          <div class="m-3  alert alert-success alert-dismissible fade show" id="alert-success" role="alert">
            <span class="alert-text text-white">
              <?php echo e(session('success')); ?></span>
            <button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close">
              <i class="fa fa-close" aria-hidden="true"></i>
            </button>
          </div>
          <?php endif; ?>
        <div class="row mb-5 justify-content-center align-items-center">
            <div class="col-lg-9 col-12 mx-auto">
                
                <!-- Card Basic Info -->
                <div class="card mt-4" id="basic-info">
                    <div class="card-header">
                        <h5>Update Offerwall Configuration</h5>
                    </div>
                    <div class="card-body pt-0">
                        <form action="/offerwall/web/update" method="POST" enctype="multipart/form-data">
                            <?php echo csrf_field(); ?>
                            <div class="row">
                                
                                <input type="hidden" name="id" value="<?php echo e($data->id); ?>"/>
                                
                                <div class="col-sm-12">
                                    <label class="form-label mt-4">Offerwall Category</label>
                                    <div class="input-group">
                                        <select name="offer_type" class="form-control">
                                            <option value="offers" <?php echo e(($data->offer_type == 'offers') ? 'selected' : ''); ?>>Offers</option>
                                            <option value="survey" <?php echo e(($data->offer_type == 'survey') ? 'selected' : ''); ?>>Survey</option>
                                        </select>
                                    </div>
                                </div>
                                
                                <div class="col-sm-12">
                                    <label class="form-label mt-4">Offerwall Name</label>
                                    <div class="input-group">
                                        <input class="form-control" name="title" value="<?php echo e($data->title); ?>" type="text"  placeholder="Cpalead" required>
                                    </div>
                                </div>

                                <div class="col-sm-12">
                                    <label class="form-label mt-4">Offerwall Slug ( Fill Offerwall Original Name like tapjoy,cpalead)</label>
                                    <div class="input-group">
                                        <input class="form-control"  name="offerwall_slug" value="<?php echo e($data->offerwall_slug); ?>" type="text" placeholder="Cpalead,Offerwall" required>
                                    </div>
                                </div>



                                <div class="col-sm-12">
                                    <label class="form-label mt-4">Offerwall Description</label>
                                    <div class="input-group">
                                        <input class="form-control"  name="description" value="<?php echo e($data->description); ?>"   type="text" placeholder="Best Offers etc" required>
                                    </div>
                                </div>
                                
                                <div class="col-sm-12">
                                    <label class="form-label mt-4">Offerwall Icon</label>
                                    <div class="input-group">
                                        <input class="form-control" id="icon" name="icon" type="file" >
                                    </div>
                                </div>
                                
                                
                                <div class="form-group row" >
                                    <label for="exampleInputConfirmPassword2" class="col-sm-3 col-form-label"></label>
                                    <div id="imgdiv"></div>
                                </div>
                                
                                
                                <div class="col-sm-12">
                                    <div class="row">
                                        <div class="col-sm-3"></div>
                                            <div class="col-sm-3">
                                               <label for="exampleInputPassword2" class="col-sm-12 col-form-label">Offerwall <b>Layout Color</b></label>
                                                <div class="col-sm-12">
                                                    <input  type="color" class="form-control" style="height:50px;" name="card_color" value="<?php echo e($data->card_color); ?>"   required>
                                                    <?php $__errorArgs = ['card_color'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                                                    <span class="invalid-feedback" role="alert">
                                                        <strong><?php echo e($message); ?></strong>
                                                    </span>
                                                    <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                                                </div> 
                                            </div>
                                
                                        <div class="col-sm-3">
                                           <label for="exampleInputPassword2" class="col-sm-12 col-form-label">Offerwall<b>Text Color</b></label>
                                            <div class="col-sm-12">
                                                  <input   type="color" class="form-control" style="height:50px;" value="<?php echo e($data->text_color); ?>"  name="text_color" required>
                                                  <?php $__errorArgs = ['text_color'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                                                <span class="invalid-feedback" role="alert">
                                                    <strong><?php echo e($message); ?></strong>
                                                </span>
                                                <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                                            </div> 
                                        </div>  
                                    </div>     
                                </div>
                                

                                
                                <div class="col-sm-12">
                                    <label class="form-label mt-4">Offerwall Complete Message </label>
                                    <div class="input-group">
                                        <input class="form-control"  name="offer_complete_title" value="<?php echo e($data->offer_complete_title); ?>" type="text"  placeholder="Cpalead offer completed" required>
                                    </div>
                                </div>
                                
                                
                                <div class="col-sm-12">
                                    <label class="form-label mt-4">Offerwall URL </label>
                                    <div class="input-group">
                                        <input class="form-control"  name="offerwall_url" value="<?php echo e($data->offerwall_url); ?>" type="text"  placeholder="https://fastrsrvr.com/list/452511" required>
                                    </div>
                                </div>
                                
                                

                                <div class="row">
                                    <div class="col-sm-6 col-lg-6">
                                        <label class="form-label mt-4">User ID Micro</label>
                                        <div class="input-group">
                                            <input class="form-control" type="text" value="<?php echo e($data->u_tag); ?>" name="u_tag" placeholder="subid={subid}" required>
                                        </div>
                                    </div>
        
                                    <div class="col-sm-6">
                                        <label class="form-label mt-4">User ID Tag Type</label>
                                        <div class="input-group">
                                            <select name="uid_type" class="form-control">
                                                 <option value="full" <?php echo e(($data->uid_type == 'full') ? 'selected' : ''); ?>>sub={subid}</option>
                                                <option value="short" <?php echo e(($data->uid_type == 'short') ? 'selected' : ''); ?>>/{subid}</option>
                                            </select>
                                        </div>
                                    </div>
                                </div>
                             
                               <div class="col-sm-12">
                                    <label class="form-label mt-4">Advertising ID TAG {Optional}</label>
                                    <div class="input-group">
                                        <input class="form-control"  name="advid_tag" type="text" value="<?php echo e($data->advid_tag); ?>" placeholder="advert={advert}" >
                                    </div>
                                </div>   
                                
                                <div class="col-sm-12">
                                    <label class="form-label mt-4">Offerwall Order By</label>
                                    <div class="input-group">
                                        <input class="form-control"  name="item_order"  value="<?php echo e($data->item_order); ?>"  type="number"  placeholder="1" required>
                                    </div>
                                </div>
                                
                                <div class="col-sm-12">
                                    <label class="form-label mt-4">Show on Home Screen?</label>
                                    <div class="input-group">
                                        <select name="home" class="form-control" required>
                                            <option value="0" <?php echo e(($data->home == '0') ? 'selected' : ''); ?>>Yes </option>
                                            <option value="1" <?php echo e(($data->home == '1') ? 'selected' : ''); ?>>No</option>
                                        </select>
                                    </div>
                                </div>
                                
                                <div class="col-sm-12">
                                    <label class="form-label mt-4">Open Offerwall In</label>
                                    <div class="input-group">
                                        <select name="browser_type" class="form-control" required>
                                             <option value="0" <?php echo e(($data->browser_type == '0') ? 'selected' : ''); ?> >In App Browser</option>
                                            <option value="1" <?php echo e(($data->browser_type == '1') ? 'selected' : ''); ?> >Chrome Custom Tab</option>
                                            <option value="2" <?php echo e(($data->browser_type == '2') ? 'selected' : ''); ?> >External Browser</option>
                                        </select>
                                    </div>
                                </div>

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

                <div class="card mt-4" id="basic-info">
                    <div class="card-header">
                        <h5>Postback Configuration</h5>
                    </div>
                    <div class="card-body pt-0">
                        <div class="row">
                            <div class="col-sm-4 col-lg-4">
                                <label class="form-label mt-4">Paramater for <label class="text-info text-sm">USER ID</label></label>
                                <div class="input-group">
                                    <input class="form-control" type="text" name="p_userid" value="<?php echo e($data->p_userid); ?>" placeholder="{user_id}"  required>
                                </div>
                            </div>

                            <div class="col-sm-4 col-lg-4">
                                <label class="form-label mt-4">Paramater for <label class="text-info text-sm">OFFER ID</label></label>
                                <div class="input-group">
                                    <input class="form-control" type="text"  name="p_campaing_id" placeholder="{campaing_id}" value="<?php echo e($data->p_campaing_id); ?>"  required>
                                </div>
                            </div>
                            
                            <div class="col-sm-4 col-lg-4">
                                <label class="form-label mt-4">Paramater for <label class="text-info text-sm">OFFER NAME</label></label>
                                <div class="input-group">
                                    <input class="form-control" type="text"  name="p_offername" placeholder="{offername}" value="<?php echo e($data->p_offername); ?>"  required>
                                </div>
                            </div>
                        </div>

                        <div class="row">
                             <div class="col-sm-4 col-lg-4">
                                <label class="form-label mt-4">Paramater for <label class="text-info text-sm">Reward Amount</label></label>
                                <div class="input-group">
                                    <input class="form-control"  type="text" name="p_payout" placeholder="{payout}"  value="<?php echo e($data->p_payout); ?>" required>
                                </div>
                            </div>
                            
                           
                            
                            <div class="col-sm-4 col-lg-4">
                                <label class="form-label mt-4">Paramater for <label class="text-info text-sm">IP ADDRESS</label></label>
                                <div class="input-group">
                                    <input class="form-control" type="text"  name="p_ip" placeholder="{ip}" value="<?php echo e($data->p_ip); ?>">
                                </div>
                            </div>
                            
                            <div class="col-sm-4 col-lg-4">
                                <label class="form-label mt-4">PostBack Return <label class="text-info text-sm">RESPONSE CODE</label></label>
                                <div class="input-group">
                                    <input class="form-control" type="text"  name="response_code"  value="<?php echo e($data->response_code); ?>" >
                                </div>
                            </div>
                            
                          
                        </div>
                        
                        <div class="row">
                          
                            <div class="col-sm-12 col-lg-12">
                                <label class="form-label mt-4">Paramater for <label class="text-info text-sm">Admin Payout ( For Calculate Admin Earning )</label></label>
                                <div class="input-group">
                                    <input class="form-control" type="text" name="p_admin_payout" value="<?php echo e($data->p_admin_payout); ?>" placeholder="{admin_payout}" required>
                                </div>
                            </div> 
                             

                        </div>

                        <div class="">
                            <button type="submit" class="btn bg-gradient-dark btn-sm float-end mt-6 mb-0">Save Changes</button>
                        </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>
</main>
<?php $__env->stopSection(); ?>
<?php $__env->startPush('js'); ?>
<script src="<?php echo e(URL::asset('assets/js/plugins/choices.min.js')); ?>"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script>

    $(document).ready(function() {
        $("#alert-success").delay(3000).slideUp(300);
        $("#conv").hide();

    });

    if (document.getElementById('choices-tag')) {
        var tag = document.getElementById('choices-tag');
        const example = new Choices(tag);
    }

    $('#choices-tag').change(function() {
        var optVal = $("#choices-tag option:selected").val();
        if (optVal == 1) {
            $('#conv').show();
        } else {
            $('#conv').hide();
        }
    });
    
    $("#icon").change(function(e) {

            for (var i = 0; i < e.originalEvent.srcElement.files.length; i++) {
                
                var file = e.originalEvent.srcElement.files[i];
                
                var img = document.createElement("img");
                var reader = new FileReader();
                reader.onloadend = function() {
                     img.src = reader.result;
                     img.height = 100;
                }
                
                reader.readAsDataURL(file);
                 $('#imgdiv').html(img);
                           
                // $("input").after(img);
            }
        });
</script>
<?php $__env->stopPush(); ?>
<?php echo $__env->make('user_type.auth', ['parentFolder' => 'offerwall', 'childFolder' => 'none'], \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/in2apps/public_html/lebara.in2apps.xyz/resources/views/offerwall/edit-web.blade.php ENDPATH**/ ?>