public function actionIndex()
 {
     $videoCr = new CDbCriteria();
     $videoCr->order = 'displayOrder ASC';
     $videoCr->scopes = ['publicAvailableInstruction'];
     $videoCr->limit = 6;
     $this->render('index', array('latestProperties' => Deal::model()->getLatest(6), 'featuredVideo' => InstructionVideo::model()->with('instruction')->findByAttributes(['featuredVideo' => 1]), 'mostViewed' => Deal::model()->getMostViewed(1, date("Y-m-d H:i:s", strtotime("-15 days"))), 'instructionVideos' => InstructionVideo::model()->with('instruction')->findAllByAttributes(['displayOnSite' => 1], $videoCr), 'propertyCategories' => PropertyCategory::model()->active()->displayOnHome()->findAll()));
 }
 public function actionManagePhotos($id)
 {
     $this->layout = '//layouts/new/main';
     if (!$id) {
         throw new CHttpException(404, 'The requested property category does not exist.');
     }
     $model = PropertyCategory::model()->findByPk($id);
     if (isset($_POST['upload-photo']) && $_POST['upload-photo']) {
         $type = isset($_POST['category-photo-type']) ? $_POST['category-photo-type'] : '';
         $recordType = PropertyCategory::CATEGORY_PHOTO_PREFIX . $type;
         $this->saveImages($model, 'category-photo', $recordType);
         $this->redirect(['ManagePhotos', 'id' => $id]);
     }
     $this->render('managePhotos', ['model' => $model]);
 }
?>
</label>

		<div class="controls">
			<?php 
echo $form->radioButtonList($model, 'dea_chainfree', Util::enumItem($model, 'dea_chainfree'), ['separator' => ' ']);
?>
		</div>
	</div>
	<div class="control-group">
		<label class="control-label">Category</label>

		<div class="controls">
			<?php 
/** @var $categories PropertyCategory[] */
$categories = PropertyCategory::model()->active()->findAll();
foreach ($categories as $category) {
    echo '<label>';
    echo CHtml::checkBox('Deal[category][' . $category->id . ']', $model->instructionBelongsToCategory($category->id));
    echo CHtml::label($category->title, 'Deal_category_' . $category->id);
    echo '</label>';
}
?>
		</div>
	</div>
	<div class="control-group">
		<label class="control-label">Tenure</label>

		<div class="controls text">
			<?php 
echo $model->dea_tenure;
<?php

/**
 * @var $this             ClientController
 * @var $model            Client
 * @var $form             AdminFilterForm
 * @var $instructionModel Deal
 * @var $minPrices        array
 * @var $maxPrices        array
 */
$propertyCategories = PropertyCategory::model()->matchClients()->findAll();
$form = $this->beginWidget('AdminFilterForm', array('id' => 'client-filter-form', 'enableAjaxValidation' => false, 'model' => [$model, $model->telephones[0]], 'ajaxFilterGrid' => 'client-list', 'focus' => [$model, 'fullName'], 'storeInSession' => false));
?>
	<div class="row-fluid">
		<div class="span12">
			<fieldset>
				<div class="content">
					<?php 
echo $form->beginControlGroup($model, 'fullName');
?>
					<label class="control-label">Search</label>

					<div class="controls">
						<?php 
echo $form->textField($model, 'fullName');
?>
					</div>
					<?php 
echo $form->endControlGroup();
?>
				</div>
 public function actionPropertyCategory($id)
 {
     if (!$id) {
         throw new CHttpException(404, 'Property Category not found');
     }
     $propCatModel = PropertyCategory::model()->active()->findByPk($id);
     if (!$propCatModel) {
         throw new CHttpException(404, 'Property Category not found');
     }
     $this->render('propertyCategory', array('instructions' => Deal::model()->getCategorized($id, 'sales', null), 'propCatModel' => $propCatModel));
 }