Пример #1
0
 public function index($data = null)
 {
     // carregar variaveis globais
     require ROOT_WEBSITE . "scripts/load_globals.php";
     $authenticated = false;
     $authentication = new cadastro_controller();
     $this->authenticated = $authentication->authenticate($uri);
     $css_files = write_css_header(array("index"));
     $js_files = write_js_header(array("index"));
     include $template_directory . "header.inc.php";
     include $template_directory . "index.inc.php";
     include $template_directory . "footer.inc.php";
 }
Пример #2
0
 public function dados_system()
 {
     // carregar variaveis globais
     require ROOT_WEBSITE . "scripts/load_globals.php";
     $authenticated = false;
     $authentication = new cadastro_controller();
     $this->authenticated = $authentication->authenticate($uri);
     // se o campo hidden foi enviado redireciono para a HOME
     if (get_vars("ok") && get_vars("email-send")) {
         header("Location: " . $base_url_site);
         header("Content-Length: 0");
         exit;
     }
     // se clicar no botão voltar
     if (get_vars("back")) {
         header("Location: " . $alias);
         header("Content-Length: 0");
         exit;
     }
     // se nao digitou o nome
     if (get_vars("ok") && !get_vars("nome")) {
         if (!isset($_SESSION["error_message"])) {
             $_SESSION["error_message"] = "Campo nome é obrigatório!";
         }
     }
     // se nao digitou o email
     if (get_vars("ok") && !get_vars("email")) {
         if (!isset($_SESSION["error_message"])) {
             $_SESSION["error_message"] = "Campo e-mail é obrigatório!";
         }
     }
     // se digitou email
     if (get_vars("ok") && get_vars("email")) {
         if (!check_email(get_vars("email"))) {
             if (!isset($_SESSION["error_message"])) {
                 $_SESSION["error_message"] = "E-mail digitado não é válido!";
             }
         } else {
             $results = $this->model->check_email_exists(get_vars("email"), $_SESSION["login_data_site"]["user_key"]);
             if ($results) {
                 if (!isset($_SESSION["error_message"])) {
                     $_SESSION["error_message"] = "E-mail digitado já consta em nossa base de dados!";
                 }
             }
         }
     }
     if (get_vars("ok") && !get_vars("login")) {
         if (!isset($_SESSION["error_message"])) {
             $_SESSION["error_message"] = "Campo login é obrigatório!";
         }
     }
     // se digitou login
     if (get_vars("ok") && get_vars("login")) {
         $results = $this->model->check_login_exists(get_vars("login"), $_SESSION["login_data_site"]["user_key"]);
         if ($results) {
             if (!isset($_SESSION["error_message"])) {
                 $_SESSION["error_message"] = "Login digitado já consta em nossa base de dados!";
             }
         }
     }
     // se redefiniu a senha
     if (get_vars("ok") && get_vars("login") && get_vars("nome") && get_vars("email") && !get_vars("email-send")) {
         $data = array('nome' => get_vars('nome'), 'email' => get_vars('email'), 'login' => get_vars('login'), 'user' => $_SESSION["login_data_site"]["user_key"]);
         $this->model->update_user($data);
         $_SESSION["login_data_site"]["login"] = get_vars('login');
         $_SESSION["login_data_site"]["full_name"] = get_vars('nome');
         $_SESSION["login_data_site"]["email"] = get_vars('email');
         $_SESSION["info_message"] = 'Dados atualizados com sucesso!';
     }
     include $template_directory . "header.inc.php";
     include $template_directory . "meus_dados.inc.php";
     include $template_directory . "footer.inc.php";
     $connection->disconnect();
 }
Пример #3
0
 public function rota_system()
 {
     // carregar variaveis globais
     require ROOT_WEBSITE . "scripts/load_globals.php";
     $authenticated = false;
     $authentication = new cadastro_controller();
     $this->authenticated = $authentication->authenticate($uri);
     if (!get_vars('ponto') || !get_vars('destino') || !get_vars('lat') || !get_vars('lng') || !get_vars('onibus')) {
         header("Location: " . $base_url_site);
     }
     $complement_title = htmlspecialchars("Meu Destino - " . get_vars('ponto'));
     $meta_description = htmlspecialchars(get_vars('ponto'));
     $css_files = write_css_header(array("rota"));
     $js_files = write_js_header(array("rota"));
     $google_api = true;
     include $template_directory . "header.inc.php";
     include $template_directory . "rota.inc.php";
     include $template_directory . "footer.inc.php";
 }