예제 #1
0
 public function index()
 {
     $this->load->library("gas");
     include "application/models/Cliente.php";
     $clientes = Model\Cliente::where('cli_estado', '1')->all();
     $data = array('clientes' => $clientes);
     $data['content'] = 'application/views/admin/cliente/cliente_list';
     $this->load->view('admin/index', $data);
 }
예제 #2
0
 public function save()
 {
     $this->load->library("gas");
     include "application/models/Cliente.php";
     $_POST['cli_estado'] = '1';
     $password = $_POST['cli_password'];
     $_POST['cli_password'] = md5($password);
     $email = Model\Cliente::where(array('cli_email' => $_POST['cli_email']))->all();
     if (count($email) > 0) {
         redirect('index.php/public/cliente/create?USEREXISTS');
     } else {
         $cliente = Model\Cliente::make($_POST);
         $cliente->save();
         redirect('index.php/auth/index');
     }
 }