public function ajoutActivite() { $this->load->model("Theme"); $this->load->model("Activite"); switch ($_SERVER['REQUEST_METHOD']) { case 'GET': $data['themes'] = Theme::getAll(); $this->load->view("ajoutActivite", $data); break; case 'POST': if ($_POST['idTheme'] == -1) { // Theme inexistant if (Theme::exist($_POST['nomTheme'])) { // rediriger sur la page du formulaire $_SESSION["messagee"] = "Le theme existe déja"; header("Location:" . base_url() . "index.php/activites/gestionActivites"); exit; break; } else { // créer le theme puis l'activite $id = Theme::create($_POST['nomTheme']); $x = Activite::create($_POST['nomActivite'], $_POST['descriptionActivite'], $id); $_SESSION["messagee"] = "Insertion effectuée avec succès"; header("Location:" . base_url() . "index.php/activites/gestionActivites"); exit; break; } } else { // Theme existe Activite::create($_POST['nomActivite'], $_POST['descriptionActivite'], $_POST['idTheme']); $_SESSION["messagee"] = "Insertion effectuée avec succès"; header("Location:" . base_url() . "index.php/activites/gestionActivites"); exit; break; } } }
<?php if (!defined('GX_LIB')) { die("Direct Access Not Allowed!"); } /** * GeniXCMS - Content Management System * * PHP Based Content Management System and Framework * * @package GeniXCMS * @since 0.0.1 build date 20150219 * @version 0.0.6 * @link https://github.com/semplon/GeniXCMS * @link http://genixcms.org * @author Puguh Wijayanto (www.metalgenix.com) * @copyright 2014-2015 Puguh Wijayanto * @license http://www.opensource.org/licenses/mit-license.php MIT * */ header("HTTP/1.0 403 Forbidden"); if (Theme::exist('403')) { Theme::theme('403'); } else { echo "<center>\n <h1>Ooops!!</h1>\n <h2 style=\"font-size: 20em\">403</h2>\n <h3>Forbidden</h3>\n Back to <a href=\"" . Options::get('siteurl') . "\">" . Options::get('sitename') . "</a>\n </center>\n "; Site::footer(); }
<?php if (!defined('GX_LIB')) { die("Direct Access Not Allowed!"); } /** * GeniXCMS - Content Management System * * PHP Based Content Management System and Framework * * @package GeniXCMS * @since 0.0.1 build date 20150219 * @version 0.0.6 * @link https://github.com/semplon/GeniXCMS * @link http://genixcms.org * @author Puguh Wijayanto (www.metalgenix.com) * @copyright 2014-2015 Puguh Wijayanto * @license http://www.opensource.org/licenses/mit-license.php MIT * */ header("HTTP/1.0 404 Not Found"); if (Theme::exist('404')) { Theme::theme('404'); } else { echo "<center>\n <h1>Ooops!!</h1>\n <h2 style=\"font-size: 20em\">404</h2>\n <h3>Page Not Found</h3>\n Back to <a href=\"" . Options::get('siteurl') . "\">" . Options::get('sitename') . "</a>\n </center>\n "; Site::footer(); }
<?php if (!defined('GX_LIB')) { die("Direct Access Not Allowed!"); } /** * GeniXCMS - Content Management System * * PHP Based Content Management System and Framework * * @package GeniXCMS * @since 0.0.1 build date 20150219 * @version 0.0.6 * @link https://github.com/semplon/GeniXCMS * @link http://genixcms.org * @author Puguh Wijayanto (www.metalgenix.com) * @copyright 2014-2015 Puguh Wijayanto * @license http://www.opensource.org/licenses/mit-license.php MIT * */ header("HTTP/1.0 400 Bad Request"); if (Theme::exist('400')) { Theme::theme('400'); } else { echo "<center>\n <h1>Ooops!!</h1>\n <h2 style=\"font-size: 20em\">400</h2>\n <h3>Bad Request</h3>\n Back to <a href=\"" . Options::get('siteurl') . "\">" . Options::get('sitename') . "</a>\n </center>\n "; Site::footer(); }
<?php if (!defined('GX_LIB')) { die("Direct Access Not Allowed!"); } /** * GeniXCMS - Content Management System * * PHP Based Content Management System and Framework * * @package GeniXCMS * @since 0.0.1 build date 20150219 * @version 0.0.6 * @link https://github.com/semplon/GeniXCMS * @link http://genixcms.org * @author Puguh Wijayanto (www.metalgenix.com) * @copyright 2014-2015 Puguh Wijayanto * @license http://www.opensource.org/licenses/mit-license.php MIT * */ header("HTTP/1.0 500 Internal Server Error"); if (Theme::exist('500')) { Theme::theme('500'); } else { echo "<center>\n <h1>Ooops!!</h1>\n <h2 style=\"font-size: 20em\">500</h2>\n <h3>Internal Server Error</h3>\n Back to <a href=\"" . Options::get('siteurl') . "\">" . Options::get('sitename') . "</a>\n </center>\n "; Site::footer(); }