Ejemplo n.º 1
0
 public static function instance()
 {
     if (!$instance) {
         self::$instance = new Pdf();
     }
     return self::$instance;
 }
Ejemplo n.º 2
0
    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";
    $client = new Client();
    $client->charger_id($commande->client);
    $pays = new Pays();
    $pays->charger($client->pays);
    $zone = new Zone();
    $zone->charger($pays->zone);
    include_once __DIR__ . "/modeles/facture.php";
    $facture = new Facture();
    $facture->creer($_GET['ref']);
    exit;
}
// Le moteur ne sortira pas le contenu de $res
$sortie = false;
// Le fond est le template de facture.
$reptpl = __DIR__ . "/template/";
$fond = "facture.html";
$lang = $commande->lang;
// Compatibilité avec le moteur.
$_REQUEST['commande'] = $_GET['ref'];
require_once __DIR__ . "/../../fonctions/moteur.php";
require_once __DIR__ . "/../../classes/Pdf.class.php";
Pdf::instance()->generer($res, $_GET['ref'] . ".pdf");
Ejemplo n.º 3
0
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;
require_once __DIR__ . "/../fonctions/moteur.php";
Pdf::instance()->generer($res, $nom_fichier_pdf);
Ejemplo n.º 4
0
 /**
  * Get the singleton instance of the object or instantiate a new object.
  *
  * @return Pdf
  */
 static function singleton()
 {
     if (!self::$instance) {
         self::$instance = new Pdf();
     }
     return self::$instance;
 }