0byt3m1n1-V2
Path:
/
home
/
nlpacade
/
www
/
arcaneoverseas.com
/
application
/
controllers
/
[
Home
]
File: partenaires.php
<?php if (!defined('BASEPATH')) exit('No direct script access allowed'); class Partenaires 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(); header ('Content-type: text/html; charset=utf-8'); //Instantiate a Doctrine Entity Manager $this->em = $this->doctrine->em; //combine css and js files $this->combineCss(); $this->combineJs(); } /** * * */ public function index(){ //render view $data = array(); $skuPage = "les_sites_amis"; //catégorie: $categorie = $this->categorieBySku("entreprise"); //liste des blocks $data['bandeauSup'] = $this->categorie(1) ; $data['bandeuMiddel'] = $this->categorie(2) ; $data['bandeuBottom'] = $this->categorie(3) ; //liste des sous menu $data['subMenu'] = $this->sub_categorie(); //liste des coups_de_coeur $coups_de_coeur = $this->categorieBySku("coups_de_coeur"); $data['coups_de_coeur'] = $coups_de_coeur; //liste des actualités $partenaires = $this->em->getRepository('Entities\GestionContenu')->getContenuByType(5); //fil d'ariane $page = $this->em->getRepository('Entities\GestionContenu')->findPage($skuPage); $filariane = array(); $filariane['categorie']['title'] = $page->getSubCategorie()->getCategories()->getTitre(); $filariane['categorie']['link'] = site_url($page->getSubCategorie()->getCategories()->getSku()).".html"; $filariane['SubCategorie']['title'] = ""; $filariane['SubCategorie']['link'] = ""; $filariane['article'] = $page->getTitre(); $data['filariane'] = $filariane; //data catégorie $data["categorie"] = $categorie; //handel layout $data["partenaires"] = $partenaires; $data["scrool"] = $skuPage; $this->layout->views('menu_top', $data) ->views('partenaires', $data) ->views('menu_center', $data) ->view('menu_bottom', $data); } /** * * Trouver Catégorie par Block */ public function categorie($block){ return $this->em->getRepository('Entities\Categorie')->findCategorieOrdre($block); } /** * Trouver catégorie par sku * */ public function categorieBySku($sku){ return $this->em->getRepository('Entities\Categorie')->findOneBySku($sku); } public function findPageBySubCategorieId($sub_categorie_id){ return $this->em->getRepository('Entities\GestionContenu')->findPageBySubCat($sub_categorie_id); } /** * Sous catégorie * */ public function sub_categorie(){ $sub_categories = $this->em->getRepository('Entities\SubCategorie')->findSubCategorieOrdre(); //to array $menu = array(); $collection = array(); foreach($sub_categories as $sub_categorie){ $menu['SubId'] = $sub_categorie->getId(); $menu['SubTitre'] = $sub_categorie->getTitre(); $menu['SubSku'] = $sub_categorie->getSku(); //$menu['SubSku'] = $sub_categorie->; $collection[$sub_categorie->getCategories()->getId()][] = $menu; } /* echo '<pre>'; print_r($collection);*/ return $collection; } /** * * */ public function combineCss() { if (combine_css == true && !@file(FCPATH . 'themes/css/all.css')) { $this->load->driver('minify'); $file = FCPATH . 'themes/css/reset.css'; $file2 = FCPATH . 'themes/css/style.css'; $file3 = FCPATH . 'themes/css/superfish.css'; $file4 = FCPATH . 'themes/css/jquery.jscrollpane.css'; $file5 = FCPATH . 'themes/css/colorbox.css'; $fileCombine = $this->minify->combine_files(array($file, $file2, $file3, $file4, $file5), 'css'); $this->minify->save_file($fileCombine, FCPATH . 'themes/css/all.css'); } } /** * * */ public function combineJs() { if (combine_js == true && !@file(FCPATH . 'themes/js/all.js')) { $this->load->driver('minify'); $file = FCPATH . 'themes/js/jquery.js'; $file2 = FCPATH . 'themes/js/custom.js'; $file3 = FCPATH . 'themes/js/superfish.js'; $file4 = FCPATH . 'themes/js/jquery.eislideshow.js'; $file5 = FCPATH . 'themes/js/jquery.easing.1.3.js'; $file6 = FCPATH . 'themes/js/jquery.colorbox-min.js'; $file7 = FCPATH . 'themes/js/jflickrfeed.min.js'; $file8 = FCPATH . 'themes/js/jquery.mousewheel.js'; $file9 = FCPATH . 'themes/js/jquery.scrollTo.js'; $file10 = FCPATH . 'themes/js/jquery.contentcarousel.js'; $fileCombine = $this->minify->js->combine_files(array($file, $file2, $file3, $file4, $file5, $file6, $file7, $file8, $file9, $file10), 'css'); $this->minify->save_file($fileCombine, FCPATH . 'themes/js/all.js'); } } } /* End of file welcome.php */ /* Location: ./application/controllers/welcome.php */
©
2018.