public function editar($id)
 {
     $rep = new Reporte();
     $us = new Usuario();
     $tip = new Tipo();
     if (!$_POST) {
         $this->data = $rep->getReporte($id);
         $this->usuario = $us->getUsuario($this->data->usuario_id);
         $this->tipos = $tip->getTipos();
     } else {
         $r = $rep->updateReporte($id, $_POST);
         if ($r != false) {
             Flash::success('Los datos del reporte han sido modificados.');
             Redirect::to('');
         } else {
             Flash::error('No han podido modificarse los datos del reporte.');
             Redirect::to('');
         }
     }
 }
Exemplo n.º 2
0
                                title: "Local",
                                icon: "http://dl.dropbox.com/u/42818496/tipos/1.png" 
                        });
                        marca.setDraggable(true);	
                        google.maps.event.addListener(marca,'dragend',
                                                              function(){
                                                                      cen = <?php echo $map; ?>.getCenter();
                                                                      $('#Evento_lat').val(cen.lat());
                                                                      $('#Evento_lon').val(cen.lng());
                                                              }
                        );      
                }
        </script>
	<div class="row">
		<?php echo $form->labelEx($model,'tipo_idtipo'); ?>
		<?php
                        echo $form->dropDownList(
                                                 $model,'tipo_idtipo',
                                                 Tipo::getTipos()
                                                )
                ?>
		<?php echo $form->error($model,'tipo_idtipo'); ?>
        </div>

	<div class="row buttons">
		<?php echo CHtml::submitButton($model->isNewRecord ? 'Create' : 'Save'); ?>
	</div>
        
<?php $this->endWidget(); ?>
        
</div><!-- form -->