コード例 #1
0
ファイル: lettre-facture.inc.php プロジェクト: bouchra012/PMB
 } else {
     $fs_footer = $pos_footer[1];
 }
 //---------------------------------------------------------------------------------------------------------------------
 $taille_doc = array($largeur_page, $hauteur_page);
 $w = $largeur_page - $marge_gauche - $marge_droite;
 $ourPDF = new $fpdf($orient_page, 'mm', $taille_doc);
 $ourPDF->Open();
 $ourPDF->SetMargins($marge_gauche, $marge_haut, $marge_droite);
 //On récupère les infos de la facture
 $fac = new actes($id_fac);
 $lignes = actes::getLignes($id_fac);
 $bibli = new entites($fac->num_entite);
 $coord_fac = new coordonnees($fac->num_contact_fact);
 $fou = new entites($fac->num_fournisseur);
 $coord_fou = entites::get_coordonnees($fac->num_fournisseur, '1');
 $coord_fou = mysql_fetch_object($coord_fou);
 $id_cde = liens_actes::getParent($id_fac);
 $cde = new actes($id_cde);
 $ourPDF->addPage();
 $ourPDF->setFont($pmb_pdf_font);
 //Affichage date
 $date = formatdate(today());
 $ourPDF->setFontSize($fs_date);
 $ourPDF->SetXY($x_date, $y_date);
 $ourPDF->Cell($l_date, $h_date, $date, 0, 0, 'L', 0);
 //Affichage raison sociale
 $raison = $bibli->raison_sociale;
 $ourPDF->setFontSize($fs_raison);
 $ourPDF->SetXY($x_raison, $y_raison);
 $ourPDF->Cell($l_raison, $h_raison, $raison, 0, 0, 'L', 0);
