$range_elements_total = $obj_ws->getStyle('H' . $row_total . ':I' . $row_total); $range_elements_total->getFont()->setSize(14)->setBold(true); $range_elements_total->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER)->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER); $range_elements_total->applyFromArray($style_table_border); //Insert Article to SUMMARY Sheet $product_row = $product_rowstart + $article_counter; if ($aid == 0) { if (isset($article_rowstart)) { mergeArticleRowsToProduct($article_rowstart, $product_row - 1); } //default article $article_rowstart = $product_row; $p_image = DIR_WS_IMAGES . $p->image; if (is_file($p_image)) { //add product image $img_path = thumbimage($p_image, $pi_width, $pi_height, 1, 1, DIR_WS_IMAGES . 'imagecache'); $obj_excel_draw = new PHPExcel_Worksheet_Drawing(); $obj_excel_draw->setWorksheet($obj_ws_summary); $obj_excel_draw->setPath($img_path); $obj_excel_draw->setCoordinates('B' . $product_row); $obj_excel_draw->setOffsetX($img_offset); $obj_excel_draw->setOffsetY($img_offset); } $no = $product_counter; $pid = $p->id; $pcode = $p->code; } else { $no = ''; $pid = ''; $pcode = ''; }
/** * Get html src path of an image * @param String $image Image location relative to our default image location * @param Int $width Specified width of image, send 0 for auto calculation * @param Int $height Specified height of image, send 0 for auto calculation * @param Boolean $ignoresizelimit * @return <type> */ function webImageSource($image, $width = '', $height = '', $ignoresizelimit = false) { $image_src = DIR_WS_IMAGES . $image; if (!file_exists($image_src)) { $image_src = DIR_WS_INCLUDES . 'sts_templates/juliengrace/images/' . $image; } $file_path = ''; if (file_exists($image_src)) { if ($image_size = @getimagesize($image_src)) { if ($width || $height) { if ($width == "100%") { $width = $image_size[0]; } elseif ($height == "100%") { $height = $image_size[1]; } elseif ($width == 0) { unset($width); } elseif ($height == 0) { unset($height); } } else { $width = $image_size[0]; unset($height); } if (!$ignoresizelimit && filesize($image_src) > MAX_IMAGESIZE_FORRESIZE && $width != $image_size[0]) { $image_src = DIR_WS_IMAGES . 'image-too-large.gif'; } $file_path = thumbimage($image_src, $width, $height, 1, 1, DIR_WS_IMAGES . 'imagecache'); if ($file_path == 'showrealimage') { $file_path = $image_src; } $file_path = JNGWEBADDRESS . str_replace(DIR_FS_CATALOG, '', $file_path); } } return $file_path; }
$e['q'] = 'Qty of Unit'; $e['ppu'] = 'Pieces per Strand'; } $elements[] = $e; $no = 0; while ($row = tep_db_fetch_array($result)) { $no++; $image_src = DIR_FS_CATALOG . $row['image']; $width = '73'; $imgsize = getimagesize($image_src); if (file_exists($image_src) && $imgsize !== false) { if ($imgsize[0] < 150) { $width = $imgsize[0]; } unset($height); $image = thumbimage($image_src, $width, $height, 1, 1, DIR_FS_CATALOG . 'images/imagecache'); if ($image == 'showrealimage') { $image = JNGWEBADDRESS . $row['image']; } else { $image = JNGWEBADDRESS . 'images/imagecache/' . basename($image); } } else { $image = ''; } $e = array(); $e['no'] = ' ' . $no . ' '; $e['id'] = ' ' . $row['elements_id'] . ' '; $e['i'] = ' ' . '<img src="' . $image . '" width="' . $width . '" />' . ' '; $e['c'] = ' ' . $row['elements_code'] . ' '; $e['n'] = ' ' . $row['name'] . ' <br /> <strong>' . $row['color'] . '</strong>' . ' '; if ($type == 'product') {