Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- defined('BASEPATH') OR exit('No direct script access allowed');
- class Main extends CI_Controller {
- public function __construct() {
- parent::__construct();
- }
- public function index() {
- if ( ! $this->session->userdata('logged') ) redirect('/login');
- $this->load->view('main/index',array('conteudo'=>'index'));
- }
- public function tabulacao() {
- if ( ! $this->session->userdata('logged') ) redirect('/login');
- $this->load->library('form_validation');
- $this->form_validation->set_rules('teste', 'TESTE', 'required');
- $this->form_validation->set_message('required','Este campo é obrigatório.');
- $this->form_validation->set_error_delimiters('', '');
- print("<h1>".$this->uri->segment(4)."</h1>");
- if ($this->form_validation->run() == True) {
- print('oi');
- }
- $conteudo='tabulacao';
- $this->load->view('tabulacao/index.php',array('conteudo'=>$conteudo));
- }
- public function cadastro() {
- if ( ! $this->session->userdata('logged') ) redirect('/login');
- switch ( $this->uri->segment(3) ) {
- case 'status':
- $this->load->library('grocery_CRUD');
- $crud=new grocery_CRUD();
- $crud->set_table('status');
- $output = $crud->render();
- $this->load->view('cadastro/status.php',$output);
- break;
- default:
- $this->load->view('main/index.php',array('conteudo'=>'cadastro'));
- break;
- }
- }
- public function relatorios() {
- if ( ! $this->session->userdata('logged') ) redirect('/login');
- $this->load->library('grocery_CRUD');
- $crud=new grocery_CRUD();
- $crud->set_table('mailing');
- $output = $crud->render();
- $this->load->view('main/relatorios.php',$output);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement