Example #1
0
 /**
  * 
  * Retorna as bolsas que acabam em 6 meses 
  */
 public static function getLasts()
 {
     $criteria = new CDbCriteria();
     $dataLimite = date("d/m/Y", mktime(0, 0, 0, date("m") + 6, date("d"), date("Y")));
     $dataAtual = date("d/m/Y");
     $criteria->addCondition("t.data_fim <= '{$dataLimite}'", 'AND');
     $criteria->addCondition("t.data_fim >= '{$dataAtual}'", 'AND');
     $criteria->order = 't.data_fim DESC';
     return PessoaFinanceiro::model()->findALL($criteria);
 }
 /**
  * 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 = PessoaFinanceiro::model()->findByPk((int) $id);
     if ($model === null) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     return $model;
 }
Example #3
0
 - <?php 
        echo $p->data_fim;
        ?>
</p>
			<?php 
    }
    ?>
			</div>
		<?php 
}
?>
		
		<!-- Bolsas que terminam -->
		
		<?php 
$bolsas = PessoaFinanceiro::getLasts();
?>
		<?php 
if (count($bolsas) > 0) {
    ?>
			<div class="view">
			<h4>Bolsas que Terminam Dentro de 6 Meses</h4>
			<?php 
    foreach ($bolsas as $b) {
        ?>
				<p><?php 
        echo $b->categoria . ' - ' . $b->pessoa->nome;
        ?>
 - <?php 
        echo $b->data_fim;
        ?>
Example #4
0
		<?php 
echo $form->listBox($model, 'pessoas', CHtml::listData(Pessoa::model()->findAll(array('order' => 'equipe_atual DESC, nome')), 'cod_pessoa', 'nome', 'equipe'), array("multiple" => "multiple", "size" => "10"));
?>
		<?php 
echo $form->error($model, 'pessoas');
?>
		<div class="hint">Segure a tecla <b>CTRL</b> para selecionar mais de uma pessoa.</div><br>
	</div>
	
	
	<div class="row">	
		<?php 
echo $form->labelEx($model, 'bolsas');
?>
		<?php 
echo $form->listBox($model, 'bolsas', CHtml::listData(PessoaFinanceiro::model()->with('pessoa')->findAll(array('order' => 'pessoa.nome')), 'cod_financeiro', 'resumo', 'pessoa.nome'), array("multiple" => "multiple", "size" => "10"));
?>
		<div class="hint">Segure a tecla <b>CTRL</b> para selecionar mais de uma bolsa.</div><br>
	</div>

	<div class="row buttons">
		<?php 
echo CHtml::submitButton($model->isNewRecord ? 'Adicionar' : 'Salvar');
?>
	</div>

<?php 
$this->endWidget();
?>

</div><!-- form -->