

<?php $__env->startSection('content'); ?>

    <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script>
    <script src="<?php echo e(asset('admin/assets/extra-libs/multicheck/datatable-checkbox-init.js')); ?>"></script>
    <script src="<?php echo e(asset('admin/assets/extra-libs/multicheck/jquery.multicheck.js')); ?>"></script>
    <script src="<?php echo e(asset('admin/assets/extra-libs/DataTables/datatables.min.js')); ?>"></script>

    <link rel="stylesheet" type="text/css" href="<?php echo e(asset('admin/assets/extra-libs/multicheck/multicheck.css')); ?>">
    <link href="<?php echo e(asset('admin/assets/libs/datatables.net-bs4/css/dataTables.bootstrap4.css')); ?>" rel="stylesheet">

    <script src="https://www.giftbasketworldwide.com/js/admin/misc.js"></script>
    <script src="https://www.giftbasketworldwide.com/js/admin/tinymce.min.js"></script>

    <main id="main" class="main">
        <?php if( Session::get('permissions.user_type') == 'A' ): ?>
            <div class="page-breadcrumb">
                <div class="row">
                    <div class="col-12 d-flex no-block align-items-center">
                        <h4 class="page-title">PRODUCT BULK UPDATE</h4>
                        <div class="ml-auto text-right">
                            <a href="<?php echo e(route('admin.product')); ?>" class="btn btn-outline-info">Back</a>
                        </div>
                    </div>
                </div>
            </div>
            <div class="container-fluid">
                <div class="row">
                    <div class="col-md-12">
                        <div class="card">
                            <div class="card-header">
                                <!-- <br> -->
                                <!-- <h4>Bulk Product Edit</h4> -->
                                <div>
                                    <a href="<?php echo e(route('admin.bulkproductupload')); ?>" class="btn btn-info" title="Bulk Upload Product">Bulk Product Upload by Excel<i class="fas fa-upload"></i></a>

                                    <a href="" class="btn btn-secondary" title="Bulk Update Product">Bulk Product Update by Excel<i class="fas fa-edit"></i></a>

                                    <a href="" class="btn btn-primary" title="Bulk Price Update">Bulk Price Upload by Excel <i class="fas fa-edit"></i></a>

                                    <a href="" class="btn btn-warning" title="Bulk Product Review">Bulk Review Upload by Excel<i class="fas fa-star"></i></a>
                                </div>
                                <?php if(session('message')): ?>
                                    <br><h4 class="alert alert-success"><?php echo e(session('message')); ?></h4>
                                <?php endif; ?>
                            </div>
                            <div class="card-body">

                                <form action="<?php echo e(route('admin.bulkproductedit')); ?>"  method="post" enctype="multipart/form-data">
                                    <?php echo csrf_field(); ?>
                                    <div class="form-group">

                                        <label><b>Choose Option</b></label><br>

                                        <div class="custom-control custom-radio">
                                            <input type="radio" id="customControlValidation1" name="bulk_product_edit" class="bulk_product_update bulk_hide custom-control-input" value="bulk_hide" required>
                                            <label class="custom-control-label" for="customControlValidation1">Product Hide</label>
                                        </div>

                                        <div class="custom-control custom-radio">
                                            <input type="radio" id="customControlValidation2" name="bulk_product_edit" class="bulk_product_update bulk_show custom-control-input" value="bulk_show" required>
                                            <label class="custom-control-label" for="customControlValidation2">Product Show</label>
                                        </div>

                                        <div class="custom-control custom-radio">
                                            <input type="radio" id="customControlValidation2" name="bulk_product_edit" class="bulk_product_update bulk_status_update custom-control-input" value="bulk_status_update" required>
                                            <label class="custom-control-label" for="customControlValidation2">Product Status Update</label>
                                        </div>

                                        <div class="custom-control custom-radio">
                                            <input type="radio" id="customControlValidation3" name="bulk_product_edit" class="bulk_product_update bulk_price_update custom-control-input" value="bulk_price_update" required>
                                            <label class="custom-control-label" for="customControlValidation3">Price Update</label>
                                        </div>

                                        <div class="custom-control custom-radio">
                                            <input type="radio" id="customControlValidation4" name="bulk_product_edit" class="bulk_product_update bulk_mrp_update custom-control-input" value="bulk_mrp_update" required>
                                            <label class="custom-control-label" for="customControlValidation4">MRP Update</label>
                                        </div>

                                        <div class="custom-control custom-radio">
                                            <input type="radio" id="customControlValidation5" name="bulk_product_edit" name="bulk_product_edit" class="bulk_product_update bulk_product_upload custom-control-input" value="bulk_product_upload" required>
                                            <label class="custom-control-label" for="customControlValidation5">Product Upload</label>
                                        </div>

                                        <div class="custom-control custom-radio">
                                            <input type="radio" id="customControlValidation6" name="bulk_product_edit" class="bulk_product_update bulk_description_change custom-control-input" value="bulk_description_change" required>
                                            <label class="custom-control-label" for="customControlValidation6">Description Update</label>
                                        </div>

                                        <div class="custom-control custom-radio">
                                            <input type="radio" id="customControlValidation7" name="bulk_product_edit" name="bulk_product_edit" class="bulk_product_update bulk_rating_upload custom-control-input" value="bulk_rating_upload" required>
                                            <label class="custom-control-label" for="customControlValidation7">Rating Upload</label>
                                        </div>

                                        <div class="custom-control custom-radio">
                                            <input type="radio" id="customControlValidation8" name="bulk_product_edit" name="bulk_product_edit" class="bulk_product_update bulk_category_add_remove custom-control-input" value="bulk_category_add_remove" required>
                                            <label class="custom-control-label" for="customControlValidation8">Category Add/Remove</label>
                                        </div>

                                        <div class="custom-control custom-radio">
                                            <input type="radio" id="customControlValidation9" name="bulk_product_edit" name="bulk_product_edit" class="bulk_product_update multiple_img_upload custom-control-input" value="multiple_img_upload" required>
                                            <label class="custom-control-label" for="customControlValidation9">Multiple Image</label>
                                        </div>

                                        <div class="custom-control custom-radio">
                                            <input type="radio" id="customControlValidation10" name="bulk_product_edit" name="bulk_product_edit" class="bulk_product_update bulk_product_sort custom-control-input" value="bulk_product_sort" required>
                                            <label class="custom-control-label" for="customControlValidation10">Product Sort</label>
                                        </div>
                                    </div>

                                    <div class="form-group category_div" style="display: none;">

                                        <div style="margin-bottom:15px;display: flex;align-items: center;">
                                            <input type="radio" id="cadd" name="select_option" value="add">
                                            <label for="cadd" style="margin-bottom: 0 !important;padding-left: 5px;font-size: 1.2rem;">Product Add into Category</label>
                                            &nbsp;&nbsp;
                                            <input type="radio" id="cremove" name="select_option" value="remove">
                                            <label for="cremove" style="margin-bottom: 0 !important;padding-left: 5px;font-size: 1.2rem;">Product Remove from Category</label>
                                        </div>

                                        <div class="allproductremove" style="margin-bottom:15px; display: none;">
                                            <input type="checkbox" id="alldata" name="alldata" value="1">
                                            <label for="alldata" style="font-size: 1.2rem;">Remove All Product from Category</label>
                                        </div>

                                        <label for="category_list"><?php echo e(__('Category List')); ?></label>
                                        <select class="form-control selectpicker" data-live-search="true" data-live-search-placeholder="Search"  data-actions-box="true" id="category_id" name="category_id">
                                        
                                            <option value="">Category</option>
                                            <?php foreach ($category_list as $key => $category) { ?>
                                           <option value="<?php echo $key; ?>" ><?php echo $category; ?></option>
                                            <?php } ?>
                                        </select>

                                    </div>


                                    <div class="form-group product_sort_category_div" style="display: none;">

                                        <label for="sort_category_list"><?php echo e(__('Category List')); ?></label>
                                        <select class="form-control selectpicker" data-live-search="true" data-live-search-placeholder="Search"  data-actions-box="true" id="sort_category_id" name="sort_category_id">
                                        
                                            <option value="">Category</option>
                                            <?php foreach ($category_list as $key => $category) { ?>
                                           <option value="<?php echo $key; ?>" ><?php echo $category; ?></option>
                                            <?php } ?>
                                        </select>

                                    
                                        <div class="upgrade_sort_order badge bg-danger" id="upgrade_sort_order" style="margin-top:10px; cursor:pointer;">Upgrade Sort Order</div>
                                        
                                        <div class="upgarde-msg"></div>
                                    </div>


                                    <div class="form-group m-t-20 fieldvalues">
                                        <label><b>Field Values</b></label><span>*</span>
                                        <textarea class="form-control" rows="8" id="field_values" name="field_values" placeholder="Enter Product Id" required></textarea>
                                    </div>
                                    <br>
                                    <button type="submit" class="btn btn-primary">Submit</button>
                                </form>

                            </div>

                            <div class="card-body bulk_hide_field" style="display: none;">
                                <div>
                                    <span style="width:323px;text-size:15%;" class="badge bg-primary">The Following Field Values will be uploaded</span>
                                </div>
                                <br>
                                <table style="width:30%; text-align: center;" border="1">
                                    <tr>
                                        <td style="width:auto;text-align:center;"><b>FNID</b></td>
                                    </tr>
                                </table>
                            </div>

                            <div class="card-body bulk_show_field" style="display: none;">
                                <div>
                                    <span style="width:323px;text-size:15%;" class="badge bg-primary">The Following Field Values will be uploaded</span>
                                </div>
                                <br>
                                <table style="width:30%; text-align: center;" border="1">
                                    <tr>
                                        <td style="width:auto;text-align:center;"><b>FNID</b></td>
                                    </tr>
                                </table>
                            </div>

                            <div class="card-body bulk_status_update_field" style="display: none;">
                                <div>
                                    <span style="width:323px;text-size:15%;" class="badge bg-primary">The Following Field Values will be uploaded</span>
                                </div>
                                <br>
                                <table style="width:30%; text-align: center;" border="1">
                                    <tr>
                                        <td style="width:auto;text-align:center;"><b>FNID</b></td>
                                        <td style="width:auto;text-align:center;"><b>AOF</b></td>
                                        <td style="width:auto;text-align:center;"><b>BOF</b></td>
                                        <td style="width:auto;text-align:center;"><b>COF</b></td>
                                        <td style="width:auto;text-align:center;"><b>DOF</b></td>
                                        <td style="width:auto;text-align:center;"><b>HOF</b></td>
                                        <td style="width:auto;text-align:center;"><b>KOF</b></td>
                                        <td style="width:auto;text-align:center;"><b>MOF</b></td>
                                        <td style="width:auto;text-align:center;"><b>POF</b></td>
                                    </tr>
                                </table>
                            </div>

                            <div class="card-body bulk_price_update_field" style="display: none;">
                                <div>
                                    <span style="width:323px;text-size:15%;" class="badge bg-primary">The Following Field Values will be uploaded</span>
                                </div>
                                <br>
                                <table style="width:40%; text-align: center;" border="1">
                                    <tr>
                                        <td style="width:auto;text-align:center;"><b>FNID</b></td>
                                        <td style="width:auto;text-align:center;"><b>Price</b></td>
                                    </tr>
                                </table>
                            </div>

                            <div class="card-body bulk_mrp_update_field" style="display: none;">
                                <div>
                                  <span style="width:323px;font-size: 14px;;" class="badge bg-primary">The Following Field Values will be uploaded</span>
                                </div>
                                <br>
                                <table style="width:40%; text-align: center;" border="1">
                                    <tr>
                                      <td style="width:auto;text-align:center;"><b>FNID</b></td>
                                      <td style="width:auto;text-align:center;"><b>MRP</b></td>
                                    </tr>
                                </table>
                            </div>

                            <div class="card-body bulk_description_change_field" style="display: none;">
                                <div>
                                    <span style="width:323px;text-size:15%;" class="badge bg-primary">The Following Field Values will be uploaded</span>
                                </div>
                                <br>
                                <table style="width:100%; text-align: center;" border="1">
                                    <tr>
                                        <td style="width:auto;text-align:center;"><b>FNID</b></td>
                                        <td style="width:auto;text-align:center;"><b>Title</b></td>
                                        <td style="width:auto;text-align:center;"><b>Description</b></td>
                                        <td style="width:auto;text-align:center;"><b>Content</b></td>
                                        <td style="width:auto;text-align:center;"><b>Delay Days</b></td>
                                        <td style="width:auto;text-align:center;"><b>Meta Title</b></td>
                                        <td style="width:auto;text-align:center;"><b>Meta Description</b></td>
                                        <td style="width:auto;text-align:center;"><b>Agent Link</b></td>
                                        <td style="width:auto;text-align:center;"><b>Slug</b></td>
                                        <td style="width:auto;text-align:center;"><b>Search Keyword</b></td>
                                    </tr>
                                </table>
                            </div>

                            <div class="card-body bulk_product_upload_field" style="display: none;">
                                <div>
                                    <span style="width:323px;text-size:15%;" class="badge bg-primary">The Following Field Values will be uploaded</span>
                                </div>
                                <br>
                                <table style="width:100%; text-align: center;" border="1">
                                    <tr>
                                        <td style="width:auto;text-align:center;"><b>Title</b></td>
                                        <td style="width:auto;text-align:center;"><b>Description</b></td>
                                        <td style="width:auto;text-align:center;"><b>Content</b></td>
                                        <td style="width:auto;text-align:center;"><b>Price</b></td>
                                        <td style="width:auto;text-align:center;"><b>Mrp</b></td>
                                        <td style="width:auto;text-align:center;"><b>Delay Days</b></td>
                                        <td style="width:auto;text-align:center;"><b>Alt</b></td>
                                        <td style="width:auto;text-align:center;"><b>Meta Title</b></td>
                                        <td style="width:auto;text-align:center;"><b>Meta Description</b></td>
                                        <td style="width:auto;text-align:center;"><b>Agent Link</b></td>
                                        <td style="width:auto;text-align:center;"><b>IMG Id /Product Id</b></td>
                                        <td style="width:auto;text-align:center;"><b>Category</b></td>
                                        <td style="width:auto;text-align:center;"><b>AOF</b></td>
                                        <td style="width:auto;text-align:center;"><b>BOF</b></td>
                                        <td style="width:auto;text-align:center;"><b>COF</b></td>
                                        <td style="width:auto;text-align:center;"><b>DOF</b></td>
                                        <td style="width:auto;text-align:center;"><b>HOF</b></td>
                                        <td style="width:auto;text-align:center;"><b>KOF</b></td>
                                        <td style="width:auto;text-align:center;"><b>MOF</b></td>
                                        <td style="width:auto;text-align:center;"><b>POF</b></td>
                                    </tr>
                                </table>
                            </div>

                            <div class="card-body bulk_rating_field" style="display: none;">
                                <div>
                                    <span style="width:323px;text-size:15%;" class="badge bg-primary">The Following Field Values will be uploaded</span>
                                </div>
                                <br>
                                <table style="width:100%; text-align: center;" border="1">
                                    <tr>
                                        <td style="width:auto;text-align:center;"><b>FNID</b></td>
                                        <td style="width:auto;text-align:center;"><b>Rating</b></td>
                                        <td style="width:auto;text-align:center;"><b>Review</b></td>
                                        <td style="width:auto;text-align:center;"><b>User Name</b></td>
                                        <td style="width:auto;text-align:center;"><b>Delivery Place</b></td>
                                        <td style="width:auto;text-align:center;"><b>Sender Place</b></td>
                                        <td style="width:auto;text-align:center;"><b>Created At</b></td>
                                    </tr>
                                </table>
                            </div>

                            <div class="card-body bulk_category_add_remove_field" style="display: none;">
                                <div>
                                    <span style="width:323px;text-size:15%;" class="badge bg-primary">The Following Field Values will be uploaded</span>
                                </div>
                                <br>
                                <table style="width:40%; text-align: center;" border="1">
                                    <tr>
                                        <td style="width:auto;text-align:center;"><b>FNID</b></td>
                                    </tr>
                                </table>
                            </div>

                            <div class="card-body multiple_img_upload_field" style="display: none;">
                                <div>
                                  <span style="width:323px;font-size: 14px;;" class="badge bg-primary">The Following Field Values will be uploaded</span>
                                </div>
                                <br>
                                <table style="width:40%; text-align: center;" border="1">
                                    <tr>
                                      <td style="width:auto;text-align:center;"><b>FNID</b></td>
                                      <td style="width:auto;text-align:center;"><b>New Image Name</b></td>
                                    </tr>
                                </table>
                            </div>

                            <div class="card-body bulk_product_sort_field" style="display: none;">
                                <div>
                                  <span style="width:323px;font-size: 14px;;" class="badge bg-primary">The Following Field Values will be uploaded</span>
                                </div>
                                <br>
                                <table style="width:40%; text-align: center;" border="1">
                                    <tr>
                                      <td style="width:auto;text-align:center;"><b>FNID</b></td>
                                      <td style="width:auto;text-align:center;"><b>Sort</b></td>
                                    </tr>
                                </table>
                            </div>

                        </div>
                    </div>
                </div>
                <div class="row" style="height:120px"></div>
            </div>
        <?php endif; ?>    
    </main><!-- End #main -->

    <style type="text/css">
        .custom-control{display: inline-block!important; padding-right: 5px;}
        .upgarde-msg{font-size: 14px; color: #3b79d0; font-weight:600}
    </style>

    <script type="text/javascript">

        $(document).ready(function(){
            setTimeout(function(){ $('.alert').fadeOut(); }, 3000);
        });

        $(document).ready(function(){
            $('.bulk_product_update').click(function(){
                        //alert(this.value);
                if(this.value == 'bulk_hide'){
                    $('.bulk_hide_field').show();
                    $('.bulk_show_field').hide();
                    $('.bulk_status_update_field').hide();
                    $('.bulk_price_update_field').hide();
                    $('.bulk_mrp_update_field').hide();
                    $('.bulk_description_change_field').hide();
                    $('.bulk_product_upload_field').hide();
                    $('.bulk_rating_field').hide();
                    $('.bulk_category_add_field').hide();
                    $('.bulk_category_add_remove_field').hide();
                    $('.category_div').hide();
                    $('input:radio[name="select_option"]').prop('required',false);
                    $('#category_id').prop('required',false);
                    $('.multiple_img_upload_field').hide();
                    $('.product_sort_category_div').hide();
                    $('#sort_category_id').prop('required',false);
                    $('.bulk_product_sort_field').hide();
                }
                else if(this.value == 'bulk_show'){
                    $('.bulk_hide_field').hide();
                    $('.bulk_show_field').show();
                    $('.bulk_status_update_field').hide();
                    $('.bulk_price_update_field').hide();
                    $('.bulk_mrp_update_field').hide();
                    $('.bulk_description_change_field').hide();
                    $('.bulk_product_upload_field').hide();
                    $('.bulk_rating_field').hide();
                    $('.bulk_category_add_field').hide();
                    $('.bulk_category_add_remove_field').hide();
                    $('.category_div').hide();
                    $('input:radio[name="select_option"]').prop('required',false);
                    $('#category_id').prop('required',false);
                    $('.multiple_img_upload_field').hide();
                    $('.product_sort_category_div').hide();
                    $('#sort_category_id').prop('required',false);
                    $('.bulk_product_sort_field').hide();
                }
                else if(this.value == 'bulk_status_update'){
                    $('.bulk_hide_field').hide();
                    $('.bulk_show_field').hide();
                    $('.bulk_status_update_field').show();
                    $('.bulk_price_update_field').hide();
                    $('.bulk_mrp_update_field').hide();
                    $('.bulk_description_change_field').hide();
                    $('.bulk_product_upload_field').hide();
                    $('.bulk_rating_field').hide();
                    $('.bulk_category_add_field').hide();
                    $('.bulk_category_add_remove_field').hide();
                    $('.category_div').hide();
                    $('input:radio[name="select_option"]').prop('required',false);
                    $('#category_id').prop('required',false);
                    $('.multiple_img_upload_field').hide();
                    $('.product_sort_category_div').hide();
                    $('#sort_category_id').prop('required',false);
                    $('.bulk_product_sort_field').hide();
                }
                else if(this.value == 'bulk_price_update'){
                    $('.bulk_hide_field').hide();
                    $('.bulk_show_field').hide();
                    $('.bulk_status_update_field').hide();
                    $('.bulk_price_update_field').show();
                    $('.bulk_mrp_update_field').hide();
                    $('.bulk_description_change_field').hide();
                    $('.bulk_product_upload_field').hide();
                    $('.bulk_rating_field').hide();
                    $('.bulk_category_add_field').hide();
                    $('.bulk_category_add_remove_field').hide();
                    $('.category_div').hide();
                    $('input:radio[name="select_option"]').prop('required',false);
                    $('#category_id').prop('required',false);
                    $('.multiple_img_upload_field').hide();
                    $('.product_sort_category_div').hide();
                    $('#sort_category_id').prop('required',false);
                    $('.bulk_product_sort_field').hide();
                }
                else if(this.value == 'bulk_mrp_update'){
                    $('.bulk_hide_field').hide();
                    $('.bulk_show_field').hide();
                    $('.bulk_status_update_field').hide();
                    $('.bulk_price_update_field').hide();
                    $('.bulk_mrp_update_field').show();
                    $('.bulk_description_change_field').hide();
                    $('.bulk_product_upload_field').hide();
                    $('.bulk_rating_field').hide();
                    $('.bulk_category_add_field').hide();
                    $('.bulk_category_add_remove_field').hide();
                    $('.category_div').hide();
                    $('input:radio[name="select_option"]').prop('required',false);
                    $('#category_id').prop('required',false);
                    $('.multiple_img_upload_field').hide();
                    $('.product_sort_category_div').hide();
                    $('#sort_category_id').prop('required',false);
                    $('.bulk_product_sort_field').hide();
                }
                else if(this.value == 'bulk_description_change'){
                    $('.bulk_hide_field').hide();
                    $('.bulk_show_field').hide();
                    $('.bulk_status_update_field').hide();
                    $('.bulk_price_update_field').hide();
                    $('.bulk_mrp_update_field').hide();
                    $('.bulk_description_change_field').show();
                    $('.bulk_product_upload_field').hide();
                    $('.bulk_rating_field').hide();
                    $('.bulk_category_add_field').hide();
                    $('.bulk_category_add_remove_field').hide();
                    $('.category_div').hide();
                    $('input:radio[name="select_option"]').prop('required',false);
                    $('#category_id').prop('required',false);
                    $('.multiple_img_upload_field').hide();
                    $('.product_sort_category_div').hide();
                    $('#sort_category_id').prop('required',false);
                    $('.bulk_product_sort_field').hide();
                }
                else if(this.value == "bulk_product_upload"){
                    $('.bulk_hide_field').hide();
                    $('.bulk_show_field').hide();
                    $('.bulk_status_update_field').hide();
                    $('.bulk_price_update_field').hide();
                    $('.bulk_mrp_update_field').hide();
                    $('.bulk_description_change_field').hide();
                    $('.bulk_product_upload_field').show();
                    $('.bulk_rating_field').hide();
                    $('.bulk_category_add_field').hide();
                    $('.bulk_category_add_remove_field').hide();
                    $('.category_div').hide();
                    $('input:radio[name="select_option"]').prop('required',false);
                    $('#category_id').prop('required',false);
                    $('.multiple_img_upload_field').hide();
                    $('.product_sort_category_div').hide();
                    $('#sort_category_id').prop('required',false);
                    $('.bulk_product_sort_field').hide();
                }
                else if(this.value == "bulk_rating_upload"){
                    $('.bulk_hide_field').hide();
                    $('.bulk_show_field').hide();
                    $('.bulk_status_update_field').hide();
                    $('.bulk_price_update_field').hide();
                    $('.bulk_mrp_update_field').hide();
                    $('.bulk_description_change_field').hide();
                    $('.bulk_product_upload_field').hide();
                    $('.bulk_rating_field').show();
                    $('.bulk_category_add_field').hide();
                    $('.bulk_category_add_remove_field').hide();
                    $('.category_div').hide();
                    $('input:radio[name="select_option"]').prop('required',false);
                    $('#category_id').prop('required',false);
                    $('.multiple_img_upload_field').hide();
                    $('.product_sort_category_div').hide();
                    $('#sort_category_id').prop('required',false);
                    $('.bulk_product_sort_field').hide();
                }
                else if(this.value == "bulk_category_add_remove"){
                    $('.bulk_hide_field').hide();
                    $('.bulk_show_field').hide();
                    $('.bulk_status_update_field').hide();
                    $('.bulk_price_update_field').hide();
                    $('.bulk_mrp_update_field').hide();
                    $('.bulk_description_change_field').hide();
                    $('.bulk_product_upload_field').hide();
                    $('.bulk_rating_field').hide();
                    $('.bulk_category_add_remove_field').show();
                    $('.category_div').show();
                    $('input:radio[name="select_option"]').prop('required',true);
                    $('#category_id').prop('required',true);
                    $('.multiple_img_upload_field').hide();
                    $('.product_sort_category_div').hide();
                    $('#sort_category_id').prop('required',false);
                    $('.bulk_product_sort_field').hide();
                }
                else if(this.value == "multiple_img_upload"){
                    $('.bulk_hide_field').hide();
                    $('.bulk_show_field').hide();
                    $('.bulk_status_update_field').hide();
                    $('.bulk_price_update_field').hide();
                    $('.bulk_mrp_update_field').hide();
                    $('.bulk_description_change_field').hide();
                    $('.bulk_product_upload_field').hide();
                    $('.bulk_rating_field').hide();
                    $('.bulk_category_add_field').hide();
                    $('.bulk_category_add_remove_field').hide();
                    $('.category_div').hide();
                    $('input:radio[name="select_option"]').prop('required',false);
                    $('#category_id').prop('required',false);
                    $('.multiple_img_upload_field').show();
                    $('.product_sort_category_div').hide();
                    $('#sort_category_id').prop('required',false);
                    $('.bulk_product_sort_field').hide();
                }
                else if(this.value == "bulk_product_sort"){
                    $('.bulk_hide_field').hide();
                    $('.bulk_show_field').hide();
                    $('.bulk_status_update_field').hide();
                    $('.bulk_price_update_field').hide();
                    $('.bulk_mrp_update_field').hide();
                    $('.bulk_description_change_field').hide();
                    $('.bulk_product_upload_field').hide();
                    $('.bulk_rating_field').hide();
                    $('.bulk_category_add_field').hide();
                    $('.bulk_category_add_remove_field').hide();
                    $('.category_div').hide();
                    $('input:radio[name="select_option"]').prop('required',false);
                    $('#category_id').prop('required',false);
                    $('.multiple_img_upload_field').hide();
                    $('.product_sort_category_div').show();
                    $('#sort_category_id').prop('required',true);
                    $('.bulk_product_sort_field').show();
                }
                
            });

            $("input[name='select_option']").click(function(){
                var radioValue = $("input[name='select_option']:checked").val();
                if(radioValue == 'remove'){
                    $('.allproductremove').show();
                }else{
                        $('.allproductremove').hide();
                        $('.fieldvalues').show();
                        $("#alldata").prop('checked', false); 
                }
            });

            $('#alldata').change(function() {
                if ($(this).prop('checked')) {
                    $('.fieldvalues').hide();
                    $('#field_values').prop('required',false);
                }
                else {
                    $('#field_values').prop('required',true);
                    $('.fieldvalues').show();
                }
            })

            $('.upgrade_sort_order').click(function(){
                var categoryId = $('#sort_category_id').val();
                if(categoryId == ''){
                    alert("Select Category");
                    return false;
                }
                $.ajaxSetup({
                    headers: {
                        'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
                    }
                });
                $.ajax({
                    url: "<?php echo e(route('admin.upgrade_sort_order')); ?>",
                    method: 'POST',
                    data: {
                        categoryId: categoryId
                    },
                    success: function(response){
                        //console.log(data);
                        response = JSON.parse(response);
                        if(response.status == "success"){
                            //window.location.reload();
                            $('.upgarde-msg').html('')
                            $('.upgarde-msg').html("Update Successfully..");
                            setTimeout(function(){ $('.upgarde-msg').html(""); }, 2000);
                        }else{
                            // $('#warning-msg').html("Access code didn't match");
                            // setTimeout(function(){ $('#warning-msg-plpr').html(""); }, 3000);
                            // return false;
                        }
                    }
                });       
            });
        });

    </script>


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

<?php echo $__env->make('layouts.admin.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/adminrighflorist/public_html/resources/views/admin/product/bulkproductedit.blade.php ENDPATH**/ ?>