コード例 #1
0
function substitproduits($texte)
{
    global $ref, $reforig, $motcle, $id_produit, $classement, $prixmin, $prixmax, $nouveaute, $promo, $stockmini;
    $tproduit = new Produit();
    $tproduitdesc = new Produitdesc();
    $url = "";
    if ($ref) {
        $tproduit->charger($ref);
    } else {
        if ($id_produit) {
            $tproduit->charger_id($id_produit);
        }
    }
    if ($ref || $id_produit) {
        $tproduitdesc->charger($tproduit->id);
        $url = $tproduitdesc->getUrl();
    }
    $texte = str_replace("#PRODUIT_URL", $url, $texte);
    $texte = str_replace("#PRODUIT_ID", $tproduit->id, $texte);
    $texte = str_replace("#PRODUIT_NOM", $tproduitdesc->titre, $texte);
    $texte = str_replace("#PRODUIT_CHAPO", $tproduitdesc->chapo, $texte);
    $texte = str_replace("#PRODUIT_DESCRIPTION", $tproduitdesc->description, $texte);
    $texte = str_replace("#PRODUIT_POSTSCRIPTUM", $tproduitdesc->postscriptum, $texte);
    $texte = str_replace("#PRODUIT_RUBRIQUE", $tproduit->rubrique, $texte);
    $texte = str_replace("#PRODUIT_CLASSEMENT", "{$classement}", $texte);
    $texte = str_replace("#PRODUIT_STOCKMINI", "{$stockmini}", $texte);
    $texte = str_replace("#PRODUIT_PRIXMIN", "{$prixmin}", $texte);
    $texte = str_replace("#PRODUIT_PRIXMAX", "{$prixmax}", $texte);
    $texte = str_replace("#PRODUIT_NOUVEAUTE", "{$nouveaute}", $texte);
    $texte = str_replace("#PRODUIT_PROMO", "{$promo}", $texte);
    $texte = str_replace("#PRODUIT_MOTCLE", $motcle, $texte);
    $texte = str_replace("#PRODUIT_REFORIG", "{$reforig}", $texte);
    $texte = str_replace("#PRODUIT_REF", $tproduit->ref, $texte);
    return $texte;
}
コード例 #2
0
function contenuassoc_ajouter($request)
{
    if ($request->query->get('type') == 1) {
        $objet = new Produit();
        $objet->charger($request->query->get('objet'));
    } else {
        $objet = new Rubrique();
        $objet->charger($request->query->get('objet'));
    }
    $contenuassoc = new Contenuassoc();
    $query = "select max(classement) as maxClassement from {$contenuassoc->table} where objet=\"" . $objet->id . "\" and type=\"" . $request->query->get('type') . "\"";
    $resul = $contenuassoc->query($query);
    $classement = $contenuassoc->get_result($resul, 0, "maxClassement") + 1;
    $contenuassoc = new Contenuassoc();
    $contenuassoc->objet = $objet->id;
    $contenuassoc->type = $request->query->get('type');
    $contenuassoc->contenu = $request->query->get('id');
    $contenuassoc->classement = $classement;
    $contenuassoc->add();
    lister_contenuassoc($request->query->get('type'), $request->query->get('objet'));
    if ($contenuassoc->type == 1) {
        ActionsModules::instance()->appel_module("modprod", $objet);
    } else {
        ActionsModules::instance()->appel_module("modrub", $objet);
    }
}
コード例 #3
0
 /**
  * 
  * todo : utiliser cette methode pour la gestion des contenus associés aux produit // actuellement uniquement pour rubrique
  */
 public function add($contentToAddId, $type, $object)
 {
     if ($type == 1) {
         $objectInstance = new Produit();
         $objectInstance->charger($object);
     } else {
         $objectInstance = new Rubrique();
         $objectInstance->charger($object);
     }
     $contentToAdd = new Contenu();
     $this->id = '';
     if (!$this->existe($object, $type, $contentToAddId) && $contentToAdd->charger($contentToAddId)) {
         $classement = $this->getMaxRanking($objectInstance->id, $type) + 1;
         $this->objet = $objectInstance->id;
         $this->type = $type;
         $this->contenu = $contentToAdd->id;
         $this->classement = $classement;
         parent::add();
         if ($this->type == 1) {
             ActionsModules::instance()->appel_module("modprod", $objectInstance);
         } else {
             ActionsModules::instance()->appel_module("modrub", $objectInstance);
         }
     }
 }
