Guest User

Untitled

a guest
Jun 21st, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. <?php
  2. class Teste_Controller extends Template_Controller {
  3.  
  4. const ALLOW_PRODUCTION = FALSE;
  5.  
  6. public $template = 'themes/base_page';
  7.  
  8. // Currently logged in user
  9. protected $user;
  10.  
  11. public function __construct()
  12. {
  13. parent::__construct();
  14.  
  15. }
  16.  
  17. /**
  18. * index
  19. *
  20. * @access public
  21. * @return void
  22. */
  23. public function index()
  24. {
  25. if ($_POST) {
  26.  
  27. $post = $_POST;
  28.  
  29. $alunos = ORM::factory('cliente');
  30.  
  31. foreach($post['mes'] as $mes) { $alunos->where('mes_ref', $mes); }
  32.  
  33. foreach($post['ano'] as $ano) { $alunos->where('ano_ref', $ano); }
  34.  
  35. foreach($post['curso'] as $curso) { $alunos->where('nome_curso', $curso); }
  36.  
  37. $this->template->alunos = $alunos->find_all();
  38.  
  39. $this->template->content = new View("teste");
  40. }
  41. }
  42.  
  43. }
  44.  
  45.  
  46. ?>
Add Comment
Please, Sign In to add comment