/** * This method returns all the property transaction types. * Returns model if successfully found. * Returns false if not found. * * @return model || false */ public static function getAll() { $property_transactionTypes = PropertyTransactionTypes::model()->findAll(); if ($property_transactionTypes) { return $property_transactionTypes; } else { return false; } }
/** * 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 = PropertyTransactionTypes::model()->findByPk($id); if ($model === null) { throw new CHttpException(404, 'The requested page does not exist.'); } return $model; }
<?php break; default: ?> <fieldset><legend>Property Details</legend> <ul> <li><span><?php echo CHtml::activeLabelEx($model, 'transaction_type_id'); ?> <span class="required">*</span></span> <?php echo CHtml::activeDropdownList($model, 'transaction_type_id', CHtml::listData(PropertyTransactionTypes::model()->findAll(), 'id', 'transaction_type'), array('empty' => 'Select', 'class' => 'slctbox')); ?> </li> <li class="error_message"><?php echo CHtml::error($model, 'transaction_type_id'); ?> </li> </ul> <ul> <li><span><?php echo CHtml::activeLabelEx($model, 'bedrooms'); ?> <span class="required">*</span></span> <span id="bedrooms-input"> <?php if ($model->bedrooms <= 10) { ?>
<input type="radio" name="Property[i_want_to]" value="Lease" id="lease" <?php echo $leaseChecked; ?> > <label for="Property_i_want_to_0" style="display:inline">Lease</label> </td> </tr> <tr> <td><label>Property Type</label> <?php echo $form->dropDownList($modelProperty, 'property_type_id', CHtml::listData(PropertyTypes::model()->findAll(), 'id', 'property_type'), array('class' => 'select_box', 'empty' => 'All', 'ajax' => array('type' => 'POST', 'url' => CController::createUrl('/front/property/searchcriteria'), 'update' => '#searchcriteria', 'data' => 'js:jQuery(this).serialize()'))); ?> </td> </tr> <tr> <td><label>Transaction Type</label> <?php echo $form->dropDownList($modelProperty, 'transaction_type_id', CHtml::listData(PropertyTransactionTypes::model()->findAll(), 'id', 'transaction_type'), array('class' => 'select_box', 'empty' => 'All')); ?> </td> </tr> <tr> <td>Keyword(s)<input type="text" name="keyword" class="txt-box1" value="<?php echo isset($_POST['keyword']) ? $_POST['keyword'] : ''; ?> " /></td> </tr> </table> </div> </li> <li> <h3>Location</h3> <div class="acc-section">