コード例 #4
0
 protected function texte_url_reecrite()
 {
     $produit = new Produit();
     $produit->charger_id($this->produit);
     $rubriquedesc = new Rubriquedesc($produit->rubrique, $this->lang);
     return $produit->id . "-" . $rubriquedesc->titre . "-" . $this->titre . ".html";
 }
コード例 #5
0
ファイル: 1.5.0.php プロジェクト: anti-conformiste/thelia1
function ancien_rewrite_prod($ref, $lang = 1)
{
    $prod = new Produit();
    $prod->charger($ref);
    $proddesc = new Produitdesc();
    if (!$proddesc->charger($prod->id, $lang)) {
        return "";
    }
    $rubfinal = $prod->rubrique;
    if (function_exists('chemin_rub')) {
        $chem = chemin_rub($rubfinal);
    } else {
        $chem = chemin($rubfinal);
    }
    // 1.4.2.1 et avant
    if (!empty($chem)) {
        $rubriquedesc = new Rubriquedesc();
        $listrub = "";
        $rubriquedesc->charger($chem[count($chem) - 1]->rubrique, $lang);
        $listrub .= $rubriquedesc->titre . "_";
        $rubriquedesc->charger($chem[0]->rubrique, $lang);
        $listrub .= $rubriquedesc->rubrique . "_";
        for ($i = count($chem) - 2; $i >= 0; $i--) {
            $rubriquedesc->charger($chem[$i]->rubrique, $lang);
            $listrub .= $rubriquedesc->titre . "_";
        }
        $listrub .= $proddesc->titre . "__" . $prod->ref . ".html";
        return eregurl($listrub);
    } else {
        return "";
    }
}
コード例 #6
0
function accessoire_supprimer()
{
    $accessoire = new Accessoire();
    $accessoire->charger($_GET['id']);
    $produit = new Produit();
    $produit->charger($accessoire->produit);
    $accessoire->delete();
    lister_accessoires($_GET['ref']);
    ActionsModules::instance()->appel_module("modprod", $produit);
}
コード例 #7
0
function accessoire_ajouter()
{
    $produit = new Produit();
    $produit->charger($_GET['ref']);
    $accessoire = new Accessoire();
    $accessoire = new Accessoire();
    $accessoire->produit = $produit->id;
    $accessoire->accessoire = $_GET['id'];
    $accessoire->add();
    lister_accessoires($_GET['ref']);
}
コード例 #8
0
ファイル: DaoProduit.php プロジェクト: aureliensauv/app-stock
 function getListProduit()
 {
     $sql = new SQL();
     $sql->connect();
     $sql->exe_select("select * from produit");
     $items = array();
     for ($i = 1; $i <= $sql->nbresult(); $i++) {
         $produit = new Produit();
         $produit->__set('idProduit', $sql->recup($i, 'ID_PRODUIT'));
         $produit->__set('libelle', $sql->recup($i, 'LIBELLE'));
         $items[] = $produit;
     }
     return $items;
 }
