include 'controller/' . $myClass . '.php'; } } spl_autoload_register("classLoad"); include 'config.php'; //classes loading end session_start(); if (isset($_SESSION['userMerlaTrav'])) { $showTodos = 0; if ($_SESSION['userMerlaTrav']->profil() == "admin") { $showTodos = 1; } //classes managers $usersManager = new UserManager($pdo); $mailManager = new MailManager($pdo); $collaborationManager = new CollaborationManager($pdo); //classes and vars //users number $users = $usersManager->getUsers(); //$mails = $mailManager->getMails(); $ideas = $collaborationManager->getCollaborations(); ?> <!DOCTYPE html> <!--[if IE 8]> <html lang="en" class="ie8"> <![endif]--> <!--[if IE 9]> <html lang="en" class="ie9"> <![endif]--> <!--[if !IE]><!--> <html lang="en"> <!--<![endif]--> <!-- BEGIN HEAD --> <head> <meta charset="UTF-8" /> <title>ImmoERP - Management Application</title> <meta content="width=device-width, initial-scale=1.0" name="viewport" />
} elseif (file_exists('../controller/' . $myClass . '.php')) { include '../controller/' . $myClass . '.php'; } } spl_autoload_register("classLoad"); include '../config.php'; include '../lib/image-processing.php'; //classes loading end session_start(); //post input processing $action = htmlentities($_POST['action']); //This var contains result message of CRUD action $actionMessage = ""; $typeMessage = ""; //Component Class Manager $collaborationManager = new CollaborationManager($pdo); //Action Add Processing Begin if ($action == "add") { if (!empty($_POST['titre'])) { $titre = htmlentities($_POST['titre']); $description = htmlentities($_POST['description']); $status = htmlentities($_POST['status']); $duree = htmlentities($_POST['duree']); $createdBy = $_SESSION['userMerlaTrav']->login(); $created = date('Y-m-d h:i:s'); //create object $collaboration = new Collaboration(array('titre' => $titre, 'description' => $description, 'status' => $status, 'duree' => $duree, 'created' => $created, 'createdBy' => $createdBy)); //add it to db $collaborationManager->add($collaboration); $actionMessage = "Opération Valide : Collaboration Ajouté(e) avec succès."; $typeMessage = "success";