<div class="modal-body">
		<?php
            $form = $this->beginWidget('CActiveForm', array(
                'id' => 'search-form',
                'enableAjaxValidation' => false,
                'enableClientValidation' => false,
            ));
            ?>
        <ul class="form-add clearfix">
             
                 <li class="form-add col-sm-6">
                 <div class="icon-box  fa-calendar-check-o  material m1">
                            <?php echo CHtml::textField('date1','', array('class' => 'date-picker','placeholder'=>'Date From')); ?>
                </div>
                </li>
                <li class="form-add col-sm-6">
                 <div class="icon-box  fa-calendar-check-o  material m1">
                            <?php echo CHtml::textField('date2','', array('class' => 'date-picker','placeholder'=>'Date To')); ?>
                </div>
                </li>
               <li class="form-add col-sm-6">
		<div class="icon-box fa-user material m1">
                <?php echo CHtml::dropDownList('building_id','building_id', Building::getPurchasedBuilding(),array('placeholder'=>'Building')); ?>
                </div>
                </li>
       </ul>
       <div class="modal-footer">
                 <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
                 <?php echo CHtml::ajaxSubmitButton('Search', Yii::app()->createUrl('purchasedbuilding/summaryDetails'), array(
				'dataType' => 'json',
				'type' => 'post',
				'success' => 'function(data) {
                    if(data.status=="success"){
                 	location.href=$("#liveSite").val()+"administrator.php?r=purchasedbuilding/summaryResults&date1="+data.date_from+"&date2="+data.date_to+"&building_id="+data.building;
                    } 
				    else 
					{  
					    $.each(data, function(key, val) { 
		                 	    $("#"+key).addClass("error");
						}); 
                 		
					} 
			}',
			'beforeSend' => 'function(){
                    $("#search-form .maintenance-save-btn").prop("disabled", true);
                }',
			'complete' => 'function(){
                	$("#search-form .maintenance-save-btn").prop("disabled", false);
                }'
		), array('id' => 'mybtn' . rand(), 'class' => 'maintenance-save-btn btn btn-primary')); ?>
		
                              </div>
       <?php $this->endWidget(); ?>
       </div>