コード例 #9
0
function lister_contenuassoc($type, $objet)
{
    if ($type == 1) {
        $obj = new Produit();
        $obj->charger($objet);
    } else {
        $obj = new Rubrique();
        $obj->charger($objet);
    }
    $contenuassoc = new Contenuassoc();
    $contenua = new Contenu();
    $contenuadesc = new Contenudesc();
    $query = "select * from {$contenuassoc->table} where type='{$type}' and objet='{$obj->id}' order by classement";
    $resul = $contenuassoc->query($query);
    $i = 0;
    while ($resul && ($row = $contenuassoc->fetch_object($resul))) {
        $fond = $i++ % 2 ? "fonce" : "claire";
        $contenua->charger($row->contenu);
        $contenuadesc->charger($contenua->id);
        $dossierdesc = new Dossierdesc();
        $dossierdesc->charger($contenua->dossier);
        ?>
		<li class="<?php 
        echo $fond;
        ?>
">
				<div class="cellule" style="width:260px;"><?php 
        echo $dossierdesc->titre;
        ?>
</div>
				<div class="cellule" style="width:260px;"><?php 
        echo $contenuadesc->titre;
        ?>
</div>
				<div class="cellule_supp"><a href="javascript:contenuassoc_supprimer(<?php 
        echo $row->id;
        ?>
, <?php 
        echo $type;
        ?>
,'<?php 
        echo $objet;
        ?>
')"><img src="gfx/supprimer.gif" /></a></div>
		</li>
<?php 
    }
}
コード例 #10
0
function lister_accessoires($refproduit)
{
    $produit = new Produit();
    $produit->charger($_GET['ref']);
    $accessoire = new Accessoire();
    $produita = new Produit();
    $produitdesca = new Produitdesc();
    $query = "select * from {$accessoire->table} where produit='{$produit->id}' order by classement";
    $resul = $accessoire->query($query);
    $i = 0;
    while ($resul && ($row = $accessoire->fetch_object($resul))) {
        $produita->charger_id($row->accessoire);
        $produitdesca->charger($produita->id);
        $rubadesc = new Rubriquedesc();
        $rubadesc->charger($produita->rubrique);
        $fond = $i++ % 2 ? "fonce" : "claire";
        ?>

			        	 <li class="<?php 
        echo $fond;
        ?>
">
							<div class="cellule" style="width:260px;"><?php 
        echo $rubadesc->titre;
        ?>
</div>
							<div class="cellule" style="width:260px;"><?php 
        echo $produitdesca->titre;
        ?>
</div>
							<div class="cellule_supp"><a href="javascript:accessoire_supprimer(<?php 
        echo $row->id;
        ?>
)"><img src="gfx/supprimer.gif" /></a></div>
						</li>

		<?php 
    }
}
コード例 #11
0
function contenuassoc_ajouter()
{
    if ($_GET['type'] == 1) {
        $objet = new Produit();
        $objet->charger($_GET['objet']);
    } else {
        $objet = new Rubrique();
        $objet->charger($_GET['objet']);
    }
    $contenuassoc = new Contenuassoc();
    $contenuassoc = new Contenuassoc();
    $contenuassoc->objet = $objet->id;
    $contenuassoc->type = $_GET['type'];
    $contenuassoc->contenu = $_GET['id'];
    $contenuassoc->add();
    lister_contenuassoc($_GET['type'], $_GET['objet']);
    if ($contenuassoc->type == 1) {
        ActionsModules::instance()->appel_module("modprod", $objet);
    } else {
        ActionsModules::instance()->appel_module("modrub", $objet);
    }
}
コード例 #12
0
 public function addToCart($event_id)
 {
     if (Request::ajax()) {
         //on récupère les informations envoyer avec ajax
         $data = Input::all();
         // on récupère les informations du produit
         $product = Produit::find($data['product_id']);
         //on prépare les donnée à insérer dans la session cart
         $parsedata = ['id' => $data['product_id'], 'price' => $data['price'], 'nom' => $product->description, 'evenement_id' => $data['evenement_id']];
         // on charge la session cart avec les nouvelles données.
         Session::push('cart.items', $parsedata);
     }
 }
