public function nueva()
 {
     View::select(null, "json");
     $nueva = new Especie(Input::post("especie"));
     if ($nueva->save()) {
         $buscar = new Especie();
         $options = $buscar->getInOptionsFormat();
         $this->data = array("valid" => true, "mensaje" => "Especie Agregada con éxito", "html" => $options);
     } else {
         $this->data = array("valid" => false, "mensaje" => strip_tags(str_replace("<br>", "\n", ob_get_contents())));
     }
 }
Esempio n. 2
0
	<div class="row">
		<?php 
echo $form->labelEx($model, 'termino');
?>
		<?php 
echo $form->textField($model, 'termino', array('disabled' => 'disabled', 'size' => 60, 'maxlength' => 60));
?>
		
	</div>
	
	<div class="row">
		<?php 
echo $form->labelEx($model, 'idespecie');
?>
		<?php 
$datos = CHtml::listData(Especie::model()->findAll(), 'id', 'nomespecie');
?>
		<?php 
echo $form->DropDownList($model, 'idespecie', $datos, array('empty' => '--Seleccione una Especie--'));
?>
		<?php 
echo $form->error($model, 'idespecie');
?>
		
	</div>
    <div class="row">
		<?php 
echo $form->labelEx($model, 'fechadehoy');
?>
	<?php 
$this->widget('zii.widgets.jui.CJuiDatePicker', array('model' => $model, 'attribute' => 'fechadehoy', 'language' => 'es', 'value' => $model->fechadehoy, 'options' => array('showAnim' => 'fold', 'showButtonPanel' => true, 'autoSize' => true, 'dateFormat' => 'yy-mm-dd')));