<div class="modal fade none-border" id="visitmodal" tabindex="-1" role="dialog" aria-labelledby="Visit View" aria-hidden="true">
    <div class="modal-dialog modal-lg" style="width: 90%;  ">
        <div class="modal-content" style="border-radius: 2px">
            <div class="modal-header" >
                <button type="button" class="close" onclick="newEvents(1); $('#visitmodal').modal('hide');" aria-hidden="true">×</button>
                <h4 class="modal-title" id="visitview_heading">Visit details: <strong id="visitview_customername"></strong> <span id="visitview_customertype"></span> <span id="visitview_customerbalanceid"></span></h4>
                <span id="visitview_customercell1" <?php if($this->session->userdata('hide_cell') == "Yes" && $this->session->userdata('role')!='Admin' && $this->session->userdata('role')!='Super User'){ echo "style='display:none;'";} ?>></span>
                <span>visit #:</span><span name="modal_visit_id" id="modal_visitview_id"></span>    
                <input id="visit_view_customer_id" type="hidden">
            </div>
            <div class="modal-body">  
                <div id="main-visit-modal-panel" class="row">
                    <div class="col-md-12">
                        <div id="customer_alert_exist1" class="row" style="display: none;">
                            <div id="alert_text_exist1" class="alert alert-danger">
                                <strong>Customer Alert!</strong>
                            </div>
                        </div>
                        <div class="row" id="visit_modal_notifications">
                            <div class="col-md-4 visit-options">                                
                                <span class="checkbox checkbox-pink checkbox-inline">
                                    <input type="checkbox" name="reminder_stricttime" id="reminder_stricttime1" value="" onclick="reminder_message('reminder_stricttime1');" /> 
                                    <label for="reminder_stricttime" class="">
                                        StrictTime
                                    </label>
                                </span>
