<section class="content">
    <div class="row">
        <div class="col-sm-12">
            <div class="tabbable">
                <div class="tab-content no-border padding-24">
                    <div class="tab-pane fade in active" id="faq-tab-1">
                        <div class="space-8"></div>
                        <div class="panel-group accordion-style1 accordion-style2" id="faq-list-1">
                            <div class="panel panel-default">
                                <div class="panel-headingnew"><?php echo $this->translate('Hotel Room Rate'); ?> </div>
                                <div class="left_panel col-sm-12 padding_margin0 pull-left bgwhite">
                                    <?php
                                    $form = $this->form;
                                    $form->prepare();
                                    $form->setAttribute('action', $this->url('hotel', ['action' => 'normal-room-rate']));
                                    $form->setAttribute('method', 'post');
                                    echo $this->form()->openTag($form);
                                    ?> 
                                    <div class="col-sm-12  " align="right">
                                        <div class="tool-bar margin">
                                            <div style="text-align: right" class="col-md-8 pull-right">
                                                <a href="<?php echo $this->url('hotel', array('action' => 'index')); ?>" id="system_restore" class="btn btn-danger"><i class="fa fa-backward"></i><?php echo $this->translate('Back'); ?> </a>
                                                <a href="#" class="reset_btn btn btn-success"><i class="fa fa-retweet"></i><?php echo $this->translate('Reset'); ?> </a>
                                                <?php echo $this->FormElement($form->get('submit')); ?></div>
                                        </div>       
                                    </div>
                                    <?php echo $this->partial('hotel-menu.phtml'); ?>
                                    <div class="tab-content tab_editprofile col-sm-10 padding-left0 marginbott10px margintop10px">
                                        <div id="common-tab" class="tab-pane fade in tab_editprofile tab_editprofile1 active">
                                            <?php echo $this->partial('hotel-room-rate-normal.phtml'); ?>
                                        </div>
                                    </div>
                                    <div class="col-sm-12  " align="right">
                                        <div class="tool-bar margin">
                                            <div style="text-align: right" class="col-md-8 pull-right">
                                                <a href="<?php echo $this->url('hotel', array('action' => 'index')); ?>" id="system_restore" class="btn btn-danger"><i class="fa fa-backward"></i><?php echo $this->translate('Back'); ?> </a>
                                                <a href="#" class="reset_btn btn btn-success"><i class="fa fa-retweet"></i><?php echo $this->translate('Reset'); ?> </a>
                                                <?php echo $this->FormElement($form->get('submit')); ?>
                                            </div>
                                        </div>       
                                    </div>
                                    <?php echo $this->FormElement($form->get('id')); ?>
                                    <?php echo $this->form()->closeTag(); ?>   
                                </div>
                            </div>
                            <br/>
                            <div class="tool-bar margin-bottom margintopnew40">
                                <?php echo $this->partial('normal-hotel-room-middle-links.phtml'); ?>
                            </div>
                            <span class="checkbox_error"></span>
                            <div class="panel panel-default">
                                <div class="panel-headingnew"> View/Update Records </div>
                                <div id="faq-1-3" class="panel-collapse collapse in" aria-expanded="false">
                                    <div class="box">
                                        <div class="box-body table-responsive listing-data">
                                            <?php echo $this->partial('normal-hotel-room-rate-listing.phtml'); ?>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</section>
<div class="modal fade" id="addUserModal" role="dialog" >
    <div class="modal-dialog  modal-dialogfeedback modal-dialog-adduser">
        <!-- Modal content-->
        <div class="modal-content modal-content-add-user" style="width:1000px;">
        </div>
    </div>
