/**
  * Deletes a particular model.
  * If deletion is successful, the browser will be redirected to the 'admin' page.
  * @param integer $id the ID of the model to be deleted
  */
 public function actionCargaatributos()
 {
     //$criteria = new CDbCriteria();
     //$criteria->addCondition("c_hcod=:proved");
     $valor = $_POST['lugarcitos'];
     $data = CHtml::listData(MaestroAtributos::model()->findAll("hid=" . $valor . ""), "id", "nombreat");
     echo CHtml::tag('option', array('value' => null), CHtml::encode('Escoja un atributo'), true);
     foreach ($data as $value => $name) {
         echo CHtml::tag('option', array('value' => $value), CHtml::encode($name), true);
     }
     //echo "h add  ola";
 }
 /**
  * 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 MaestroAtributos the loaded model
  * @throws CHttpException
  */
 public function loadModel($id)
 {
     $model = MaestroAtributos::model()->findByPk($id);
     if ($model === null) {
         throw new CHttpException(404, 'El enlace o direccion solicitado no existe');
     }
     return $model;
 }