 
 <?php $__env->startSection('content'); ?>
     <div class="page-content-wrapper">
         <div class="page-content">
             <?php
             if ($publisher->address == '' || $publisher->city == '' || $publisher->skype == '' || $publisher->regions == '' || $publisher->postal_code == '' || $publisher->website_url == '' || $publisher->monthly_traffic == '' || $publisher->publisher_image == '' || $publisher->phone == '' || $publisher->payment_terms == '') {
                 echo "<div class='alert alert-danger'>Please Complete your Profile.</div>";
             } ?>
             <?php if($errors->any()): ?>
                 <script>
                     alert('<?php echo implode('', $errors->all(':message')); ?>')
                 </script>
             <?php endif; ?>
             <div class="page-breadcrumb d-none d-md-flex align-items-center mb-3">
                 <div class="breadcrumb-title pr-3">User Profile</div>
                 <div class="pl-3">
                     <nav aria-label="breadcrumb">
                         <ol class="breadcrumb mb-0 p-0">
                             <li class="breadcrumb-item"><a href="javaScript:;"><i class='bx bx-home-alt'></i></a>
                             </li>
                             <li class="breadcrumb-item active" aria-current="page">User Profile</li>
                         </ol>
                     </nav>
                 </div>
                 <div class="ml-auto">

                 </div>
             </div>
             <!--end breadcrumb-->
             <div class="user-profile-page">
                 <div class="card">
                     <div class="card-body">
                         <div class="row">
                             <div class="col-12 col-lg-5 border-right">

                                 <div class="d-md-flex align-items-center">
                                     <div class="mb-md-0 mr-md-4  mx-3">
                                         <form id="image_form" action="<?php echo e(url('publisher/upload-image')); ?>" method="post"
                                             enctype="multipart/form-data">
                                             <?php echo csrf_field(); ?>
                                             <p><input type="file" name="file" id="file" style="display: none;"></p>
                                             <p><label for="file" style="cursor: pointer;">
                                                     <?php if(Auth::guard('publisher')->user()->publisher_image != null): ?>
                                                         <img src="<?php echo e(asset('uploads')); ?>/<?php echo e(Auth::guard('publisher')->user()->publisher_image); ?>"
                                                             class="rounded-circle shadow" width="130" height="130" alt="">
                                                     <?php else: ?>
                                                         <img src="<?php echo e($site_settings->cdn_url); ?>site/dashboard_assets/images/avatars/avatar-1.png"
                                                             class="rounded-circle shadow" width="130" height="130" alt="">
                                                     <?php endif; ?>
                                                 </label></p>
                                         </form>
                                     </div>
                                     <div class="ml-md-4 flex-grow-1">
                                         <div class="d-flex align-items-center mb-1">
                                             <h4 class="mb-0"><?php echo e($publisher->name); ?></h4>
                                         </div>
                                         <p class="mb-0 text-muted"><?php echo e($publisher->email); ?></p>
                                         <p class="text-primary"><i class='bx bx-buildings'></i><?php
                                         if ($publisher->total_earnings < 10) {
                                             echo 'Beginner';
                                         } elseif ($publisher->total_earnings >= 10 && $publisher->total_earnings < 35) {
                                             echo 'Expert';
                                         } elseif ($publisher->total_earnings >= 35 && $publisher->total_earnings < 100) {
                                             echo 'Genious';
                                         } elseif ($publisher->total_earnings >= 100 && $publisher->total_earnings < 1000) {
                                             echo 'Boss';
                                         } elseif ($publisher->total_earnings >= 1000 && $publisher->total_earnings < 15000) {
                                             echo 'Rock';
                                         } elseif ($publisher->total_earnings >= 15000) {
                                             echo 'Superman';
                                         }
                                         ?>
                                         </p>

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

                             <!--     <div class="col-12 col-lg-4 border-right">
                                        <table class="table table-sm table-borderless mt-md-0 mt-3">
                                          <tbody>
                                            <tr>
                                              <th>Availability:</th>
                                              <td> <span class="badge badge-success">available</span>
                                              </td>
                                            </tr>
                                            <tr>
                                              <th>Account Type:</th>
                                              <td><?php echo e($publisher->account_type); ?></td>
                                            </tr>
                                            <tr>
                                              <th>Address:</th>
                                              <td><?php echo e($publisher->address); ?></td>
                                            </tr>
                                            <tr>
                                              <th>Country:</th>
                                              <td><?php echo e($publisher->country); ?></td>
                                            </tr>
                                          </tbody>
                                        </table>
                                       </div> -->

                             

                         </div>
                         <!--end row-->
                     </div>
                 </div>
                 <div class="card">
                     <div class="card-body">
                         <ul class="nav nav-tabs">

                             <li class="nav-item"> <a class="nav-link active" data-toggle="tab"
                                     href="#Edt-Profile"><span class="p-tab-name">Edit Profile</span><i
                                         class='bx bx-message-edit font-24 d-sm-none'></i></a>
                             </li>
                         </ul>
                     </div>
                 </div>
                 <div class="card">
                     <div class="card-body">
                         <div class="tab-content">

                             <div>
                                 <div class="card shadow-none border mb-0">
                                     <div class="card-body">
                                         <div class="form-body">

                                             <div class="row my-3">

                                                 <div class="col-12 col-lg-12 border-right">
                                                     <form id="form2" action="<?php echo e(url('publisher/change-password')); ?>"
                                                         method="post">
                                                         <?php echo csrf_field(); ?>
                                                         <div class="row">
                                                             <div class="col-lg-6">
                                                                 <div class="form-group  ">
                                                                     <label><b> Password</b></label>
                                                                     <input type="password" name="password"
                                                                         class="form-control">
                                                                 </div>
                                                             </div>
                                                             <div class="col-lg-6">
                                                                 <div class="form-group  ">
                                                                     <label><b>Confirm Password</b></label>
                                                                     <input type="password" name="confirm_password"
                                                                         class="form-control">
                                                                 </div>
                                                             </div>
                                                         </div>
                                                         <div class="form-group  ">
                                                             <button type="submit" class="btn btn-primary my-3">Change
                                                                 Password</button>
                                                         </div>
                                                     </form>

                                                 </div>
                                             </div>
                                             <div class="row">

                                                 <div class="col-12 col-lg-12">
                                                     <form id="form3" action="<?php echo e(url('publisher/update-settings')); ?>"
                                                         method="post" enctype="multipart/form-data">

                                                         <?php echo csrf_field(); ?>
                                                         <div class="form-row row">

                                                             <div class="form-group col-lg-6">
                                                                 <label><b> Name</b></label>
                                                                 <input type="text" value="<?php echo e($publisher->name); ?>"
                                                                     name="name" class="form-control">
                                                             </div>

                                                             <div class="col-lg-6   ">
                                                                 <label><b>Phone</b></label>
                                                                 <div class="form-group">

                                                                     <select class="form-control" name="phone_code"
                                                                         style="width: 30%;float: left;">




                                                                         <?php $__currentLoopData = $country_list; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $q): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                                             <option value="<?php echo e($q->phonecode); ?>"
                                                                                 <?php echo e($q->phonecode == $publisher->phone_code ? 'selected' : null); ?>>
                                                                                 <?php echo e($q->phonecode); ?>-<?php echo e($q->country_name); ?>

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



                                                                     </select>
                                                                     <input type="number" placeholder="Enter Phone Number "
                                                                         style="width: 70%;float: left"
                                                                         class="form-control"
                                                                         value="<?php echo e($publisher->phone); ?>" name="phone">

                                                                 </div>
                                                             </div>


                                                             <div class="form-group col-lg-6">
                                                                 <label><b>Address</b></label>
                                                                 <input type="text" value="<?php echo e($publisher->address); ?>"
                                                                     name="address" class="form-control">
                                                             </div>
                                                             <div class="form-group col-lg-6">
                                                                 <label><b>Region</b></label>
                                                                 <input type="text" value="<?php echo e($publisher->regions); ?>"
                                                                     name="region" class="form-control">
                                                             </div>

                                                             <div class="form-group col-lg-6">
                                                                 <label><b>City</b></label>
                                                                 <input type="text" value="<?php echo e($publisher->city); ?>"
                                                                     name="city" class="form-control">
                                                             </div>
                                                             <div class="col-lg-6  col-lg-6">
                                                                 <div class="form-group">
                                                                     <label><b>Zip/Postal Code</b></label>
                                                                     <input type="text" placeholder="Enter Zip/Postal Code"
                                                                         class="form-control "
                                                                         value="<?php echo e($publisher->postal_code); ?>"
                                                                         name="zip">

                                                                 </div>
                                                             </div>
                                                             <div class="col-lg-6">
                                                                 <div class="form-group">
                                                                     <label><b>Skype</b></label>
                                                                     <input type="text" placeholder="Enter Skype Name "
                                                                         class="form-control <?php $__errorArgs = ['skype'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>"
                                                                         value="<?php echo e($publisher->skype); ?>" name="skype">

                                                                 </div>
                                                             </div>
                                                             <div class="col-lg-6  ">
                                                                 <div class="form-group">
                                                                     <label><b>Website Url</b></label>
                                                                     <input type="text" placeholder="Enter Website Url "
                                                                         class="form-control "
                                                                         value="<?php echo e($publisher->website_url); ?>"
                                                                         name="website_url">

                                                                 </div>
                                                             </div>


                                                             <div class="col-lg-6  ">
                                                                 <div class="form-group">
                                                                     <label><b>Monthly Traffic</b></label>

                                                                     <select
                                                                         class="form-control <?php $__errorArgs = ['monthly_traffic'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>"
                                                                         value="<?php echo e($publisher->monthly_traffic); ?>"
                                                                         name="monthly_traffic">
                                                                         <option value="">Select Traffic</option>
                                                                         <option value="Less than 1k"
                                                                             <?php echo e('Less than 1k' == $publisher->monthly_traffic ? 'selected' : null); ?>>
                                                                             Less than 1k</option>
                                                                         <option value="1K to 5K"
                                                                             <?php echo e('1K to 5K' == $publisher->monthly_traffic ? 'selected' : null); ?>>
                                                                             1K to 5K</option>
                                                                         <option value="5K to 10K"
                                                                             <?php echo e('5K to 10K' == $publisher->monthly_traffic ? 'selected' : null); ?>>
                                                                             5K to 10K</option>
                                                                         <option value="10K to 50K"
                                                                             <?php echo e('10K to 50K' == $publisher->monthly_traffic ? 'selected' : null); ?>>
                                                                             10K to 50K</option>
                                                                         <option value="50K  to 100K"
                                                                             <?php echo e('50K  to 100K ' == $publisher->monthly_traffic ? 'selected' : null); ?>>
                                                                             50K to 100K</option>
                                                                         <option value="100K to 1M"
                                                                             <?php echo e('100K to 1M' == $publisher->monthly_traffic ? 'selected' : null); ?>>
                                                                             100K to 1M</option>
                                                                         <option value="More than 1 M"
                                                                             <?php echo e('More than 1 M' == $publisher->monthly_traffic ? 'selected' : null); ?>>
                                                                             More than 1 M</option>



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

                                                             <div class="col-lg-6  ">
                                                                 <div class="form-group">
                                                                     <label><b>Site Category</b></label>
                                                                     <select name="category"
                                                                         class="form-control <?php $__errorArgs = ['category'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>"
                                                                         value="<?php echo e($publisher->category); ?>">
                                                                         <option value="">Select Category</option>
                                                                         

                                                                         <?php $__currentLoopData = $site_category_list; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $q): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                                             <option value="<?php echo e($q->site_category_name); ?>"
                                                                                 <?php echo e($q->site_category_name == $publisher->category ? 'selected' : null); ?>>
                                                                                 <?php echo e($q->site_category_name); ?></option>
                                                                         <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                                                     </select>
                                                                 </div>
                                                             </div>
                                                           
                                                        
                                                             <div class="col-lg-12">
                                                                 <div class="form-group">
                                                                     <label><b>Payment Term</b></label>
                                                                     <input type="text" name="" disabled=""
                                                                         value="<?php echo e($publisher->payment_terms); ?>"
                                                                         class="form-control">
                                                                 </div>
                                                             </div>
                                                             <div class="col-lg-12 my-4 ">
                                                                 <div class="form-group text-center">
                                                                     <button type="submit" class="btn btn-primary">Save
                                                                         Changes</button>
                                                                 </div>
                                                             </div>

                                                         </div>
                                                     </form>

                                                     <div class="row my-4" id="showdata">
                                                        
                                                         <?php $__currentLoopData = $payment; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $p): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                             <div class="col-12 col-lg-4 col-md-6 col-sm-12 col-xs-12 mb-3">
                                                                 <div class="card shadow-none border mb-3 mb-md-0">
                                                                     <div class="card-body">
                                                                         <div class="media align-items-center">
                                                                             <div class="col-lg-5 text-center">
                                                                                <?php echo $p->paymentmethod->photo; ?>

                                                                             </div>
                                                                             <div class="media-body ml-2">

                                                                                 <h6 class="mb-0 ">
                                                                                    <?php echo e($p->payment_details); ?>

                                                                                    
                                                                                 </h6>
                                                                                 <p class="text-warning">
                                                                                     <?php echo e($p->created_at); ?></p>
                                                                                 <p class="text-primary" style="position: absolute;">
                                                                                     <?php echo e($p->is_primary == 1 ? 'Primary' : ''); ?>

                                                                                 </p>
                                                                             </div>
                                                                         </div>
                                                                     </div>
                                                                     <div class="card-footer bg-transparent ">
                                                                         <!-- <a href="javaScript:;" class="text-primary   ml-auto" data="<?php echo e($p->id); ?>">View</a> -->
                                                                         <a href="javaScript:;"
                                                                             class="text-danger  removepayment"
                                                                             style="float:right"
                                                                             data="<?php echo e($p->id); ?>">REMOVE</a>
                                                                     </div>
                                                                 </div>
                                                             </div>
                                                         <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>

                                                         <div class="col-12 col-lg-4 col-md-6 col-sm-12 col-xs-12 mb-3 text-center">

                                                             <div class="icon-box qp0pm4-0 pByfF border addPayment btn btn-primary"
                                                                 style="width: 96%" tabindex="375" data-bs-toggle="modal"
                                                                 data-bs-target="#addModal">
                                                                 <div class="icon-box-inner">
                                                                     <div class="icon-base"> <i
                                                                             class="fadeIn animated bx bx-plus"></i>
                                                                     </div>
                                                                     <div class="icon-box-name">Add Payment</div>

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

                                                     </div>

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




     <!-- ADD MODAL -->

     <div id="addModal" class="modal fade" tabindex="-1" role="dialog" aria-hidden="true">
         <div class="modal-dialog" role="document">
             <div class="modal-content position-relative">
                 <div class="modal-header">
                     <h5 class="modal-title">Add Site</h5>

                     <button class="btn-close btn btn-sm btn-circle d-flex flex-center transition-base"
                         data-bs-dismiss="modal" aria-label="Close"></button>

                 </div>
                 <div class="modal-body">
                     <form id="add_form" method="post" action="<?php echo e(url('publisher/add-payment')); ?>">
                         <?php echo csrf_field(); ?>
                         <label> Select Payment Method</label>

                         <select class="form-control" name="payment_type">
                             <option value="">Select</option>
                             <?php $__currentLoopData = $paymentmethod; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $pay): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                 <option value="<?php echo e($pay->name); ?>"><?php echo e($pay->name); ?></option>
                             <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                             
                         </select>
                         <label> Payment Details</label>
                         <textarea type="text" name="payment_details" class="form-control"></textarea>
                         <label class="mt-2">Make Primary Account</label>
                         <input type="checkbox" name="primary" value="1">
                     </form>
                 </div>
                 <div class="modal-footer">
                     <button type="submit" class="btn btn-primary" id="btnSave">Save</button>
                     <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
                 </div>
             </div>
         </div>
     </div>
 <?php $__env->stopSection(); ?>
 <?php $__env->startSection('js'); ?>
     <script>
         $(function() {
             $('#form2').submit(function(e) {
                 e.preventDefault();

                 let data = $(this).serialize();
                 $.ajax({
                     url: "<?php echo e(route('publisher.change-password')); ?>",
                     type: 'POST',
                     dataType: 'JSON',
                     data: data,
                     success: function(result) {
                         $('.text-danger').remove();
                         $('.loader').fadeOut();
                         // console.log(result);
                         if (!result.status) {
                             Swal.fire('Failed', result.message, 'error');

                         } else {
                             Swal.fire('Success', result.message, 'success');



                         }
                     },
                     error: function(xhr) {
                         var form = $('#form3');
                         $('.loader').fadeOut();
                         $('.text-danger').remove();
                         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);
                     }
                 });
             })
                 $('#btnSave').unbind().click(function() {
                let data = $('#add_form').serialize();
                $.ajax({
                    url: "<?php echo e(route('publisher.add-payment')); ?>",
                    type: 'POST',
                    dataType: 'JSON',
                    data: data,
                    success: function(result) {
                        $('.loader').fadeOut();
                        // console.log(result);
                        if (!result.status) {
                            Swal.fire('Failed', result.message, 'error');

                        } else {
                            Swal.fire('Success', result.message, 'success');


                            location.reload();
                        }
                    },
                    error: function(xhr) {
                        $('.loader').fadeOut();
                        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);
                    }
                });
            })
             $('#file').change(function() {

                 var formdata = new FormData();

                 formdata.append('file', this.files[0]);

                 var url = "<?php echo e(url('publisher/upload-image')); ?>";
                 $('#image_form').submit();

                 //         $.ajax({
                 //        type:'ajax',

                 //     type:'post',
                 //     data:formdata,

                 //           contentType:false,
                 //               cache:false,

                 //         processData:false,
                 //     url:url,

                 //     async:false,

                 //         success:function(res){
                 //    console.log(res);
                 //        // window.location.reload();
                 //         }

                 // });
             });
                         $('#showdata').on('click', '.removepayment', function() {
                let id = $(this).attr('data');
                Swal.fire({
                    title: 'Are you sure?',
                    text: "You want to remove this Payment method ",
                    type: 'warning',
                    showCancelButton: true,
                    confirmButtonColor: '#3085d6',
                    cancelButtonColor: '#d33',
                    confirmButtonText: 'Yes, remove it!'
                }).then((result) => {
                    if (result.value) {
                        $.ajax({
                            url: "<?php echo e(route('publisher.remove-payment')); ?>",
                            type: 'GET',
                            dataType: 'JSON',
                            data: {
                                id: id
                            },
                            success: function(result) {
                                $('.loader').fadeOut();
                                // console.log(result);
                                if (!result.status) {
                                    Swal.fire('Failed', result.message, 'error');

                                } else {
                                    Swal.fire('Success', result.message, 'success');

                                    location.reload();

                                }
                            },
                            error: function(xhr) {
                                $('.loader').fadeOut();
                                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>
 <?php $__env->stopSection(); ?>

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