</div>
<?php echo $this->inlineScript()->prependFile('https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js', $type = 'text/javascript') ?>
<script type="text/javascript">
    $(document).ready(function () {

        $('#id_garden').click(function () {
            $('#garden').toggle('fast');
            //$('#div1').show('fast');
        });
        $('#id_garden2').click(function () {
            $('#garden').toggle('fast');
            // $('#div2').show('fast');
        });
    });

    $(document).ready(function () {
        $('#id_conference').click(function () {
            $('#conference').toggle('fast');
            //$('#div1').show('fast');
        });
        $('#id_conference1').click(function () {
            $('#conference').toggle('fast');
            // $('#div2').show('fast');
        });
    });

    $(document).ready(function () {
        $('#id_boutique').click(function () {
            $('#boutique').toggle('fast');
            //$('#div1').show('fast');
        });
        $('#id_boutique1').click(function () {
            $('#boutique').toggle('fast');
            // $('#div2').show('fast');
        });
    });


    $(document).ready(function () {
        $('#id_swimming').click(function () {
            $('#swimming').toggle('fast');
            //$('#div1').show('fast');
        });
        $('#id_swimming1').click(function () {
            $('#swimming').toggle('fast');
            // $('#div2').show('fast');
        });
    });


    $(document).ready(function () {
        $('#id_petfreindly').click(function () {
            $('#petfreindly').toggle('fast');
            //$('#div1').show('fast');
        });
        $('#id_petfreindly1').click(function () {
            $('#petfreindly').toggle('fast');
            // $('#div2').show('fast');
        });
        $('#add-roomBut').click(function () {
            $('#add-room').show('');
            $('#manage-room').hide('');
        });

        $('#back-roomBut').click(function () {
            $('#add-room').hide('');
            $('#manage-room').show('');
        });

        $('#fixed').click(function () {
            $('#fixed-price').show('');

        });
        $('#percent').click(function () {
            $('#fixed-price').hide('');

        });

        $('#commission-rate').click(function () {
            $('#Type_of_commission').show('');

        });
        $('#net-rate').click(function () {
            $('#Type_of_commission').hide('');

        });
        
        
        $('.package_commission_rate').click(function () {
            var value = $(this).attr('rel');
            $('#pacakge-type-of-commission-'+value).show('');

        });
        $('.package_net_rate').click(function () {
            var value = $(this).attr('rel');
            $('#pacakge-type-of-commission-'+value).hide('');

        });


        $('#view-rate').click(function () {
            $('#rate-div').show('');
            $('#add-div').hide('');
        });
        $('#back-but').click(function () {
            $('#rate-div').hide('');
            $('#add-div').show('');
        });


        $('#addrate-But').click(function () {
            $('#rate-div').hide('');

            $('#add-div').show('');

        });

        /*$(".meal_plan_div").hide();
        $("#hotel-rate-type").change(function () {
            var val = $("option:selected", this).val();
            if (val != "") {
                if (val == 1) {
                    $("#package-rate").hide();
                    //$("#add-package-rate").hide();
                    $("#normal-rate").show();
                    $(".meal_plan_div").show();

                } else {
                    $("#package-rate").show();
                    //$("#add-package-rate").show();
                    $("#normal-rate").hide();
                    $(".meal_plan_div").hide();
                }
            } else {
                $("#package-rate").hide();
                $("#normal-rate").hide();
                $(".meal_plan_div").hide();

            }
        });*/




    });


</script>

<script>
    $(document).ready(function () {
        $('#dataTables-example1').dataTable();
        $('#dataTables-example2').dataTable();
        $('#dataTables-example3').dataTable();
    });

    function myFunction() {
        var x = document.getElementById("searchDIV");
        if (x.style.display === "none") {
            x.style.display = "block";
        } else {
            x.style.display = "none";
        }
    }

    function myFunction1() {
        var x = document.getElementById("searchDIV1");
        if (x.style.display === "none") {
            x.style.display = "block";
        } else {
            x.style.display = "none";
        }
    }



</script>

