//classes loading begin function classLoad($myClass) { if (file_exists('../admin/model/' . $myClass . '.php')) { include '../admin/model/' . $myClass . '.php'; } elseif (file_exists('../admin/controller/' . $myClass . '.php')) { include '../admin/controller/' . $myClass . '.php'; } } spl_autoload_register("classLoad"); include '../include/config.php'; //classes loading end //class managers $sliderImageManager = new SliderImageManager($pdo); $sliderVideoManager = new SliderVideoManager($pdo); $configManager = new ConfigManager($pdo); $projetManager = new ProjetManager($pdo); $imageManager = new ImageManager($pdo); //classes $projets = $projetManager->getProjets(); $sliderImages = $sliderImageManager->getSliderImages(); $sliderVideos = $sliderVideoManager->getSliderVideos(); $config = $configManager->getConfig(); ?> <!DOCTYPE html> <html dir="ltr" lang="en-US"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <meta name="author" content="SemiColonWeb" />
} elseif (file_exists('../controller/' . $myClass . '.php')) { include '../controller/' . $myClass . '.php'; } } spl_autoload_register("classLoad"); include '../../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 $sliderVideoManager = new SliderVideoManager($pdo); //Action Add Processing Begin if ($action == "add") { if (!empty($_POST['name'])) { $name = htmlentities($_POST['name']); $url = htmlentities($_POST['url']); $description = htmlentities($_POST['description']); $createdBy = $_SESSION['userAnnahdaSite']->login(); $created = date('Y-m-d h:i:s'); //create object $sliderVideo = new SliderVideo(array('name' => $name, 'url' => $url, 'description' => $description, 'created' => $created, 'createdBy' => $createdBy)); //add it to db $sliderVideoManager->add($sliderVideo); $actionMessage = "Opération Valide : SliderVideo Ajouté(e) avec succès."; $typeMessage = "success"; } else {