Webfinance is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. Webfinance 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 Webfinance; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ include "../inc/main.php"; $societe = GetCompanyInfo(); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="/css/themes/main/main.css" /> <title>Paiement <?php echo $societe->raison_sociale; ?> </title> </head> <body> <br /><br /> <table width="500" align="center" border="0" cellspacing="5" cellpadding="5" style="border: 1px solid gray;">
function SendPaymentRequest($id_invoice, $mode = 'paypal') { $Invoice = new Facture(); $invoice = $Invoice->getInfos($id_invoice); $client = new Client($invoice->id_client); $societe = GetCompanyInfo(); $q = "SELECT value FROM webfinance_pref WHERE type_pref='mail_paypal_" . $invoice->language . "'"; $result = mysql_query($q) or die(mysql_error()); list($data) = mysql_fetch_array($result); $pref = unserialize(base64_decode($data)); $varlink = $id_invoice . '|' . $invoice->id_client; $converter = new Encryption(); $encoded_varlink = $converter->encode($varlink); $link = $societe->wf_url . "/payment/?id={$encoded_varlink}"; $mails = array(); $from = ''; $fromname = ''; $subject = ''; $patterns = array('/%%NUM_INVOICE%%/', '/%%CLIENT_NAME%%/', '/%%URL_PAYPAL%%/', '/%%AMOUNT%%/', '/%%COMPANY%%/'); $replacements = array($invoice->num_facture, $invoice->nom_client, $link, $invoice->nice_total_ttc, $societe->raison_sociale); $body = stripslashes(preg_replace($patterns, $replacements, stripslashes(utf8_decode($pref->body)))); if (!$Invoice->sendByEmail($id_invoice, $mails, $from, $fromname, $subject, $body)) { die(_('Invoice was not sent')); } return $link; }