<!--                                <span class="checkbox checkbox-pink checkbox-inline">
                                    <input type="checkbox" name="reminder_requested" id="reminder_requested1" value="" onclick="reminder_message('reminder_requested1');" /> 
                                    <label for="reminder_requested" class="">
                                        Requested
                                    </label>
                                </span>-->
                                <span class="checkbox checkbox-pink checkbox-inline">
                                    <input type="checkbox" name="reminder_sms" id="reminder_sms1" value="" onclick="reminder_message('reminder_sms1');" /> 
                                    <label for="reminder_sms1" class="">
                                        SMS
                                    </label>
                                </span>
                                 <span class="checkbox checkbox-pink checkbox-inline">
                                    <input type="checkbox" name="reminder_call" id="reminder_call1" value="" onclick="reminder_message('reminder_call1');" />                                    
                                    <label for="reminder_call">
                                        CALL
                                    </label>
                                </span>
                                 <span class="checkbox checkbox-pink checkbox-inline">
                                    <input type="checkbox" name="reminder_email" id="reminder_email1" value="" onclick="reminder_message('reminder_email1');" /> 
                                    <label for="reminder_email">
                                        EMAIL
                                    </label>
                                </span>
                            </div>
                            <div class="col-md-4 check-in-time">
                                <form class="form form-inline">
                                    <label class="form-label">Check-In Time</label>
                                    <input id="arrival_time" type="text" class="form-control">
                                    <button type="button" class="btn waves-effect waves-light btn-warning" onclick="change_arrival_time();" >Change</button>
                                </form>

                            </div>
                             <div class="col-md-4">
                                <form class="form form-inline">
                                    <label class="form-label">Assign All To</label>
                                    <select id="staff_all_to" type="text" class="form-control">
                                    </select>
                                    <button type="button" class="btn waves-effect waves-light btn-warning" onclick="assign_to_staff();" >Assign</button>
                                </form>
                             </div>
                            
                        </div>
                        <hr>
                        <div class="row">
                            <div class="col-md-2"  style="border-right:1px dashed #c7c7c7; ">
                                <div id="visit_remarks_div">                                       
                                    <div class="row m-t-5 form-group-sm" style="display:inline-block">
                                        <div class="col-md-3">
                                            <label class="form-label" >Add #</label>
                                        </div>
                                        <div class="col-md-6">
                                            <input class="form-control"  id="visit_extra" name="visit_extra">                                        
                                        </div>
                                        <div class="col-md-2">
                                            <a href="javascript:void(0);" onclick="addextra();" class="btn btn-sm btn-warning waves-effect waves-light numeric"><i class="fa fa-save"></i></a>
                                        </div>
                                    </div>

                                    <div class="row m-t-5 form-group-sm">
                                        <div class="col-md-6 ">
                                           <div data-color-format="rgb" data-color="rgb(255, 146, 180)" class="colorpicker-default input-group input-group-sm">
                                               <input id="visit_modal_color_picker" type="text" readonly="readonly" value="" class="form-control">
                                               <span class="input-group-btn  add-on">
                                                   <button class="btn btn-white" type="button">
                                                       <i style="background-color: rgb(124, 66, 84);margin-top: 2px;"></i>
                                                   </button>
                                               </span>
                                           </div>
                                       </div>
                                       <div class="col-md-6">
                                           <a href="javascript:void(0);" onclick="visitchangecolor();" class="btn btn-sm btn-custom waves-effect waves-light ">Change</a>
                                       </div>
                                   </div>

                                    <div class="row m-t-10"> <!-- Remarks -->
                                         <div class="col-md-12 ">
                                             <label for="txtvisitremarks">Remarks:</label>
                                             <textarea row="5" class="form-control" id="txtvisitremarks1" name="txtvisitremarks1"></textarea>
                                         </div>
                                    </div>                        
                                    <div class="row m-t-5" style="">
                                        <div class="col-md-6 ">
                                            <?php if($this->session->userdata('role')=="Admin" || $this->session->userdata('role')=="Super User" || substr($this->session->userdata('role'),0,5)=="Store"){?>
                                            <button type="button" class="btn btn-sm btn-success waves-effect waves-light pull-left btndispatchrequest" onclick="add_dispatch_request();"><i class="fa fa-inbox"></i>Dispatch Req.</button>    
                                            <?php } ?>
                                        </div>
                                        <div class="col-md-6" style="text-align: right">
                                            <button onclick="add_remarks();" class="btn btn-sm btn-custom waves-effect waves-light pull-right">Remark</button>
                                        </div>
                                    </div>
                                    
                                    <div class="row m-t-10" ><!--Function Busttons-->                                                                

                                        <div id="adv_cancel_btns" style="display:none; border-top:1px dashed #c7c7c7;">
                                            <div class="row m-t-5">
                                                <div class="col-md-12 ">
                                                    <button type="button" class="btn btn-danger btn-sm waves-effect waves-light btn-trans" onclick="cancelVisitKeepAdv('forfiet');" id="btncancelvisitkeepadv"><i class="ti ti-close"></i> Cancel Visit (keep advance)</button>
                                                </div>
                                            </div>
                                            <div class="row m-t-5">
                                               <div class="col-md-12">    
                                                    <button type="button" class="btn btn-danger btn-sm waves-effect waves-light btn-trans" onclick="cancelVisitKeepAdv('retain');" id="btncancelvisitretainadv"><i class="ti ti-close"></i> Cancel Visit (retain advance, use later)</button>
                                                </div>
                                            </div>
                                            <div class="row m-t-5">
                                                <div class="col-md-12">    
                                                    <button type="button" class="btn btn-danger btn-sm waves-effect waves-light btn-trans" onclick="cancelVisitKeepAdv('return');" id="btncancelvisitreturnadv"><i class="ti ti-close"></i> Cancel Visit (return advance from till)</button>
                                                </div>
                                            </div>
                                        </div>
                                    </div>    
                                </div>
                            </div>
                            <div class="col-md-8" ><!-- Services -->
                                
                                <div class="row">
                                    <div class="col-md-12" id="visitservices1"></div>
                                </div>
                                <div class="row m-t-5">
                                        
                                        
                                </div>
                                <div id='visitdiscountdiv' class="row" style="text-align: left; border-top: dashed 1px #c7c7c7; padding-top:10px;">
                                    <div class="col-md-6 form form-inline" >
                                        <label class="form-label">Discount:</label>
                                        <div class="input-group input-group-sm inline">
                                            <select onchange="$('#txtvisitdiscount1').val(parseFloat($(this).children('option:selected').attr('perc'))*parseFloat($('.s-total').text())/100);" style="width:150px !important;" class="form-control form" id="txtvisitdiscounttype">
                                                <option perc='0' value='0'>Select</option>
                                                <?php if(isset($discount_reasons)){ foreach($discount_reasons as $discount_reason){?>
                                                <option perc="<?php echo $discount_reason['discount_perc']; ?>" value="<?php echo $discount_reason['id_discount_reasons']; ?>"><?php echo $discount_reason['discount_reason'].' '. round($discount_reason['discount_perc'],2).'%'; ?></option>
                                                <?php }} ?>
                                            </select>
                                        </div>
                                        <div class="input-group input-group-sm inline">    
                                            <input readonly="readonly" type="text" id="txtvisitdiscount1" style="width:80px !important;" class="form-control numeric visitdiscount" placeholder="Offer Discount">
                                            <span class="input-group-btn">
                                                <button type="button" onclick="add_discount();" class="btn waves-effect waves-light btn-custom"><i class="fa fa-plus"></i></button>
                                            </span>
                                        </div>
                                    </div>
                                    <div class="col-md-4 form-group-sm" id="duplicate_div" style="display: inline-block">
