?>
                            <?php 
$provinces = new Province();
echo $form->dropDownList($model, 'scope', $provinces->getDropdown(), array('empty' => 'Toàn quốc'));
?>
                            <?php 
echo $form->error($model, 'scope');
?>
                        </div>
                    
                        <div class="newrow">
                            <?php 
echo $form->labelEx($model, 'category');
?>
                            <?php 
$adsCategories = new AdvertisingCategory();
echo $form->dropDownList($model, 'category', $adsCategories->getDropdown());
?>
                            <?php 
echo $form->error($model, 'category');
?>
                        </div>
                    
                        <div class="newrow">
                            <?php 
echo $form->labelEx($model, 'type');
?>
                            <?php 
echo $form->dropDownList($model, 'type', array(1 => 'Mua', 0 => 'Bán'));
?>
                            <?php 
 /**
  * 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 $id the ID of the model to be loaded
  * @return AdvertisingCategory the loaded model
  * @throws CHttpException
  */
 public function loadModel($id)
 {
     $model = AdvertisingCategory::model()->findByPk($id);
     if ($model === null) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     return $model;
 }
 public function getDropdown()
 {
     global $dataDropdown;
     $dataDropdown = array();
     $parents = AdvertisingCategory::model()->with('levelTop')->findALl();
     foreach ($parents as $parent) {
         $dataDropdown[$parent->id] = $parent->name;
         $this->_subDropDown($parent->childCategories);
     }
     return $dataDropdown;
 }