コード例 #13
0
/******************************************************************************/
// object and content
/******************************************************************************/
$newsObj = new News();
$newsObj->GetHomeNews($newsData, $newsDataSize);
$smarty->assign('newsData', $newsData);
$testimonyObj = new Testimony();
$testimonyObj->GetHomeTestimony($testimonyData, $testimonyDataSize);
$smarty->assign('testimonyData', $testimonyData);
$publiciteObj = new Publicite();
$publiciteObj->GetHomePub($publiciteData, $publiciteDataSize);
$smarty->assign('publiciteData', $publiciteData);
$fournisseurObj = new Fabricant();
$fournisseurObj->GetFabricant($fournisseurData, $fournisseurDataSize);
$smarty->assign('fournisseurDataSize', $fournisseurDataSize);
$fournisseurObj = new Produit();
$fournisseurObj->GetProduit($medicamentData, $medicamentDataSize);
$smarty->assign('medicamentDataSize', $medicamentDataSize);
/******************************************************************************/
/******************************************************************************/
$smarty->assign('contentTemplate', 'templates/content/index.tpl');
$smarty->assign('sectionid', 'index');
$smarty->assign('pageid', 'index');
$smarty->assign('htmlpagetitle', 'Medicament.cd');
$smarty->assign('pagetitle', 'Accueil');
/******************************************************************************/
// Display the template
/******************************************************************************/
$smarty->display('templates/container.tpl');
/******************************************************************************/
// Clear up
コード例 #14
0
ファイル: produit_detail.php プロジェクト: xav335/fournil
<?
	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";
	
	$debug = false;
	$categorie = new Categorie();
	$produit = new Produit();
	
	$id_categorie = intval( $_GET[ "idc" ] );
	$id_produit = intval( $_GET[ "idp" ] );
	
	// ---- Liste des catégories enfants ---------- //
	if ( 1 == 1 ) {
		unset( $recherche );
		$recherche[ "id_parent" ] = $id_categorie;
		$liste_categorie = $categorie->getListe( $recherche, $debug );
	}
	// -------------------------------------------- //
	
	// ---- Infos sur le produit à afficher ------- //
	if ( 1 == 1 ) {
		$data = $produit->getInfoProduit( $id_categorie, $id_produit, $debug );
		//print_pre( $data );
		//exit();
		
		$id_produit =	$data[ 0 ][ "id" ];
		$titre = 		$data[ 0 ][ "nom" ];
		$description =	$data[ 0 ][ "description" ];
		$image =		$data[ 0 ][ "image" ];
コード例 #15
0
require_once __DIR__ . "/../pre.php";
require_once __DIR__ . "/../auth.php";
if (!est_autorise("acces_configuration")) {
    exit;
}
require_once "../../fonctions/modules.php";
header('Content-Type: text/html; charset=utf-8');
list($modif, $id) = explode("_", $_POST['id']);
$classement = $_POST["value"];
if ($modif == "classementrub" && est_autorise("acces_catalogue")) {
    $obj = new Rubrique();
    $obj->modifier_classement($id, $classement);
    echo "rubrique|";
} else {
    if ($modif == "classementprod" && est_autorise("acces_catalogue")) {
        $obj = new Produit();
        $obj->modifier_classement($id, $classement);
        echo "produit|";
    } else {
        if ($modif == "classementdossier" && est_autorise("acces_catalogue")) {
            $obj = new Dossier();
            $obj->modifier_classement($id, $classement);
            echo "...";
        } else {
            if ($modif == "classementcontenu" && est_autorise("acces_catalogue")) {
                $obj = new Contenu();
                $obj->modifier_classement($id, $classement);
                echo "...";
            } else {
                if ($modif == "classementcarac" && est_autorise("acces_configuration")) {
                    $obj = new Caracteristique();
コード例 #16
0
ファイル: boucles.php プロジェクト: anti-conformiste/thelia1
function boucleStock($texte, $args)
{
    $declidisp = lireTag($args, "declidisp", "int");
    $produit = lireTag($args, "produit", "int");
    $article = lireTag($args, "article", "int");
    $declinaison = lireTag($args, "declinaison", "int");
    $res = '';
    if ($article != "") {
        $produit = $_SESSION['navig']->panier->tabarticle[$article]->produit->id;
    }
    if ($produit == "") {
        return "";
    }
    if ($article != "" && $declinaison) {
        foreach ($_SESSION['navig']->panier->tabarticle[$article]->perso as $perso) {
            if ($perso->declinaison == $declinaison) {
                $declidisp = $perso->valeur;
            }
        }
    }
    if ($declidisp != "") {
        $stock = new Stock($declidisp, $produit);
        $stock_dispo = $stock->valeur;
    } else {
        $tmpprod = new Produit();
        $tmpprod->charger_id($produit);
        $stock_dispo = $tmpprod->stock;
    }
    $tmpprod = new Produit();
    $tmpprod->charger_id($produit);
    $prix = $tmpprod->prix + $stock->surplus;
    $prix2 = $tmpprod->prix2 + $stock->surplus;
    $temp = str_replace("#ID", "{$stock->id}", $texte);
    $temp = str_replace("#PRIX2", "{$prix2}", $temp);
    $temp = str_replace("#PRIX", "{$prix}", $temp);
    $temp = str_replace("#SURPLUS", "{$stock->surplus}", $temp);
    $temp = str_replace("#DECLIDISP", "{$declidisp}", $temp);
    $temp = str_replace("#PRODUIT", "{$produit}", $temp);
    $temp = str_replace("#VALEUR", "{$stock_dispo}", $temp);
    $temp = str_replace("#ARTICLE", "{$article}", $temp);
    if (trim($temp) != "") {
        $res .= $temp;
    }
    return $res;
}
コード例 #17
0
function supprimer($ref, $parent)
{
    $produit = new Produit($ref);
    $produit->delete();
    ActionsModules::instance()->appel_module("supprod", $produit);
    redirige("parcourir.php?parent=" . $parent);
}
コード例 #18
0
ファイル: addcom.php プロジェクト: anti-conformiste/thelia1
/*                                                                                   */
/*      This program is distributed in the hope that it will be useful,              */
/*      but WITHOUT ANY WARRANTY; without even the implied warranty of               */
/*      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the                */
/*      GNU General Public License for more details.                                 */
/*                                                                                   */
/*      You should have received a copy of the GNU General Public License            */
/*      along with this program.  If not, see <http://www.gnu.org/licenses/>.        */
/*                                                                                   */
/*************************************************************************************/
require_once "pre.php";
require_once "auth.php";
if (!est_autorise("acces_commandes")) {
    exit;
}
$produit = new Produit();
if ($produit->charger($ref)) {
    $produitdesc = new Produitdesc();
    $produitdesc->charger($produit->id);
    $_SESSION["commande"]->nbart++;
    $nbart = $_SESSION["commande"]->nbart;
    $_SESSION["commande"]->venteprod[$nbart - 1] = new Venteprod();
    $_SESSION["commande"]->venteprod[$nbart - 1]->ref = $produit->ref;
    $_SESSION["commande"]->venteprod[$nbart - 1]->titre = $produitdesc->titre;
    $_SESSION["commande"]->venteprod[$nbart - 1]->quantite = $_REQUEST["qtite"];
    $_SESSION["commande"]->venteprod[$nbart - 1]->tva = $tva;
    $_SESSION["commande"]->venteprod[$nbart - 1]->prixu = $prixu;
} else {
    $_SESSION["commande"]->nbart++;
    $nbart = $_SESSION["commande"]->nbart;
    $_SESSION["commande"]->venteprod[$nbart - 1] = new Venteprod();
コード例 #19
0
ファイル: traitement.php プロジェクト: xav335/fournil
			else $page_redirection = "/admin/produit/liste.php";
			
			if ( $debug ) echo "Redirection vers " . $page_redirection;
			else header( "Location: " . $page_redirection );
			exit();
		}
		// ---------------------------------------------- //
		
	} 
	// ------------------------------------------------------------------------ //
	
	
	// ---- GET GET GET ------------------------------------------------------- //
	elseif ( $_GET[ "action" ] == 'delete' ) {
		try {
			$produit = new Produit();
			$result = $produit->supprimer( $_GET[ "id" ], $debug );
			
			if ( !$debug ) header( "Location: /admin/produit/liste.php" );
		} 
		catch (Exception $e) {
			echo 'Erreur contactez votre administrateur <br> :',  $e->getMessage(), "\n";
			$goldbook = null;
			exit();
		}
	}
	// ------------------------------------------------------------------------ //
	
	
	// ---- ERREUR!!! --------------------------------------------------------- //
	else {
コード例 #20
0
<?php

require_once __DIR__ . "/../class/Produit.class.php";
if (isset($_POST)) {
    $Produit = new Produit();
    $Produit->setCode($_POST['code']);
    $Produit->initInfoWithCODE();
    echo $Produit->getPrintedModal();
}
コード例 #21
0
ファイル: 1.5.3.php プロジェクト: anti-conformiste/thelia1
<?php

// Attention, le path doit être relatif, sinon file_get_contents() interptète le code PHP
// qui se trouve dans les fichiers au lieu de retourner le contenu.
require_once __DIR__ . "/../../classes/Reecriture.class.php";
query_patch("update variable set valeur='153' where nom='version'");
query_patch("insert into variable(nom, valeur, protege, cache) values('sanitize_admin', 0, 1, 1)");
/*gestion retroactivité des url reecrites des produits supprimés*/
$q = "SELECT * FROM " . Reecriture::TABLE . " WHERE actif=1 AND fond IN ('produit', 'contenu', 'rubrique', 'dossier')";
$r = mysql_query($q, $cnx->link);
while ($a = mysql_fetch_object($r)) {
    switch ($a->fond) {
        case 'produit':
            preg_match("#id_produit=([0-9]+)([^[0-9]])*#", $a->param, $match);
            $id = $match[1];
            $produit = new Produit();
            if (!$produit->charger_id($id)) {
                $reecriture = new Reecriture();
                $reecriture->charger($a->url);
                $reecriture->actif = 0;
                $reecriture->maj();
                $reecriture_new = new Reecriture();
                $reecriture_new->url = $reecriture->url;
                $reecriture_new->fond = 'nexisteplus';
                $reecriture_new->param = $reecriture->param . '&ancienfond=' . $reecriture->fond;
                $reecriture_new->actif = 1;
                $reecriture_new->lang = $reecriture->lang;
                $reecriture_new->add();
            }
            break;
        case 'contenu':
コード例 #22
0
ファイル: Achat.php プロジェクト: maxeber/eshop
 public function __construct($arr)
 {
     $this->quantites = 1;
     parent::__construct($arr);
 }
コード例 #23
0
 public function defalquer_stock($retourenstock = false)
 {
     try {
         $modules = new Modules();
         if ($modules->charger_id($this->paiement)) {
             $modpaiement = ActionsModules::instance()->instancier($modules->nom);
             if ($retourenstock) {
                 $defalquer = $modpaiement->defalqcmd != 0 || $modpaiement->defalqcmd == 0 && $this->statut != self::NONPAYE;
             } else {
                 $defalquer = $modpaiement->defalqcmd == 0;
             }
             if ($defalquer) {
                 $delta = $retourenstock ? 1 : -1;
                 $venteprod = new Venteprod();
                 $query = "select * from {$venteprod->table} where commande='" . $this->id . "'";
                 $resul = $venteprod->query($query);
                 while ($resul && ($row = $venteprod->fetch_object($resul))) {
                     // Mise à jour du stock général
                     $produit = new Produit($row->ref);
                     $produit->stock += $delta * $row->quantite;
                     $produit->maj();
                     $vdec = new Ventedeclidisp();
                     $query2 = "select * from {$vdec->table} where venteprod='" . $row->id . "'";
                     $resul2 = $vdec->query($query2);
                     while ($resul2 && ($row2 = $vdec->fetch_object($resul2))) {
                         $stock = new Stock();
                         // Mise à jour du stock des declinaisons
                         if ($stock->charger($row2->declidisp, $produit->id)) {
                             $stock->valeur += $delta * $row->quantite;
                             $stock->maj();
                         }
                     }
                 }
             }
         }
     } catch (Exception $ex) {
         // Rien
     }
 }
コード例 #24
0
ファイル: edition.php プロジェクト: xav335/fournil
<?
	include_once '../../inc/inc.config.php';
	include_once '../inc-auth-granted.php';
	include_once '../classes/utils.php';
	require '../classes/Categorie.php';
	require '../classes/Produit.php';
	
	$debug = false;
	$categorie = new Categorie();
	$produit = new Produit();
	
	// ---- Modification ---------------------------- //
	if ( !empty( $_GET ) ) {
		$action = 'modif';
		$result = $produit->load( $_GET[ "id" ] );

		if ( !empty( $result ) ) {
			$titre_page = 	'Catégorie "'. $result[ 0 ][ "nom" ] . '"';
			$id =			$_GET[ "id" ];
			$id_categorie = $result[ 0 ][ "id_categorie" ];
			$nom = 			$result[ 0 ][ "nom" ];
			$description = 	$result[ 0 ][ "description" ];
			$image[ 1 ] = 	$result[ 0 ][ "image" ];
			$tag = 			$result[ 0 ][ "tag" ];
			$online = 		( $result[ 0 ][ "online" ]=='1' ) ? "checked" : "";
			
			if( empty( $image[ 1 ] ) || !isset( $image[ 1 ] ) ) {
				$img[ 1 ] = "/img/favicon.png";
				$imgval[ 1 ] = "/img/favicon.png";
			} 
			else {
コード例 #25
0
<?php

require_once __DIR__ . "/../class/Produit.class.php";
if (isset($_POST)) {
    $Produit = new Produit();
    $Produit->setCode($_POST['code']);
    $Produit->setTitre($_POST['titre']);
    $Produit->setAuteur($_POST['auteur']);
    $Produit->setEditeur($_POST['editeur']);
    $Produit->setEdition($_POST['edition']);
    $Produit->setType($_POST['type']);
    echo $Produit->updateInfo();
}
コード例 #26
0
ファイル: Achat.php プロジェクト: Tri125/LogiKek
 public function __construct($tableau)
 {
     $this->nombre = 1;
     parent::__construct($tableau);
 }
コード例 #27
0
ファイル: amenagements.php プロジェクト: xav335/modulouest
<?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">
コード例 #28
0
function liste_parent($parent, $niveau, $commande, $grandParent, $debutLie = 0)
{
    global $deco, $listePassee;
    $venteprod = new Venteprod();
    $query = "select * from {$venteprod->table} where commande='{$commande->id}' AND parent='{$parent}'";
    $resul = $venteprod->query($query);
    $memFin = "";
    while ($resul && ($row = $venteprod->fetch_object($resul))) {
        $venteprod->charger($row->id);
        $baseIndentation = 25;
        $paddingIndentation = 5;
        //base
        $largeurDesignation = 399;
        $indentation = "";
        if ($debutLie) {
            $indentation = "╓";
        } elseif ($grandParent != 0 && $grandParent == $venteprod->id) {
            $indentation = "╙";
        } elseif ($niveau > 0) {
            /*for($niv=0;$niv<$niveau;$niv++)
            		{
            			$indentation .= "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
            		}*/
            $paddingIndentation += $baseIndentation * $niveau;
            $indentation .= "↳";
        }
        $largeurDesignation -= $paddingIndentation;
        $produit = new Produit();
        $produitdesc = new Produitdesc();
        $produit->charger($venteprod->ref);
        $produitdesc->charger($produit->id);
        $rubrique = new Rubrique();
        $rubrique->charger($produit->rubrique);
        $rubriquedesc = new Rubriquedesc();
        $rubriquedesc->charger($rubrique->id);
        if ($rubriquedesc->titre != "") {
            $titrerub = $rubriquedesc->titre;
        } else {
            $titrerub = "//";
        }
        if (!($deco % 2)) {
            $fond = "ligne_fonce_BlocDescription";
        } else {
            $fond = "ligne_claire_BlocDescription";
        }
        $listePassee[] = $venteprod->id;
        if ($grandParent != 0 && $grandParent == $venteprod->id) {
            $memFin = "<ul class=\"__COULEUR_FOND__\">\n\t\t\t\t<li style=\"width:" . $largeurDesignation . "px;padding-left:" . $paddingIndentation . "px\">{$indentation} {$venteprod->ref} - {$titrerub} - " . str_replace("\n", "<br />", $venteprod->titre) . "</li>\n\t\t\t\t<li style=\"width:73px;\">" . round($venteprod->prixu, 2) . "</li>\n\t\t\t\t<li style=\"width:23px;\">" . $venteprod->quantite . "</li>\n\t\t\t\t<li style=\"width:20px;\">" . round($venteprod->quantite * $venteprod->prixu, 2) . "</li>\n\t\t\t\t</ul>";
        } else {
            $deco++;
            ?>
				<ul class="<?php 
            echo $fond;
            ?>
">
				<li style="width:<?php 
            echo $largeurDesignation;
            ?>
px; padding-left:<?php 
            echo $paddingIndentation;
            ?>
px;"><?php 
            echo $indentation . " " . $venteprod->ref . " - " . $titrerub;
            ?>
 - <?php 
            echo str_replace("\n", "<br />", $venteprod->titre);
            ?>
</li>
				<li style="width:73px;"><?php 
            echo round($venteprod->prixu, 2);
            ?>
</li>
				<li style="width:23px;"><?php 
            echo $venteprod->quantite;
            ?>
</li>
				<li style="width:20px;"><?php 
            echo round($venteprod->quantite * $venteprod->prixu, 2);
            ?>
</li>
				</ul>

		<?php 
        }
        if ($grandParent != $venteprod->id) {
            liste_parent($venteprod->id, $niveau + 1, $commande, $parent);
        }
    }
    if ($memFin != "") {
        if (!($deco % 2)) {
            $fond = "ligne_fonce_BlocDescription";
        } else {
            $fond = "ligne_claire_BlocDescription";
        }
        $deco++;
        echo str_replace("__COULEUR_FOND__", $fond, $memFin);
    }
}
コード例 #29
0
ファイル: produit.php プロジェクト: elBichon/freeCitizen
 $ville = $_POST['ville'];
 $type = $_POST['type'];
 $statut = $_POST['statut'];
 $mieuxNotes = "produit.php";
 $recherche = "rechercheProduit.php";
 $ajouter = "ajoutProduit.php";
 require 'includes/menu.php';
 require 'includes/menuServices.php';
 require 'includes/menuInfos.php';
 require 'includes/themesProduit.php';
 require 'objets/ObjetProduit.php';
 require 'includes/bbcodeTexte.php';
 echo '<section id="voirProduit"><h2>Les meilleures propostions et recherches de produits dans cette ville</h2>';
 $request = $bdd->query('SELECT * FROM freeCitizenProduit WHERE ville = "' . $ville . '" AND type = "' . $type . '" AND statut =  "' . $statut . '" ORDER BY votes LIMIT 0, 10');
 while ($donnees = $request->fetch(PDO::FETCH_ASSOC)) {
     $produit = new Produit($donnees);
     echo $produit->id();
     echo "</br>";
     echo $produit->titre();
     echo "</br>";
     echo $produit->date();
     echo "</br>";
     echo $produit->ville();
     echo "</br>";
     echo $produit->type();
     echo "</br>";
     echo $produit->statut();
     echo "</br>";
     echo $produit->votes();
     echo "</br>";
     $texte = $produit->descriptif();
コード例 #30
0
ファイル: produit.php プロジェクト: anti-conformiste/thelia1
require_once __DIR__ . "/../auth.php";
require_once __DIR__ . "/../../fonctions/divers.php";
if (!est_autorise("acces_catalogue")) {
    exit;
}
header('Content-Type: text/html; charset=utf-8');
list($modif, $id) = explode("_", lireParam("id", "string"));
if (strstr($modif, "rub") !== false) {
    $obj = new Rubrique();
    $obj->charger($id);
    $objdesc = new Rubriquedesc();
    $objdesc->charger($obj->id);
    $point_entree = "modrub";
    $champ_parent = "parent";
} else {
    $obj = new Produit();
    $obj->charger_id($id);
    $obj->datemodif = date('Y-m-d H:i:s');
    $objdesc = new Produitdesc();
    $objdesc->charger($obj->id);
    $point_entree = "modprod";
    $champ_parent = "rubrique";
}
switch ($modif) {
    case 'prix':
        $obj->prix = lireParam('value', 'string');
        echo $obj->prix;
        break;
    case 'prix2':
        $obj->prix2 = lireParam('value', 'string');
        echo $obj->prix2;