コード例 #2
0
ファイル: devis.inc.php プロジェクト: noble82/proyectos-ULS
function print_dev($id_bibli = 0, $id_dev = 0, $by_mail = FALSE)
{
    global $dbh, $charset, $base_path, $acquisition_pdfdev_print;
    global $acquisition_pdfdev_obj_mail, $acquisition_pdfdev_text_mail;
    global $acquisition_pdfdev_by_mail, $PMBuseremailbcc;
    if (!($id_bibli && $id_dev)) {
        return;
    }
    $bib = new entites($id_bibli);
    $bib_coord = pmb_mysql_fetch_object(entites::get_coordonnees($id_bibli, 1));
    $dev = new actes($id_dev);
    $id_fou = $dev->num_fournisseur;
    $fou = new entites($id_fou);
    $fou_coord = pmb_mysql_fetch_object(entites::get_coordonnees($id_fou, 1));
    $no_mail = FALSE;
    if ($by_mail == FALSE || !($acquisition_pdfdev_by_mail && strpos($bib_coord->email, '@') && strpos($fou_coord->email, '@'))) {
        $no_mail = TRUE;
    } else {
        $dest_name = '';
        if ($fou_coord->libelle) {
            $dest_name = $fou_coord->libelle;
        } else {
            $dest_name = $fou->raison_sociale;
        }
        if ($fou_coord->contact) {
            $dest_name .= " " . $fou_coord->contact;
        }
        $dest_mail = $fou_coord->email;
        $obj_mail = $acquisition_pdfdev_obj_mail;
        $text_mail = $acquisition_pdfdev_text_mail;
        $bib_name = $bib_coord->raison_sociale;
        $bib_mail = $bib_coord->email;
        $lettre = lettreDevis_factory::make();
        $lettre->doLettre($id_bibli, $id_dev);
        $piece_jointe = array();
        $piece_jointe[0]['contenu'] = $lettre->getLettre('S');
        $piece_jointe[0]['nomfichier'] = $lettre->getFileName();
        //         mailpmb($to_nom="", $to_mail,   $obj="",   $corps="",  $from_name="", $from_mail, $headers, $copie_CC="", $copie_BCC="", $faire_nl2br=0, $pieces_jointes=array())
        $res_envoi = mailpmb($dest_name, $dest_mail, $obj_mail, $text_mail, $bib_name, $bib_mail, "Content-Type: text/plain; charset=\"{$charset}\"", '', $PMBuseremailbcc, 1, $piece_jointe);
        if (!$res_envoi) {
            $no_mail = TRUE;
        }
    }
    if ($no_mail) {
        print "\t\n\t\t\t<form name='print_dev' action='pdf.php?pdfdoc=devi' target='lettre' method='post'>\t\t\n\t\t\t\t<input type='hidden' name='id_bibli' value='" . $id_bibli . "'/>\n\t\t\t\t<input type='hidden' name='id_dev' value='" . $id_dev . "'/>\n\t\t\t\t<script type='text/javascript'>\n\t\t\t\t\topenPopUp('','lettre', 600, 500, -2, -2, 'toolbar=no, dependent=yes, resizable=yes');\n\t\t\t\t\tdocument.print_dev.submit();\n\t\t\t\t</script>\n\t\t\t</form>";
    }
}
コード例 #3
0
ファイル: entite.inc.php プロジェクト: bouchra012/PMB
function show_coord_form($id = 0)
{
    global $msg;
    global $charset;
    global $coord_form, $coord_form_biblio, $coord_form_suite;
    global $ptab, $script;
    $ptab[1] = $ptab[1] . $ptab[10] . $ptab[11];
    $ptab[1] = str_replace('!!adresse!!', htmlentities($msg[acquisition_adr_fac], ENT_QUOTES, $charset), $ptab[1]);
    $coord_form = str_replace('!!id!!', $id, $coord_form);
    $ptab[3] = str_replace('!!id!!', $id, $ptab[3]);
    if (!$id) {
        $coord_form = str_replace('!!form_title!!', htmlentities($msg[acquisition_ajout_biblio], ENT_QUOTES, $charset), $coord_form);
        $coord_form = str_replace('!!raison_suppr!!', '', $coord_form);
        $coord_form = str_replace('!!raison!!', '', $coord_form);
        $coord_form = str_replace('!!contact!!', $ptab[1], $coord_form);
        $coord_form = str_replace('!!max_coord!!', '2', $coord_form);
        $coord_form = str_replace('!!id1!!', '0', $coord_form);
        $coord_form = str_replace('!!lib_1!!', '', $coord_form);
        $coord_form = str_replace('!!cta_1!!', '', $coord_form);
        $coord_form = str_replace('!!ad1_1!!', '', $coord_form);
        $coord_form = str_replace('!!ad2_1!!', '', $coord_form);
        $coord_form = str_replace('!!cpo_1!!', '', $coord_form);
        $coord_form = str_replace('!!vil_1!!', '', $coord_form);
        $coord_form = str_replace('!!eta_1!!', '', $coord_form);
        $coord_form = str_replace('!!pay_1!!', '', $coord_form);
        $coord_form = str_replace('!!te1_1!!', '', $coord_form);
        $coord_form = str_replace('!!te2_1!!', '', $coord_form);
        $coord_form = str_replace('!!fax_1!!', '', $coord_form);
        $coord_form = str_replace('!!ema_1!!', '', $coord_form);
        $coord_form = str_replace('!!com_1!!', '', $coord_form);
        $coord_form = str_replace('!!id2!!', '0', $coord_form);
        $coord_form = str_replace('!!lib_2!!', '', $coord_form);
        $coord_form = str_replace('!!cta_2!!', '', $coord_form);
        $coord_form = str_replace('!!ad1_2!!', '', $coord_form);
        $coord_form = str_replace('!!ad2_2!!', '', $coord_form);
        $coord_form = str_replace('!!cpo_2!!', '', $coord_form);
        $coord_form = str_replace('!!vil_2!!', '', $coord_form);
        $coord_form = str_replace('!!eta_2!!', '', $coord_form);
        $coord_form = str_replace('!!pay_2!!', '', $coord_form);
        $coord_form = str_replace('!!te1_2!!', '', $coord_form);
        $coord_form = str_replace('!!te2_2!!', '', $coord_form);
        $coord_form = str_replace('!!fax_2!!', '', $coord_form);
        $coord_form = str_replace('!!ema_2!!', '', $coord_form);
        $coord_form = str_replace('!!com_2!!', '', $coord_form);
        $coord_form = str_replace('!!commentaires!!', '', $coord_form);
        $coord_form = str_replace('!!siret!!', '', $coord_form);
        $coord_form = str_replace('!!rcs!!', '', $coord_form);
        $coord_form = str_replace('!!naf!!', '', $coord_form);
        $coord_form = str_replace('!!tva!!', '', $coord_form);
        $coord_form = str_replace('!!site_web!!', '', $coord_form);
        $coord_form = str_replace('!!logo!!', '', $coord_form);
        autorisations();
    } else {
        $biblio = new entites($id);
        $coord_form = str_replace('!!form_title!!', htmlentities($msg[acquisition_modif_biblio], ENT_QUOTES, $charset), $coord_form);
        $coord_form = str_replace('!!raison!!', htmlentities($biblio->raison_sociale, ENT_QUOTES, $charset), $coord_form);
        $coord_form = str_replace('!!contact!!', $ptab[1], $coord_form);
        $row = mysql_fetch_object(entites::get_coordonnees($biblio->id_entite, '1'));
        $coord_form = str_replace('!!id1!!', $row->id_contact, $coord_form);
        $coord_form = str_replace('!!lib_1!!', htmlentities($row->libelle, ENT_QUOTES, $charset), $coord_form);
        $coord_form = str_replace('!!cta_1!!', htmlentities($row->contact, ENT_QUOTES, $charset), $coord_form);
        $coord_form = str_replace('!!ad1_1!!', htmlentities($row->adr1, ENT_QUOTES, $charset), $coord_form);
        $coord_form = str_replace('!!ad2_1!!', htmlentities($row->adr2, ENT_QUOTES, $charset), $coord_form);
        $coord_form = str_replace('!!cpo_1!!', htmlentities($row->cp, ENT_QUOTES, $charset), $coord_form);
        $coord_form = str_replace('!!vil_1!!', htmlentities($row->ville, ENT_QUOTES, $charset), $coord_form);
        $coord_form = str_replace('!!eta_1!!', htmlentities($row->etat, ENT_QUOTES, $charset), $coord_form);
        $coord_form = str_replace('!!pay_1!!', htmlentities($row->pays, ENT_QUOTES, $charset), $coord_form);
        $coord_form = str_replace('!!te1_1!!', htmlentities($row->tel1, ENT_QUOTES, $charset), $coord_form);
        $coord_form = str_replace('!!te2_1!!', htmlentities($row->tel2, ENT_QUOTES, $charset), $coord_form);
        $coord_form = str_replace('!!fax_1!!', htmlentities($row->fax, ENT_QUOTES, $charset), $coord_form);
        $coord_form = str_replace('!!ema_1!!', htmlentities($row->email, ENT_QUOTES, $charset), $coord_form);
        $coord_form = str_replace('!!com_1!!', htmlentities($row->commentaires, ENT_QUOTES, $charset), $coord_form);
        $row = mysql_fetch_object(entites::get_coordonnees($biblio->id_entite, '2'));
        $coord_form = str_replace('!!id2!!', $row->id_contact, $coord_form);
        $coord_form = str_replace('!!lib_2!!', htmlentities($row->libelle, ENT_QUOTES, $charset), $coord_form);
        $coord_form = str_replace('!!cta_2!!', htmlentities($row->contact, ENT_QUOTES, $charset), $coord_form);
        $coord_form = str_replace('!!ad1_2!!', htmlentities($row->adr1, ENT_QUOTES, $charset), $coord_form);
        $coord_form = str_replace('!!ad2_2!!', htmlentities($row->adr2, ENT_QUOTES, $charset), $coord_form);
        $coord_form = str_replace('!!cpo_2!!', htmlentities($row->cp, ENT_QUOTES, $charset), $coord_form);
        $coord_form = str_replace('!!vil_2!!', htmlentities($row->ville, ENT_QUOTES, $charset), $coord_form);
        $coord_form = str_replace('!!eta_2!!', htmlentities($row->etat, ENT_QUOTES, $charset), $coord_form);
        $coord_form = str_replace('!!pay_2!!', htmlentities($row->pays, ENT_QUOTES, $charset), $coord_form);
        $coord_form = str_replace('!!te1_2!!', htmlentities($row->tel1, ENT_QUOTES, $charset), $coord_form);
        $coord_form = str_replace('!!te2_2!!', htmlentities($row->tel2, ENT_QUOTES, $charset), $coord_form);
        $coord_form = str_replace('!!fax_2!!', htmlentities($row->fax, ENT_QUOTES, $charset), $coord_form);
        $coord_form = str_replace('!!ema_2!!', htmlentities($row->email, ENT_QUOTES, $charset), $coord_form);
        $coord_form = str_replace('!!com_2!!', htmlentities($row->commentaires, ENT_QUOTES, $charset), $coord_form);
        $liste_coord = entites::get_coordonnees($biblio->id_entite, '0');
        $coord_form = str_replace('!!max_coord!!', mysql_num_rows($liste_coord) + 2, $coord_form);
        $i = 3;
        while ($row = mysql_fetch_object($liste_coord)) {
            $coord_form = str_replace('<!--coord_repetables-->', $ptab[2] . '<!--coord_repetables-->', $coord_form);
            $coord_form = str_replace('!!no_X!!', $i, $coord_form);
            $i++;
            $coord_form = str_replace('!!idX!!', $row->id_contact, $coord_form);
            $coord_form = str_replace('!!lib_X!!', htmlentities($row->libelle, ENT_QUOTES, $charset), $coord_form);
            $coord_form = str_replace('!!cta_X!!', htmlentities($row->contact, ENT_QUOTES, $charset), $coord_form);
            $coord_form = str_replace('!!ad1_X!!', htmlentities($row->adr1, ENT_QUOTES, $charset), $coord_form);
            $coord_form = str_replace('!!ad2_X!!', htmlentities($row->adr2, ENT_QUOTES, $charset), $coord_form);
            $coord_form = str_replace('!!cpo_X!!', htmlentities($row->cp, ENT_QUOTES, $charset), $coord_form);
            $coord_form = str_replace('!!vil_X!!', htmlentities($row->ville, ENT_QUOTES, $charset), $coord_form);
            $coord_form = str_replace('!!eta_X!!', htmlentities($row->etat, ENT_QUOTES, $charset), $coord_form);
            $coord_form = str_replace('!!pay_X!!', htmlentities($row->pays, ENT_QUOTES, $charset), $coord_form);
            $coord_form = str_replace('!!te1_X!!', htmlentities($row->tel1, ENT_QUOTES, $charset), $coord_form);
            $coord_form = str_replace('!!te2_X!!', htmlentities($row->tel2, ENT_QUOTES, $charset), $coord_form);
            $coord_form = str_replace('!!fax_X!!', htmlentities($row->fax, ENT_QUOTES, $charset), $coord_form);
            $coord_form = str_replace('!!ema_X!!', htmlentities($row->email, ENT_QUOTES, $charset), $coord_form);
            $coord_form = str_replace('!!com_X!!', htmlentities($row->commentaires, ENT_QUOTES, $charset), $coord_form);
        }
        $coord_form = str_replace('!!commentaires!!', htmlentities($biblio->commentaires, ENT_QUOTES, $charset), $coord_form);
        $coord_form = str_replace('!!siret!!', htmlentities($biblio->siret, ENT_QUOTES, $charset), $coord_form);
        $coord_form = str_replace('!!rcs!!', htmlentities($biblio->rcs, ENT_QUOTES, $charset), $coord_form);
        $coord_form = str_replace('!!naf!!', htmlentities($biblio->naf, ENT_QUOTES, $charset), $coord_form);
        $coord_form = str_replace('!!tva!!', htmlentities($biblio->tva, ENT_QUOTES, $charset), $coord_form);
        $coord_form = str_replace('!!site_web!!', htmlentities($biblio->site_web, ENT_QUOTES, $charset), $coord_form);
        $coord_form = str_replace('!!logo!!', htmlentities($biblio->logo, ENT_QUOTES, $charset), $coord_form);
        autorisations($biblio->autorisations);
        $coord_form = str_replace('<!-- bouton_sup -->', $ptab[3], $coord_form);
        $coord_form = str_replace('!!raison_suppr!!', addslashes($biblio->raison_sociale), $coord_form);
    }
    print confirmation_delete("./admin.php?categ=acquisition&sub=entite&action=del&id=");
    print $script;
    print $coord_form;
}
コード例 #4
0
ファイル: coordonnees.inc.php プロジェクト: bouchra012/PMB
function show_results($dbh, $nbr_lignes = 0, $page = 0)
{
    global $nb_per_page;
    global $base_url;
    global $caller;
    global $charset;
    global $msg;
    global $id_bibli;
    // on récupére le nombre de lignes qui vont bien
    $nbr_lignes = entites::count_coordonnees($id_bibli);
    if (!$page) {
        $page = 1;
    }
    $debut = ($page - 1) * $nb_per_page;
    if ($nbr_lignes) {
        // on lance la vraie requête
        $res = entites::get_coordonnees($id_bibli, '-1', $debut, $nb_per_page);
        while ($row = mysql_fetch_object($res)) {
            $adresse = '';
            $adresse1 = '';
            if ($row->libelle != '') {
                $adresse = htmlentities(addslashes($row->libelle), ENT_QUOTES, $charset) . "\\n";
                $adresse1 = htmlentities($row->libelle, ENT_QUOTES, $charset);
            }
            if ($row->contact != '') {
                $adresse .= htmlentities(addslashes($row->contact), ENT_QUOTES, $charset) . "\\n";
            }
            $adresse1 .= ' (';
            if ($row->adr1 != '') {
                $adresse .= htmlentities(addslashes($row->adr1), ENT_QUOTES, $charset) . "\\n";
                $adresse1 .= htmlentities($row->adr1, ENT_QUOTES, $charset) . ' ';
            }
            if ($row->adr2 != '') {
                $adresse .= htmlentities(addslashes($row->adr2), ENT_QUOTES, $charset) . "\\n";
                $adresse1 .= htmlentities($row->adr2, ENT_QUOTES, $charset) . ' ';
            }
            if ($row->cp != '') {
                $adresse .= htmlentities(addslashes($row->cp), ENT_QUOTES, $charset) . ' ';
                $adresse1 .= htmlentities($row->cp, ENT_QUOTES, $charset) . ' ';
            }
            if ($row->ville != '') {
                $adresse .= htmlentities(addslashes($row->ville), ENT_QUOTES, $charset);
                $adresse1 .= htmlentities($row->ville, ENT_QUOTES, $charset);
            }
            $adresse1 .= ')';
            print pmb_bidi("\n\t\t\t<a href='#' onclick=\"set_parent('{$caller}', '{$row->id_contact}', '{$adresse}' )\">{$adresse1}</a>");
            print "<br />";
        }
        mysql_free_result($res);
        // constitution des liens
        $nbepages = ceil($nbr_lignes / $nb_per_page);
        $suivante = $page + 1;
        $precedente = $page - 1;
        // affichage du lien précédent si nécessaire
        print '<hr /><div align=center>';
        if ($precedente > 0) {
            print "<a href='{$base_url}&page={$precedente}&nbr_lignes={$nbr_lignes}&no_display={$no_display}'><img src='./images/left.gif' border='0' title='{$msg['48']}' alt='[{$msg['48']}]' hspace='3' align='middle' /></a>";
        }
        for ($i = 1; $i <= $nbepages; $i++) {
            if ($i == $page) {
                print "<b>{$i}/{$nbepages}</b>";
            }
        }
        if ($suivante <= $nbepages) {
            print "<a href='{$base_url}&page={$suivante}&nbr_lignes={$nbr_lignes}&no_display={$no_display}'><img src='./images/right.gif' border='0' title='{$msg['49']}' alt='[{$msg['49']}]' hspace='3' align='middle' /></a>";
        }
    }
    print '</div>';
}
コード例 #5
0
function show_coord_form($id_bibli, $id_fou = 0)
{
    global $msg;
    global $charset;
    global $coord_form2;
    global $ptab, $script;
    global $pmb_gestion_devise;
    $bibli = new entites($id_bibli);
    $ptab[1] = $ptab[1] . $ptab[11];
    $ptab[1] = str_replace('!!adresse!!', htmlentities($msg[acquisition_adr_fou], ENT_QUOTES, $charset), $ptab[1]);
    $coord_form2 = str_replace('!!id!!', $id_fou, $coord_form2);
    $coord_form2 = str_replace('!!id_bibli!!', $id_bibli, $coord_form2);
    $coord_form2 = str_replace('!!lib_bibli!!', htmlentities($bibli->raison_sociale, ENT_QUOTES, $charset), $coord_form2);
    $ptab[3] = str_replace('!!id!!', $id_fou, $ptab[3]);
    if (!$id_fou) {
        $coord_form2 = str_replace('!!form_title!!', htmlentities($msg[acquisition_ajout_fourn], ENT_QUOTES, $charset), $coord_form2);
        $coord_form2 = str_replace('!!raison_suppr!!', '', $coord_form2);
        $coord_form2 = str_replace('!!raison!!', '', $coord_form2);
        $coord_form2 = str_replace('!!num_cp!!', '', $coord_form2);
        $coord_form2 = str_replace('!!contact!!', $ptab[1], $coord_form2);
        $coord_form2 = str_replace('!!max_coord!!', '1', $coord_form2);
        $coord_form2 = str_replace('!!lib_1!!', '', $coord_form2);
        $coord_form2 = str_replace('!!id1!!', '0', $coord_form2);
        $coord_form2 = str_replace('!!cta_1!!', '', $coord_form2);
        $coord_form2 = str_replace('!!ad1_1!!', '', $coord_form2);
        $coord_form2 = str_replace('!!ad2_1!!', '', $coord_form2);
        $coord_form2 = str_replace('!!cpo_1!!', '', $coord_form2);
        $coord_form2 = str_replace('!!vil_1!!', '', $coord_form2);
        $coord_form2 = str_replace('!!eta_1!!', '', $coord_form2);
        $coord_form2 = str_replace('!!pay_1!!', '', $coord_form2);
        $coord_form2 = str_replace('!!te1_1!!', '', $coord_form2);
        $coord_form2 = str_replace('!!te2_1!!', '', $coord_form2);
        $coord_form2 = str_replace('!!fax_1!!', '', $coord_form2);
        $coord_form2 = str_replace('!!ema_1!!', '', $coord_form2);
        $coord_form2 = str_replace('!!com_1!!', '', $coord_form2);
        $coord_form2 = str_replace('!!commentaires!!', '', $coord_form2);
        $coord_form2 = str_replace('!!siret!!', '', $coord_form2);
        $coord_form2 = str_replace('!!rcs!!', '', $coord_form2);
        $coord_form2 = str_replace('!!naf!!', '', $coord_form2);
        $coord_form2 = str_replace('!!tva!!', '', $coord_form2);
        $coord_form2 = str_replace('!!site_web!!', '', $coord_form2);
    } else {
        $fourn = new entites($id_fou);
        $coord_form2 = str_replace('!!form_title!!', htmlentities($msg[acquisition_modif_fourn], ENT_QUOTES, $charset), $coord_form2);
        $coord_form2 = str_replace('!!raison!!', htmlentities($fourn->raison_sociale, ENT_QUOTES, $charset), $coord_form2);
        $coord_form2 = str_replace('!!num_cp!!', htmlentities($fourn->num_cp_client, ENT_QUOTES, $charset), $coord_form2);
        $coord_form2 = str_replace('!!contact!!', $ptab[1], $coord_form2);
        $row = pmb_mysql_fetch_object(entites::get_coordonnees($fourn->id_entite, '1'));
        $coord_form2 = str_replace('!!id1!!', $row->id_contact, $coord_form2);
        $coord_form2 = str_replace('!!lib_1!!', htmlentities($row->libelle, ENT_QUOTES, $charset), $coord_form2);
        $coord_form2 = str_replace('!!cta_1!!', htmlentities($row->contact, ENT_QUOTES, $charset), $coord_form2);
        $coord_form2 = str_replace('!!ad1_1!!', htmlentities($row->adr1, ENT_QUOTES, $charset), $coord_form2);
        $coord_form2 = str_replace('!!ad2_1!!', htmlentities($row->adr2, ENT_QUOTES, $charset), $coord_form2);
        $coord_form2 = str_replace('!!cpo_1!!', htmlentities($row->cp, ENT_QUOTES, $charset), $coord_form2);
        $coord_form2 = str_replace('!!vil_1!!', htmlentities($row->ville, ENT_QUOTES, $charset), $coord_form2);
        $coord_form2 = str_replace('!!eta_1!!', htmlentities($row->etat, ENT_QUOTES, $charset), $coord_form2);
        $coord_form2 = str_replace('!!pay_1!!', htmlentities($row->pays, ENT_QUOTES, $charset), $coord_form2);
        $coord_form2 = str_replace('!!te1_1!!', htmlentities($row->tel1, ENT_QUOTES, $charset), $coord_form2);
        $coord_form2 = str_replace('!!te2_1!!', htmlentities($row->tel2, ENT_QUOTES, $charset), $coord_form2);
        $coord_form2 = str_replace('!!fax_1!!', htmlentities($row->fax, ENT_QUOTES, $charset), $coord_form2);
        $coord_form2 = str_replace('!!ema_1!!', htmlentities($row->email, ENT_QUOTES, $charset), $coord_form2);
        $coord_form2 = str_replace('!!com_1!!', htmlentities($row->commentaires, ENT_QUOTES, $charset), $coord_form2);
        $liste_coord = entites::get_coordonnees($fourn->id_entite, '0');
        $coord_form2 = str_replace('!!max_coord!!', pmb_mysql_num_rows($liste_coord) + 1, $coord_form2);
        $i = 2;
        while ($row = pmb_mysql_fetch_object($liste_coord)) {
            $coord_form2 = str_replace('<!--coord_repetables-->', $ptab[2] . '<!--coord_repetables-->', $coord_form2);
            $coord_form2 = str_replace('!!no_X!!', $i, $coord_form2);
            $i++;
            $coord_form2 = str_replace('!!idX!!', $row->id_contact, $coord_form2);
            $coord_form2 = str_replace('!!lib_X!!', htmlentities($row->libelle, ENT_QUOTES, $charset), $coord_form2);
            $coord_form2 = str_replace('!!cta_X!!', htmlentities($row->contact, ENT_QUOTES, $charset), $coord_form2);
            $coord_form2 = str_replace('!!ad1_X!!', htmlentities($row->adr1, ENT_QUOTES, $charset), $coord_form2);
            $coord_form2 = str_replace('!!ad2_X!!', htmlentities($row->adr2, ENT_QUOTES, $charset), $coord_form2);
            $coord_form2 = str_replace('!!cpo_X!!', htmlentities($row->cp, ENT_QUOTES, $charset), $coord_form2);
            $coord_form2 = str_replace('!!vil_X!!', htmlentities($row->ville, ENT_QUOTES, $charset), $coord_form2);
            $coord_form2 = str_replace('!!eta_X!!', htmlentities($row->etat, ENT_QUOTES, $charset), $coord_form2);
            $coord_form2 = str_replace('!!pay_X!!', htmlentities($row->pays, ENT_QUOTES, $charset), $coord_form2);
            $coord_form2 = str_replace('!!te1_X!!', htmlentities($row->tel1, ENT_QUOTES, $charset), $coord_form2);
            $coord_form2 = str_replace('!!te2_X!!', htmlentities($row->tel2, ENT_QUOTES, $charset), $coord_form2);
            $coord_form2 = str_replace('!!fax_X!!', htmlentities($row->fax, ENT_QUOTES, $charset), $coord_form2);
            $coord_form2 = str_replace('!!ema_X!!', htmlentities($row->email, ENT_QUOTES, $charset), $coord_form2);
            $coord_form2 = str_replace('!!com_X!!', htmlentities($row->commentaires, ENT_QUOTES, $charset), $coord_form2);
        }
        $coord_form2 = str_replace('!!commentaires!!', htmlentities($fourn->commentaires, ENT_QUOTES, $charset), $coord_form2);
        $coord_form2 = str_replace('!!siret!!', htmlentities($fourn->siret, ENT_QUOTES, $charset), $coord_form2);
        $coord_form2 = str_replace('!!rcs!!', htmlentities($fourn->rcs, ENT_QUOTES, $charset), $coord_form2);
        $coord_form2 = str_replace('!!naf!!', htmlentities($fourn->naf, ENT_QUOTES, $charset), $coord_form2);
        $coord_form2 = str_replace('!!tva!!', htmlentities($fourn->tva, ENT_QUOTES, $charset), $coord_form2);
        $coord_form2 = str_replace('!!site_web!!', htmlentities($fourn->site_web, ENT_QUOTES, $charset), $coord_form2);
        $coord_form2 = str_replace('<!-- bouton_sup -->', $ptab[3], $coord_form2);
        $coord_form2 = str_replace('!!raison_suppr!!', addslashes($fourn->raison_sociale), $coord_form2);
    }
    print confirmation_delete("./acquisition.php?categ=ach&sub=fourn&action=del&id_bibli={$id_bibli}&id=");
    print $script;
    print $coord_form2;
}
コード例 #6
0
// +-------------------------------------------------+
// © 2002-2004 PMB Services / www.sigb.net pmb@sigb.net et contributeurs (voir www.sigb.net)
// +-------------------------------------------------+
// $Id: liste_relances.inc.php,v 1.7 2015-04-03 11:16:26 jpermanne Exp $
if (stristr($_SERVER['REQUEST_URI'], ".inc.php")) {
    die("no access");
}
// popup d'impression PDF pour liste des relances de receptions
// reçoit : tab_no_mail
require_once "{$class_path}/entites.class.php";
require_once "{$class_path}/receptions_relances.class.php";
$tab_fou = unserialize(rawurldecode($tab_no_mail));
if (count($tab_fou) && $id_bibli) {
    switch ($acquisition_pdfrel_pdfrtf) {
        case '1':
            $lettre = new lettreRelance_RTF();
            break;
        default:
            $lettre = new lettreRelance_PDF();
            break;
    }
    foreach ($tab_fou as $id_fou => $tab_act) {
        $bib = new entites($id_bibli);
        $bib_coord = pmb_mysql_fetch_object(entites::get_coordonnees($id_bibli, 1));
        $fou = new entites($id_fou);
        $fou_coord = pmb_mysql_fetch_object(entites::get_coordonnees($id_fou, 1));
        $lettre->doLettre($bib, $bib_coord, $fou, $fou_coord, $tab_act);
    }
    $lettre->getLettre();
}
コード例 #7
0
ファイル: fournisseur.inc.php プロジェクト: bouchra012/PMB
function show_results($dbh, $user_input, $nbr_lignes = 0, $page = 0, $id = 0)
{
    global $nb_per_page;
    global $base_url;
    global $caller;
    global $charset;
    global $msg;
    global $id_bibli;
    //comptage
    if ($user_input == "") {
        $nbr_lignes = entites::getNbFournisseurs($id_bibli);
    } else {
        $aq = new analyse_query(stripslashes($user_input));
        if ($aq->error) {
            error_message($msg["searcher_syntax_error"], sprintf($msg["searcher_syntax_error_desc"], $aq->current_car, $aq->input_html, $aq->error_message));
            exit;
        }
        $nbr_lignes = entites::getNbFournisseurs($id_bibli, $aq);
    }
    if (!$page) {
        $page = 1;
    }
    $debut = ($page - 1) * $nb_per_page;
    if ($nbr_lignes) {
        //liste
        if ($user_input == "") {
            $res = entites::list_fournisseurs($id_bibli, $debut, $nb_per_page);
        } else {
            $res = entites::list_fournisseurs($id_bibli, $debut, $nb_per_page, $aq);
        }
        while ($row = mysql_fetch_object($res)) {
            $entry = $row->raison_sociale;
            $adresse = '';
            if ($caller != 'form_abonnement') {
                $coord = entites::get_coordonnees($row->id_entite, '1');
                if (mysql_num_rows($coord) != 0) {
                    $coord = mysql_fetch_object($coord);
                    if ($coord->libelle != '') {
                        $adresse = htmlentities(addslashes($coord->libelle), ENT_QUOTES, $charset) . "\\n";
                    }
                    if ($coord->contact != '') {
                        $adresse .= htmlentities(addslashes($coord->contact), ENT_QUOTES, $charset) . "\\n";
                    }
                    if ($coord->adr1 != '') {
                        $adresse .= htmlentities(addslashes($coord->adr1), ENT_QUOTES, $charset) . "\\n";
                    }
                    if ($coord->adr2 != '') {
                        $adresse .= htmlentities(addslashes($coord->adr2), ENT_QUOTES, $charset) . "\\n";
                    }
                    if ($coord->cp != '') {
                        $adresse .= htmlentities(addslashes($coord->cp), ENT_QUOTES, $charset) . ' ';
                    }
                    if ($coord->ville != '') {
                        $adresse .= htmlentities(addslashes($coord->ville), ENT_QUOTES, $charset);
                    }
                }
            }
            print pmb_bidi("\n\t\t\t<a href='#' onclick=\"set_parent('{$caller}', '{$row->id_entite}', '" . htmlentities(addslashes($entry), ENT_QUOTES, $charset) . "', '{$adresse}' )\">{$entry}</a>");
            print "<br />";
        }
        mysql_free_result($res);
        // constitution des liens
        $nbepages = ceil($nbr_lignes / $nb_per_page);
        $suivante = $page + 1;
        $precedente = $page - 1;
        // affichage du lien précédent si nécessaire
        print '<hr /><div align=center>';
        if ($precedente > 0) {
            print "<a href='{$base_url}&page={$precedente}&nbr_lignes={$nbr_lignes}&user_input=" . rawurlencode(stripslashes($user_input)) . "&no_display={$no_display}'><img src='./images/left.gif' border='0' title='{$msg['48']}' alt='[{$msg['48']}]' hspace='3' align='middle' /></a>";
        }
        for ($i = 1; $i <= $nbepages; $i++) {
            if ($i == $page) {
                print "<b>{$i}/{$nbepages}</b>";
            }
        }
        if ($suivante <= $nbepages) {
            print "<a href='{$base_url}&page={$suivante}&nbr_lignes={$nbr_lignes}&user_input=" . rawurlencode(stripslashes($user_input)) . "&no_display={$no_display}'><img src='./images/right.gif' border='0' title='{$msg['49']}' alt='[{$msg['49']}]' hspace='3' align='middle' /></a>";
        }
    }
    print '</div>';
}
コード例 #8
0
         $array_selector[$typ . ',' . $lib_rem . ',' . $lib_tva] = htmlentities($lib_typ, ENT_QUOTES, $charset);
     }
     $origine = "ARRAY";
     break;
 case 'fournisseurs':
     // $param1 : id_bibli
     $array_selector = array();
     require_once $class_path . '/entites.class.php';
     $requete = "select raison_sociale, id_entite from entites where type_entite='0' ";
     $requete .= "and num_bibli='" . $param1 . "' ";
     $requete .= "and raison_sociale like '" . addslashes($start) . "%' order by 1";
     $res = pmb_mysql_query($requete, $dbh);
     while ($row = pmb_mysql_fetch_object($res)) {
         $adresse = "";
         $idAdresse = 0;
         $coord = entites::get_coordonnees($row->id_entite, '1');
         if (pmb_mysql_num_rows($coord) != 0) {
             $coord = pmb_mysql_fetch_object($coord);
             $idAdresse = $coord->id_contact;
             if ($coord->libelle != '') {
                 $adresse = htmlentities($coord->libelle, ENT_QUOTES, $charset) . "\n";
             }
             if ($coord->contact != '') {
                 $adresse .= htmlentities($coord->contact, ENT_QUOTES, $charset) . "\n";
             }
             if ($coord->adr1 != '') {
                 $adresse .= htmlentities($coord->adr1, ENT_QUOTES, $charset) . "\n";
             }
             if ($coord->adr2 != '') {
                 $adresse .= htmlentities($coord->adr2, ENT_QUOTES, $charset) . "\n";
             }
コード例 #9
0
ファイル: lettre_devis.class.php プロジェクト: bouchra012/PMB
 function doLettre($id_bibli, $id_dev)
 {
     global $msg, $pmb_pdf_font;
     //On récupère les infos du devis
     $dev = new actes($id_dev);
     $lignes = actes::getLignes($id_dev);
     $bib = new entites($dev->num_entite);
     $coord_liv = new coordonnees($dev->num_contact_livr);
     $coord_fac = new coordonnees($dev->num_contact_fact);
     $fou = new entites($dev->num_fournisseur);
     $coord_fou = entites::get_coordonnees($dev->num_fournisseur, '1');
     $coord_fou = mysql_fetch_object($coord_fou);
     $this->PDF->AddPage();
     $this->PDF->setFont($pmb_pdf_font);
     $this->PDF->npage = 1;
     //Affichage logo
     if ($bib->logo != '') {
         $this->PDF->Image($bib->logo, $this->x_logo, $this->y_logo, $this->l_logo, $this->h_logo);
     }
     //Affichage raison sociale
     $raison = $bib->raison_sociale;
     $this->PDF->setFontSize($this->fs_raison);
     $this->PDF->SetXY($this->x_raison, $this->y_raison);
     $this->PDF->MultiCell($this->l_raison, $this->h_raison, $raison, 0, 'L', 0);
     //Affichage date $ville
     $ville_end = stripos($coord_fac->ville, "cedex");
     if ($ville_end !== false) {
         $ville = trim(substr($coord_fac->ville, 0, $ville_end));
     } else {
         $ville = $coord_fac->ville;
     }
     $date = $ville . $this->sep_ville_date . format_date($dev->date_acte);
     $this->PDF->setFontSize($this->fs_date);
     $this->PDF->SetXY($this->x_date, $this->y_date);
     $this->PDF->Cell($this->l_date, $this->h_date, $date, 0, 0, 'L', 0);
     //Affichage coordonnees fournisseur
     //si pas de raison sociale définie, on reprend le libellé
     //si il y a une raison sociale, pas besoin
     if ($fou->raison_sociale != '') {
         $adr_fou = $fou->raison_sociale . "\n";
     } else {
         $adr_fou = $coord_fou->libelle . "\n";
     }
     if ($coord_fou->adr1 != '') {
         $adr_fou .= $coord_fou->adr1 . "\n";
     }
     if ($coord_fou->adr2 != '') {
         $adr_fou .= $coord_fou->adr2 . "\n";
     }
     if ($coord_fou->cp != '') {
         $adr_fou .= $coord_fou->cp . " ";
     }
     if ($coord_fou->ville != '') {
         $adr_fou .= $coord_fou->ville . "\n\n";
     }
     if ($coord_fou->contact != '') {
         $adr_fou .= $coord_fou->contact;
     }
     $this->PDF->setFontSize($this->fs_adr_fou);
     $this->PDF->SetXY($this->x_adr_fou, $this->y_adr_fou);
     $this->PDF->MultiCell($this->l_adr_fou, $this->h_adr_fou, $adr_fou, 0, 'L', 0);
     //Affichage adresse facturation
     $adr_fac = $this->text_adr_fac . "\n";
     if ($coord_fac->libelle != '') {
         $adr_fac .= $coord_fac->libelle . "\n";
     }
     if ($coord_fac->adr1 != '') {
         $adr_fac .= $coord_fac->adr1 . "\n";
     }
     if ($coord_fac->adr2 != '') {
         $adr_fac .= $coord_fac->adr2 . "\n";
     }
     if ($coord_fac->cp != '') {
         $adr_fac .= $coord_fac->cp . " ";
     }
     if ($coord_fac->ville != '') {
         $adr_fac .= $coord_fac->ville . "\n";
     }
     if ($coord_fac->tel1 != '') {
         $adr_fac .= $this->text_adr_fac_tel . " " . $coord_fac->tel1 . "\n";
     }
     if ($coord_fac->tel2 != '') {
         $adr_fac .= $this->text_adr_fac_tel2 . " " . $coord_fac->tel2 . "\n";
     }
     if ($coord_fac->fax != '') {
         $adr_fac .= $this->text_adr_fac_fax . " " . $coord_fac->fax . "\n";
     }
     if ($coord_fac->email != '') {
         $adr_fac .= $this->text_adr_fac_email . " " . $coord_fac->email . "\n";
     }
     $this->PDF->setFontSize($this->fs_adr_fac);
     $this->PDF->SetXY($this->x_adr_fac, $this->y_adr_fac);
     $this->PDF->MultiCell($this->l_adr_fac, $this->h_adr_fac, $adr_fac, 1, 'L', 0);
     //Affichage adresse livraison
     $adr_liv = '';
     if ($coord_liv->libelle != '') {
         $adr_liv .= $coord_liv->libelle . "\n";
     }
     if ($coord_liv->adr1 != '') {
         $adr_liv .= $coord_liv->adr1 . "\n";
     }
     if ($coord_liv->adr2 != '') {
         $adr_liv .= $coord_liv->adr2 . "\n";
     }
     if ($coord_liv->cp != '') {
         $adr_liv .= $coord_liv->cp . " ";
     }
     if ($coord_liv->ville != '') {
         $adr_liv .= $coord_liv->ville . "\n";
     }
     if ($coord_liv->tel1 != '') {
         $adr_liv .= $this->text_adr_liv_tel . " " . $coord_liv->tel1 . "\n";
     }
     if ($coord_liv->tel2 != '') {
         $adr_liv .= $this->text_adr_liv_tel2 . " " . $coord_liv->tel2 . "\n";
     }
     if ($adr_liv != '') {
         $adr_liv = $this->text_adr_liv . "\n" . $adr_liv;
         $this->PDF->setFontSize($this->fs_adr_liv);
         $this->PDF->SetXY($this->x_adr_liv, $this->y_adr_liv);
         $this->PDF->MultiCell($this->l_adr_liv, $this->h_adr_liv, $adr_liv, 1, 'L', 0);
     }
     //Affichage tiret pliage
     $this->PDF->Line(0, 105, 3, 105);
     //Affichage numero devis
     $numero = $this->text_num . $dev->numero;
     $this->PDF->SetFontSize($this->fs_num);
     $this->PDF->Cell($this->l_num, $this->h_num, $numero, 0, 0, 'L', 0);
     $this->PDF->Ln();
     //Affichage texte before + commentaires
     if ($dev->commentaires_i != '') {
         if ($this->text_before != '') {
             $this->text_before .= "\n\n";
         }
         $this->text_before .= $dev->commentaires_i;
     }
     if ($this->text_before != '') {
         $this->PDF->SetFontSize($this->fs);
         $this->PDF->MultiCell($this->w, $this->h_tab, $this->text_before, 0, 'J', 0);
         $this->PDF->Ln();
     }
     //Affichage lignes devis
     $this->PDF->SetAutoPageBreak(false);
     $this->PDF->AliasNbPages();
     $this->PDF->SetFontSize($this->fs_tab);
     $this->PDF->SetFillColor(230);
     $this->y = $this->PDF->GetY();
     $this->PDF->SetXY($this->x_tab, $this->y);
     $this->x_code = $this->x_tab;
     $this->w_code = round($this->w * 20 / 100);
     $this->x_lib = $this->x_code + $this->w_code;
     $this->w_lib = round($this->w * 60 / 100);
     $this->x_qte = $this->x_lib + $this->w_lib;
     $this->w_qte = round($this->w * 10 / 100);
     $this->doEntete();
     while ($row = mysql_fetch_object($lignes)) {
         $typ = new types_produits($row->num_type);
         $col1 = $typ->libelle . "\n" . $row->code;
         $this->h = $this->h_tab * max($this->PDF->NbLines($this->w_code, $col1), $this->PDF->NbLines($this->w_lib, $row->libelle), $this->PDF->NbLines($this->w_qte, $row->nb));
         $this->s = $this->y + $this->h;
         if ($this->s > $this->hauteur_page - $this->marge_bas) {
             $this->PDF->AddPage();
             $this->PDF->SetXY($this->x_tab, $this->y_tab);
             $this->y = $this->PDF->GetY();
             $this->doEntete();
         }
         $this->PDF->SetXY($this->x_code, $this->y);
         $this->PDF->Rect($this->x_code, $this->y, $this->w_code, $this->h);
         $this->PDF->MultiCell($this->w_code, $this->h_tab, $col1, 0, 'L');
         $this->PDF->SetXY($this->x_lib, $this->y);
         $this->PDF->Rect($this->x_lib, $this->y, $this->w_lib, $this->h);
         $this->PDF->MultiCell($this->w_lib, $this->h_tab, $row->libelle, 0, 'L');
         $this->PDF->SetXY($this->x_qte, $this->y);
         $this->PDF->Rect($this->x_qte, $this->y, $this->w_qte, $this->h);
         $this->PDF->MultiCell($this->w_qte, $this->h_tab, $row->nb, 0, 'L');
         $this->y = $this->y + $this->h;
     }
     $this->PDF->SetAutoPageBreak(true, $this->marge_bas);
     $this->PDF->SetX($this->marge_gauche);
     $this->PDF->SetY($this->y);
     $this->PDF->SetFontSize($this->fs);
     $this->PDF->Ln();
     //Affichage texte after
     if ($this->text_after != '') {
         $this->PDF->MultiCell($this->w, $this->h_tab, $this->text_after, 0, 'J', 0);
         $this->PDF->Ln();
     }
     //Affichage signature
     $this->PDF->Ln();
     $this->PDF->SetFontSize($this->fs_sign);
     $this->PDF->SetX($this->x_sign);
     $this->PDF->MultiCell($this->l_sign, $this->h_sign, $this->text_sign, 0, 'L', 0);
 }
コード例 #10
0
 function doLettre($id_bibli, $id_cde)
 {
     global $msg, $acquisition_gestion_tva;
     //On récupère les infos de la commande
     $cde = new actes($id_cde);
     $lignes = actes::getLignes($id_cde);
     $bib = new entites($cde->num_entite);
     $coord_liv = new coordonnees($cde->num_contact_livr);
     $coord_fac = new coordonnees($cde->num_contact_fact);
     $fou = new entites($cde->num_fournisseur);
     $coord_fou = entites::get_coordonnees($cde->num_fournisseur, '1');
     $coord_fou = pmb_mysql_fetch_object($coord_fou);
     $this->PDF->AddPage();
     $this->PDF->npage = 1;
     //Affichage logo
     if ($bib->logo != '') {
         $this->PDF->Image($bib->logo, $this->x_logo, $this->y_logo, $this->l_logo, $this->h_logo);
     }
     //Affichage raison sociale
     $raison = $bib->raison_sociale;
     $this->PDF->setFontSize($this->fs_raison);
     $this->PDF->SetXY($this->x_raison, $this->y_raison);
     $this->PDF->MultiCell($this->l_raison, $this->h_raison, $raison, 0, 'L', 0);
     //Affichage date $ville
     $ville_end = stripos($coord_fac->ville, "cedex");
     if ($ville_end !== false) {
         $ville = trim(substr($coord_fac->ville, 0, $ville_end));
     } else {
         $ville = $coord_fac->ville;
     }
     if ($cde->date_valid != '0000-00-00') {
         $date = $ville . $this->sep_ville_date . format_date($cde->date_valid);
     } else {
         $date = $ville . $this->sep_ville_date . format_date($cde->date_acte);
     }
     $this->PDF->setFontSize($this->fs_date);
     $this->PDF->SetXY($this->x_date, $this->y_date);
     $this->PDF->Cell($this->l_date, $this->h_date, $date, 0, 0, 'L', 0);
     //Affichage coordonnees fournisseur
     //si pas de raison sociale définie, on reprend le libellé
     //si il y a une raison sociale, pas besoin
     if ($fou->raison_sociale != '') {
         $adr_fou = $fou->raison_sociale . "\n";
     } else {
         $adr_fou = $coord_fou->libelle . "\n";
     }
     if ($coord_fou->adr1 != '') {
         $adr_fou .= $coord_fou->adr1 . "\n";
     }
     if ($coord_fou->adr2 != '') {
         $adr_fou .= $coord_fou->adr2 . "\n";
     }
     if ($coord_fou->cp != '') {
         $adr_fou .= $coord_fou->cp . " ";
     }
     if ($coord_fou->ville != '') {
         $adr_fou .= $coord_fou->ville . "\n\n";
     }
     if ($coord_fou->contact != '') {
         $adr_fou .= $coord_fou->contact;
     }
     $this->PDF->setFontSize($this->fs_adr_fou);
     $this->PDF->SetXY($this->x_adr_fou, $this->y_adr_fou);
     $this->PDF->MultiCell($this->l_adr_fou, $this->h_adr_fou, $adr_fou, 0, 'L', 0);
     //Affichage adresse facturation
     $adr_fac = $this->text_adr_fac . "\n";
     if ($coord_fac->libelle != '') {
         $adr_fac .= $coord_fac->libelle . "\n";
     }
     if ($coord_fac->adr1 != '') {
         $adr_fac .= $coord_fac->adr1 . "\n";
     }
     if ($coord_fac->adr2 != '') {
         $adr_fac .= $coord_fac->adr2 . "\n";
     }
     if ($coord_fac->cp != '') {
         $adr_fac .= $coord_fac->cp . " ";
     }
     if ($coord_fac->ville != '') {
         $adr_fac .= $coord_fac->ville . "\n";
     }
     if ($coord_fac->tel1 != '') {
         $adr_fac .= $this->text_adr_fac_tel . " " . $coord_fac->tel1 . "\n";
     }
     if ($coord_fac->tel2 != '') {
         $adr_fac .= $this->text_adr_fac_tel2 . " " . $coord_fac->tel2 . "\n";
     }
     if ($coord_fac->fax != '') {
         $adr_fac .= $this->text_adr_fac_fax . " " . $coord_fac->fax . "\n";
     }
     if ($coord_fac->email != '') {
         $adr_fac .= $this->text_adr_fac_email . " " . $coord_fac->email . "\n";
     }
     if ($bib->tva) {
         $adr_fac .= $msg["acquisition_tva"] . ": " . $bib->tva . "\n";
     }
     $this->PDF->setFontSize($this->fs_adr_fac);
     $this->PDF->SetXY($this->x_adr_fac, $this->y_adr_fac);
     $this->PDF->MultiCell($this->l_adr_fac, $this->h_adr_fac, $adr_fac, 1, 'L', 0);
     //Affichage adresse livraison
     $adr_liv = '';
     if ($coord_liv->libelle != '') {
         $adr_liv .= $coord_liv->libelle . "\n";
     }
     if ($coord_liv->adr1 != '') {
         $adr_liv .= $coord_liv->adr1 . "\n";
     }
     if ($coord_liv->adr2 != '') {
         $adr_liv .= $coord_liv->adr2 . "\n";
     }
     if ($coord_liv->cp != '') {
         $adr_liv .= $coord_liv->cp . " ";
     }
     if ($coord_liv->ville != '') {
         $adr_liv .= $coord_liv->ville . "\n";
     }
     if ($coord_liv->tel1 != '') {
         $adr_liv .= $this->text_adr_liv_tel . " " . $coord_liv->tel1 . "\n";
     }
     if ($coord_liv->tel2 != '') {
         $adr_liv .= $this->text_adr_liv_tel2 . " " . $coord_liv->tel2 . "\n";
     }
     if ($coord_liv->email != '') {
         $adr_liv .= $this->text_adr_liv_email . " " . $coord_liv->email . "\n";
     }
     if ($adr_liv != '') {
         $adr_liv = $this->text_adr_liv . "\n" . $adr_liv;
         $this->PDF->setFontSize($this->fs_adr_liv);
         $this->PDF->SetXY($this->x_adr_liv, $this->y_adr_liv);
         $this->PDF->MultiCell($this->l_adr_liv, $this->h_adr_liv, $adr_liv, 1, 'L', 0);
     }
     //Affichage tiret pliage
     $this->PDF->Line(0, 105, 3, 105);
     $this->y = $this->PDF->GetY();
     $this->PDF->Ln();
     $this->PDF->Ln();
     //Affichage numero client
     $numero_cli = $this->text_num_cli . " " . $fou->num_cp_client;
     $this->PDF->SetFontSize($this->fs_num);
     $this->PDF->SetXY($this->x_num, $this->y_num);
     $this->PDF->Cell($this->l_num_cli, $this->h_num, $numero_cli, 0, 0, 'L', 0);
     $this->PDF->Ln();
     //Affichage numero commande
     $numero = $this->text_num . $cde->numero;
     $this->PDF->SetFontSize($this->fs_num);
     $this->PDF->Cell($this->l_num, $this->h_num, $numero, 0, 0, 'L', 0);
     $this->PDF->Ln();
     //Affichage reference
     if ($cde->reference != '') {
         $ref = $this->text_ref . $cde->reference;
         $this->PDF->SetFontSize($this->fs);
         $this->PDF->Cell($this->w, $this->h_tab, $ref, 0, 0, 'L', 0);
         $this->PDF->Ln();
         $this->PDF->Ln();
     }
     //Affichage texte before + commentaires
     if ($cde->commentaires_i != '') {
         if ($this->text_before != '') {
             $this->text_before .= "\n\n";
         }
         $this->text_before .= $cde->commentaires_i;
     }
     if ($this->text_before != '') {
         $this->PDF->SetFontSize($this->fs);
         $this->PDF->MultiCell($this->w, $this->h_tab, $this->text_before, 0, 'J', 0);
     }
     //Affichage lignes commandes
     $this->PDF->SetAutoPageBreak(false);
     $this->PDF->AliasNbPages();
     $this->PDF->SetFontSize($this->fs_tab);
     $this->PDF->SetFillColor(230);
     $this->y = $this->PDF->GetY();
     $this->PDF->SetXY($this->x_tab, $this->y);
     $tab_mnt = array();
     $i = 0;
     while ($row = pmb_mysql_fetch_object($lignes)) {
         $typ = new types_produits($row->num_type);
         $col1 = $typ->libelle;
         if ($row->code) {
             $col1 .= "\n" . $row->code;
         }
         $col2 = $row->libelle;
         $col3 = $row->nb;
         $col4 = number_format(round($row->prix, 2), 2, '.', '') . " " . $cde->devise;
         if ($acquisition_gestion_tva) {
             $col4 .= "\n" . number_format(round($row->tva, 2), 2, '.', '') . " %";
         }
         $col4 .= "\n" . number_format(round($row->remise, 2), 2, '.', '') . " %";
         $col5 = '';
         if ($row->date_ech != '0000-00-00') {
             $col5 = formatdate($row->date_ech);
         }
         if ($row->num_rubrique) {
             $rub = new rubriques($row->num_rubrique);
             if ($rub->num_cp_compta) {
                 $col5 .= "\n\n" . $rub->num_cp_compta;
             }
         }
         //Est ce qu'on dépasse ?
         $this->h = $this->h_tab * max($this->PDF->NbLines($this->w_col1, $col1), $this->PDF->NbLines($this->w_col2, $col2), $this->PDF->NbLines($this->w_col3, $col3), $this->PDF->NbLines($this->w_col4, $col4), $this->PDF->NbLines($this->w_col5, $col5));
         $this->s = $this->y + $this->h;
         if (!$this->p_header) {
             $this->s = $this->s + $this->h_header;
         }
         //Si oui, chgt page
         if ($this->s > $this->hauteur_page - $this->marge_bas - $this->fs_footer) {
             $this->PDF->AddPage();
             $this->y = $this->y_tab;
             $this->p_header = false;
         }
         if (!$this->p_header) {
             $this->doEntete();
             $this->y += $this->h_header;
         }
         $this->p_header = true;
         $this->PDF->SetXY($this->x_col1, $this->y);
         $this->PDF->Rect($this->x_col1, $this->y, $this->w_col1, $this->h);
         $this->PDF->MultiCell($this->w_col1, $this->h_tab, $col1, 0, 'L');
         $this->PDF->SetXY($this->x_col2, $this->y);
         $this->PDF->Rect($this->x_col2, $this->y, $this->w_col2, $this->h);
         $this->PDF->MultiCell($this->w_col2, $this->h_tab, $col2, 0, 'L');
         $this->PDF->SetXY($this->x_col3, $this->y);
         $this->PDF->Rect($this->x_col3, $this->y, $this->w_col3, $this->h);
         $this->PDF->MultiCell($this->w_col3, $this->h_tab, $col3, 0, 'R');
         $this->PDF->SetXY($this->x_col4, $this->y);
         $this->PDF->Rect($this->x_col4, $this->y, $this->w_col4, $this->h);
         $this->PDF->MultiCell($this->w_col4, $this->h_tab, $col4, 0, 'R');
         $this->PDF->SetXY($this->x_col5, $this->y);
         $this->PDF->Rect($this->x_col5, $this->y, $this->w_col5, $this->h);
         $this->PDF->MultiCell($this->w_col5, $this->h_tab, $col5, 0, 'R');
         $this->y += $this->h;
         $tab_mnt[$i]['q'] = $row->nb;
         $tab_mnt[$i]['p'] = $row->prix;
         $tab_mnt[$i]['r'] = $row->remise;
         $tab_mnt[$i]['t'] = $row->tva;
         $i++;
     }
     $this->PDF->SetAutoPageBreak(true, $this->marge_bas);
     $this->PDF->SetX($this->marge_gauche);
     $this->PDF->SetY($this->y);
     $this->PDF->SetFontSize($this->fs);
     $this->PDF->Ln();
     //affichage des montants ht, ttc, tva
     $tab_tot = calc($tab_mnt, 2);
     $this->y = $this->PDF->GetY();
     if ($acquisition_gestion_tva) {
         $this->h = $this->h_tot * 3;
     } else {
         $this->h = $this->h_tot;
     }
     $this->s = $this->y + $this->h;
     if ($this->s > $this->hauteur_page - $this->marge_bas) {
         $this->PDF->AddPage();
         $this->PDF->SetXY($this->x_tot, $this->marge_haut);
         $this->y = $this->PDF->GetY();
     }
     if ($acquisition_gestion_tva) {
         $this->PDF->Cell($this->l_tot, $this->h_tot, $msg['acquisition_total_ht'], 1, 0, 'L', 0);
         $this->PDF->Cell($this->l_tot, $this->h_tot, number_format($tab_tot['ht'], 2, '.', '') . " " . $cde->devise, 1, 1, 'R', 0);
         $this->PDF->Cell($this->l_tot, $this->h_tot, $msg['acquisition_tva'], 1, 0, 'L', 0);
         $this->PDF->Cell($this->l_tot, $this->h_tot, number_format($tab_tot['tva'], 2, '.', '') . " " . $cde->devise, 1, 1, 'R', 0);
     }
     $this->PDF->Cell($this->l_tot, $this->h_tot, $msg['acquisition_total_ttc'], 1, 0, 'L', 0);
     $this->PDF->Cell($this->l_tot, $this->h_tot, number_format($tab_tot['ttc'], 2, '.', '') . " " . $cde->devise, 1, 1, 'R', 0);
     $this->PDF->Ln();
     //Affichage conditions de paiement
     $text_paiement = $msg['acquisition_mode_pai'];
     if ($fou->num_paiement) {
         $pai = new paiements($fou->num_paiement);
         $text_paiement .= "{$pai->libelle}";
         $this->PDF->MultiCell($this->w, $this->h_tab, $text_paiement, 0, 'L', 0);
         $this->PDF->Ln();
     }
     //Affichage texte after
     if ($this->text_after != '') {
         $this->PDF->MultiCell($this->w, $this->h_tab, $this->text_after, 0, 'J', 0);
         $this->PDF->Ln();
     }
     //Affichage signature
     $this->PDF->Ln();
     $this->PDF->SetFontSize($this->fs_sign);
     $this->PDF->SetX($this->x_sign);
     $this->PDF->MultiCell($this->l_sign, $this->h_sign, $this->text_sign, 0, 'L', 0);
 }
コード例 #11
0
 function generate_RTF()
 {
     global $base_path, $charset, $msg, $biblio_logo;
     global $biblio_name, $biblio_logo, $biblio_adr1, $biblio_adr2, $biblio_cp, $biblio_town, $biblio_state, $biblio_country, $biblio_phone, $biblio_email, $biblio_website;
     global $madame_monsieur;
     //Format des fonts
     $fontHead = new Font(12, 'Arial', '#0E298A');
     $fontHead->setBold();
     $fontSmall = new Font(1);
     $fontComment = new Font(10, 'Arial');
     $fontComment->setItalic();
     $fontChapter = new Font(10, 'Arial');
     $fontSubChapter = new Font(10, 'Arial');
     $fontSubChapter->setUnderline();
     //Format des paragraphes
     $parPmb = new ParFormat();
     $parPmb->setIndentRight(12.5);
     $parPmb->setBackColor('#0E298A');
     $parPmb->setSpaceAfter(8);
     $parHead = new ParFormat();
     $parHead->setSpaceBefore(5);
     $parChapter = new ParFormat();
     $parChapter->setSpaceBefore(2);
     $parChapter->setSpaceAfter(1);
     $parComment = new ParFormat();
     $parComment->setIndentLeft(1);
     $parComment->setIndentRight(0.5);
     $parContenu = new ParFormat('justify');
     $parContenu->setIndentLeft(1);
     $parSubChapter = new ParFormat();
     $parSubChapter->setIndentLeft(0.5);
     $parInfo = new ParFormat();
     $parInfo->setIndentLeft(0, 5);
     $parInfo->setSpaceAfter(1.5);
     $parInfoBib = new ParFormat();
     $parInfoBib->setIndentLeft(0);
     $parInfoBib->setSpaceAfter(1.5);
     //Document
     $rtf = new Rtf();
     $rtf->setMargins(1, 1, 1, 1);
     foreach ($this->liste_rel as $id_fournisseur => $info_fournisseur) {
         $rtf->setMargins(1, 1, 1, 1);
         $sect =& $rtf->addSection();
         $table =& $sect->addTable();
         $table->addRows(1, 2);
         $table->addColumnsList(array(15, 4));
         //$table->addImageToCell(1,1,$base_path."/images/".$biblio_logo,new ParFormat('center'),0,0);
         // Info biblio
         $cell =& $table->getCell(1, 1);
         $cell->writeText($this->to_utf8($biblio_name), new Font(14, 'Arial', '#0E298A'), new ParFormat('left'));
         if ($biblio_adr1) {
             $cell->writeText($this->to_utf8($biblio_adr1), new Font(12, 'Arial', '#0E298A'), new ParFormat('left'));
         }
         if ($biblio_adr2) {
             $cell->writeText($this->to_utf8($biblio_adr2), new Font(12, 'Arial', '#0E298A'), new ParFormat('left'));
         }
         if ($biblio_cp || $biblio_town) {
             $cell->writeText($this->to_utf8($biblio_cp . " " . $biblio_town), new Font(12, 'Arial', '#0E298A'), new ParFormat('left'));
         }
         if ($biblio_phone) {
             $cell->writeText($this->to_utf8($biblio_phone), new Font(12, 'Arial', '#0E298A'), new ParFormat('left'));
         }
         if ($biblio_email) {
             $cell->writeText($this->to_utf8($biblio_email), new Font(12, 'Arial', '#0E298A'), new ParFormat('left'));
         }
         // Info date de génération
         $cell =& $table->getCell(1, 2);
         if ($biblio_email) {
             $cell->writeText($this->to_utf8("\n" . $msg['fpdf_edite'] . " " . formatdate(date("Y-m-d", time())), ENT_QUOTES, $charset), new Font(12, 'Arial', '#0E298A'), new ParFormat('right'));
         }
         if ($id_fournisseur) {
             $fou = new entites($id_fournisseur);
             $coord_fou = entites::get_coordonnees($id_fournisseur, 1);
             $coord_fou = pmb_mysql_fetch_object($coord_fou);
             if ($fou->raison_sociale != '') {
                 $libelle = $fou->raison_sociale;
             } else {
                 $libelle = $coord_fou->libelle;
             }
             $table =& $sect->addTable();
             $table->addRows(2, 2);
             $table->addColumnsList(array(9, 10));
             $cell =& $table->getCell(1, 2);
             $cell->writeText($this->to_utf8($libelle), new Font(14, 'Arial', '#0E298A'), new ParFormat('left'));
             if ($coord_fou->adr1) {
                 $cell->writeText($this->to_utf8($coord_fou->adr1), new Font(12, 'Arial', '#0E298A'), new ParFormat('left'));
             }
             if ($coord_fou->adr2) {
                 $cell->writeText($this->to_utf8($coord_fou->adr2), new Font(12, 'Arial', '#0E298A'), new ParFormat('left'));
             }
             if ($coord_fou->cp) {
                 $cell->writeText($this->to_utf8($coord_fou->cp), new Font(12, 'Arial', '#0E298A'), new ParFormat('left'));
             }
             if ($coord_fou->ville) {
                 $cell->writeText($this->to_utf8($coord_fou->ville), new Font(12, 'Arial', '#0E298A'), new ParFormat('left'));
             }
             if ($coord_fou->contact != '') {
                 $cell =& $table->getCell(2, 2);
                 $cell->writeText($this->to_utf8($msg['acquisition_act_formule'] . " " . $coord_fou->contact), new Font(12, 'Arial', '#0E298A'), new ParFormat('left'));
             }
         }
         $sect->writeText($this->to_utf8($msg["abts_gestion_retard_lettre_monsieur"] . "<br />"), new Font(12, 'Arial', '#0E298A'), new ParFormat('left'));
         foreach ($info_fournisseur as $num_notice => $info_notice) {
             //print $num_notice; print_r($info_notice) ;exit;
             $perio = new serial_display($num_notice);
             $sect->writeText($this->to_utf8($perio->notice->tit1), $fontHead, $parHead);
             $sect->emptyParagraph($fontSmall, $parPmb);
             foreach ($info_notice as $abt_num => $info_abt) {
                 //$sect->writeText($this->to_utf8($doc), new Font(10,'Arial'), $parInfo);
                 foreach ($info_abt as $rel_id => $rel_info) {
                     $date = "<u>" . $rel_info["rel_libelle_numero"] . "</u> : " . formatdate($rel_info["rel_date_parution"]);
                     $sect->writeText($this->to_utf8($date), new Font(10, 'Arial'), $parInfo);
                     $sect->writeText($this->to_utf8($rel_info["rel_comment_gestion"]), new Font(10, 'Arial'), $parSubChapter);
                 }
             }
         }
         $sect->insertPageBreak();
     }
     $rtf->sendRtf("rapport");
 }
コード例 #12
0
ファイル: receptions.inc.php プロジェクト: bouchra012/PMB
function do_relances()
{
    global $dbh, $charset;
    global $id_bibli, $chk, $id_lig;
    global $acquisition_pdfrel_obj_mail, $acquisition_pdfrel_text_mail;
    global $acquisition_pdfrel_by_mail, $PMBuseremailbcc;
    //recuperation des lignes a relancer
    $tab_lig = array();
    foreach ($chk as $v) {
        if ($id_lig[$v]) {
            $tab_lig[] = $id_lig[$v];
        }
    }
    $tab_fou = array();
    $q = lignes_actes::getLines($tab_lig, true);
    if ($q) {
        $r = mysql_query($q, $dbh);
        if (mysql_num_rows($r)) {
            while ($row = mysql_fetch_object($r)) {
                if (!array_key_exists($row->num_fournisseur, $tab_fou)) {
                    $tab_fou[$row->num_fournisseur] = array();
                }
                if (!array_key_exists($row->id_acte, $tab_fou[$row->num_fournisseur])) {
                    $tab_fou[$row->num_fournisseur][$row->id_acte] = array();
                }
                $tab_fou[$row->num_fournisseur][$row->id_acte][] = $row->id_ligne;
            }
        }
    }
    $bib = new entites($id_bibli);
    $bib_coord = mysql_fetch_object(entites::get_coordonnees($id_bibli, 1));
    $tab_no_mail = array();
    if (!($acquisition_pdfrel_by_mail && strpos($bib_coord->email, '@'))) {
        $tab_no_mail = $tab_fou;
    } else {
        if (count($tab_fou)) {
            foreach ($tab_fou as $id_fou => $tab_act) {
                $fou = new entites($id_fou);
                $fou_coord = mysql_fetch_object(entites::get_coordonnees($id_fou, 1));
                //Si on peut relancer par mail
                if (strpos($fou_coord->email, '@')) {
                    $dest_name = '';
                    if ($fou_coord->libelle) {
                        $dest_name = $fou_coord->libelle;
                    } else {
                        $dest_name = $fou->raison_sociale;
                    }
                    if ($fou_coord->contact) {
                        $dest_name .= " " . $fou_coord->contact;
                    }
                    $dest_mail = $fou_coord->email;
                    $obj_mail = $acquisition_pdfrel_obj_mail;
                    $text_mail = $acquisition_pdfrel_text_mail;
                    $bib_name = $bib_coord->raison_sociale;
                    $bib_mail = $bib_coord->email;
                    $lettre = new lettreRelance_PDF();
                    $lettre->doLettre($bib, $bib_coord, $fou, $fou_coord, $tab_act);
                    $piece_jointe = array();
                    $piece_jointe[0]['contenu'] = $lettre->getLettre('S');
                    $piece_jointe[0]['nomfichier'] = $lettre->getFileName();
                    //         mailpmb($to_nom="", $to_mail,   $obj="",   $corps="",  $from_name="", $from_mail, $headers, $copie_CC="", $copie_BCC="", $faire_nl2br=0, $pieces_jointes=array())
                    $res_envoi = mailpmb($dest_name, $dest_mail, $obj_mail, $text_mail, $bib_name, $bib_mail, "Content-Type: text/plain; charset=\"{$charset}\"", '', $PMBuseremailbcc, 1, $piece_jointe);
                    if (!$res_envoi) {
                        $tab_no_mail[$id_fou] = $tab_act;
                    }
                } else {
                    $tab_no_mail[$id_fou] = $tab_act;
                }
            }
        }
    }
    if (count($tab_no_mail)) {
        print "\t\n\t\t<form name='print_liste_relances' action='pdf.php?pdfdoc=listrecept' target='lettre' method='post'>\t\t\n\t\t\t<input type='hidden' name='id_bibli' value='" . $id_bibli . "'/>\n\t\t\t<input type='hidden' name='tab_no_mail' value='" . rawurlencode(serialize($tab_no_mail)) . "'/>\n\t\t\t<script type='text/javascript'>\n\t\t\t\topenPopUp('','lettre', 600, 500, -2, -2, 'toolbar=no, dependent=yes, resizable=yes');\n\t\t\t\tdocument.print_liste_relances.submit();\n\t\t\t</script>\n\t\t</form>";
    }
    lignes_actes::setRelances($tab_lig);
}