Ejemplo n.º 1
0
 public function getInfoProduit($id_categorie = 0, $id_produit = 0, $debug = false)
 {
     if ($debug) {
         echo "--- id_categorie : " . $id_categorie . "<br>";
     }
     if ($debug) {
         echo "--- id_produit : " . $id_produit . "<br>";
     }
     // ---- On recherche le 1ier produit à afficher ------- //
     if ($id_produit == '') {
         $categorie = new Categorie();
         $produit_charge = false;
         // ---- Liste des catégories enfants ---------- //
         if (1 == 1) {
             unset($recherche);
             $recherche["id_parent"] = $id_categorie;
             $liste_categorie = $categorie->getListe($recherche, $debug);
         }
         // -------------------------------------------- //
         // ---- On prend le 1ier produit dans la liste  //
         if (!empty($liste_categorie)) {
             foreach ($liste_categorie as $_categorie) {
                 // ---- Recherche des produits associés à cette sous catégorie ---- //
                 unset($recherche);
                 $recherche["id_categorie"] = $_categorie["id"];
                 $recherche["online"] = '1';
                 $liste_produit = $this->getListe($recherche, $debug);
                 // ---------------------------------------------------------------- //
                 // ---- Affichage des produits ------------------------------------ //
                 if (!empty($liste_produit)) {
                     $id_produit = $liste_produit[0]["id"];
                 }
                 // ---------------------------------------------------------------- //
             }
         }
         // -------------------------------------------- //
     }
     // ---------------------------------------------------- //
     // ---- Produit renseigné --> On le charge ------------ //
     $data = $this->load(intval($id_produit), $debug);
     // ---------------------------------------------------- //
     return $data;
 }
Ejemplo n.º 2
0
<?php

include_once $_SERVER["DOCUMENT_ROOT"] . "/admin/classes/utils.php";
require $_SERVER["DOCUMENT_ROOT"] . "/inc/inc.config.php";
require $_SERVER["DOCUMENT_ROOT"] . "/admin/classes/Categorie.php";
require $_SERVER["DOCUMENT_ROOT"] . "/admin/classes/Produit.php";
require $_SERVER["DOCUMENT_ROOT"] . "/admin/classes/Produit_image.php";
$debug = false;
$categorie = new Categorie();
$produit = new Produit();
$produit_image = new Produit_image();
// ---- Liste des catégories de niveau 0 ------ //
if (1 == 1) {
    unset($recherche);
    $recherche["id_parent"] = 0;
    $liste_categorie = $categorie->getListe($recherche, $debug);
}
// -------------------------------------------- //
?>

<!doctype html>
<html class="no-js" lang="fr">
	<head>
		<title>Les différents aménagements de Modul-Ouest</title>
		<?php 
include $_SERVER["DOCUMENT_ROOT"] . "/inc/header.php";
?>
	</head>
	
	<body class="page">
Ejemplo n.º 3
0
<? include_once ( $_SERVER[ "DOCUMENT_ROOT" ] . "/admin/inc-auth-granted.php" );?>
<? include_once ( $_SERVER[ "DOCUMENT_ROOT" ] . "/admin/classes/utils.php" );?>
<? 
	require( $_SERVER[ "DOCUMENT_ROOT" ] . "/inc/inc.config.php" );
	require $_SERVER[ "DOCUMENT_ROOT" ] . "/admin/classes/Categorie.php";
	
	$debug = false;
	$categorie = new Categorie();
	
	// ---- Liste des catégories de niveau 0 ------ //
	if ( 1 == 1 ) {
		unset( $recherche );
		$recherche[ "id_parent" ] = 0;
		$liste_categorie = $categorie->getListe( $recherche, $debug );
	}
	// -------------------------------------------- //

	if ( empty( $liste_categorie ) ) {
		$message = 'Aucun enregistrement';
	} 
	else {
		$message = '';
	}

?>

<!doctype html>
<html class="no-js" lang="en">
	<head>
		<? include_once $_SERVER[ "DOCUMENT_ROOT" ] . "/admin/inc-meta.php";?>
	</head>