예제 #1
0
 $pdf->setFontFamily(BATCH_PDF_DIR . 'Helvetica.afm');
 if ($HTTP_POST_VARS['show_comments']) {
     $get_customer_comments = ' and h.orders_status_id = ' . DEFAULT_ORDERS_STATUS_ID;
 }
 if ($HTTP_POST_VARS['pull_status']) {
     $pull_w_status = " and o.orders_status = " . $HTTP_POST_VARS['pull_status'];
 }
 $orders_query = tep_db_query("select o.orders_id,h.comments,MIN(h.date_added) from " . TABLE_ORDERS . " o, " . TABLE_ORDERS_STATUS_HISTORY . " h where o.date_purchased between '" . tep_db_input($startdate) . "' and '" . tep_db_input($enddate) . " 23:59:59'  and h.orders_id = o.orders_id" . $pull_w_status . $get_customer_comments . ' group by o.orders_id');
 if (!tep_db_num_rows($orders_query) > 0) {
     message_handler('NO_ORDERS');
 }
 $num = 0;
 while ($orders = tep_db_fetch_array($orders_query)) {
     $order = new order($orders['orders_id']);
     if ($num != 0) {
         $pdf->EzNewPage();
     }
     $y = $pdf->ezText(STORE_NAME_ADDRESS, COMPANY_HEADER_FONT_SIZE);
     $y -= 10;
     $pdf->setLineStyle(1);
     $pdf->line(LEFT_MARGIN, $y, LINE_LENGTH, $y);
     $pdf->ezSetY($y);
     $dup_y = $y;
     $y = $pdf->ezText("<b>" . TEXT_ORDER_NUMBER . " </b>" . $orders['orders_id'] . "\n\n", SUB_HEADING_FONT_SIZE);
     if ($HTTP_POST_VARS['show_order_date']) {
         $pdf->ezSetY($dup_y);
         $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'));
     }
     $pdf->addText(LEFT_MARGIN, $y, SUB_HEADING_FONT_SIZE, "<b>" . ENTRY_SOLD_TO . "</b>");
     $pos = $y;
     $indent = LEFT_MARGIN + TEXT_BLOCK_INDENT;