Exemple #1
0
            $mainController->cambiarswitch();
            break;
        case ConfigApp::$ACTION_AGREGAR_HABITACION:
            $mainController = new mainController();
            $mainController->agregarHabitacion();
            break;
        case ConfigApp::$ACTION_ELIMINAR_HABITACION:
            $mainController = new mainController();
            $mainController->eliminarHabitacion();
            break;
        case ConfigApp::$ACTION_AGREGAR_COMPONENTE:
            $mainController = new mainController();
            $mainController->agregarComponente();
            break;
        case ConfigApp::$ACTION_ELIMINAR_COMPONENTE:
            $mainController = new mainController();
            $mainController->eliminarComponente();
            break;
        case ConfigApp::$ACTION_REFRESCAR_DROPY_ELIMINAR_COMPONENTE:
            $mainController = new mainController();
            $mainController->refrescarDropyEliminarComponente();
            break;
        case ConfigApp::$ACTION_REFRESCAR_ADMINISTRAR:
            $mainController = new mainController();
            $mainController->refrescarAdministrar();
            break;
        default:
            echo 'Pagina no encontrada';
            break;
    }
}
 public static function params($request, $context)
 {
     try {
         $u = context::getSessionAttribute("utilisateur");
         // Enregistrer le profil public
         if (key_exists("enregistrerProfil", $request)) {
             $u->statut = htmlspecialchars($request["statut"], $flags = ENT_QUOTES | ENT_HTML401);
             $u->prenom = $request["prenom"];
             $u->nom = $request["nom"];
             if (key_exists("avatar", $_FILES) && $_FILES["avatar"]["size"] > 0) {
                 $path = mainController::uploadImage("avatar", mainController::REPERTOIRE_AVATAR, $u->id);
                 if (empty($path)) {
                     // Si on n'arrive pas à stocker l'image, on ne s'arrête pas.
                     context::setSessionAttribute("erreur", new Exception("Il y a eu une erreur pour télécharger l'avatar."));
                 } else {
                     $u->avatar = $path;
                 }
             }
             if (is_null($u->save())) {
                 throw new Exception("Il y a eu une erreur pour enregistrer le profil public.");
             } else {
                 context::setSessionAttribute("succes", "Le profil à bien été modifié.");
                 return context::SUCCESS;
             }
         } else {
             if (key_exists("enregistrerSecurite", $request)) {
                 // On contrôle le mot de passe actuel
                 $returnLogin = utilisateurTable::getUserByLoginAndPass($u->identifiant, $request['passwordActuel']);
                 if (is_null($returnLogin)) {
                     throw new Exception("Le mot de passe actuel n'est pas correct!");
                 }
                 // On contrôle que les nouveaux mot de passe soient égales et pas vides
                 if (empty($request["passwordNouveau"])) {
                     throw new Exception("Le nouveau mot de passe est vide.");
                 }
                 if ($request["passwordNouveau"] != $request["passwordRepete"]) {
                     throw new Exception("Les nouveaux mots de passe ne sont pas égales.");
                 }
                 // Enfin, on stocke le nouveau mot de passe dans la base
                 $u->pass = sha1($request["passwordNouveau"]);
                 if (is_null($u->save())) {
                     throw new Exception("Il y a eu une erreur pour enregistrer les paramètres de sécurité");
                 } else {
                     context::setSessionAttribute("succes", "Le nouveau mot de passe à bien été modifié.");
                     return context::SUCCESS;
                 }
             } else {
                 return context::SUCCESS;
             }
         }
     } catch (Exception $e) {
         context::setSessionAttribute("erreur", $e);
         return context::ERROR;
     }
 }
Exemple #3
0
  <link rel="stylesheet" href="css/screen.css">
    <!-- Just for debugging purposes. Don't actually copy this line! -->
    <!--[if lt IE 9]><script src="../../assets/js/ie8-responsive-file-warning.js"></script><![endif]-->

    <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
      <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
      <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
  </head>

  <body>
	 <?php 
include_once "controllers/mainController.php";
include_once "controllers/notificationController.php";
$controller = new mainController();
$notification = new notificationController();
?>
<!--   <div class="navbar navbar-fixed-top" role="navigation">
    <div class="container-fluid">
      <div class="navbar-header">
       <a class="navbar-brand" href="index.php?subMenuID=1" style="margin: 0px; padding: 0px">
          <img src="img/banner2.jpg"/>
       </a>        
        <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
          <span class="sr-only">Toggle navigation</span>
          <span class="icon-bar"></span>
          <span class="icon-bar"></span>
          <span class="icon-bar"></span>
        </button>
      </div>
Exemple #4
0
<?php

include_once "Controllers/mainController.php";
$main = new mainController();
$main->invoke();
Exemple #5
0
<?php

include '../config/config.php';
$controller = new mainController();
$controller->redirect();
class mainController
{
    /**
     * 	This function will be called when returning the consumer back to the webshop. Within this function you can update the order (first request the transaction status then), or redirect the consumer back to your stores thank you page.
     */
    public function redirect()
    {
        if (isset($_GET['view'])) {
            $view = "view=" . $_GET['view'];
        } else {
            $view = "view=return";
        }
        $return_url = substr(BASE_URL, 0, -12) . 'index.php?' . $view . '&transactionid=' . $_GET['transactionid'];
        header("Location: " . $return_url);
    }
}