public function getUrl() { if (Variable::lire("rewrite") != 0) { $reecriture = new Reecriture(); if ($reecriture->charger_param($this->colonne, "&" . $this->clef_url_reecrite(), $this->lang, 1)) { return urlfond() . "/" . $reecriture->url; } } return urlfond($this->colonne, htmlspecialchars($this->clef_url_reecrite()), true); }
$idprec = mysql_result($resul, 0, "id"); ?> <a href="contenu_modifier.php?id=<?php echo $idprec; ?> &dossier=<?php echo $contenu->dossier; ?> "><img src="gfx/precedent.png" alt="Contenu précédent" title="Contenu précédent" style="padding:0 5px 0 0;margin-top:-5px;height:38px;"/></a> <?php } } ?> <!-- pour visualiser la page contenu correspondante en ligne --> <a title="Voir le contenu en ligne" href="<?php echo urlfond("contenu", "id_contenu={$contenu->id}", true); ?> " target="_blank" ><img src="gfx/site.png" alt="Voir le contenu en ligne" title="Voir le contenu en ligne" /></a> <a href="#" onclick="document.getElementById('formulaire').submit();"><img src="gfx/valider.png" alt="Enregistrer les modifications" title="Enregistrer les modifications" style="padding:0 5px 0 0;"/></a> <a href="#" onclick="document.getElementById('url').value='1'; document.getElementById('formulaire').submit();"><img src="gfx/validerfermer.png" alt="Enregistrer les modifications et fermer la fiche" title="Enregistrer les modifications et fermer la fiche" style="padding:0 5px 0 0;"/></a> <?php if ($classement < $maxclassement) { $suivant = $contenu->classement; do { $suivant++; $query = "select id from {$contenu->table} where dossier={$contenu->dossier} and classement={$suivant}"; $resul = mysql_query($query); } while (!mysql_num_rows($resul) && $suivant < $maxclassement); if (mysql_num_rows($resul) != 0) { $idsuiv = mysql_result($resul, 0, "id"); ?>
} else { if ($_SESSION["navig"]->urlpageret == "") { $_SESSION["navig"]->urlpageret = urlfond(); } } // Sécurisation if ($securise && !$_SESSION["navig"]->connecte) { redirige(urlfond("connexion")); } // Vérif transport if ($transport && !$_SESSION["navig"]->commande->transport) { redirige(urlfond("adresse")); } // Vérif panier if ($panier && !$_SESSION["navig"]->panier->nbart) { redirige(urlfond()); } $parseur = new Parseur(); // fonctions à éxecuter avant les inclusions ActionsModules::instance()->appel_module("inclusion"); // inclusion $parseur->inclusion($res); // inclusions des plugins ActionsModules::instance()->appel_module("action"); $res = $parseur->analyse($res); ActionsModules::instance()->appel_module("analyse"); Filtres::exec($res); $res = $parseur->post($res); // inclusions des plugins filtres ActionsModules::instance()->appel_module("post"); Tlog::ecrire($res);
function boucleTransport($texte, $args) { // récupération des arguments $id = lireTag($args, "id", "int_list"); $nom = lireTag($args, "nom", "string"); $exclusion = lireTag($args, "exclusion", "string_list"); $idpays = intval(lireTag($args, "pays", "int")); $cpostal = intval(lireTag($args, "cpostal", "string")); $montantmini = intval(lireTag($args, "montantmini", "float")); $search = ""; $res = ""; if ($id != "") { $search .= "and id in ({$id})"; } if ($nom != "") { $search .= "and nom=\"{$nom}\""; } if ($exclusion != "") { $liste = ""; $tabexcl = explode(",", $exclusion); for ($i = 0; $i < count($tabexcl); $i++) { $liste .= "'" . $tabexcl[$i] . "'" . ","; } $liste = rtrim($liste, ","); $search .= " and nom not in ({$liste})"; } $modules = new Modules(); $query = "select * from {$modules->table} where type='2' and actif='1' {$search} order by classement"; $resul = CacheBase::getCache()->query($query); if (empty($resul)) { return ""; } $pays = new Pays(); if ($idpays > 0) { $pays->charger($idpays); } else { if ($_SESSION['navig']->adresse != "" && $_SESSION['navig']->adresse != 0) { $adr = new Adresse(); $adr->charger($_SESSION['navig']->adresse); $pays->charger($adr->pays); } else { $pays->charger($_SESSION['navig']->client->pays); } } $transzone = new Transzone(); $compt = 0; foreach ($resul as $row) { if (!$transzone->charger($row->id, $pays->zone)) { continue; } $compt++; $modules = new Modules(); $modules->charger_id($row->id); try { $instance = ActionsModules::instance()->instancier($modules->nom); $port = round(port($row->id, $pays->id, $cpostal), 2); $titre = $instance->getTitre(); $chapo = $instance->getChapo(); $description = $instance->getDescription(); } catch (Exception $ex) { $titre = $chapo = $description = ''; } if ($port < $montantmini) { continue; } // Chercher le logo $exts = array('png', 'gif', 'jpeg', 'jpg'); $logo = false; foreach ($exts as $ext) { $tmp = ActionsModules::instance()->lire_chemin_base() . "/{$row->nom}/logo.{$ext}"; if (file_exists($tmp)) { $logo = ActionsModules::instance()->lire_url_base() . "/{$row->nom}/logo.{$ext}"; break; } } $temp = str_replace("#NOM", $row->nom, $texte); $temp = str_replace("#TITRE", "{$titre}", $temp); $temp = str_replace("#CHAPO", "{$chapo}", $temp); $temp = str_replace("#DESCRIPTION", "{$description}", $temp); $temp = str_replace("#URLCMD", urlfond("commande", "action=transport&id=" . $row->id, true), $temp); $temp = str_replace("#ID", "{$row->id}", $temp); $temp = str_replace("#LOGO", $logo, $temp); $temp = str_replace("#PORT", formatter_somme($port), $temp); $temp = str_replace("#COMPT", "{$compt}", $temp); $res .= $temp; } return $res; }
<a href="dossier_modifier.php?id=<?php echo $previous->id; ?> " title="<?php echo trad('previous', 'admin'); ?> " class="change-page"> <i class="icon-backward"></i> </a> <?php } ?> </li> <li class=""> <a href="<?php echo urlfond("dossier", "id_dossier={$dossier->id}", true); ?> " target="_blank" title="<?php echo trad('preview', 'admin'); ?> " class="change-page"> <i class="icon-eye-open"></i> </a> </li> <li class=""> <?php $next = ToolBoxAdmin::getNext($dossier); if ($next !== false) { ?> <a href="dossier_modifier.php?id=<?php echo $next->id;
function substitutions($texte) { global $fond, $action; $texte = str_replace("#FOND", $fond, $texte); $texte = str_replace("#ACTION", $action, $texte); $texte = str_replace("#URLPREC", $_SESSION['navig']->urlprec, $texte); $texte = str_replace("#URLPAGERET", $_SESSION['navig']->urlpageret, $texte); $texte = str_replace("#URLPANIER", urlfond("panier"), $texte); $texte = str_replace("#URLCOMMANDER", urlfond("commande"), $texte); $texte = str_replace("#URLNOUVEAU", urlfond("nouveau"), $texte); // Supprimer l'éventuel paramètre de déconnexion, en, préservant les éventuels autres. $selfurl = supprimer_deconnexion(url_page_courante()); $parametres = parse_url($selfurl, PHP_URL_QUERY); $texte = str_replace("#URLCOURANTEPARAM", $parametres, $texte); $texte = str_replace("#URLCOURANTE", escape_ampersand($selfurl), $texte); $texte = str_replace("#URLDECONNEXION", escape_ampersand($selfurl . ($parametres != '' ? "&" : "?") . "action=deconnexion"), $texte); $texte = str_replace("#URLRECHERCHE", urlfond("recherche"), $texte); $texte = str_replace("#URLADRESSE", urlfond("adresse"), $texte); $texte = str_replace("#URLPAIEMENT", urlfond("commande"), $texte); $texte = str_replace("#URLSOMMAIRE", urlfond(), $texte); $texte = str_replace("#URLCOMPTEMODIFIER", urlfond("compte_modifier"), $texte); $texte = str_replace("#URLCOMPTE", urlfond("moncompte"), $texte); // Substitutions "langue" $texte = ActionsLang::instance()->substitutions(ActionsLang::instance()->get_langue_courante(), $texte); // Substitutions "devises" $texte = ActionsDevises::instance()->substitutions(ActionsDevises::instance()->get_devise_courante(), $texte); if (strstr($texte, "#VARIABLE")) { $texte = substitvariable($texte); } if (strstr($texte, "#MESSAGE_")) { $texte = substitmessage($texte); } if (strstr($texte, "#RUBRIQUE_")) { $texte = substitrubriques($texte); } if (strstr($texte, "#PRODUIT_")) { $texte = substitproduits($texte); } if (strstr($texte, "#PANIER_")) { $texte = substitpanier($texte); } if (strstr($texte, "#CLIENT_")) { $texte = substitclient($texte); } if (strstr($texte, "#PAGE_")) { $texte = substitpage($texte); } if (strstr($texte, "#ADRESSE_")) { $texte = substitadresse($texte); } if (strstr($texte, "#COMMANDE_")) { $texte = substitcommande($texte); } if (strstr($texte, "#IMAGE_")) { $texte = substitimage($texte); } if (strstr($texte, "#CARACTERISTIQUE_")) { $texte = substitcaracteristique($texte); } if (strstr($texte, "#DECLINAISON_")) { $texte = substitdeclinaison($texte); } if (strstr($texte, "#DOSSIER_")) { $texte = substitdossier($texte); } if (strstr($texte, "#CONTENU_")) { $texte = substitcontenu($texte); } if (strstr($texte, "#PARRAIN_")) { $texte = substitparrain($texte); } if (strstr($texte, "#PROMO_")) { $texte = substitpromo($texte); } // Traduction du template $texte = substitlang($texte); if (isset($_GET['errconnex']) && $_GET['errconnex'] == "1") { $texte = preg_replace("/\\#ERRCONNEX\\[([^]]*)\\]/", "\\1", $texte); } else { $texte = preg_replace("/\\#ERRCONNEX\\[([^]]*)\\]/", "", $texte); } // URL d'un fond, forme: #URLFOND(nom-du-fond) if (preg_match_all("`\\#URLFOND\\(([^\\),]+)(:?,([^\\),]+))*\\)`", $texte, $matches, PREG_SET_ORDER)) { foreach ($matches as $match) { $url = urlfond($match[1], isset($match[2]) ? $match[3] : false, true); $texte = str_replace($match[0], $url, $texte); } } // Ajout d'un paramètre à une URL, forme: #AJOUT_PARAMETRE(url,liste-de-paramètres) if (preg_match_all("`\\#AJOUTER_PARAMETRE\\(([^\\),]+)(:?,([^\\),]+))*\\)`", $texte, $matches, PREG_SET_ORDER)) { foreach ($matches as $match) { $url = $match[1]; if (isset($match[2])) { if (strstr($url, '?') !== false) { $url .= "&" . $match[3]; } else { $url .= "?" . $match[3]; } } $texte = str_replace($match[0], $url, $texte); } } $texte = str_replace("index.php", "", $texte); return $texte; }
if (mysql_num_rows($resul) != 0) { $refprec = mysql_result($resul, 0, 'ref'); ?> <a href="produit_modifier.php?ref=<?php echo $refprec; ?> &rubrique=<?php echo $rubrique; ?> " ><img src="gfx/precedent.png" alt="Produit précédent" title="Produit précédent" style="padding:0 5px 0 0;margin-top:-5px;height:38px;"/></a> <?php } } ?> <a title="Voir le produit en ligne" href="<?php echo urlfond("produit", "ref={$ref}&id_rubrique={$rubrique}", true); ?> " target="_blank" ><img src="gfx/site.png" alt="Voir le produit en ligne" title="Voir le produit en ligne" /></a> <a href="#" onclick="dupliquer();"><img src="gfx/dupliquer.png" alt="Dupliquer la fiche produit" title="Dupliquer la fiche produit" style="padding:0 5px 0 0;"/></a> <a href="#" onclick="envoyer();"><img src="gfx/valider.png" alt="Enregistrer les modifications" title="Enregistrer les modifications" style="padding:0 5px 0 0;"/></a> <a href="#" onclick="$('#url').val('1'); envoyer(); "><img src="gfx/validerfermer.png" alt="Enregistrer les modifications et fermer la fiche" title="Enregistrer les modifications et fermer la fiche" style="padding:0 5px 0 0;"/></a> <?php if ($classement != $classementmax) { $precedent = $classement; do { $precedent++; $query = "select * from {$produit->table} where rubrique='" . $rubrique . "' and classement='" . $precedent . "' "; $resul = mysql_query($query, $produit->link); } while (!mysql_num_rows($resul) && $precedent < $classementmax); if (mysql_num_rows($resul) != 0) {
&dossier=<?php echo $previous->dossier; ?> " title="<?php echo trad('previous', 'admin'); ?> " class="change-page"> <i class="icon-backward"></i> </a> <?php } ?> </li> <li class=""> <a href="<?php echo urlfond("contenu", "id_contenu={$contenu->id}&id_dossier={$contenu->dossier}", true); ?> " target="_blank" title="<?php echo trad('preview', 'admin'); ?> " class="change-page"> <i class="icon-eye-open"></i> </a> </li> <li class=""> <?php $next = ToolBoxAdmin::getNext($contenu, 'dossier'); if ($next !== false) { ?> <a href="contenu_modifier.php?id=<?php echo $next->id;
/** * @return string l'URL complète de la page courante. Si le rewriting est activé, il * s'agit de l'URL ré-écrite. */ function url_page_courante() { $uri = $_SERVER['REQUEST_URI']; // Si on est a la racine, s'assurer qu'on a une url avec fichier if (substr($uri, -1) == '/') { $uri = $uri . 'index.php'; } // On utilise ensuite basename() pour retirer l'éventuel chemin comme dans http://www.maboutique.com/path/to/maboutique/mapage.html return urlfond() . '/' . basename($uri); }
<a href="rubrique_modifier.php?id=<?php echo $previousCategory->id; ?> " title="<?php echo trad('previous', 'admin'); ?> " class="change-page"> <i class="icon-backward"></i> </a> <?php } ?> </li> <li class=""> <a href="<?php echo urlfond("rubrique", "id_rubrique={$rubrique->id}", true); ?> " target="_blank" title="<?php echo trad('preview', 'admin'); ?> " class="change-page"> <i class="icon-eye-open"></i> </a> </li> <li class=""> <?php $nextCategory = ToolBoxAdmin::getNext($rubrique); if ($nextCategory !== false) { ?> <a href="rubrique_modifier.php?id=<?php echo $nextCategory->id;
</a> <?php } ?> </li> <li class=""> <a href="#duplicateModal" target="_blank" title="<?php echo trad('duplicate', 'admin'); ?> " class="change-page" data-toggle="modal"> <i class="icon-folder-close"></i> </a> </li> <li class=""> <a href="<?php echo urlfond("produit", "id_produit={$produit->id}&id_rubrique={$produit->rubrique}", true); ?> " target="_blank" title="<?php echo trad('preview', 'admin'); ?> " class="change-page"> <i class="icon-eye-open"></i> </a> </li> <li class=""> <?php $next = ToolBoxAdmin::getNext($produit, 'rubrique'); if ($next !== false) { ?> <a href="produit_modifier.php?ref=<?php echo $next->ref;
public function substitmail($corps, $commande) { ActionsModules::instance()->appel_module("preSubstitmail", $corps, $commande); $nomsite = Variable::lire("nomsite"); $jour = substr($commande->date, 8, 2); $mois = substr($commande->date, 5, 2); $annee = substr($commande->date, 0, 4); $heure = substr($commande->date, 11, 2); $minute = substr($commande->date, 14, 2); $seconde = substr($commande->date, 17, 2); $client = new Client($commande->client); $paiement = new Modules($commande->paiement); $paiementdesc = new Modulesdesc($paiement->nom, $commande->lang); $transport = new Modules($commande->transport); $transportdesc = new Modulesdesc($transport->nom, $commande->lang); $total = $commande->total(); $totcmdport = $commande->port + $total; $adresse = new Venteadr($commande->adrlivr); $raisondesc = new Raisondesc(); $raisondesc->charger($adresse->raison, $commande->lang); $nom = $adresse->nom; $prenom = $adresse->prenom; $entreprise = $adresse->entreprise; $adresse1 = $adresse->adresse1; $adresse2 = $adresse->adresse2; $adresse3 = $adresse->adresse3; $cpostal = $adresse->cpostal; $ville = $adresse->ville; $pays = new Paysdesc($adresse->pays, $commande->lang); $corps = str_replace("__COMMANDE_REF__", $commande->ref, $corps); $corps = str_replace("__COMMANDE_DATE__", $jour . "/" . $mois . "/" . $annee, $corps); $corps = str_replace("__COMMANDE_HEURE__", $heure . ":" . $minute, $corps); $corps = str_replace("__COMMANDE_TRANSACTION__", $commande->transaction, $corps); $corps = str_replace("__COMMANDE_PAIEMENT__", $paiementdesc->titre, $corps); $corps = str_replace("__COMMANDE_TOTALPORT__", $totcmdport - $commande->remise, $corps); $corps = str_replace("__COMMANDE_TOTAL__", $total, $corps); $corps = str_replace("__COMMANDE_PORT__", $commande->port, $corps); $corps = str_replace("__COMMANDE_REMISE__", $commande->remise, $corps); $corps = str_replace("__COMMANDE_TRANSPORT__", $transportdesc->titre, $corps); $corps = str_replace("__COMMANDE_TRANSPORTCHAPO__", $transportdesc->chapo, $corps); $corps = str_replace("__COMMANDE_LIVRRAISON__", $raisondesc->court, $corps); $corps = str_replace("__COMMANDE_LIVRNOM__", $nom, $corps); $corps = str_replace("__COMMANDE_LIVRPRENOM__", $prenom, $corps); $corps = str_replace("__COMMANDE_LIVRENTREPRISE__", $entreprise, $corps); $corps = str_replace("__COMMANDE_LIVRADRESSE1__", $adresse1, $corps); $corps = str_replace("__COMMANDE_LIVRADRESSE2__", $adresse2, $corps); $corps = str_replace("__COMMANDE_LIVRADRESSE3__", $adresse3, $corps); $corps = str_replace("__COMMANDE_LIVRCPOSTAL__", $cpostal, $corps); $corps = str_replace("__COMMANDE_LIVRVILLE__", $ville, $corps); $corps = str_replace("__COMMANDE_LIVRPAYS__", $pays->titre, $corps); $corps = str_replace("__COMMANDE_LIVRTEL__", $adresse->tel, $corps); $corps = str_replace("__NOMSITE__", $nomsite, $corps); $corps = str_replace("__URLSITE__", urlfond(), $corps); $adresse = new Venteadr($commande->adrfact); $raisondesc = new Raisondesc(); $raisondesc->charger($adresse->raison); $pays = new Paysdesc(); $pays->charger($adresse->pays); $corps = str_replace("__CLIENT_REF__", $client->ref, $corps); $corps = str_replace("__CLIENT_RAISON__", $raisondesc->court, $corps); $corps = str_replace("__CLIENT_ENTREPRISE__", $client->entreprise, $corps); $corps = str_replace("__CLIENT_SIRET__", $client->siret, $corps); $corps = str_replace("__CLIENT_FACTNOM__", $adresse->nom, $corps); $corps = str_replace("__CLIENT_FACTPRENOM__", $adresse->prenom, $corps); $corps = str_replace("__CLIENT_ADRESSE1__", $adresse->adresse1, $corps); $corps = str_replace("__CLIENT_ADRESSE2__", $adresse->adresse2, $corps); $corps = str_replace("__CLIENT_ADRESSE3__", $adresse->adresse3, $corps); $corps = str_replace("__CLIENT_CPOSTAL__", $adresse->cpostal, $corps); $corps = str_replace("__CLIENT_VILLE__", $adresse->ville, $corps); $corps = str_replace("__CLIENT_PAYS__", $pays->titre, $corps); $corps = str_replace("__CLIENT_EMAIL__", $client->email, $corps); $corps = str_replace("__CLIENT_TELFIXE__", $client->telfixe, $corps); $corps = str_replace("__CLIENT_TELPORT__", $client->telport, $corps); $pattern = '{<VENTEPROD>((?:(?:(?!<VENTEPROD[^>]*>|</VENTEPROD>).)++|<VENTEPROD[^>]*>(?1)</VENTEPROD>)*)</VENTEPROD>}si'; if (preg_match($pattern, $corps, $cut)) { $corps = str_replace("<VENTEPROD>", "", $corps); $corps = str_replace("</VENTEPROD>", "", $corps); $res = ""; $venteprod = new Venteprod(); $query = "select * from {$venteprod->table} where commande=\"" . $commande->id . "\""; $resul = $venteprod->query($query); while ($resul && ($row = $venteprod->fetch_object($resul))) { $temp = str_replace("__VENTEPROD_TITRE__", $row->titre, $cut[1]); $temp = str_replace("__VENTEPROD_REF__", $row->ref, $temp); $temp = str_replace("__VENTEPROD_CHAPO__", $row->chapo, $temp); $temp = str_replace("__VENTEPROD_QUANTITE__", $row->quantite, $temp); $temp = str_replace("__VENTEPROD_PRIXU__", $row->prixu, $temp); $temp = str_replace("__VENTEPROD_TOTAL__", $row->prixu * $row->quantite, $temp); ActionsModules::instance()->appel_module("substitutionsventeprodmailcommande", $temp, $row); $res .= $temp; } $corps = str_replace($cut[1], $res, $corps); } // Substitutions mail "devise" $devise = new Devise($commande->devise); ActionsDevises::instance()->subsititutions_mail($devise, $corps); ActionsModules::instance()->appel_module("substitutionsmailcommande", $corps, $commande); return $corps; }
function reprise_paiement($id_paiement, $id_commande) { if (!$_SESSION['navig']->client->id) { redirige(urlfond()); } $commande = new Commande(); $paiement = new Modules(); if ($commande->charger_id($id_commande) && $paiement->charger_id($id_paiement)) { if ($commande->client != $_SESSION['navig']->client->id) { redirige(urlfond()); } $_SESSION['navig']->panier = new Panier(); $commande->total = $commande->total(true, true); $commande->paiement = $paiement->id; $commande->maj(); $_SESSION['navig']->commande = $commande; $className = $paiement->nom; $modpaiement = ActionsModules::instance()->instancier($paiement->nom); $modpaiement->paiement($commande); } }