Exemple #1
0
<div class="view">

	<b><?php 
echo CHtml::link(CHtml::encode($data->nome), array('view', 'id' => $data->cod_item));
?>
</b>
	<br />

	<b><?php 
echo CHtml::encode('Termo');
?>
:</b>
	<?php 
echo CHtml::link(CHtml::encode(PatrimonioTermo::model()->findByPk($data->cod_termo)->nro_termo_responsabilidade), array('patrimoniotermo/view', 'id' => $data->cod_termo));
?>
	<br />

	<b><?php 
echo CHtml::encode($data->getAttributeLabel('nome'));
?>
:</b>
	<?php 
echo CHtml::encode($data->nome);
?>
	<br />

	<b><?php 
echo CHtml::encode($data->getAttributeLabel('nro_patrimonio'));
?>
:</b>
	<?php 
Exemple #2
0
	<p class="note">Campos com <span class="required">*</span> são obrigatórios.</p>

	<?php 
echo $form->errorSummary($model);
?>

	<div class="row">
			<label>Número do Termo de Responsabilidade <span class="required">*</span></label>
			<?php 
$termos = array();
?>
			<?php 
$termos["NULL"] = "Não Selecionado";
?>
			<?php 
$termos = $termos + CHtml::listData(PatrimonioTermo::model()->findAll(array('order' => 'nro_termo_responsabilidade')), 'cod_termo', 'nro_termo_responsabilidade');
?>
			<?php 
echo $form->dropDownList($model, 'cod_termo', $termos);
?>
			<?php 
echo $form->error($model, 'cod_termo');
?>
		</div>

	<div class="row">
		<?php 
echo $form->labelEx($model, 'nome');
?>
		<?php 
echo $form->textField($model, 'nome');
Exemple #3
0
<?php

$this->breadcrumbs = array('Patrimônios' => array('index'), 'Gerenciar');
$this->menu = array(array('label' => 'Termos de Patrimônios', 'url' => array('patrimoniotermo/index')), array('label' => 'Todos os Patrimônios', 'url' => array('index')), array('label' => 'Criar Patrimônio', 'url' => array('create')));
Yii::app()->clientScript->registerScript('search', "\n\$('.search-button').click(function(){\n\t\$('.search-form').toggle();\n\treturn false;\n});\n\$('.search-form form').submit(function(){\n\t\$.fn.yiiGridView.update('patrimonio-item-grid', {\n\t\tdata: \$(this).serialize()\n\t});\n\treturn false;\n});\n");
?>

<h1>Gerenciar Patrimônios
<?php 
if (isset($model->cod_termo)) {
    ?>
 do Termo #<?php 
    echo PatrimonioTermo::model()->findByPk($model->cod_termo)->nro_termo_responsabilidade;
}
?>
</h1>

<?php 
echo CHtml::link('Pesquisa Avançada', '#', array('class' => 'search-button'));
?>
<div class="search-form" style="display:none">
<?php 
$this->renderPartial('_search', array('model' => $model));
?>
</div><!-- search-form -->

<?php 
$this->widget('zii.widgets.grid.CGridView', array('id' => 'patrimonio-item-grid', 'dataProvider' => $model->search(), 'filter' => $model, 'columns' => array('nome', 'nro_patrimonio', 'valor', array('class' => 'CButtonColumn'))));
 /**
  * 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 = PatrimonioTermo::model()->findByPk((int) $id);
     if ($model === null) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     return $model;
 }