0byt3m1n1-V2
Path:
/
home
/
nlpacade
/
www
/
arcaneoverseas.com
/
application
/
controllers
/
admin
/
[
Home
]
File: config.php
<?php if (!defined('BASEPATH')) exit('No direct script access allowed'); class Config extends CI_Controller { /** * Index Page for this controller. * * Maps to the following URL * http://example.com/index.php/welcome * - or - * http://example.com/index.php/welcome/index * - or - * Since this controller is set as the default controller in * config/routes.php, it's displayed at http://example.com/ * * So any other public methods not prefixed with an underscore will * map to /index.php/welcome/<method_name> * @see http://codeigniter.com/user_guide/general/urls.html */ /* * Doctrine EntityManager */ public $em; /* * constructeur */ public function __construct() { parent::__construct(); /* Session controle */ if ($this->session->userdata("logged_in") != true) redirect('admin/login/index'); /* Standard Libraries */ $this->layout->set_theme('admin/interne_page'); //Instantiate a Doctrine Entity Manager $this->em = $this->doctrine->em; /* Standard Libraries */ $this->load->database(); $this->load->helper('url'); /* Load Crud */ $this->load->library('grocery_CRUD'); } public function index() { $data = array(); $crud = new grocery_CRUD(); $crud->set_table('config'); $crud->display_as('nom_du_site', 'Nom du site'); $crud->display_as('adresse_email_contact', 'Email Module Nous écrire'); $crud->display_as('adresse_email_club', 'Email Module Club'); $crud->display_as('adresse_email_cv', 'Email Module CV'); $crud->display_as('url', 'Lien du site'); $crud->display_as('google_analytics', 'Google Analytiques'); $crud->required_fields('nom_du_site', 'adresse_email_contact','adresse_email_club','adresse_email_cv'); $crud->columns('nom_du_site', 'adresse_email_contact', 'adresse_email_club','activer_cache'); $crud->unset_texteditor('adresse','seo_keyword'); $crud->unset_texteditor('google_analytics','seo_keyword'); $crud->callback_field('activer_cache', array($this, 'callback_active')); $crud->unset_delete(); $crud->unset_add(); $output = $crud->render(); $output->title_module = "Configuration générale" ; $output->ariane ='<a href="">Accueil</a> > <a href="">Configuration du site</a>> Configuration générale' ; $this->layout->views('admin/session_user') ->views('admin/header') ->views('admin/nav') ->view('admin/view_standart', $output); } public function callback_active($value = NULL) { $options = array('oui', 'non'); $option_tag = ''; foreach ($options as $option) { $attribute = 'value="' . $option . '"'; if ($option == $value) { $attribute .= ' selected="selected"'; } $option_tag .= "<option $attribute>$option</option>"; } return '<select name="column">' . $option_tag . '</select>'; } } /* End of file welcome.php */ /* Location: ./application/controllers/welcome.php */
©
2018.