| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374 |
- <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
- class Admin extends CI_Controller {
- public function __construct()
- {
- parent::__construct();
- if (!isset($_SERVER['PHP_AUTH_USER']) || $_SERVER['PHP_AUTH_USER'] != 'admin' || $_SERVER['PHP_AUTH_PW'] != 'Fernando1') {
- header('WWW-Authenticate: Basic realm="Acceso a Administrador"');
- header('HTTP/1.0 401 Unauthorized');
- die('Access Denied');
- }
- $this->load->database();
- $this->load->helper('url');
- $this->load->library('grocery_CRUD');
- }
- public function _example_output($output = null)
- {
- $this->load->view('example.php',(array)$output);
- }
- public function offices()
- {
- $output = $this->grocery_crud->render();
- $this->_example_output($output);
- }
- public function index()
- {
- $this->_example_output((object)array('output' => '' , 'js_files' => array() , 'css_files' => array()));
- }
- public function deptos()
- {
- $crud = new grocery_CRUD();
- $crud->set_table('datos_x_depto');
- $output = $crud->render();
- $this->_example_output($output);
- }
- public function distribuidoras()
- {
- $crud = new grocery_CRUD();
- $crud->set_table('distribuidoras');
- $output = $crud->render();
- $this->_example_output($output);
- }
- public function datospanel()
- {
- $crud = new grocery_CRUD();
- $crud->set_table('datosPanel');
- $output = $crud->render();
- $this->_example_output($output);
- }
- }
|