/**
 * createBatchDetailsNotification()
 * wrapper-function to create the notification to the customer
 * 
 * @param		array			customer information array
 */
function createBatchDetailsNotification($customerInfo)
{
    global $base;
    $html = prepareNotificationTemplate($customerInfo);
    $pdfDocument = createPDF($html);
    return $pdfDocument;
}
/**
 * createUserDetailsInvoiceNotification()
 * wrapper-function to create the notification to the customer
 * 
 * @param		array			customer information array
 */
function createUserDetailsInvoiceNotification($customerInfo)
{
    global $base;
    $html = prepareNotificationTemplate($customerInfo);
    $pdfDocument = createPDF($html);
    file_put_contents("{$base}/out4.pdf", $pdfDocument);
    return $pdfDocument;
}
/**
 * sendWelcomeNotification()
 * wrapper-function to send notification to the customer
 * 
 * @param		array			customer information array
 * @param		array			smtp server information
 * @param		string			from email address of the sender identity
 */
function sendWelcomeNotification($customerInfo, $smtpInfo, $from)
{
    global $base;
    if (empty($customerInfo['customer_email'])) {
        return;
    }
    $headers = array("From" => $from, "Subject" => "Welcome new customer!", "Reply-To" => $from);
    $html = prepareNotificationTemplate($customerInfo);
    $pdfDocument = createPDF($html);
    $mime = new Mail_mime();
    $mime->setTXTBody("Notification letter of service");
    $mime->addAttachment($pdfDocument, "application/pdf", "notification.pdf", false, 'base64');
    $body = $mime->get();
    $headers = $mime->headers($headers);
    $mail =& Mail::factory("smtp", $smtpInfo);
    $mail->send($customerInfo['customer_email'], $headers, $body);
}
Ejemplo n.º 4
0
    // Merge le logo avec l'image
    imagecopymerge($imgDest, $imgLogo, $nMapWidth - $width, $nMapHeight - $height, 0, 0, $width, $height, 100);
    imagepng($imgDest, $mapImagePath);
    imagedestroy($imgDest);
    unlink($imagePath);
}
/**
 * If outputed document is pdf, create it.  Add the title, map and comments to
 * the document.
 */
if ($szOutputFormat == 'pdf') {
    $basename = basename($szMapImageURL);
    // Construct the map image path
    $pdfPath = $_IMAGEPATH . $basename;
    $pdfUrl = $szMapImageURL . ".pdf";
    createPDF($page_width, $page_height, $szTitle, $szComments, $pdfPath);
    print $pdfUrl;
} else {
    print $szMapImageURL;
}
if (isset($vecteurFilePath)) {
    unlink($vecteurFilePath);
    unlink($vecteurMapFilePath);
}
/**
 * This function creates a PDF with a title, an image and a comment.
 *
 * @param $page_width  	(The page width in dpi. (inches x 72) )
 * @param $page_height  (The page height in dpi. (inches x 72) )
 * @param $title		(The title to insert in the pdf)
 * @param $comments		(The comments to insert in the pdf)
Ejemplo n.º 5
0
    if ($outtype == 'html') {
        include "header.php";
        echo "<h2>" . $reportTitle . "</h2>";
        echo "<p>" . $descriptionText . "</p>";
        echo $translatedResponse;
        // display the bottom user options
        $uiElem->reportNode = $thisReport[0];
        // the paramter is true if the record set is empty
        echo $uiElem->bottomUserInput(false);
        include "app/sendData.inc";
        include "footer.php";
    }
    if ($outtype == 'print') {
        //createPDF(tidyHTML($translatedResponse), $reportTitle, 'browser', $printTemplate);
        // disable tidy temporarily because tidy is not loaded properly on the server
        createPDF($translatedResponse, $reportTitle, 'browser', $printTemplate);
    }
}
function tidyHTML($htmlString)
{
    $tidyConfig = array('indent' => true, 'output-xhtml' => true, 'wrap' => 200);
    // Tidy
    $tidy = new tidy();
    $tidy->parseString($htmlString, $tidyConfig, 'utf8');
    $tidy->cleanRepair();
    return $tidy;
}
function handle_error($errorMsg, $outtype)
{
    if ($outtype == 'email') {
        // return json
Ejemplo n.º 6
0
 /**
  * This handles the export functionality just for a store's product catalog.
  * 
  * @author unknown
  * @param string $format
  */
 public function export_catalog($format)
 {
     $catalog_columns = $this->Store->get_columns_by_store($this->store_id);
     $column_order = $column_names = array();
     for ($i = 0, $n = count($catalog_columns); $i < $n; $i++) {
         $column_order[] = $catalog_columns[$i]->db_name;
         $column_names[] = $catalog_columns[$i]->display_name;
     }
     $csv_data = array($column_names);
     // get all non-archived products
     $products = $this->Product->get_products_for_store($this->store_id);
     //$products = $this->Product->getByStore($this->store_id);
     for ($i = 0, $n = count($products); $i < $n; $i++) {
         $row = array();
         foreach ($column_order as $column) {
             switch ($column) {
                 case 'wholesale_price':
                     $price = getPricePoint($products[$i]['upc_code'], $this->store_id, $column);
                     $price = empty($price) ? '0.00' : number_format($price, 2, '.', '');
                     $row[] = $price;
                     break;
                 case 'retail_price':
                     $price = getPricePoint($products[$i]['upc_code'], $this->store_id, $column);
                     $price = empty($price) ? '0.00' : number_format($price, 2, '.', '');
                     $row[] = $price;
                     break;
                 case 'price_floor':
                     $price = getPricePoint($products[$i]['upc_code'], $this->store_id, $column);
                     $price = empty($price) ? '0.00' : number_format($price, 2, '.', '');
                     $row[] = $price;
                     break;
                 default:
                     $row[] = isset($products[$i][$column]) ? $products[$i][$column] : '';
             }
         }
         $csv_data[] = $row;
     }
     $name = 'catalog';
     /*
     if ($this->store_id !== 'all')
     	$name = str_replace(' ', '_', $this->store_data['store_name']);
     */
     // get current store being viewed
     $store = $this->Store->get_store_by_id_array($this->store_id);
     $name = str_replace(' ', '_', $store['store_name']);
     $name .= '_' . date('Y-m-d');
     if ($format == 'excel') {
         createCSV($csv_data, $name);
     } else {
         createPDF($csv_data, $name);
     }
     exit;
 }