示例#1
0
		<?php 
        }
        ?>
</li>
	<li class="error_message"><?php 
        echo CHtml::error($model, 'bathrooms');
        ?>
</li>
</ul>
<ul>
	<li><span><?php 
        echo CHtml::activeLabelEx($model, 'age_of_construction');
        ?>
<span class="required">*</span></span>
	<?php 
        echo CHtml::activeDropdownList($model, 'age_of_construction', CHtml::listData(PropertyAgeOfConstruction::model()->findAll(), 'id', 'age'), array('empty' => 'Select', 'class' => 'slctbox'));
        ?>
	</li>
	<li class="error_message"><?php 
        echo CHtml::error($model, 'age_of_construction');
        ?>
</li>
</ul>
<ul>
	<li><span><?php 
        echo CHtml::activeLabelEx($model, 'ownership_type_id');
        ?>
<span class="required">*</span></span>
	<?php 
        echo CHtml::activeDropdownList($model, 'ownership_type_id', CHtml::listData(CategoryOwnershipTypes::model()->findAll(), 'id', 'ownership_type'), array('empty' => 'Select', 'class' => 'slctbox'));
        ?>
 /**
  * This method returns the property age of construction.
  * Returns model if successfully found. 
  * Returns false if not found.
  * 
  * @return model
  */
 public static function getpropertyAgeById($Id)
 {
     return PropertyAgeOfConstruction::model()->findByPk($Id);
 }
			<label><input type="checkbox" name="without_budget" value="1" <?php 
echo $withoutBudgetChecked;
?>
/>Include properties without budget</label>
			</td>
		</tr>
		</table>
		</div>
	</li>
	<li>
		<h3>Property Features</h3>	
		<div class="acc-section">
		<table width="92%" border="0" cellpadding="0" cellspacing="0" align="center">
		<tr>
			<td><label>Age Of Construction</label><br /> <?php 
echo $form->dropdownList($modelProperty, 'age_of_construction', CHtml::listData(PropertyAgeOfConstruction::model()->findAll(), 'id', 'age'), array('empty' => 'All'));
?>
			</td>
		</tr>
		<tr>
			<td><label>Type of Ownership</label> <?php 
echo $form->dropdownList($modelProperty, 'ownership_type_id', CHtml::listData(CategoryOwnershipTypes::model()->findAll(), 'id', 'ownership_type'), array('empty' => 'All'));
?>
			</td>
		</tr>
		<tr>
			<td><label>Amenities</label><br />
				<div class="multi_checkbox med">
				<?php 
$amenities = isset($_POST['amenity_id']) ? $_POST['amenity_id'] : null;
echo CHtml::checkBoxList('amenity_id', $amenities, CHtml::listData(CategoryAmenities::model()->findAll(), 'id', 'amenity'), array('size' => '5', 'multiple' => 'multiple', 'id' => 'amenities-multi'));
 /**
  * Returns the data model based on the primary key given in the GET variable.
  * If the data model is not found, an HTTP exception will be raised.
  * @param integer the ID of the model to be loaded
  */
 public function loadModel($id)
 {
     $model = PropertyAgeOfConstruction::model()->findByPk($id);
     if ($model === null) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     return $model;
 }