function substitcommande($texte)
{
    global $commande;
    if ($commande) {
        $refs = $commande;
    } else {
        $refs = $_SESSION['navig']->commande->ref;
    }
    $texte = str_replace("#COMMANDE_TRANSPORT", $_SESSION['navig']->commande->transport, $texte);
    $tcommande = new Commande();
    $tcommande->charger_ref($refs);
    $texte = str_replace("#COMMANDE_ID", $tcommande->id, $texte);
    $texte = str_replace("#COMMANDE_REF", $tcommande->ref, $texte);
    $texte = str_replace("#COMMANDE_TRANSACTION", $tcommande->transaction, $texte);
    return $texte;
}
示例#2
0
<?php

require_once "auth.php";
if (!est_autorise("acces_commandes")) {
    exit;
}
$commande = new Commande();
$commande->charger_ref($ref);
if (file_exists(__DIR__ . '/../client/pdf/modeles/facture.php')) {
    $commande = new Commande();
    $commande->charger_ref($ref);
    $client = new Client();
    $client->charger_id($commande->client);
    $pays = new Pays();
    $pays->charger($client->pays);
    $zone = new Zone();
    $zone->charger($pays->zone);
    require_once "../client/pdf/modeles/livraison.php";
    $livraison = new Livraison();
    $livraison->creer($ref);
    exit;
}
$nom_fichier_pdf = $commande->livraison . '.pdf';
// Le moteur ne sortira pas le contenu de $res
$sortie = false;
// Le fond est le template de livraison.
$reptpl = __DIR__ . "/../client/pdf/template/";
$fond = "livraison.html";
$lang = $commande->lang;
// Compatibilité avec le moteur.
$_REQUEST['commande'] = $ref;
示例#3
0
/*      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/>.        */
/*                                                                                   */
/*************************************************************************************/
include_once __DIR__ . '/../../fonctions/error_reporting.php';
include_once __DIR__ . "/../../classes/Navigation.class.php";
include_once __DIR__ . "/../../classes/Administrateur.class.php";
include_once __DIR__ . "/../../fonctions/modules.php";
session_start();
$commande = new Commande();
$commande->charger_ref($_GET['ref']);
// Si un client est identifié mais n'est pas celui qui a commandé ou que la commande n'est pas payée
// ou qu'un admin identifié n'est pas autorisé
if (!(isset($_SESSION['navig']) && $_SESSION['navig']->connecte && $_SESSION['navig']->client->id == $commande->client && $commande->facture != "" || isset($_SESSION["util"]) && est_autorise("acces_commandes"))) {
    exit;
}
// Compatibilité 1.4 -> On utilise le modèle PDF si il existe
if (file_exists(__DIR__ . '/modeles/facture.php')) {
    include_once __DIR__ . "/../../classes/Commande.class.php";
    include_once __DIR__ . "/../../classes/Client.class.php";
    include_once __DIR__ . "/../../classes/Venteprod.class.php";
    include_once __DIR__ . "/../../classes/Produit.class.php";
    include_once __DIR__ . "/../../classes/Adresse.class.php";
    include_once __DIR__ . "/../../classes/Zone.class.php";
    include_once __DIR__ . "/../../classes/Pays.class.php";
    include_once __DIR__ . "/../../fonctions/divers.php";
示例#4
0
function boucleReprisePaiement($texte, $args)
{
    $paiement = lireTag($args, "paiement", "int");
    $refcommande = lireTag($args, "refcommande", "string");
    $module = new Modules();
    $commande = new Commande();
    $res = "";
    if (!empty($paiement) && $module->charger_id($paiement) && !empty($refcommande) && $commande->charger_ref($refcommande)) {
        if ($module->type == 1 && $module->actif == 1) {
            $res = str_replace("#URL", sprintf("index.php?action=reprise_paiement&amp;id_commande=%d&amp;id_paiement=%d", $commande->id, $module->id), $texte);
        }
    }
    return $res;
}