Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * Aluno_info_Controller
- *
- * @uses Template
- * @uses _Controller
- * @package
- * @version $id$
- * @copyright 1997-2005 The SPACEONLINE GROUP
- * @author Márcio Dias <suporte@spaceonline.com.br>
- * @license PHP Version 5.3
- */
- class Teste_Controller extends Template_Controller {
- // Do not allow to run in production
- const ALLOW_PRODUCTION = FALSE;
- // Use the default Kohana template
- public $template = 'themes/base_page';
- // Currently logged in user
- protected $user;
- /**
- * __construct
- *
- * @access public
- * @return void
- */
- public function __construct()
- {
- parent::__construct();
- // Load sessions, to support logins
- $this->session = Session::instance();
- if (Auth::instance()->logged_in())
- {
- // Set the current user
- $this->user = $_SESSION['auth_user'];
- }
- }
- /**
- * index
- *
- * @access public
- * @return void
- */
- public function index()
- {
- if ($_POST) {
- $post = $_POST;
- $where_mes = "";
- foreach($post['mes'] as $mes) {
- $where_mes .= '->where("mes_ref", '."$mes".')';
- }
- $where_ano = "";
- foreach($post['ano'] as $ano) {
- $where_ano .= '->where("ano_ref", '."$ano".')';
- }
- $where_curso = "";
- foreach($post['curso'] as $curso) {
- $where_curso .= '->where("nome_curso", '."$curso".')';
- }
- $query_orm = "$where_mes"."$where_ano"."$where_curso";
- $this->template->alunos = ORM::factory('cliente').$query_orm.->find_all();
- $this->template->content = "$where_mes"."$where_ano"."$where_curso";
- }
- }
- }
- ?>
Add Comment
Please, Sign In to add comment