

<div class="row">
    <div class="container">
         <ol class="breadcrumb">
            <li><a href="#">نظام العقارات والوحدات </a></li>
            <li><a href="realestateunitsrenters.php?do=show">  تأجير الوحدات للمستأجرين   </a></li>
            <li class="active">عرض   </li>
        </ol>


        <div class="panel panel-default panel-m">
            <!-- Default panel contents -->
            <div class="panel-heading" style="padding:5px 15px 15px">
                <h3 class="panel-title" style="display: inline-block;"> عرض       </h3>
                <a href="realestateunitsrenters.php" class="hidden-print"><input type="button"  id="submit" style="margin-left: 12px" class="btn btn-primary pull-left " value="إضافة جديد"/></a>
            </div>
            
            <hr/>
            <form class="form-inline hidden-print" id="searchdata"  method="post" action="realestateunitsrenters.php?do=show">
                    
                   
                    <div class="form-group">
                        <label class="sr-only">من التاريخ</label>
                        <input type="text" class="form-control awdatepicker searchdata" autocomplete="off"   data-date-format="yyyy-mm-dd"  id="start_date" value="{$date}">
                    </div>
                    <div class="form-group">
                        <label class="sr-only">إلى التاريخ</label>
                        <input type="text" class="form-control awdatepicker searchdata" autocomplete="off"   data-date-format="yyyy-mm-dd"  id="end_date" value="{$date}">
                    </div>

                    <div class="form-group"  >
                        <label class="sr-only">المستاجرين</label>
                        <div style="width: 200px;">
                            <input type="text" name="clientid" class="searchdata wdt100" id="select2client" data-placeholder="اختر " />
                        </div> 
                    </div>
                     
                     <div class="form-group"  >
                        <label class="sr-only">العقارات</label>
                        <div style="width: 200px;">
                            <input type="text" name="realestateid" class="searchdata wdt100" id="select2realestates" data-placeholder="اختر " />
                        </div> 
                    </div>
                    <div class="form-group"  >
                        <label class="sr-only">الوحدات</label>
                        <div style="width: 200px;">
                             <input type="text" name="realestateunitid" class="searchdata wdt100" id="select2realestatesunits" data-placeholder="اختر " />
                        </div> 
                    </div>
                    <div class="form-group">
                        <label class="sr-only">المحذوف</label>
                        <div style="text-align: center;">
                          <input type="checkbox" class="form-control searchdata" id="del"  value="1" style="    width: 23px;">  
                        </div>
                    </div>
                </form>
            <hr/>



            <table class="table table-black" id="getajaxdata" 
            data-controll="realestateunitsrenters.php?do=showajax">
                <thead>
                    <tr>
                        <th style="width:50px;">م</th>
                        <th>المستاجر</th>
                        <th>العقار</th>
                        <th>الوحده</th>
                        <th>التاريخ</th>
                        <th>المستخدم</th>
                        <th class="noprint">تعديل</th>
                        <th class="noprint">حذف</th>
                    </tr>
                </thead>
                <tbody>

                </tbody>
            </table>





            <div class="clearfix"></div>


           


        </div>



    </div>

</div>





{literal}
<script type="text/javascript">
$(document).ready(function () {
        var formatResult;
        formatResult = function (data) {return  data.text;}

       

         $("#select2client").select2({
            placeholder: "إسم  المشروع",
            multiple: false,
            quietMillis: 100,
            ajax: {
                url: "realestateunits.php?do=select2client",
                type: "post",
                dataType: 'json',
                data: function (term, page) {
                    return {
                        searchTerm: term,
                    };
                },
                results: function (data) {
                    return {results: data};
                }
            },
            formatResult: formatResult,
            initSelection: function (element, callback) {
                var item = element.val().split(':');
                var data = {id: item[0], text: item[1]};
                callback(data);
            }
        });

        $("#select2realestates").select2({
            placeholder: "إسم  المشروع",
            multiple: false,
            quietMillis: 100,
            ajax: {
                url: "realestateunits.php?do=select2realestates",
                type: "post",
                dataType: 'json',
                data: function (term, page) {
                    return {
                        searchTerm: term,
                    };
                },
                results: function (data) {
                    return {results: data};
                }
            },
            formatResult: formatResult,
            initSelection: function (element, callback) {
                var item = element.val().split(':');
                var data = {id: item[0], text: item[1]};
                callback(data);
            }
        });
        $("#select2realestatesunits").select2({
            placeholder: "الوحده",
            multiple: false,
            quietMillis: 100,
            ajax: {
                url: "realestateunits.php?do=select2realestatesunits",
                type: "post",
                dataType: 'json',
                data: function (term, page) {
                    var select2realestates = Number($('#select2realestates').val());
                     if (!select2realestates) {
                        alert('يجب اختيار العقار اولا');
                        return false;
                     }
                    return {
                        searchTerm: term,
                        realestateid: select2realestates,
                    };
                },
                results: function (data) {
                    return {results: data};
                }
            },
            formatResult: formatResult,
            initSelection: function (element, callback) {
                var item = element.val().split(':');
                var data = {id: item[0], text: item[1]};
                callback(data);
            }
        });
        deldata();
});  
</script>
{/literal}


