<div class="container-fluid container-fixed-lg bg-white">
    <div class="panel panel-transparent">
        <div class="panel-heading">
            <div class="panel-title"><?php print CommonLanguage::getMessage('rent_type'); ?></div>
            <?php if ($permissions->hasPermission('add_rent_type')) { ?>
            <div class="col-xs-12 p-0 m-b-10">  
                <div class="floatingContainer ">
                    <a href="" id="new_rent_type" data-target="#add-edit-rent-type-modal" data-toggle="modal" >
                        <div class="actionButton btn-bg-success-darker text-white" >
                            <p class="floatingText"><span class="floatingTextBG"><?php echo CommonLanguage::getMessage('add_rent_type') ?></span></p>
                        </div>
                    </a>
                </div>
            </div>
            <?php } ?>
        </div>
        <div class="panel-body">
            <div class="row">
                <div class="col-md-12">
                    <div class="table-responsive">
                        <table class="table table-bordered garage" id="tableWithSearch">
                            <thead>
                                <tr>
                                    <th><?php print CommonLanguage::getMessage('rent_type_name') ?></th>
                                    <th><?php print CommonLanguage::getMessage('Price') ?></th>
                                    <th><?php print CommonLanguage::getMessage('currency') ?></th>
                                    <th><?php print CommonLanguage::getMessage('Action') ?></th>
                                </tr>
                            </thead>
                            <tbody>
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<script>
    $(function(){
        RebuildDataTable($('.panel-heading .panel-title').html(), [0,1], 'GarageAjax/getRentType');
        $('#tableWithSearch').on('click', '.delete_rent_type', function () {
            var entry_value = $(this).attr('data-id')
            IncludeDeleteModal(common_delete_modal, {rent_type_id: entry_value}, function () {
                RebuildDataTable($('.panel-heading .panel-title').html(), [0,1], 'GarageAjax/getRentType');
            }, "GarageAjax/deleteRentType");
        });
    });
</script>
<?php
    include 'Views/Garage/add-edit-rent-type-modal.php';