<script>
    $(document).ready(function () {
        $("#but_facilityType").click(function () {
            $("#add-facility").show();

        });
        $("#but_add").click(function () {
            $("#add-facility").hide();

        });

        $("#but_roomType").click(function () {
            $("#add_roomType").show();
            $("#searchDIV").hide();
        });
        
        
        
        
        
        
        
        

        $(".ep_pub_tax").attr("disabled", "disabled");
        $(".ep_pub_tax_inclusive").click(function () {
            if ($(this).is(":checked")) {
                $(".ep_pub_tax").attr("disabled", "disabled");
            } else {
                $(".ep_pub_tax").removeAttr("disabled");
            }
        });


        $(".ep_net_tax").attr("disabled", "disabled");
        $(".ep_net_tax_inclusive").click(function () {
            if ($(this).is(":checked")) {
                $(".ep_net_tax").attr("disabled", "disabled");
            } else {
                $(".ep_net_tax").removeAttr("disabled");
            }
        });


        $(".cp_pub_tax").attr("disabled", "disabled");
        $(".cp_pub_tax_inclusive").click(function () {
            if ($(this).is(":checked")) {
                $(".cp_pub_tax").attr("disabled", "disabled");
            } else {
                $(".cp_pub_tax").removeAttr("disabled");
            }
        });

        $(".cp_net_tax").attr("disabled", "disabled");
        $(".cp_net_tax_inclusive").click(function () {
            if ($(this).is(":checked")) {
                $(".cp_net_tax").attr("disabled", "disabled");
            } else {
                $(".cp_net_tax").removeAttr("disabled");
            }
        });


        $(".map_pub_tax").attr("disabled", "disabled");
        $(".map_pub_tax_inclusive").click(function () {
            if ($(this).is(":checked")) {
                $(".map_pub_tax").attr("disabled", "disabled");
            } else {
                $(".map_pub_tax").removeAttr("disabled");
            }
        });

        $(".map_net_tax").attr("disabled", "disabled");
        $(".map_net_tax_inclusive").click(function () {
            if ($(this).is(":checked")) {
                $(".map_net_tax").attr("disabled", "disabled");
            } else {
                $(".map_net_tax").removeAttr("disabled");
            }
        });




        $(".ap_pub_tax").attr("disabled", "disabled");
        $(".ap_pub_tax_inclusive").click(function () {
            if ($(this).is(":checked")) {
                $(".ap_pub_tax").attr("disabled", "disabled");
            } else {
                $(".ap_pub_tax").removeAttr("disabled");
            }
        });

        $(".ap_net_tax").attr("disabled", "disabled");
        $(".ap_net_tax_inclusive").click(function () {
            if ($(this).is(":checked")) {
                $(".ap_net_tax").attr("disabled", "disabled");
            } else {
                $(".ap_net_tax").removeAttr("disabled");
            }
        });

        $(".ai_pub_tax").attr("disabled", "disabled");
        $(".ai_pub_tax_inclusive").click(function () {
            if ($(this).is(":checked")) {
                $(".ai_pub_tax").attr("disabled", "disabled");
            } else {
                $(".ai_pub_tax").removeAttr("disabled");
            }
        });

        $(".ai_net_tax").attr("disabled", "disabled");
        $(".ai_net_tax_inclusive").click(function () {
            if ($(this).is(":checked")) {
                $(".ai_net_tax").attr("disabled", "disabled");
            } else {
                $(".ai_net_tax").removeAttr("disabled");
            }
        });


        $(".jp_pub_tax").attr("disabled", "disabled");
        $(".jp_pub_tax_inclusive").click(function () {
            if ($(this).is(":checked")) {
                $(".jp_pub_tax").attr("disabled", "disabled");
            } else {
                $(".jp_pub_tax").removeAttr("disabled");
            }
        });

        $(".jp_net_tax").attr("disabled", "disabled");
        $(".jp_net_tax_inclusive").click(function () {
            if ($(this).is(":checked")) {
                $(".jp_net_tax").attr("disabled", "disabled");
            } else {
                $(".jp_net_tax").removeAttr("disabled");
            }
        });

        $(".extra_nobed_pub_tax").attr("disabled", "disabled");
        $(".extra_nobed_pub_tax_inclusive").click(function () {
            if ($(this).is(":checked")) {
                $(".extra_nobed_pub_tax").attr("disabled", "disabled");
            } else {
                $(".extra_nobed_pub_tax").removeAttr("disabled");
            }
        });

        $(".extra_nobed_net_tax").attr("disabled", "disabled");
        $(".extra_nobed_net_tax_inclusive").click(function () {
            if ($(this).is(":checked")) {
                $(".extra_nobed_net_tax").attr("disabled", "disabled");
            } else {
                $(".extra_nobed_net_tax").removeAttr("disabled");
            }
        });


        $(".public_room_rate").hide();
        $(".net_room_rate").show();

        $("#commission-rate").click(function () {
            $(".net_room_rate").hide();
            $(".public_room_rate").show();
        });


        $("#net-rate").click(function () {
            $(".net_room_rate").show();
            $(".public_room_rate").hide();
        });
        
        
        
        $(".package_public_room_rate").hide();
        $(".package_net_room_rate").show();

        $("#package-commission-rate").click(function () {
            $(".package_net_room_rate").hide();
            $(".package_public_room_rate").show();
        });


        $("#package-net-rate").click(function () {
            $(".package_net_room_rate").show();
            $(".package_public_room_rate").hide();
        });

        $('#promotion-rate').click(function () {
            $('#add-promoton').toggle();
            //$('#div1').show('fast');
        });


        $('.rate').hide();
        
        function exists(elemt, arr) {
            return (jQuery.inArray(elemt, arr) > -1);
        }
        $(document).on('change', '#meal-plan-id', function () {
            var $selected = $(this).val();
            $('.rate').each(function () {
                $(this).fadeIn('fast')[
                        (exists($(this).attr('match'), $selected)) ? 'show' : 'hide' ]();
            });
        });
        
        $('.package_meal_plan').each(function(index, element) {
            index = index+1;
            $(element).attr('rel', index);
            $('.package-rate-'+index).hide();
        });

        $(document).on('change', '#package-meal-plan-id', function () {
            var $selected = $(this).val();
            var $selectedAttr = $(this).attr('rel');
            $('.package-rate-'+$selectedAttr).each(function () {
                $(this).fadeIn('fast')[
                        (exists($(this).attr('match'), $selected)) ? 'show' : 'hide' ]();
            });
        });

        $('.promotion').hide();
        $(document).on('change', '#promotion-rate-type', function () {
            var $selected = $(this).val();
            if ($selected != "") {
                $('.promotion').each(function () {
                    $(this).fadeIn('fast')[
                            (exists($(this).attr('match'), $selected)) ? 'show' : 'hide' ]();
                    //$(".price-plane").show();
                    $("#add-promoton").show();
                });
            } else {
                $("#add-promoton").hide();
            }
        });
        
        $('.hotel-package-rate').hide();
         $(document).on('change', '#hotel-rate-type', function () {
            var $selected = $(this).val();
            $('.hotel-package-rate').show();
            $('.hotel-package').each(function () {
                $(this).fadeIn('fast')[
                (exists($(this).attr('match-package-rate'), $selected)) ? 'show' : 'hide' ]();                
            });
        });
        
        
        /*$(document).on('change', '#hotel-rate-type', function () {
            var $selected = $(this).val();
            $('.hotel-rate').each(function () {
                alert($selected);
                $(this).fadeIn('fast')[
                (exists($(this).attr('match'), $selected)) ? 'show' : 'hide' ]();
                
            });
        });*/
        
        
        $('.package-promotion-rate').each(function(index, element) {
            index = index+1;
            $(element).attr('rel', index);
            $('.package-promotion-'+index).hide();
        });
        $(document).on('change', '#package-promotion-rate-type', function () {
            var $selected = $(this).val();
            var $selectedAttr = $(this).attr('rel');           
            if ($selected != "") {
                $('.package-promotion-'+$selectedAttr).each(function () {
                    $(this).fadeIn('fast')[
                            (exists($(this).attr('match'), $selected)) ? 'show' : 'hide' ]();
                    //$(".price-plane").show();
                    $("#add-promoton-"+$selectedAttr).show();
                });
            } else {
                $("#add-promoton-"+$selectedAttr).hide();
            }
        });
        
        $(document).ready(function () {
            $('#normal-rate').click(function () {
                if($(this).prop("checked") == true){
                    $('.hotel-contract-rate').show('fast');
                }else{
                    $('.hotel-contract-rate').hide('fast');
                }
                /*if($(this).prop("checked") == true){
                var URL = "/hotel/normal-rate";
                contentType = 'application/x-www-form-urlencoded; charset=UTF-8';
                $.ajax({
                    url: URL,
                    type: "post",
                    dataType: 'html',
                    contentType: contentType,
                    data: {},
                    success: function (result) {
                        $('.hotel-contract-rate').html(result);
                    }
                });
                }*/
            });
            $('#package-rate').click(function () {
                if($(this).prop("checked") == true){
                    $('.hotel_rate_type').show('fast');
                }
                else if($(this).prop("checked") == false){
                    $('.hotel_rate_type').hide('fast');
                    $('.hotel-package-rate').hide('fast');
                }
            });
        });


    });
</script>
<?php echo $this->inlineScript()->appendFile($this->basePath('/js/tinymce/tinymce.min.js')); ?>
