Beispiel #1
0
    $pdf->productHeaderAddRow('COMMENTAIRE', 35, 'C');
    //#2 Ajout des infos
    $pdf->initPDF("INVENTAIRE N°" . $oInv->inv_id, "Créé le " . $day . "/" . $month . "/" . $year);
    if (isset($tabLigPdf)) {
        //Création d'une ligne par éléments à l'intérieur de mon tableau
        for ($i = 0; $i < count($tabLigPdf['ref']); $i++) {
            //On formate la date récupéré comme on la souhaite
            list($year, $month, $day) = explode("-", (string) $tabLigPdf['lot'][$i]->lot_dlc);
            $lotDlc = $day . "/" . $month . "/" . $year;
            //Et on ajoute une ligne à notre PDF
            $pdf->productAdd(array((string) $tabLigPdf['ref'][$i]->ref_code, (string) $tabLigPdf['ref'][$i]->ref_lbl, (string) $tabLigPdf['lot'][$i]->lot_id, (string) $tabLigPdf['invLig'][$i]->liginv_qt_stock, (string) $tabLigPdf['invLig'][$i]->liginv_qt_reel, $lotDlc, (string) $tabLigPdf['invLig'][$i]->liginv_lbl));
        }
    }
    require_once $path . '/templatePdf/template.php';
    //------------------Construction du pdf ------------------//
    //# Construction et affichage du pdf
    $pdf->buildPDF();
    $pdf->Output('INVENTAIRE' . $oInv->inv_id . 'pdf', 'I');
    //On vide le buffer pour permettre l'affichage du pdf sans problèmes lors du prochain passage.
    ob_end_flush();
} catch (MySQLException $e) {
    //Si une erreur survient on la catch dans une exception
    if (isset($resEr[0])) {
        //Si elle provient de la base
        $msg = "<p class='erreur'> " . date('H:i:s') . " Impossible de générer le PDF. Code :" . $resEr[0] . " Message : {$resEr['1']}" . "</p>";
    } else {
        //Si c'est une erreur coté client
        $msg = "<p class='erreur'> " . date('H:i:s') . " Impossible de générer le PDF. Code :" . $e->getCode() . " Message : " . $e->getMessage() . "</p>";
    }
    Tool::addMsg($msg);
}
Beispiel #2
0
    $pdf->productHeaderAddRow('PRODUIT ', 30, 'C');
    $pdf->productHeaderAddRow('N°LOT ', 20, 'C');
    $pdf->productHeaderAddRow('LOT QTE ', 25, 'C');
    $pdf->productHeaderAddRow('DLC/DLUO ', 25, 'C');
    $pdf->productHeaderAddRow('DEPOT ', 25, 'C');
    $pdf->productHeaderAddRow('COMMENTAIRE ', 40, 'C');
    //#2 Ajout des infos
    $pdf->initPDF("BON ENTREE N°" . $oBe->be_id, "Caen le " . $day . "/" . $month . "/" . $year);
    //Création d'une ligne par éléments à l'intérieur de mon tableau
    for ($i = 0; $i < count($tabLig['ref']); $i++) {
        //On formate la date récupéré comme on la souhaite
        list($year, $month, $day) = explode("-", (string) $tabLig['lot'][$i]->lot_dlc);
        $lotDlc = $day . "/" . $month . "/" . $year;
        $pdf->productAdd(array((string) $tabLig['ref'][$i]->ref_code, (string) $tabLig['ref'][$i]->ref_lbl, (string) $tabLig['lot'][$i]->lot_id, (string) $tabLig['lig'][$i]->lig_qte, $lotDlc, (string) $tabLig['lig'][$i]->lig_com_dep, (string) $tabLig['lig'][$i]->lig_com));
    }
    require_once $path . '/templatePdf/template.php';
    //------------------Construction du pdf ------------------//
    //# Construction et affichage du pdf
    $pdf->buildPDF();
    $pdf->Output('Bon' . $sTypeBon . $oBe->be_id . 'pdf', 'I');
    //On vide le buffer pour permettre l'affichage du pdf sans problèmes lors du prochain passage.
    ob_end_flush();
} catch (Exception $e) {
    echo '<br>';
    Tool::printAnyCase($e->getCode());
    echo '<br>';
    Tool::printAnyCase($e->getMessage());
    echo '<br>';
    Tool::printAnyCase($e->getTraceAsString());
    echo '<br>';
}
Beispiel #3
0
    $pdf->productHeaderAddRow('DEPOT ', 25, 'C');
    $pdf->productHeaderAddRow('COMMENTAIRE ', 40, 'C');
    //#2 Ajout des infos
    $pdf->initPDF("BON N°" . $oBon->bon_id . " " . $sCat, "Caen le " . $day . "/" . $month . "/" . $year);
    if (isset($tabLig)) {
        //Création d'une ligne par éléments à l'intérieur de mon tableau
        for ($i = 0; $i < count($tabLig['ref']); $i++) {
            //On formate la date récupéré comme on la souhaite
            list($year, $month, $day) = explode("-", (string) $tabLig['lot'][$i]->lot_dlc);
            $lotDlc = $day . "/" . $month . "/" . $year;
            $pdf->productAdd(array((string) $tabLig['ref'][$i]->ref_code, (string) $tabLig['ref'][$i]->ref_lbl, (string) $tabLig['lot'][$i]->lot_id, (string) $tabLig['lig'][$i]->lig_qte, $lotDlc, (string) $tabLig['lig'][$i]->lig_com_dep, (string) $tabLig['lig'][$i]->lig_com));
        }
    }
    require_once $path . '/templatePdf/template.php';
    //------------------Construction du pdf ------------------//
    //# Construction et affichage du pdf
    $pdf->buildPDF();
    $pdf->Output('Bon' . $sTypeBon . $oBon->bon_id . 'pdf', 'I');
    //On vide le buffer pour permettre l'affichage du pdf sans problèmes lors du prochain passage.
    ob_end_flush();
} catch (Exception $e) {
    //Si une erreur survient on la catch dans une exception
    if (isset($resEr[0])) {
        //Si elle provient de la base
        $msg = "<p class='erreur'> " . date('H:i:s') . " Impossible de générer le PDF. Code :" . $resEr[0] . " Message : {$resEr['1']}" . "</p>";
    } else {
        //Si c'est une erreur coté client
        $msg = "<p class='erreur'> " . date('H:i:s') . " Impossible de générer le PDF. Code :" . $e->getCode() . " Message : " . $e->getMessage() . "</p>";
    }
    Tool::addMsg($msg);
}