<!--                                        <input class="form-control" style="display:inline; width: 70px;" min="1" max="50" type="number" id="dupqty" name="dupqty"/>
                                        <a href="javascript:void(0);" onclick="duplicate_visit();" style="display:inline" class="btn btn-sm btn-icon btn-danger waves-effect waves-light btn-trans m-b-5"><i class="ti ti-check-box"></i> Duplicate</a>                                           -->
                                    </div>
                                    
                                    <div class="col-md-2" >
                                        <button onclick="$('#main-visit-modal-panel').slideUp(); $('#services-visit-modal-panel').fadeIn();"  class="btn btn-sm btn-custom waves-effect waves-light pull-right btnaddmoreservices"><i class="fa fa-plus"></i> Add Service</button>
                                    </div>
                                </div>
                            </div>    
                            <div class="col-md-2" id="advance_block1" style="border-left:1px dashed #c7c7c7;"><!--Advance-->
                                <div class="row">
                                    <table id="adv_table1" class="table table-stripped">
                                        <tbody>
                                        </tbody>
                                        <tfoot>
                                        </tfoot>
                                    </table>
                                </div>
                                <div class="row m-t-5 form-group form-group-sm" style="border-top:1px dashed #c7c7c7;">
                                    <div class="col-md-12 m-t-5">
                                        <p style="font-size: 14px;"><b>Add Advance:</b></p>
                                    </div>
                                    <div class="col-md-4">
                                        <label class="form-label">Advance Amount:</label>
                                    </div>
                                    <div class="col-md-8">
                                        <div class="input-group">
                                            <span class="input-group-addon"><?php echo CURRENCY_CODE;?>. </span>
                                            <input class="form-control numeric" onchange="update_cccharge1();" name="advance_amount1" id="advance_amount1" style="text-align: right;" />
                                        </div>
                                    </div>
                                </div>
                                <div class="row" id="advance_inst_div1" style="display:none;">
                                    <div class="col-md-4">
                                        <label class="form-label">Inst. #:</label>
                                    </div>
                                    <div class="col-md-8">                                                                    
                                        <input class="form-control numeric" name="advance_inst1" id="advance_inst1" style="text-align: right; " />
                                    </div>
                                    <div class="col-md-4">
                                        <label class="form-label">CC Fee:</label>
                                    </div>
                                    <div class="col-md-8">
                                        <input class="form-control decimal" readonly="readonly" name="cc_charge1" id="cc_charge1" style="text-align: right; " />                                
                                     </div>
                                </div>
                                <div class="row form-group-sm">
                                    <div class="col-md-4">
                                        <label class="form-label">Mode:</label>
                                    </div>
                                    <div class="col-md-8">
                                        <div class="form-group">
                                            <select class="form-control" onchange="showhideinst1();" id="advance_mode1" name = "advance_mode1">
                                                <option value="cash">Cash</option>
                                                <option value="card">Credit Card</option>
                                                <option value="card">Debit Card</option>
                                                <option value="check">Bank</option>
                                            </select>
                                        </div>
                                    </div>
                                </div>
                                <div class="row form-group-sm">
                                    <div class="col-md-4">
                                        <label class="form-label">Advance Comment:</label>
                                    </div>
                                    <div class="col-md-8">
                                        <div class="input-group">
                                            <input class="form-control" name="advance_comment1" id="advance_comment1"  />
                                        </div>
                                    </div>
                                </div>
                                <div class="row m-t-10">
                                    <div class="col-md-12">
                                        <button type="button" onclick="visitprintadvance();"  class="btn btn-default waves-effect waves-light pull-right m-l-5"><i class="fa fa-print"></i></button>
                                        <button type="button" onclick="saveadvance1();"  class="btn btn-sm btn-custom waves-effect waves-light pull-right">Add Adv.</button>
                                    </div>
                                </div>
                            </div>
                        </div>   
                    </div>
                </div>
                
                <!---Sliding Divs For Service And Additional Staff-->
                <div id="services-visit-modal-panel" style="display: none;">
                    <button type="button" onclick="$('#services-visit-modal-panel').fadeOut(); $('#main-visit-modal-panel').slideDown();" class="btn btn-inverse btn-xs pull-right"><i class="glyphicon glyphicon-chevron-left"></i> Back</button><br>
                    <p id="alreadyvisitid" class="text-info hidden" align="center">
                        An un-invoiced visit already exists for this customer! Visit ID: <strong></strong>
                    </p>

                    <div class="row hidden">
                        <div class="col-md-4">
                            <div class="form-group">
                                <label for="visit-customername" class="control-label">Name</label>
                                <input readonly="readonly" type="text" class="form-control" id="visit-modal-customername" name="visit-customername" placeholder="Name">
                                <input type="hidden" class="form-control" id="visit-modal-customerid" name="visit-customerid">
                            </div>
                        </div>
                        <div class="col-md-4">
                            <div class="form-group">
                                <label for="visit-customercell" class="control-label">Cell Number</label>
                                <input readonly="readyonly" type="text" class="form-control" id="visit-modal-customercell" name="visit-customercell" placeholder="Cell Phone">
                            </div>
                        </div>
                        <div class="col-md-4">
                            <div class="form-group">
                                <label for="visit-customeremail" class="control-label">Email</label>
                                <input readonly="readyonly" type="text" class="form-control" id="visit-modal-customeremail" name="visit-customeremail" placeholder="Email">
                            </div>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-md-6">
                            <lable for="crosssell" class="form-label">Cross Selling by:</lable>
                            <select id="crosssell" class="form-control crosssell">
                                <option selected="selected" value="none"></option>
                                <?php foreach($additional_staff as $as){?>
                                    <option value="<?php echo $as->staff_fullname;?>"><?php echo $as->staff_fullname;?></option>
                                <?php } ?>
                            </select>
                        </div>
                    </div>
                    <div class="row">
                        <input type="hidden">
                        <div class="col-md-3">
                            <div class="form-group" style="border: 1px solid #eaeaea; padding: 10px; ">
                                <label class="control-label">Services Types</label>
                                <div id="visit-services-types1" class="nicescroll_service_types2 visit-services-types services" style="height: 200px; overflow-y: scroll; outline: none;">
                                    <input id="searchgetservicestypes" class="form-control servicetypesearch" type="text" style="width:80%"/>
                                            <ul class="servicelist m-t-10 servicetypelist" id="getservicestypes">
                                            <?php foreach($service_types as $service_type){
                                                
                                                $id = $service_type['id_service_types'];
                                                $name = $service_type['service_type'];
                                                $flag = $service_type['flag'];
                                                //$image = '<img src="'.base_url().'assets/images/servicetype/'.$service_type['service_type_image'].'">';
                                                $image = file_exists($service_type['service_type_image']) ? '<img src="'.base_url().$service_type['service_type_image'].'">' : '<img src="'.base_url().'assets/images/servicetype/nu.png">' ;
                                                
                                                ?>
                                                <li data-service_types_id="<?php echo $id; ?>" data-service_types_flag="<?php echo $name; ?>" onclick="get_services('<?php echo $id; ?>' ,'<?php echo $flag; ?>');"> <?php echo $image.' '.$name; ?></li>
                                            <?php } ?>
                                            </ul>
                                </div>
                            </div>
                        </div>
                        <div class="col-md-3">
                            <div class="form-group" style="border: 1px solid #eaeaea; padding: 10px;">
                                <label class="control-label">Services Categories</label>
                                <div id="visit-services-categories1" class="nicescroll2 visit-services-categories services" style="height: 200px; overflow-y: scroll;  outline: none;">
                                    <div class="fa fa-spin fa-spinner" style="display:none;" id='categories_spinner'></div>
                                            <input id="searchgetcategoriesevent" class="form-control servicecategorysearcher" type="text" style="width:80%"/>
                                            <ul class="servicelist m-t-10 servicecategorylist" id="categories_list_event" >
                                                <?php foreach($service_categories as $service_category){ 
                                                    $id = $service_category['id_service_category'];
                                                    $type_id=$service_category['service_type_id'];
                                                    $name = $service_category['service_category'];
                                                    $flag = $service_category['flag'];
                                                    $image = file_exists($service_category['service_category_image']) ? '<img src="'.base_url().$service_category['service_category_image'].'">' : '<img src="'.base_url().'assets/images/servicetype/nu.png">' ;
                                                    
//                                                    if($service_category['service_category_image']!=='' && null!==$service_category['service_category_image']){
//                                                        $image = '<img style="height: 30px;" src="'.base_url() . 'assets/images/category/'.$service_category['service_category_image'].'">';
//                                                    }else{
//                                                        $image = '<img style="height: 30px;" src="'.base_url() . 'assets/images/category/nu.jpg">';
//                                                    }
                                                    $category_name = str_replace($name, '\'','');
                                                    $category_name = str_replace($category_name, "",'');
                                                ?>
                                                <li style="display:none; cursor: pointer; border-bottom: 1px solid #f6f6f6; margin-bottom: 5px;" data-service-type-id="<?php echo $type_id;?>" data-service_category_id="<?php echo $id;?>" data-service_types_flag="<?php echo $flag;?>" onclick="get_category_services(<?php echo $id;?>,'<?php echo $flag;?>');"><?php echo $image.' '.$name;?></li>

                                                <?php } ?>
                                            </ul>
                                </div>
                            </div>
                        </div>
                        <div class="col-md-3">
                            <div class="form-group" style="border: 1px solid #eaeaea; padding: 10px;">
                                <label for="visit_services" class="control-label">Select Services</label><button style="display:none" onclick="selectallservicesevent()" class="pull-right btn btn-xs btn-primary waves-effect waves-light">All</button>
                                <input class="form-control m-b-10 servicesearcher" id="searchservicedirect1">
                                <div id="visit_services" name="visit_services" class="visit-services vservices" style="height: 200px; overflow-y: scroll;  outline: none;">
                                    <div style="display: none;" id="fa-spinner" class="fa fa-spin fa-spinner"></div>
                                </div>
                            </div>
                        </div>
                        <div class="col-md-3">
                            <div class="form-group" style="border: 1px solid #eaeaea; padding: 10px;"><button onclick="selectallproductsevent()" class="pull-right btn btn-xs btn-primary waves-effect waves-light">All</button>
                                <label for="visit_products" class="control-label">Select Products</label>
                                <div id="visit_products" name="visit_products"  class="nicescrollproducts visit-products vproducts services" style="height: 200px; overflow: hidden; outline: none;">
                                    <div style="display: none;" id="fa-spinner" class="fa fa-spin fa-spinner"></div>
                                </div>
                            </div>
                        </div>
                        <div class="col-md-12">
                            <div class="row" style="">
                                <div class="col-md-8">
                                   
                                </div>
                                <div class="col-md-4" align="right">                                    
                                    <button type="button" onclick="updatevisit();" class="btn btn-info waves-effect waves-light">Save Changes</button>
                                </div>
                                
                            </div>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-md-12 selectedservices" id="selectedservicesvisit"></div>
                    </div>
                </div>
                
                <div id="add-staff-visit-modal-panel" style="display: none;">
                    <button type="button" onclick="$('#main-visit-modal-panel').slideDown(); $('#add-staff-visit-modal-panel').slideUp(); " class="btn btn-inverse btn-xs pull-right"><i class="glyphicon glyphicon-chevron-left"></i> Back</button><br>
                    <div class="row">
                        <div class="col-md-2"></div>
                        <div class="col-md-6">
                            <input type="hidden" id="visit_modal_vservice_id">
                            <input type="hidden" id="visit_modal_vstaff_id">                            
                            <select id="visit_additional_staff" name="visit_additional_staff" multiple>
                                <?php foreach($additional_staff as $as){?>
                                    <option value=<?php echo $as->id_staff;?>><?php echo $as->staff_fullname;?></option>
                                <?php } ?>
                            </select>
                        </div>
                        <div class="col-md-2">
                            <button type="button" onclick="VisitaddAdditionalStaff();" class="btn btn-info">Add</button>
                        </div>
                        <div class="col-md-2"></div>
                    </div><br>
                </div>
                <!--End Sliding Divs for Services and Additional Staff-->
                
            </div>
            <div class="modal-footer">
                <div class="row m-t-10">                
                    <div class="col-md-4" >
                        <button type="button" class="btn btn-pink waves-effect waves-light pull-left btncancelvisit" onclick="cancelVisit();"><i class="ti ti-eraser"></i> Cancel Visit</button>    
                        <a target="bookingslip" class="btn btn-purple waves-effect waves-light pull-left bookingslip" herf="#"><i class="ti ti-list"></i> Booking Slip</a>    
                        <button href="javascript:void(0);" onclick="openConcentForms();" id="visit_concent_btn" class="btn btn-primary waves-effect waves-light"><i class="ti ti-comments"></i> Consent</button>
                        <?php if($this->session->userdata('role')=="Admin" || $this->session->userdata('role')=="Super User"){ ?>
                            <button href="javascript:void(0);" onclick="openNotes();" id="visit_note_btn" class="btn btn-primary waves-effect waves-light"><i class="ti ti-notepad"></i> Notes</button>
                        <?php } else { ?>
                            <?php if(defined(SHOW_REC_NOTES)){
                                if(SHOW_REC_NOTES==TRUE){ ?>
                                <button href="javascript:void(0);" onclick="openNotes();" id="visit_note_btn" class="btn btn-primary waves-effect waves-light"><i class="ti ti-notepad"></i> Notes</button>    
                                <?php } ?>
                            <?php } ?>

                        <?php }?>
                    </div>
                    
                    <div class="col-md-8" >
                        
                        <form method="post" target="_blank" action="<?php echo base_url('open_sms_sender'); ?>">
                        <?php if($scheduler_style[0]['loyalty_enable']=='Y'){?>
                               
                        
                            <input type="hidden" name="csrf_test_name" class="reminder_csrf" value=""/>
                            <input type="hidden" name="visit_id" class="sms_visit_id" value="">
                            <input type="hidden" name="customer_name" class="sms_customer_name" value="'">
                            <input type="hidden" name="customer_cell" class="sms_customer_cell" value="">                                    
                            <button type="submit" onclick="$('.reminder_csrf').val($('#cook').val()); window.reload;" class="btn btn-icon waves-effect waves-light btn-warning "><i class="ti ti-comment"></i> SMS</button>
                       


                        <?php } ?>
                        
                        <a href="javascript:void(0);" onclick="openFeedback();" id="visit_feedback_btn" class="btn btn-custom waves-effect waves-light"><i class="ti ti-comments"></i> Feed Back</a>
                        <a href="javascript:void(0);" onclick="openAccount();" class="btn btn-primary waves-effect waves-light"><i class="ti ti-user"></i> Customer Account</a>
                        <a href="javascript:void(0);" onclick="mark_inservice();" class="btn btn-icon btn-warning waves-effect waves-light m-l-5 markinservice"><i class="ti ti-check-box"></i> Mark as "In-Service"</a>
                        <button <?php if($this->session->userdata('role')=='Floor Staff'){ echo 'disabled="disabled"';} ?> type="button" onclick="$('#event_view_csrf').val($('#cook').val()); generateInvoice(); " style="" class="btn btn-pink waves-effect waves-light m-l-5 btngenerateinvoice" id="btngenerateinvoice"><i class="ti ti-money"></i> Generate Invoice</button>
                        <button type="button" onclick="openinvoice();" style="display:none" class="btn btn-pink waves-effect waves-light m-l-5 viewinvoice"><i class="ti ti-money"></i> View Invoice</button>
                        <button type="button" class="btn btn-purple waves-effect waves-light" onclick="newEvents(1); $('#visitmodal').modal('hide');" aria-hidden="true" >Close</button>
                         </form>
                    </div>                    
                </div>
            </div>
        </div>
    </div>
</div>
                
<script>

$(document).ready(function(){
   
   
    $(".servicetypelist").searcher({
            itemSelector: "li",
            textSelector: "",
            inputSelector: ".servicetypesearch"
    });
    
    
    $(".servicecategorylist").searcher({
            itemSelector: "li",
            textSelector: "",
            inputSelector: ".servicecategorysearcher"
    });
    
    $(".vservices").searcher({
            itemSelector: "li",
            textSelector: "",
            inputSelector: ".servicesearcher"
    });
   
   
    $("#visitmodal").on('hidden.bs.modal', function () {
       //console.log('visitmodal remove');
        $(".vservices ul").remove();
        $(".vproducts ul").remove();
        $(".selectedservices").html('');

        $('.modal-backdrop').remove(); // Remove leftover backdrops
        $('body').removeClass('modal-open'); // Ensure the scroll is re-enabled

        hideCalendarOverlay();
    });
   
});

</script>