[ Index ]

PHP Cross Reference of osCMax 2.0.4

title

Body

[close]

/admin/includes/modules/batch_print/templates/ -> Integrated-Packing2.php (source)

   1  <?php
   2  // set paper type and size

   3  if ($pageloop == "0") {
   4  $pdf = new Cezpdf(Letter,portrait);
   5  } else {
   6  
   7  define('LEFT_MARGIN','30');
   8  // The small indents in the Sold to: Ship to: Text blocks

   9  define('TEXT_BLOCK_SMALL_INDENT', '5');
  10  define('TEXT_BLOCK_INDENT', '25');
  11  
  12  define('SHIP_TO_COLUMN_START','330');
  13  define('MIDDLE_COLUMN_START','250');
  14  define('RIGHT_COLUMN_START','450');
  15  // This changes the 'Total', 'Sub-Total', 'Tax', and 'Shipping Method' text block

  16  // position, for example if you choose to make the text a bigger font size you need to 

  17  // tweak this value in order to prevent the text from clashing together

  18  define('PRODUCT_TOTAL_TITLE_COLUMN_START','400');
  19  define('RIGHT_MARGIN','30');
  20  define('LINE_LENGTH', '552');
  21  // If you have attributes for certain products, you can have the text wrap

  22  // or just be written completely on one line, with the text wrap disabled

  23  // it makes the tables smaller appear much better, of course that is only my opinion

  24  // so I made this variable if anyone would like it to wrap.

  25  define('PRODUCT_ATTRIBUTES_TEXT_WRAP', true);
  26  // This sets the space size between sections

  27  define('SECTION_DIVIDER', '15');
  28  // Product table Settings

  29  define('TABLE_HEADER_FONT_SIZE', '10');
  30  define('TABLE_HEADER_BKGD_COLOR', DARK_GREY);
  31  define('PRODUCT_TABLE_HEADER_WIDTH', '530');
  32  // This is more like cell padding, it moves the text the number

  33  // of points specified to make the rectangle appear padded

  34  define('PRODUCT_TABLE_BOTTOM_MARGIN', '2');
  35  // Tiny indent right before the product name, again more like

  36  // the cell padding effect

  37  define('PRODUCT_TABLE_LEFT_MARGIN', '2');
  38  // Height of the product listing rectangles

  39  define('PRODUCT_TABLE_ROW_HEIGHT', '11');
  40  // The column sizes are where the product listing columns start on the

  41  // PDF page, if you make the TABLE HEADER FONT SIZE any larger you will

  42  // need to tweak these values to prevent text from clashing together

  43  define('PRODUCTS_COLUMN_SIZE', '215');
  44  define('PRODUCT_LISTING_BKGD_COLOR',GREY);
  45  define('MODEL_COLUMN_SIZE', '62');
  46  define('PRICING_COLUMN_SIZES', '52');
  47  
  48  define('SMALL_LEADING', '6');
  49  define('IPS_LEADING', '9');
  50  define('LABEL_LEADING', '12');
  51  define('IPS_FONT_SIZE', '10');
  52  define('LABEL_FONT_SIZE', '12');
  53  define('SENDER_TICKET_SIZE', '8');
  54  define('SENDER_FONT_SIZE', '6');
  55  define('SENDER_SMALL_FONT_SIZE', '7');
  56  define('TICKET_FONT_SIZE', '7');
  57  // This should go in the language file

  58  $vilains = array("&#224;", "&#225;",  "&#226;", "&#227;", "&#228;", "&#229;", "&#230;", "&#231;", "&#232;", "&#233;", "&#234;", "&#235;", "&#236;", "&#237;", "&#238;", "&#239;", "&#240;", "&#241;", "&#242;", "&#243;", "&#244;", "&#245;", "&#246;", "&#247;", "&#248;", "&#249;", "&#250;", "&#251;", "&#252;", "&#253;", "&#254;", "&#255;", "&#223;","&#39;", "&nbsp;", "&agrave;", "&aacute;", "&atilde;","&auml;", "&Arond;", "&egrave;", "&aelig;", "&ecirc;", "&euml;", "&igrave;", "&iacute;", "&Iacute;", "&icirc;", "&iuml;", "&ograve;", "&oacute;", "&ocirc;", "&otilde;", "&ouml;", "&oslash;", "&ugrave;", "&uacute;", "&ucirc;", "&uuml;", "&ntilde;", "&ccedil;", "&yacute;", "&lt;","&gt;", "&amp;");
  59  $cools = array('','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','\'', ' ','','','','','','','','','','','','','','','','','','','','','','','','','','','','<','>','&');
  60  
  61  $currencies = new currencies();
  62  
  63  $pdf->selectFont(BATCH_PDF_DIR . 'Helvetica.afm');
  64  $pdf->setFontFamily(BATCH_PDF_DIR . 'Helvetica.afm');
  65   // set up delivery address array

  66  $address_array=explode('<br>',tep_address_format($order->delivery['format_id'], $order->delivery, 1, '', '<br>'));
  67  
  68  if (SHIP_FROM_COUNTRY == $address_array[count($address_array)-1]) {
  69   $address_array[count($address_array)-1] = '';
  70   }
  71  $delivery_address_array = array();
  72  $i = 0;
  73  foreach ($address_array as $key => $value) {
  74    if ((!is_null($value))&& ($value !== "")) {
  75      $delivery_address_array[$i] = $value;
  76      $i++;
  77    }
  78  }
  79  
  80   // set up billing address array

  81  $address_array=explode('<br>',tep_address_format($order->billing['format_id'], $order->billing, 1, '', '<br>'));
  82  $lines = count($address_array)-1;
  83  if (SHIP_FROM_COUNTRY == $address_array[$lines]) {
  84   $address_array[$lines] = '';
  85   }
  86  $billing_address_array = array();
  87  $i = 0;
  88  foreach ($address_array as $key => $value) {
  89    if ((!is_null($value))&& ($value !== "")) {
  90      $billing_address_array[$i] = $value;
  91      $i++;
  92    }
  93  }
  94  
  95  $address_array=explode('<br>', str_replace("\r\n", "<br>", STORE_NAME_ADDRESS));
  96  $i = 0;
  97  //The first $key number is the number of lines in your store name and address excluding the telephone number at the bottom.

  98  //The second $key number is the number of lines in your store name and address excluding telephone number and country.

  99  foreach ($address_array as $key=>$value)  {
 100  if (((SHIP_FROM_COUNTRY != $order->delivery['country']) && ($key < 5)) || ($key < 4))
 101   {
 102      $store_address_array[$i] = $value;
 103     $i++;
 104  }
 105  }
 106  $y=720;
 107  $pos = $y;
 108  
 109  
 110  
 111  foreach ($delivery_address_array as $key=>$value)  {
 112   $pdf->addText(LEFT_MARGIN,$pos -= SMALL_LEADING,SENDER_SMALL_FONT_SIZE,$value);
 113  }
 114  
 115      $pos=$y;
 116  
 117  //  $address_array=explode('<br>', str_replace("\r\n", "<br>", STORE_NAME_ADDRESS));

 118  foreach ($store_address_array as $key=>$value)  {
 119  // echo $value.'<br>' ;

 120   $pdf->addText(SHIP_TO_COLUMN_START,$pos -= SMALL_LEADING,SENDER_SMALL_FONT_SIZE,$value);
 121  }
 122     $y-=55;
 123  // company name and details pulled from the my store address and phone number

 124  // in admin configuration mystore 

 125  $pdf->setStrokeColor(0,0,0);
 126  $pdf->setLineStyle(1);
 127  $pdf->roundedRectangle(28,570,230,120,10,$f=0);
 128  
 129  // order number

 130  //$y = $pdf->ezText("" . TEXT_ORDER_NUMBER . " " . $orders['orders_id'] ."\n\n",SENDER_FONT_SIZE);

 131  $indent =  LEFT_MARGIN +  TEXT_BLOCK_SMALL_INDENT;
 132  $pdf->addText($indent,$y,SUB_HEADING_FONT_SIZE,"<b>" . TEXT_TO . "</b>");
 133  //$y = $pdf->ezText(STORE_NAME_ADDRESS,GENERAL_FONT_SIZE);

 134  $pos = $y;
 135  $indent =  LEFT_MARGIN +  TEXT_BLOCK_INDENT;
 136  
 137  foreach ($store_address_array as $key=>$value)  {
 138   $pdf->addText($indent,$pos -= LABEL_LEADING,LABEL_FONT_SIZE,"<b>".$value."</b>");
 139  }
 140  
 141  
 142  // logo image  set to right of the above .. change first number to move sideways    

 143  // $pdf->addJpegFromFile(BATCH_PRINT_INC . 'templates/' . 'invoicelogo.jpg',365,730,85,85);

 144  
 145  
 146  $pdf->setStrokeColor(0,0,0);
 147  $pdf->setLineStyle(1);
 148  $pdf->roundedRectangle(330,570,260,120,10,$f=0);
 149  
 150  
 151  // ship to info in right column

 152  $indent = SHIP_TO_COLUMN_START + TEXT_BLOCK_SMALL_INDENT;
 153  $pdf->addText($indent,$y,SUB_HEADING_FONT_SIZE,"<b>" . TEXT_TO . "</b>");
 154  
 155  $pos = $y;
 156  $indent = SHIP_TO_COLUMN_START + TEXT_BLOCK_INDENT;
 157  
 158  
 159  foreach ($delivery_address_array as $key=>$value)  {
 160   $pdf->addText($indent,$pos -= LABEL_LEADING,LABEL_FONT_SIZE,"<b>".$value."</b>");
 161  }
 162  $y -=105;
 163      // order number

 164   $pdf->addText(LEFT_MARGIN + 55,$y,TICKET_FONT_SIZE,"" . TEXT_RETURNS_LABEL . " " . $orders['orders_prefix'] . $orders['orders_id'] ."");
 165  
 166   $pdf->addText(SHIP_TO_COLUMN_START + 70,$y,TICKET_FONT_SIZE,"" . TEXT_SHIPPING_LABEL . " " . $orders['orders_prefix'] . $orders['orders_id'] ."");
 167  
 168  // line between header order number and order date

 169  $y -=30;
 170     $pdf->addText(LEFT_MARGIN,$y,TICKET_FONT_SIZE, TEXT_RETURNS);
 171    $y -=3;
 172  $pdf->setLineStyle(1);
 173  $pdf->line(LEFT_MARGIN,$y,LINE_LENGTH,$y);
 174  $pdf->ezSetY($y);
 175  $dup_y = $y;
 176  
 177  // order number

 178  $y = $pdf->ezText("<b>" . TEXT_ORDER_NUMBER . " </b>" . $orders['orders_prefix'] . $orders['orders_id'] ."\n\n",SUB_HEADING_FONT_SIZE);
 179  
 180  // order date

 181   if ($HTTP_POST_VARS['show_order_date']) {
 182      $pdf->ezSetY($dup_y);
 183      $pdf->ezText("<b>" . TEXT_ORDER_DATE . " </b>" . date(TEXT_ORDER_FORMAT, strtotime($order->info['date_purchased'])) ."\n\n",SUB_HEADING_FONT_SIZE,array('justification'=>'right'));
 184      }
 185  
 186  $y -= 10;
 187  
 188  
 189  //left rounded rectangle around sold to info

 190  $pdf->setStrokeColor(0,0,0);
 191  $pdf->setLineStyle(1);
 192  $pdf->roundedRectangle(28,400,190,100,10,$f=0);
 193  
 194  
 195  // sold to info in left rectangle    

 196  $pdf->addText(LEFT_MARGIN,$y,SUB_HEADING_FONT_SIZE,"<b>" . ENTRY_SOLD_TO . "</b>");
 197  
 198  $pos = $y;
 199  $indent = LEFT_MARGIN + TEXT_BLOCK_INDENT;
 200  
 201  //  $address_array=explode('<br>',tep_address_format($order->billing['format_id'], $order->billing, 1, '', '<br>'));

 202  foreach ($billing_address_array as $key=>$value)  {
 203   $pdf->addText($indent,$pos -= IPS_LEADING,IPS_FONT_SIZE,$value);
 204  }
 205  
 206  
 207  if ($order->delivery != $order->billing)     {
 208  // right rounded rectangle around ship to info

 209    $pdf->setStrokeColor(0,0,0);
 210    $pdf->setLineStyle(1);
 211    $pdf->roundedRectangle(228,400,190,100,10,$f=0);
 212  
 213  // ship to info in middle column

 214    $pdf->addText(MIDDLE_COLUMN_START,$y,SUB_HEADING_FONT_SIZE,"<b>" . ENTRY_SHIP_TO . "</b>");
 215  
 216    $pos = $y;
 217    $indent = MIDDLE_COLUMN_START + TEXT_BLOCK_INDENT;
 218  
 219  //  $address_array=explode('<br>',tep_address_format($order->delivery['format_id'], $order->delivery, 1, '', '<br>'));

 220    foreach ($delivery_address_array as $key=>$value)  {
 221     $pdf->addText($indent,$pos -= IPS_LEADING,IPS_FONT_SIZE,$value);
 222    }
 223  }
 224  
 225  // logo image  set to right below store name/address.. change first number to move sideways

 226  $pdf->addJpegFromFile(BATCH_PRINT_INC . 'templates/' . 'integrated_logo.jpg',450,400,55,40);
 227  
 228    $pos = $y;
 229    $address_array=explode('<br>', str_replace("\r\n", "<br>", STORE_NAME_ADDRESS));
 230  foreach ($address_array as $key=>$value)  {
 231  // echo $value.'<br>' ;

 232   $pdf->addText(RIGHT_COLUMN_START,$pos -= IPS_LEADING,IPS_FONT_SIZE,$value);
 233  }
 234    $pdf->addText(RIGHT_COLUMN_START,$pos -= IPS_LEADING,IPS_FONT_SIZE,WEBSITE);
 235  
 236  // phone and email statments .. added blank lines if turned off so as to maintain layout

 237  //if ($HTTP_POST_VARS['show_phone'] || $HTTP_POST_VARS['show_email'] ) {

 238  
 239  $pos -= SECTION_DIVIDER;
 240  $pdf->ezSetY($pos - 20 );
 241  
 242  //if ($HTTP_POST_VARS['show_phone']) {

 243  $pos = $pdf->ezText("<b>" . ENTRY_PHONE . "</b> " . $order->customer['telephone'],IPS_FONT_SIZE);
 244  
 245  //}  if ($HTTP_POST_VARS['show_email']) {

 246  $pos = $pdf->ezText("<b>" . ENTRY_EMAIL . "</b> " .$order->customer['email_address'],IPS_FONT_SIZE);
 247  //}

 248  //} else {

 249  
 250  //$pos -= SECTION_DIVIDER;

 251  //$pdf->ezSetY($pos - 40 );

 252  
 253  //$pos = $pdf->ezText("");

 254  
 255  
 256  
 257  //}

 258  // divider between email and payment method 

 259   $pos -= SECTION_DIVIDER;
 260   $pdf->ezSetY($pos);
 261   
 262  // payment method  

 263  //if ($HTTP_POST_VARS['show_pay_method']) {

 264  $pos = $pdf->ezText("<b>" . ENTRY_PAYMENT_METHOD . "</b> " . str_replace($vilains , $cools ,$order->info['payment_method']),IPS_FONT_SIZE);
 265  
 266  //    if ($order->info['payment_method'] == PAYMENT_TYPE) {

 267  //$pos = $pdf->ezText("<b>" . ENTRY_PAYMENT_TYPE . "</b> " . $order->info['cc_type'],IPS_FONT_SIZE);

 268  //$pos = $pdf->ezText("<b>" . ENTRY_CC_OWNER . "</b> " . $order->info['cc_owner'],IPS_FONT_SIZE);

 269  //        if ($HTTP_POST_VARS['show_cc']) {

 270  //        $pos = $pdf->ezText("<b>" . ENTRY_CC_NUMBER . "</b> " . $order->info['cc_number'],IPS_FONT_SIZE);

 271  //        }

 272          
 273  //        $pos = $pdf->ezText("<b>" . ENTRY_CC_EXP . "</b> " . $order->info['cc_expires'],IPS_FONT_SIZE);

 274  //    }

 275  
 276  //}

 277  $pos -= SECTION_DIVIDER;
 278   
 279  // products , model etc table layout 

 280  change_color(TABLE_HEADER_BKGD_COLOR);
 281  $pdf->filledRectangle(LEFT_MARGIN,$pos-PRODUCT_TABLE_ROW_HEIGHT,PRODUCT_TABLE_HEADER_WIDTH,PRODUCT_TABLE_ROW_HEIGHT);
 282  
 283  $x = LEFT_MARGIN + PRODUCT_TABLE_LEFT_MARGIN;
 284  $pos = ($pos-PRODUCT_TABLE_ROW_HEIGHT) + PRODUCT_TABLE_BOTTOM_MARGIN;
 285  
 286  change_color(GENERAL_FONT_COLOR);
 287  
 288  $pdf->addText($x,$pos,TABLE_HEADER_FONT_SIZE,TABLE_HEADING_PRODUCTS_MODEL);
 289  $pdf->addText($x += MODEL_COLUMN_SIZE,$pos,TABLE_HEADER_FONT_SIZE,TABLE_HEADING_PRODUCTS);
 290  $pdf->addText($x += MODEL_COLUMN_SIZE + PRODUCTS_COLUMN_SIZE, $pos, TABLE_HEADER_FONT_SIZE, TABLE_HEADING_QTY);
 291  if ( $billing_address_array[0] == $delivery_address_array[0]) {
 292    //$pdf->addText($x += MODEL_COLUMN_SIZE,$pos,TABLE_HEADER_FONT_SIZE,TABLE_HEADING_TAX);

 293    $pdf->addText($x += MODEL_COLUMN_SIZE,$pos,TABLE_HEADER_FONT_SIZE,TABLE_HEADING_PRICE_EXCLUDING_TAX);
 294    //$pdf->addText($x += PRICING_COLUMN_SIZES,$pos,TABLE_HEADER_FONT_SIZE,TABLE_HEADING_PRICE_INCLUDING_TAX);

 295    $pdf->addText($x += PRICING_COLUMN_SIZES,$pos,TABLE_HEADER_FONT_SIZE,TABLE_HEADING_TOTAL_EXCLUDING_TAX);
 296    //$pdf->addText($x += PRICING_COLUMN_SIZES,$pos,TABLE_HEADER_FONT_SIZE,TABLE_HEADING_TOTAL_INCLUDING_TAX);

 297    }
 298  
 299  $pos -= PRODUCT_TABLE_BOTTOM_MARGIN;
 300  
 301  // Sort through the products

 302  
 303  for ($i = 0, $n = sizeof($order->products); $i < $n; $i++) {
 304  
 305  //$prod_str = $order->products[$i]['qty'] . " x " . $order->products[$i]['name'];

 306  $prod_str = $order->products[$i]['name'];
 307  
 308  
 309  change_color(PRODUCT_LISTING_BKGD_COLOR);
 310  $pdf->filledRectangle(LEFT_MARGIN,$pos-PRODUCT_TABLE_ROW_HEIGHT,PRODUCT_TABLE_HEADER_WIDTH,PRODUCT_TABLE_ROW_HEIGHT);
 311  
 312  $x = LEFT_MARGIN + PRODUCT_TABLE_LEFT_MARGIN;
 313  $pos = ($pos-PRODUCT_TABLE_ROW_HEIGHT) + PRODUCT_TABLE_BOTTOM_MARGIN;
 314  //page feed

 315   if ($pos <= 30) {
 316   $pdf->ezNewPage();
 317   $pos =780;
 318   }
 319  // end page feed

 320  change_color(GENERAL_FONT_COLOR);
 321  
 322  $pdf->rectangle(15,$pos-2,8,8);
 323  // $pdf->addText($x += PRODUCTS_COLUMN_SIZE,$pos,TABLE_HEADER_FONT_SIZE,$order->products[$i]['model']);

 324  $pdf->addText($x, $pos, TABLE_HEADER_FONT_SIZE, $order->products[$i]['model']);
 325  $truncated_str = $pdf->addTextWrap($x += MODEL_COLUMN_SIZE,$pos,PRODUCTS_COLUMN_SIZE,TABLE_HEADER_FONT_SIZE,$prod_str);
 326  $pdf->addText($x += MODEL_COLUMN_SIZE + PRODUCTS_COLUMN_SIZE,$pos,TABLE_HEADER_FONT_SIZE,$order->products[$i]['qty']);
 327  
 328  
 329  if ( $billing_address_array[0] == $delivery_address_array[0]) {
 330    //$pdf->addText($x += MODEL_COLUMN_SIZE,$pos,TABLE_HEADER_FONT_SIZE,$order->products[$i]['tax']);

 331    $pdf->addText($x += MODEL_COLUMN_SIZE,$pos,TABLE_HEADER_FONT_SIZE,$currencies->format($order->products[$i]['final_price'], true, $order->info['currency'], $order->info['currency_value']));
 332    //$pdf->addText($x += PRICING_COLUMN_SIZES,$pos,TABLE_HEADER_FONT_SIZE,$currencies->format(tep_add_tax($order->products[$i]['final_price'], $order->products[$i]['tax']), true, $order->info['currency'], $order->info['currency_value']));

 333    $pdf->addText($x += PRICING_COLUMN_SIZES,$pos,TABLE_HEADER_FONT_SIZE,$currencies->format($order->products[$i]['final_price'] * $order->products[$i]['qty'], true, $order->info['currency'], $order->info['currency_value']));
 334    //$pdf->addText($x += PRICING_COLUMN_SIZES,$pos,TABLE_HEADER_FONT_SIZE,$currencies->format(tep_add_tax($order->products[$i]['final_price'], $order->products[$i]['tax']) * $order->products[$i]['qty'], true, $order->info['currency'], $order->info['currency_value']));

 335    }
 336  $pos -= PRODUCT_TABLE_BOTTOM_MARGIN;
 337  if ($truncated_str) { 
 338      
 339      change_color(PRODUCT_LISTING_BKGD_COLOR);
 340      $pdf->filledRectangle(LEFT_MARGIN,$pos-PRODUCT_TABLE_ROW_HEIGHT,PRODUCT_TABLE_HEADER_WIDTH,PRODUCT_TABLE_ROW_HEIGHT);
 341      $pos = ($pos-PRODUCT_TABLE_ROW_HEIGHT) + PRODUCT_TABLE_BOTTOM_MARGIN;
 342      change_color(GENERAL_FONT_COLOR);
 343      $reset_x = LEFT_MARGIN + PRODUCT_TABLE_LEFT_MARGIN;
 344      $pdf->addText($reset_x,$pos,TABLE_HEADER_FONT_SIZE,$truncated_str);
 345      $pos -= PRODUCT_TABLE_BOTTOM_MARGIN;
 346      
 347      }
 348      
 349      if ( ($k = sizeof($order->products[$i]['attributes'])) > 0) {
 350          for ($j = 0; $j < $k; $j++) {
 351          $attrib_string = '<i> - ' . $order->products[$i]['attributes'][$j]['option'] . ': ' . $order->products[$i]['attributes'][$j]['value'];
 352          if ($order->products[$i]['attributes'][$j]['price'] != '0') { 
 353          $attrib_string .= ' (' . $order->products[$i]['attributes'][$j]['prefix'] . 
 354          $currencies->format($order->products[$i]['attributes'][$j]['price'] * $order->products[$i]['qty'], true, $order->info['currency'], $order->info['currency_value']) . ')'; 
 355          
 356          }
 357          
 358          $attrib_string .= '</i>';
 359          change_color(PRODUCT_LISTING_BKGD_COLOR);
 360          $pdf->filledRectangle(LEFT_MARGIN,$pos-PRODUCT_TABLE_ROW_HEIGHT,PRODUCT_TABLE_HEADER_WIDTH,PRODUCT_TABLE_ROW_HEIGHT);
 361          $pos = ($pos-PRODUCT_TABLE_ROW_HEIGHT) + PRODUCT_TABLE_BOTTOM_MARGIN;
 362          change_color(GENERAL_FONT_COLOR);
 363          $reset_x = LEFT_MARGIN + PRODUCT_TABLE_LEFT_MARGIN;
 364          if (PRODUCT_ATTRIBUTES_TEXT_WRAP) {
 365          $wrapped_str = $pdf->addTextWrap($reset_x += MODEL_COLUMN_SIZE,$pos,PRODUCTS_COLUMN_SIZE,PRODUCT_ATTRIBUTES_FONT_SIZE,$attrib_string);
 366          } else { 
 367          $pdf->addText($reset_x += MODEL_COLUMN_SIZE,$pos,PRODUCT_ATTRIBUTES_FONT_SIZE,$attrib_string);
 368          }
 369          $pos -= PRODUCT_TABLE_BOTTOM_MARGIN;
 370                    
 371                      if ($wrapped_str) { 
 372                      change_color(PRODUCT_LISTING_BKGD_COLOR);
 373                      $pdf->filledRectangle(LEFT_MARGIN,$pos-PRODUCT_TABLE_ROW_HEIGHT,PRODUCT_TABLE_HEADER_WIDTH,PRODUCT_TABLE_ROW_HEIGHT);
 374                      $pos = ($pos-PRODUCT_TABLE_ROW_HEIGHT) + PRODUCT_TABLE_BOTTOM_MARGIN;
 375                      change_color(GENERAL_FONT_COLOR);
 376                      $pdf->addText($reset_x,$pos,PRODUCT_ATTRIBUTES_FONT_SIZE,$wrapped_str);
 377                      $pos -= PRODUCT_TABLE_BOTTOM_MARGIN;
 378                      }
 379                  }
 380              }
 381    } //EOFOR

 382   if ( $billing_address_array[0] == $delivery_address_array[0]) {
 383    $pos -= PRODUCT_TABLE_BOTTOM_MARGIN;
 384      
 385      for ($i = 0, $n = sizeof($order->totals); $i < $n; $i++) {
 386      
 387  //$pdf->addText (LEFT_MARGIN ,$pos -= PRODUCT_TOTALS_LEADING,PRODUCT_TOTALS_FONT_SIZE,"<b>" . str_replace($vilains , $cools ,$order->totals[$i]['title']) . "</b>");

 388  
 389  //$pdf->addText (355 ,$pos -= PRODUCT_TOTALS_LEADING,PRODUCT_TOTALS_FONT_SIZE,"<b>" . str_replace($vilains , $cools ,$order->totals[$i]['title']) . "</b>");   

 390  
 391  
 392  //addTextWrap($x,$y,$width,$size,$text,$justification='left',$angle=0,$test=0)

 393  
 394  $pdf->addTextWrap(250, $pos -= PRODUCT_TOTALS_LEADING, PRODUCTS_COLUMN_SIZE, PRODUCT_TOTALS_FONT_SIZE,"<b>" . str_replace($vilains , $cools ,$order->totals[$i]['title']) . "</b>",$justification='right');
 395  
 396  $pdf->addText($x,$pos,PRODUCT_TOTALS_FONT_SIZE,$order->totals[$i]['text'], $order->info['currency_value']);
 397          
 398          } //EOFOR

 399    }
 400  $pos -= SECTION_DIVIDER;
 401  
 402  //if ($orders['comments']) {

 403  //$pdf->ezSetY($pos);

 404  //$pdf->ezText("<b>Comments:</b>\n" . $orders['comments'],IPS_FONT_SIZE);

 405  //}

 406  
 407  $innum = $orders['orders_id'];
 408  $orders_comments_query = tep_db_query("select comments,date_added from " . TABLE_ORDERS_STATUS_HISTORY . " where orders_id = '$innum' order by date_added");
 409  if (tep_db_num_rows($orders_comments_query)) {
 410      while ($orders_comments = tep_db_fetch_array($orders_comments_query)) {
 411      if(tep_not_null($orders_comments['comments'])){
 412              $pdf->ezSetY($pos);
 413              $pdf->ezText(date(TEXT_ORDER_FORMAT, strtotime($orders_comments['date_added'])) ,6);
 414              $y = $pdf->ezText("<b>Comments:</b> " . $orders_comments['comments'],GENERAL_FONT_SIZE);
 415              $pos = ($y -5);
 416          }
 417      }
 418  }
 419  
 420  //require(BATCH_PRINT_INC . 'templates/' . 'grid.php');

 421  
 422  
 423  }
 424  ?>


Generated: Fri Jan 1 13:43:16 2010 Cross-referenced by PHPXref 0.7