$cat_result = tep_db_query($cat_query); $cat = array(); $c = array(); $c['img'] = 'Product'; $c['cl-c'] = 'Cross-Selling'; $c['cl-u'] = 'UP-selling'; $c['cl-a'] = 'Accessory'; $c['cl-d'] = 'Device'; $cat[] = $c; while ($row = tep_db_fetch_array($cat_result)) { $detail_link = "?open=sp-product&id={$row['products_id']}"; $pid = '<input type="hidden" name="products_id" value="' . $row['products_id'] . '" />'; $c = array(); $img = $pid; $img .= '<div class="pro-thumb">'; $img .= '<div><a href="' . webImageSource($row['products_image'], '500', '500') . '" title="View Image ' . $row['products_id'] . '" class="view_image">' . webImage($row['products_image'], '80', '80') . '</a></div>'; $img .= '<div class="bold"><a href="' . $detail_link . '" title="View and Manage Product Detail for Neckermann Catalog">' . $row['products_id'] . '</a></div>'; $img .= '<div>' . $row['article_number'] . '</div>'; $img .= '<div class="green">' . displayCurrency('EUR', $row['price']) . '</div>'; $img .= '</div>'; $c['img'] = $img; $c['cl-c'] = '<img src="images/ajax-load-2.gif" />'; $c['cl-u'] = '<img src="images/ajax-load-2.gif" />'; $c['cl-a'] = '<img src="images/ajax-load-2.gif" />'; $c['cl-d'] = '<img src="images/ajax-load-2.gif" />'; $c['cl-d'] = '<img src="images/ajax-load-2.gif" />'; $cat[] = $c; } if (count($cat) == 1) { $c = array(); foreach ($cat[0] as $key => $val) {
$sda_return['return_comment_customer'] = tep_db_prepare_input(utf8_decode($_POST['comment_c'])); $sda_return['return_comment_jng'] = tep_db_prepare_input(utf8_decode($_POST['comment_j'])); $sda_return['shipping_paid'] = tep_db_prepare_input($_POST['shipping_paid']); $class_jo->returnItemUpdate($return_id, $sda_return); echo '<div class="green">Return detail is successfully saved</div>'; exit; } //START TEMPLATE $return_id = isset($_GET['id']) ? tep_db_prepare_input($_GET['id']) : ''; if ($return_id == '') { exit; } $return = $class_jo->retrieveReturnDetail($return_id); $item = $class_jo->retrieveItemDetail($return['jng_sp_orders_items_id']); $order = $class_jo->retrieveDetail($item['jng_sp_orders_id']); $pimg = webImageSource($item['products_image'], '500'); if ($pimg != '') { $pimg = webImage($item['products_image'], '120', '120', '', 'img-border img-padding'); } $content .= '<div style="float:left;">' . $pimg . '</div>'; $content .= '<div style="margin-left:150px;">'; $content .= '<table border="0" cellpadding="0" cellspacing="0">'; $order_id = $order['order_id'] == '' ? 'J&G ID: ' . $order['jng_sp_orders_id'] : $order['order_id']; if ($return['confirm_return'] == '1') { $return_reason = $class_jo->returnReasonText($return['return_reason']); $return_qty = $return['return_quantity']; $comment_c = nl2br($return['return_comment_customer']); $comment_j = nl2br($return['return_comment_jng']); $shipping_status = $return['shipping_paid'] == '1' ? 'Paid' : 'Unpaid'; } else { $return_reason = $class_jo->returnReasonCombo('', 'input2', 'return_reason', $return['return_reason']);
function drawProductsImage($xpos, $ypos, $products_image) { if (file_exists(DIR_WS_IMAGES . $products_image)) { return $this->Image(webImageSource($products_image, IMAGE_SIZE_THUMBNAIL_3, IMAGE_SIZE_THUMBNAIL_3), $xpos, $ypos, 28, 28); } }
$stock[$a_counter] = $stock[$a_counter]; $stock_target[$a_counter] = $stock_target[$a_counter]; $qty_ordered[$a_counter] = $qty_ordered[$a_counter]; $qty_missing[$a_counter] = $qty_missing[$a_counter]; $levelling_target[$a_counter] = $levelling_target[$a_counter]; $levelling_orders[$a_counter] = $levelling_orders[$a_counter]; $levelling_orders_ptb[$a_counter] = $levelling_orders_ptb[$a_counter]; $levelling_orders_os[$a_counter] = $levelling_orders_os[$a_counter]; $total_target[$a_counter] = $total_target[$a_counter]; $total_qty_missing[$a_counter] = $total_qty_missing[$a_counter]; $levelling_orders_today[$a_counter] = $levelling_orders_today[$a_counter]; } //$asep => Article SEParator $asep = '<br />'; $image = webImage($p['image'], '80', '80'); $imagesource = webImageSource($p['image'], '500', '500'); if ($imagesource != '') { $image = '<a href="' . $imagesource . '" class="view_image">' . $image . '</a>'; } $row = array(); $info = $pid . ' / ' . $p['code']; $info .= '<br />' . $p['name']; $row['a'] = "<div>{$counter}</div>"; $row['b'] = "<div>{$image}</div>"; $row['c'] = "<div>{$info}</div>"; $row['d'] = '<div>' . implode($asep, $size) . '</div>'; $row['e'] = '<div>' . implode($asep, $ean) . '</div>'; $row['f'] = '<div>' . implode($asep, $sold_last_month_nopromo) . '</div>'; $row['g'] = '<div>' . implode($asep, $sold_last_month) . '</div>'; $row['h'] = '<div>' . implode($asep, $stock) . '</div>'; $row['i'] = '<div>' . implode($asep, $stock_target) . '</div>';
$isnotjpg = strpos($file['type'], 'jpg') === false && strpos($file['type'], 'jpeg') === false; if ($isnotjpg) { $error = true; $errormsg = 'Only JPG is allowed'; } else { $imagesize = 500; $filesize = @getimagesize($file['tmp_name']); if ($filesize[0] != $imagesize || $filesize[1] != $imagesize) { $error = true; $errormsg = 'Bad Size, must be ' . $imagesize . 'x' . $imagesize . ' pixels'; } else { $element->uploadImage($file['tmp_name'], $file['name']); } } $err_status = $error ? '0' : '1'; $image_src = webImageSource($element->image, '130', '130'); //$image_src_ori = webImageSource($element->image); //$image_src_list = webImageSource($element->image, '80', '80'); // echo '<div id="uir_status">'.$result.'</div>'; // echo '<div id="uir_errmsg">'.$errormsg.'</div>'; // echo '<div id="uir_imgsrc">'.$image_src.'</div>'; //echo '<div id="uir_imgsrc_ori">'.$image_src_ori.'</div>'; //echo '<div id="uir_imgsrc_list">'.$image_src_list.'</div>'; //echo '<div id="finalized_class">'.(($element->isFinalized()) ? 'green' : 'red').'</div>'; $result = array(); $result['uir_status'] = $err_status; $result['uir_errmsg'] = $errormsg; $result['uir_imgsrc'] = $image_src; if ($accessed == CONST_ACCESS_DESIGNS_MANAGEMENT) { $result['designs_id'] = $draft->designs_id; $result['drafts_id'] = $draft->id;
} else { $colsize = 0; } $pdf->setXY($margin + $colsize, $pdf->ypos); $pdf->MultiCell($colwidth, $lineheight_header, $header, 1, 'C', true); } } else { $pdf->ypos += $key == 1 ? $lineheight_header + 5.2 : $lineheight; $pdf->setXY($margin, $pdf->ypos); foreach ($cols_value as $rkey => $cr) { if ($rkey == $col_image - 1) { $pdf->Cell($colwidth, $lineheight, '', 1, 0, 'C'); // die($cols_value[0]); $items = $class_pm->retrieveDetail($cols_value[0], 'p'); $img_path = DIR_WS_IMAGES . 'imagecache/'; $img_file = basename(webImageSource($items['p']['products_image'], IMAGE_SIZE_THUMBNAIL_1, IMAGE_SIZE_THUMBNAIL_1)); $img = $img_path . $img_file; $x_col = $margin + ($col_image - 1) * $colwidth; $posx_image = $x_col + 3; $pdf->Image($img, $posx_image, $pdf->ypos + 4, 20); //PRINT TEXT BELOW IMAGE $pdf->setXY($x_col, $pdf->ypos + $lineheight - ($lineheight / 2 + 2)); $text_under_image_height = $lineheight; if ($pdf->PageNo() > 1) { $text_under_image_height -= 3.1; } else { $text_under_image_height -= 2; } $pdf->Cell($colwidth, $text_under_image_height, $cr, 0, 0, 'C'); $pdf->setXY($x_col + $colwidth, $pdf->ypos); //RESET BACK CELL POSITION SAME WITH CELL BEFORE
/** * Standard Display of Image Thumb with icons * @param int $width * @param int $height * @param string $additional_title * @param boolean $border * @param string $class * @param const $link_to IMAGE_LINKTO_BIGGER_IMAGE or IMAGE_LINKTO_PRODUCT_DETAIL * @return type */ public function displayImage($width, $height, $additional_title = '', $border = true, $class = '', $link_to = self::IMAGE_LINKTO_BIGGER_IMAGE) { $title = "Product {$this->id}"; if ($additional_title != '') { $title .= " {$additional_title}"; } $popup_title = 'View Larger Image (' . $this->id . '/' . $this->code . ')'; if ($additional_title != '') { $popup_title .= " {$additional_title}"; } $border_class = $border ? 'img-border' : ''; if ($border_class != $class) { $class .= ($class != '' ? ' ' : '') . $border_class; } //PREPARE THUMBNAIL $img_thumb = webImage($this->image, $width, $height, $popup_title, $class); $thumb_width = $width; $thumb_height = $height; if ($width == '' || $height == '') { $thumb_image_source = webImageSource($this->image, $width, $height); if ($thumb_image_source != '') { list($thumb_width, $thumb_height) = @getimagesize($thumb_image_source); } } //PREPARE LINK if ($link_to == self::IMAGE_LINKTO_BIGGER_IMAGE) { $main_image = webImageSource($this->image, IMAGE_SIZE_BIG_1); $link_target = $main_image != '' ? $main_image : ''; $link_class = 'view_image'; } else { $link_target = $this->getLinkProductDetail(); $link_class = 'view_webpage'; } if ($link_target != '') { $image = '<a href="' . $link_target . '" class="' . $link_class . '" title="' . $popup_title . '">' . $img_thumb . '</a>'; } else { $image = $img_thumb; } //PREPARE ICONS $icons_total_width = 0; $icons = array(); if ($this->isKilled()) { $icons[] = drawKilledIcon('Killed Product', ''); $icons_total_width += 16; } //DIAMOND ICON if ($this->isUsingDiamond()) { $icons[] = drawDiamondIcon('Diamond Product', ''); $icons_total_width += 16; } //GOLD ICON if ($this->isUsingGold()) { $icons[] = drawGoldIcon($this->metal_stamp_code, $this->metal_stamp_info); $icons_total_width += 21; } $icons_total_width += count($icons) * 2; //consider white space $icons_margin_top = $thumb_height - 16 - 1; //16 is default icon height, 1 is margin bottom $icons_margin_left = $thumb_width - $icons_total_width; $div_image = '<div>' . $image . '</div>'; $div_icons = '<div style="position:absolute;margin:' . $icons_margin_top . 'px 0 0 ' . $icons_margin_left . 'px;">' . implode(' ', array_reverse($icons)) . '</div>'; $div_stars = '<div>' . drawStars($this->stars) . '</div>'; return '<div class="tac" style="width:' . $thumb_width . 'px;margin:0 auto;">' . $div_icons . $div_image . $div_stars . '</div>'; }
function processReturnOld($sp_type, $order_id, $ean_code, $reason = '0') { global $class_jo; global $class_o; use_class('payone'); use_class('products_minierp'); $class_payone = new payone(); $class_pm = new products_minierp(); $return_allowed_status = array('9', '11', '16', '20'); $is_best_product = ''; $order_product_id = ''; $product_barcode = ''; $status = 'RETURNNOTALLOWED'; if (strtolower($sp_type) == 's') { $items = $class_jo->retrieveItems($order_id); foreach ($items as $key => $item) { $items_id = $item['jng_sp_orders_items_id']; $product_code = $item['products_model']; $product_name = $item['products_name']; // echo $item['products_ean']." | ".$item['status']."<br/>"; if ($item['products_ean'] == $ean_code && in_array($item['status'], $return_allowed_status)) { $products_id = $item['products_id']; // if($reason=='') { // $order_product_id = $items_id; // $status = 'MCSCANREASON'; // $reasons = $class_jo->returnReasonList(); // $reasons_list = array(); // foreach($reasons as $reason_id=>$val){ // $reasons_list[] = $reason_id."-".$val; // } // $result['reasons'] = $reasons_list; // }else{ $returnable = $item['order_quantity']; $return_data = $class_jo->retrieveReturnItem($items_id); // echo "<pre>";var_dump($return_data); if (!is_null($return_data)) { foreach ($return_data as $rd) { $returnable -= $rd['return_quantity']; } } if ($returnable > 0) { $order_product_id = $items_id; $product_barcode = "SP-{$order_product_id}"; $is_best_product = $class_pm->isBestProduct($item['products_id']); $status = $is_best_product ? 'MCBINORRETURN' : 'MCRETURNTOBALI'; //CREATE RETURN $return_date = date('Y-m-d H:i:s'); $return_qty = 1; $comment_customer = ''; $comment_jng = ''; $shipping_paid = tep_db_prepare_input($_POST['shipping_paid']); $return_id = $class_jo->returnItem($items_id, $return_date, $return_qty, $reason, $comment_customer, $comment_jng, $shipping_paid); //CREATE PAYONE RETURN // $return_id = '123'; if ($return_id != '') { $class_payone->createReturnContainerSP($return_id, $return_qty, $items_id); $items_q = tep_db_query("SELECT SUM(order_quantity) AS total FROM jng_sp_orders_items WHERE jng_sp_orders_id={$order_id} AND status NOT IN (10, 12)"); $items = tep_db_fetch_array($items_q); $items_total = $items['total']; $returns_total = getTotalReturnOrderSP($order_id); $returnable = $items_total - $returns_total; } } // } //BLOCK reason status } } } elseif (strtolower($sp_type) == 'j') { use_class('products_ean'); $class_pean = new products_ean(); $items = $class_o->retrieveProducts($order_id); foreach ($items as $key => $item) { $ean = $class_pean->getEAN($item['products_id'], $item['products_articles_id']); $opid = $item['orders_products_id']; $product_code = $item['products_model']; $product_name = $item['products_name']; // echo $ean." | ".$item['status']."<br/>"; if ($ean == $ean_code && in_array($item['status'], $return_allowed_status)) { $products_id = $item['products_id']; $existing_return = $class_o->productReturnTotalQty($opid); if ($existing_return < $item['products_quantity']) { $order_product_id = $opid; $product_barcode = "JG-{$order_product_id}"; $is_best_product = $class_pm->isBestProduct($item['products_id']); $status = $is_best_product ? 'MCBINORRETURN' : 'MCRETURNTOBALI'; //CREATE RETURN $opid = $item['orders_products_id']; $return_date = date('Y-m-d H:i:s'); $return_qty = 1; $return_type = 'C'; $return_status = '0'; $return_comment = ''; $product_received = 1; $return_id = $class_o->addReturnProduct($opid, $return_date, $return_qty, $return_type, $return_status, $return_comment, $product_received); //CREATE PAYONE RETURN // $return_id = '123'; if ($return_id != '') { $class_payone->createReturnContainer($return_id, $return_qty, $opid); $items_q = tep_db_query("SELECT SUM(products_quantity) AS total FROM orders_products WHERE orders_id={$order_id} AND status NOT IN (10, 12)"); $items = tep_db_fetch_array($items_q); $items_total = $items['total']; $returns_total = getTotalReturnOrderJG($order_id); $returnable = $items_total - $returns_total; } } } } } $result['product_barcode'] = $product_barcode; $result['order_product_id'] = $order_product_id; $result['eancode'] = $ean_code; if ($products_id != '') { $result['product_id'] = $products_id; $qp = "SELECT p.*, pd.products_name FROM products p INNER JOIN products_description pd ON p.products_id = pd.products_id\n WHERE p.products_id = {$products_id} AND pd.language_id = 2"; $dbqp = tep_db_query($qp); $rp = tep_db_fetch_array($dbqp); $result['product_code'] = $rp['products_model']; $result['product_name'] = $rp['products_name']; $result['product_image'] = webImageSource($rp['products_image'], '80'); //'http://www.julie-grace.de/images/imagecache/500x500_03601033.jpg'; } $result['returnable'] = $returnable; $result['status'] = $status; return $result; }
function shopifyTemplate($is_article, $product_id, $var_ean, $var_length, $add_images) { global $class_pm, $class_pmat, $class_pa, $r; $product_materials_name = ''; // $product = $class_pm->retrieveDetail($product_id, 'p,pd,pd2,pc,pnc,cat,pei,pci'); $product = Product::getOldProductFunction()->retrieveDetail($product_id, 'p,pd,pd2,pc,pnc,cat,pei,pci'); $product_name = $product['pd'][3]['products_name']; $product_name_handle = strtolower(str_replace(' ', '-', $product_name)); $product_articles = $class_pa->retrieveList($product_id); $product_articles_total = count($product_articles); // $product_stock = $class_pm->stockRetrieve(WAREHOUSE_ID_PRODUCTS_HAMBURG, $product_id, '*'); $product_stock = Product::getOldProductFunction()->stockRetrieve(WAREHOUSE_ID_PRODUCTS_HAMBURG, $product_id, '*'); $product_obj = new Product($product_id); //$product_price_uvp = $product['p']['products_price_uvp']; $product_price_uvp = $product_obj->getPriceUVP(); // $product_price_default = $product['p']['products_price_default']; $product_price_default = $product_obj->getPriceDefault(); $main_image = webImageSource($product['p']['products_image']); // $product_gender = $class_pm->productGenderName($product['p']['products_gender']); $product_gender_id = $product['p']['products_gender']; if ($product_gender_id == 1) { $product_gender = 'Pria'; } elseif ($product_gender_id == 2) { $product_gender = 'Wanita'; } //$product_gender = Product::getOldProductFunction()->productGenderName($product['p']['products_gender']); // $product_agegroup = $class_pm->productAgeGroupName($product['p']['products_agegroup']); $product_agegroup = Product::getOldProductFunction()->productAgeGroupName($product['p']['products_agegroup']); $cat_for_fashion = new Category($product['categories_id']); if ($product['categories_id'] < 36) { $product_categories = translateCategoriesToIndonesian($product['categories_id']); } else { $product_categories = $cat_for_fashion->getName('3'); } // $productLength = ($product['pc']['products_length'] !== false) ? $product['pc']['products_length']/10 : $product['pnc']['products_length']/10; if ($product['pc'] !== false) { $product_length = number_format($product['pc']['products_length'], 0); $length_code = '_' . number_format($product_length, 0); // $product_length_for_var = 'One size'; //FOR NOW WE ALWAYS USE One Size for every Categories except ring if ($product['categories_id'] == 29) { $product_lenght_code = $product_length; $product_length = $product_length * 10; $length_code = '_' . $product_length; } } else { //if ($product['categories_id'] < 36) { //} else { $product_length = number_format($product['pnc']['products_length'], 0); $length_code = '_' . number_format($product_length, 0); // $product_length_for_var = 'One size'; //FOR NOW WE ALWAYS USE One Size for every Categories except ring if ($product['categories_id'] == 29) { $product_lenght_code = $product_length; $product_length = $product_length * 10; $length_code = '_' . $product_length; } //} } if ($product_length == '0.00') { $length_code = ''; } // $productLength = ($product['pc'] !== false) ? $product['pc']['products_length'] : $product['pnc']['products_length']; if ($product['pd2']['width'] == '0.00') { $product_width = ''; } else { $product_width = $product['pd2']['width'] / 10; } if ($product['pd2']['height'] == '0.00') { $product_height = ''; } else { $product_height = $product['pd2']['height'] / 10; } if ($product['pd2']['weight'] == '0.00') { $product_weight = ''; } else { $product_weight = $product['pd2']['weight']; } if ($product['pd2']['diameter'] == '0') { $product_diameter = ''; } else { $product_diameter = $product['pd2']['diameter'] / 10; } $product_ean = $product['p']['products_ean']; $product_keywords = $product['pd'][3]['products_head_keywords_tag']; $product_description = $product['pd'][3]['products_description']; $product_brand = $product['p']['products_brand_name']; $product_selling_points = explode(';', $product['pd'][3]['products_selling_points']); $materials = $class_pmat->retrieveList('', 'material_name'); // $product_materials = $class_pm->loadProductMaterials($product_id); $product_materials = Product::getOldProductFunction()->loadProductMaterials($product_id); $separator = ''; foreach ($materials as $mat) { if (in_array($mat['products_materials_id'], $product_materials)) { $materials_name = explode(',', $mat['material_name']); $product_materials_name .= $separator; $product_materials_name .= $materials_name[2]; if (!$separator) { $separator = ','; } } } $query_color = "SELECT ptcp.products_id, ptcp.color_pattern_id, cpd.name FROM products_to_color_pattern ptcp"; $query_color .= " LEFT JOIN color_pattern_description cpd ON cpd.color_pattern_id = ptcp.color_pattern_id"; $query_color .= " WHERE ptcp.products_id = {$product_id} AND languages_id = 1"; $query_color_result = tep_db_query($query_color); $product_color_row = mysql_fetch_row($query_color_result); $product_color = translateColorToIndonesian($product_color_row[1]); if ($is_article) { if ($product_articles_total > 0) { $product_ean = $var_ean; $product_length = $var_length * 10; $length_code = '_' . $var_length; if ($product['categories_id'] == 29) { $length_code = '_' . $var_length * 10; } } } if ($is_article || $add_images != '') { $product_name = ''; $product_description = ''; $product_brand = ''; } $add_images != '' ? $main_image = webImageSource($add_images) : $main_image; $product_code = $product['p']['products_model']; $x = array(); /*A - Handle */ $x[0][0] = $product_name_handle; /*B - Title */ $x[0][1] = $add_images == '' ? $product_name : ''; /*C - Body (HTML) */ $x[0][2] = $add_images == '' ? $product_description : ''; /*D - Vendor */ $x[0][3] = $add_images == '' ? 'Bellinda Germany' : ''; /*E - Type */ $x[0][4] = $add_images == '' ? $product_categories : ''; /*F - Tags */ $x[0][5] = $add_images == '' ? $product_materials_name . ', ' . $product_color . ', ' . $product_gender : ''; /*G - Published */ $x[0][6] = $add_images == '' ? 'TRUE' : ''; /*H - Option1 Name */ $x[0][7] = $add_images == '' ? 'Product Length/Size' : ''; /*I - Option1 Value */ $x[0][8] = $add_images == '' ? $product_length : ''; /*J - Option2 Name */ $x[0][9] = $add_images == '' ? 'Color' : ''; /*K - Option2 Value */ $x[0][10] = $add_images == '' ? $product_color : ''; /*L - Option3 Name */ $x[0][11] = $add_images == '' ? 'Material' : ''; /*M - Option3 Value */ $x[0][12] = $add_images == '' ? $product_materials_name : ''; /*N - Variant SKU */ $x[0][13] = $add_images == '' ? $product_code . $length_code : ''; /*O - Variant Gram */ $x[0][14] = $add_images == '' ? $product_weight : ''; /*P - Variant Inventory Tracker*/ $x[0][15] = $add_images == '' ? 'shopify' : ''; /*Q - Variant Inventory Qty */ $x[0][16] = $add_images == '' ? '10' : ''; /*R - Variant Inventory Policy */ $x[0][17] = $add_images == '' ? 'deny' : ''; /*S - Variant Fulfillment Service */ $x[0][18] = $add_images == '' ? 'manual' : ''; /*T - Variant Price */ $x[0][19] = $add_images == '' ? $product_price_default : ''; /*U - Variant Compare At Price */ $x[0][20] = $add_images == '' ? $product_price_uvp : ''; /*V - Variant Requires Shipping*/ $x[0][21] = $add_images == '' ? 'TRUE' : ''; /*W - Variant Taxable*/ $x[0][22] = $add_images == '' ? 'TRUE' : ''; /*X - Variant Barcode */ $x[0][23] = $add_images == '' ? $product_ean : ''; /*Y - Image Src */ $x[0][24] = $main_image; /*Z - Image Alt Text */ $x[0][25] = $add_images == '' ? $product_name : ''; /*AA - Gift Card */ $x[0][26] = $add_images == '' ? 'FALSE' : ''; /*AB - Google Shopping / MPN */ $x[0][27] = ''; /*AC - Google Shopping / Age Group */ $x[0][28] = $add_images == '' ? $product_agegroup : ''; /*AD - Google Shopping / Gender */ $x[0][29] = $add_images == '' ? $product_gender : ''; /*AE - Google Shopping / Google Product Category */ $x[0][30] = ''; /*AF - SEO Title */ $x[0][31] = $add_images == '' ? $product_name : ''; /*AG - SEO Description */ $x[0][32] = $add_images == '' ? $product_keywords : ''; /*AH - Google Shopping / AdWords Grouping*/ $x[0][33] = ''; /*AI - Google Shopping / AdWords Labels */ $x[0][34] = ''; /*AJ - Google Shopping / Condition */ $x[0][35] = $add_images == '' ? 'new' : ''; /*AK - Google Shopping / Custom Product */ $x[0][36] = ''; /*AL - Google Shopping / Custom Label 0 */ $x[0][37] = ''; /*AM - Google Shopping / Custom Label 1 */ $x[0][38] = ''; /*AN - Google Shopping / Custom Label 2 */ $x[0][39] = ''; /*AO - Google Shopping / Custom Label 3 */ $x[0][40] = ''; /*AP - Google Shopping / Custom Label 4 */ $x[0][41] = ''; /*AQ - Variant Image */ $x[0][42] = $add_images == '' ? $main_image : ''; /*AR - Variant Weight Unit */ $x[0][43] = $add_images == '' ? 'g' : ''; $csv_row = array(); $csv_row['data'] = $x; // $csv_row['temp_images'] = (!$is_article) ? $temp_images : ''; return $csv_row; }
break; case 'cha': $form .= '<tr>'; $form .= '<td>Name</td>'; $form .= '<td><input type="text" name="name" id="name" style="width:100%;" value="' . $attribute_data['name'] . '" /></td>'; $form .= '</tr>'; $form .= '<tr>'; $form .= '<td>Description</td>'; $form .= '<td><textarea name="description" style="width:100%;height:50px;">' . $attribute_data['description'] . '</textarea></td>'; $form .= '</tr>'; $form .= '<tr><td colspan="2"> </td></tr>'; $form .= '<tr><td colspan="2"><span class="red">* Image height must be ' . $minimagewidth . ' pixels</span></td></tr>'; $label_text = 'Setting Image'; $action = ''; $label = webImage($attribute_data['chain_image'], '80', '80', $label_text, 'img-border'); $main_image = webImageSource($attribute_data['chain_image'], '500'); if ($main_image != '') { $main_image_link = '<a href="' . $main_image . '" class="view_image" title="' . $label_text . '">'; $label = $main_image_link . $label . '</a>'; $action .= '<div style="margin-top:5px;">» ' . $main_image_link . 'View Image</a></div>'; } $form .= '<tr>'; $form .= '<td style="width:85px;padding-bottom:10px;">' . $label . '</td>'; $form .= '<td>'; $form .= '<div style="font-weight:bold;">' . $label_text . '</div>'; $form .= '<div><input type="file" name="chain_image" class="input" /></div>'; $form .= $action; $form .= '</td>'; $form .= '</tr>'; break; }
<?php global $db; require_once '../confy.php'; require_once '../functions.php'; require_once '../functions-2.php'; require_once DIR_WS_FUNCTIONS . 'html_output.php'; tep_db_connect(); use_class('products_minierp'); $class_pm = new products_minierp(); $pids = explode(',', tep_db_prepare_input($_GET['pids'])); //$pids = array(75637, 75704, 75701); $width = tep_db_prepare_input($_GET['width']); if (count($pids) > 0) { if (isset($_GET['height'])) { $height = tep_db_prepare_input($_GET['height']); } else { $height = $width * 1.5; } foreach ($pids as $pid) { $product_data = $class_pm->retrieveDetail($pid, 'p'); $new_image_src = webImageSource($product_data['p']['products_image'], $width, $height, true); echo "{$pid} => <a href = \"{$new_image_src}\">{$new_image_src}</a><br/>"; } } else { echo "No Products found"; }
$ypos += $spacing; $pdf->setXY($xpos, $ypos); foreach ($cwidth as $cwkey => $cw) { $pdf->setFont('Arial', 'B', '10'); if ($cwkey + 1 == $totalcols) { $newline = 1; $ypos += $line_height; } else { $newline = 0; } $pdf->Cell($cw, $line_height, $ctitle[$cwkey], 1, $newline, 'C', true); } } $counter++; $xpos = $margin_left + $cwidth[0]; $img_file = basename(webImageSource($e_detail->image, '', '80', '80')); $img = $img_path . $img_file; if ($img != $img_path) { $test = getimagesize($img); if ($test[2] == 2) { $pdf->Image($img, $xpos + $img_boxpad, $ypos + $img_boxpad, $img_size, $img_size); } } $unit_price = convertCurrency($e['unit_price'], $e['unit_price_currency'], $currency); $qty_price = $e['quantity'] * $unit_price; $qty_weight = $e['quantity'] * $e['unit_multiplier'] * $e['elements_weight']; $total_price += $qty_price; $cellcontent = array(); $cellcontent[] = $counter; $cellcontent[] = ''; $cellcontent[] = $e['elements_id'];
$products_query .= $join_query; $products_query .= " WHERE p.products_image!='' "; $products_query .= $filter_query; $products_query .= " GROUP BY p.`products_id`"; $products_query .= " ORDER BY p.products_model ASC "; //$products_query .= " ORDER BY p.`products_date_added` DESC"; $products_result = tep_db_query($products_query); $p = array(); $p['img'] = 'Product'; $p['name'] = 'Info'; $p['stc'] = 'Active'; $p['sta'] = 'J&G Status'; $p['stb'] = 'Kill Status'; $products[] = $p; while ($row = tep_db_fetch_array($products_result)) { $imagelink = webImageSource($row['produccts_image'], '500', '500'); $image = webImage($row['products_image'], '80', '80'); if ($imagelink != '') { $image = '<a href="' . $imagelink . '" title="View Bigger Image" class="view_image">' . $image . '</a>'; } $managelink = '?open=product-detail&products_id=' . $row['products_id'] . '&hidemenu=true'; $managelink_title = 'Manage Product Detail'; $p = array(); $info2 = "<div><strong>{$row['products_id']}"; if ($row[products_model] != '') { $info2 .= " / {$row['products_model']}"; } $info2 = '<a href="' . $managelink . '" title="' . $managelink_title . '" class="view_webpage_full">' . $info2 . '</a>'; $info2 .= "</strong></div>"; $info2 .= "<div>{$row['products_name']}</div>"; $p['img'] = $image;
$pdf->SetAuthor('JULIE GRACE'); $pdf->SetCreator('k-Auto Generated PDF'); $pdf->SetDisplayMode('real'); $pdf->SetAutoPageBreak(false, 1); $counter = 0; foreach ($sl as $e) { $pdf->currentSupplier = $suppliers[$sup_id]; $xpos = $margin_left; if ($counter % 5 == 0) { $pdf->AddPage(); $pdf->setFont('Arial', '', '15'); $ypos = $margin_top; } $ypos += $spacing; $box_pad = 2; $img = DIR_WS_IMAGES . 'imagecache/' . basename(webImageSource($e['image'], '', '130', '130')); $test = getimagesize($img); if ($img != '' && $test[2] == 2) { $pdf->Image($img, $xpos + $box_pad, $ypos + $box_pad, $img_size, $img_size); } $box_size = $img_size + 2 * $box_pad; $pdf->SetDrawColor(200, 200, 200); $pdf->SetLineWidth(0.2); $pdf->Rect($xpos, $ypos, $box_size, $box_size); $text_middling = 7; $xpos += $img_size + $spacing; $ypos += $text_middling; $data_array = array(); $data_array[] = 'Code'; $data_array[] = 'Qty'; $data_array[] = 'Price';
function printProductImage($type, $image, $id, $width) { $product_image = webImageSource($image); if ($product_image == '' && $type == 'CP') { $product_image = webImageSource('products/' . $id . '.png'); } if ($product_image != '') { $result[] = webImage($image, $width, ''); $result_text = implode("\n", $result); } else { $result_text = ''; } return $result_text; }
function getDetailData($products_id, $type) { global $class_pm, $class_pa, $class_pb, $class_sp, $target_group, $colpats, $class_s; $result = array(); $detail_is_complete = false; $r_dt = ''; switch ($type) { case 'checkname': //NAME $r_nm = '<span class="red">Name not yet set</span>'; $nm = $class_pm->retrieveName($products_id, '2'); if ($nm != 'None') { $r_nm = "<span class=\"green\">{$nm}</span>"; } $r_dt .= "» {$r_nm}<br />"; //COLORS $colors = $class_pm->loadColorPatternNames($products_id, LANGUAGEID); $total_colors = count($colors); $colors_has_neon = false; if ($total_colors == 0) { $r_dt .= '» <span class="red">Color not yet set</span>'; } else { $r_cp = ''; foreach ($colors as $cpid => $cpname) { if ($cpid == '22') { $colors_has_neon = true; } $cp_img = webImageSource('color-pattern-' . $cpid . '.png'); $r_cp .= '<img src="' . $cp_img . '" width="20" height="20" title="' . $cpname . '" /> '; } $r_dt .= "» {$r_cp}"; if ($total_colors == 1 && !$colors_has_neon || $total_colors == 2 && $colors_has_neon) { $detail_is_complete = true; } else { $r_dt .= '<br /><strong class="red">Only 1 color / 2 colors with Neon is allowed!</strong>'; } } //$nm!='None' break; case 'setprofin': //optional step, auto set detail directly as complete $detail_is_complete = true; $styles = $class_s->getProductStyles($products_id); foreach ($styles as $groups => $styles_data) { if ($groups == ProductAttribute::GROUP_ID_PRODUCT_FINISHING) { $product_finishing = $styles_data; break; } } $total_profin = count($product_finishing); if ($total_profin == 0) { $r_profin = '» <span class="notice">' . 'No Product Finishing attached</span>'; } else { $r_profin = '» <span class="green">' . implode(', ', $product_finishing) . '</span>'; } $r_dt .= $r_profin; break; case 'setsubcat': $styles = $class_s->getProductStyles($products_id); $subcat = array(); //S now substracted as S1, S2, etc. so we couldn't use this anymore //foreach($styles['S'] as $sbk=>$sbv) $subcat[] = $sbv; foreach ($styles as $groups => $styles_data) { if ($groups[0] == ProductAttribute::GROUP_ID_SUB_CATEGORY) { foreach ($styles_data as $styles_id => $styles_name) { $subcat[] = $styles_name; } } } $total_subcat = count($subcat); $r_subcat = ''; if ($total_subcat == 0) { $r_subcat .= '» <span class="red">Sub Category not yet set</span>'; } elseif ($total_subcat > 1) { $r_subcat .= '» ' . implode('<br />» ', $subcat); $r_subcat .= '<br /><strong class="red">Only 1 Sub Category is allowed!</strong>'; } else { $r_subcat .= '» <span class="green">' . $subcat[0] . '</span>'; $detail_is_complete = true; } $r_dt .= $r_subcat; break; case 'setbrand': $product = $class_pm->retrieveDetail($products_id, 'p'); $r_br = '<span class="red">not yet set</span>'; if ($product['p']['products_brand_id'] != '' && $product['p']['products_brand_id'] != '0') { $brand = $class_pb->retrieveDetail($product['p']['products_brand_id']); $r_br = "<span class=\"green\">" . $brand['brand_name'] . "</span>"; $detail_is_complete = true; } $r_dt .= "» {$r_br}"; break; case 'setlength': $ln = ''; $r_ln = '<span class="red">not yet set</span>'; $product = $class_pm->retrieveDetail($products_id, 'p,pd,pnc'); $articles = $class_pa->retrieveList($products_id); if ($product['pnc']['products_length'] != '') { $ln = '<strong>' . textLength($product['pnc']['products_length']) . '</strong> (default)'; } if (isset($articles) && is_array($articles) && count($articles) > 0) { foreach ($articles as $a) { if ($ln != '') { $ln .= ', '; } //$ln .= number_format($a['length'], 1).' cm'; $ln .= textLength($a['length']); } } if ($ln != '') { $detail_is_complete = true; $r_ln = "<span class=\"green\">{$ln}</span>"; } $r_dt .= "» {$r_ln}"; break; case 'addelements': $r_el = '» <span class="red">not yet set</span>'; $el_used = $class_pm->retrieveElementsUsage($products_id); if (count($el_used) > 0) { $detail_is_complete = true; $r_el = "<span class=\"green\">"; $r_el .= '<table border="0" cellpadding="0" cellspacing="0" class="form">'; $els = array(); use_class('element'); foreach ($el_used as $el_id => $el_data) { $r_el .= "<tr>"; $e = new element($el_id); $el_image = webImageWithDetailLink($e->image, IMAGE_SIZE_THUMBNAIL_1, IMAGE_SIZE_THUMBNAIL_1, 'Element ' . $e->id, 'img-border'); $r_el .= '<td class="green" title="quantity"><strong>' . $el_data['quantity'] . 'x</strong></td>'; $r_el .= '<td class="green">' . $el_image . '</td>'; $r_el .= '<td class="green"><a class="green" href="?open=element&id=' . $el_id . '&hidemenu=true">' . $el_id . '</a></td>'; $r_el .= '<td class="green">' . $e->detail['name'] . '</td>'; $finishing = array(); if ($el_data['finishing_goldplate'] == '1') { $finishing[] = 'Yellow Goldplate'; } if ($el_data['finishing_hammer'] == '1') { $finishing[] = 'Hammer'; } if ($el_data['finishing_brush'] == '1') { $finishing[] = 'Brush'; } if ($el_data['finishing_oxid'] == '1') { $finishing[] = 'Oxid'; } if ($el_data['finishing_rosegoldplate'] == '1') { $finishing[] = 'Rose Goldplate'; } if (count($finishing) > 0) { $r_el .= '<td class="green" title="finishing">(' . implode(',', $finishing) . ')</td>'; } $r_el .= "</tr>"; } $r_el .= "</table>"; $r_el .= "</span>"; } $r_dt .= "{$r_el}"; break; case 'manpi': $r_mp = ''; //optional step, auto set detail directly as complete $detail_is_complete = true; $dbqmp = tep_db_query("SELECT * FROM products_non_configurator pnc WHERE pnc.products_id={$products_id}"); if (tep_db_num_rows($dbqmp) > 0) { $mpi = tep_db_fetch_array($dbqmp); // TODO: remove this after freetext switch to attach // $manpi = $mpi['products_instruction']; // if($manpi!='') $r_mp = "» <span class=\"green\">".substr($manpi, 0, 20)." ...</span>"; // End todo if (!empty($mpi['production_instruction_id'])) { $piids = explode(",", $mpi['production_instruction_id']); foreach ($piids as $piid) { $class_pim = new production_instruction_manual($piid); $r_mp .= "» <span class=\"green\">" . $class_pim->cat_name . " - " . $class_pim->name . "</span><br />"; } } } $r_dt .= $r_mp; break; case 'prolinks': $r_pr = ''; //optional step, auto set detail directly as complete $detail_is_complete = true; $dbqpl = tep_db_query("SELECT * FROM products_linking WHERE products_id={$products_id}"); if (tep_db_num_rows($dbqpl) > 0) { $r_pr = "<span class=\"green\">"; $pltype = array(); $plds = array(); while ($r = tep_db_fetch_array($dbqpl)) { $plds[$r['type']][] = $r['links_id']; } foreach (array_keys($plds) as $type) { foreach ($plds[$type] as $plid) { $plinks = $class_pm->retrieveDetail($plid, 'p'); $pl_image = webImage($plinks['p']['products_image'], IMAGE_SIZE_THUMBNAIL_1, IMAGE_SIZE_THUMBNAIL_1, 'Product ' . $plid); $r_pr .= $pl_image . ' '; } } $r_pr .= "</span>"; } $r_dt .= $r_pr; break; case 'setnavs': $detail_is_complete = true; $dbq = tep_db_query("SELECT jng_sp_id, navigation, navigation2, navigation3 FROM jng_sp_catalog WHERE products_id={$products_id} ORDER BY jng_sp_id"); if (tep_db_num_rows($dbq) > 0) { $navlist = array(); while ($r = tep_db_fetch_array($dbq)) { $sp = $class_sp->retrieveDetail($r['jng_sp_id']); if ($sp['active_status'] == '1') { if ($r['jng_sp_id'] == '1') { if ($r['navigation2'] != '' && $r['navigation'] != '' && $r['navigation3'] != '' && $r['navigation3'] != '0') { $navlist[] = '» <span class="green"><strong>' . $sp['package_prefix'] . '</strong> [ all sets - Please Recheck ]</span>'; } else { $navlist[] = '» <span class="red"><strong>' . $sp['package_prefix'] . '</strong> [ not yet set or incomplete ]</span>'; $detail_is_complete = false; } } elseif ($r['jng_sp_id'] == '2') { if ($r['navigation'] != '' && $r['navigation3'] != '' && $r['navigation3'] != '0') { $navlist[] = '» <span class="green"><strong>' . $sp['package_prefix'] . '</strong> [ all sets - Please Recheck ]</span>'; } else { $navlist[] = '» <span class="red"><strong>' . $sp['package_prefix'] . '</strong> [ not yet set or incomplete ]</span>'; $detail_is_complete = false; } } elseif ($r['jng_sp_id'] == '3') { if ($r['navigation'] != '') { $navlist[] = '» <span class="green"><strong>' . $sp['package_prefix'] . '</strong> [ all sets - Please Recheck ]</span>'; } else { $navlist[] = '» <span class="red"><strong>' . $sp['package_prefix'] . '</strong> [ not yet set or incomplete ]</span>'; $detail_is_complete = false; } } } } } $r_dt = implode('<br />', $navlist); break; case 'setdesc2': $min_value_needed = 3; $p = $class_pm->retrieveDetail($products_id, 'p,pd2'); $pd2data = $class_pm->description2_label($p['pd2']); $total_pd2 = count($pd2data); // if($total_pd2>=$min_value_needed) $detail_is_complete = true; if ($p['p']['improved_content'] == '1') { $detail_is_complete = true; } // if($total_pd2 == 0) { if ($p['p']['improved_content'] == '0') { // $r_dt = '» <span class="red">No data has been set (min. '.$min_value_needed.')</span>'; $r_dt = '» <span class="red">Content Improved needs to be checked</span>'; } // else { // $r_dt = ''; // $r_dt_array = array(); // foreach($pd2data as $label=>$value) { // $data = $label.': '.$value; // if($detail_is_complete) $data = '<span class="green">'.$data.'</span>'; // $r_dt_array[] = '» '.$data; // } // $r_dt .= implode('<br />', $r_dt_array); //// if(!$detail_is_complete) $r_dt .= '<br /><strong class="red">Minimum '.$min_value_needed.' data must be set!</strong>'; // if(!$detail_is_complete) $r_dt .= '<br /><strong class="red">Content Improved needs to be checked</strong>'; // } break; case 'setfamily': $p = $class_pm->retrieveDetail($products_id, 'p'); if (is_null($p['p']['family_id'])) { $r_dt = '» <span class="red">Family Unset</span>'; } else { $detail_is_complete = true; $r_dt = '» <span class="green">Family ' . $p['p']['family_id'] . '</span>'; } break; } $result['view'] = utf8_encode('<div style="margin-left:10px;">' . $r_dt . '</div>'); $result['iscomplete'] = $detail_is_complete ? '1' : '0'; return $result; }
function getImageForPDF($image, $width, $height) { $img_pdf = ''; $img_path = DIR_WS_IMAGES . 'imagecache/'; $img_file = basename(webImageSource($image, $width, $height)); $img = $img_path . $img_file; if ($img != $img_path) { $test = getimagesize($img); if ($test[2] == 2) { $img_pdf = $img; } } return $img_pdf; }
$item_counter = 0; foreach ($items as $item) { $product = $class_pm->retrieveDetail($item['products_id'], 'p,pd,pnc,cat'); if ($item['products_articles_id'] == 0) { $size = $product['pnc']['products_length'] > 0 ? textLength($product['pnc']['products_length']) : '-'; } else { $article = $class_pa->retrieveDetail($item['products_articles_id']); $size = textLength($article['length']); } // echo '<pre>'; // var_dump($product); // echo '</pre>'; $item_counter++; $img_pdf = ''; $img_path = DIR_WS_IMAGES . 'imagecache/'; $img_file = basename(webImageSource($product['p']['products_image'], IMAGE_SIZE_THUMBNAIL_2, IMAGE_SIZE_THUMBNAIL_2)); $img = $img_path . $img_file; if ($img != $img_path) { $test = getimagesize($img); if ($test[2] == 2) { $img_pdf = $img; } } $pdf->setXY($colpos, $pdf->ypos); $pdf->setFont('Arial', '', $fontsize_med); $pdf->Cell($col_subcol_width[1], $colheight, $item_counter, 1, 0, 'C'); $pdf->Cell($col_subcol_width[2], $colheight, '', 1, 0, 'C'); //product image $pdf->Cell($col_subcol_width[3], $colheight, $size, 1, 0, 'C'); $pdf->Cell($col_subcol_width[4], $colheight, $product_categories_name[$product['categories_id']], 1, 0, 'C'); $pdf->Cell($col_subcol_width[5], $colheight, $product['pd']['2']['products_name'], 1, 0, 'C');
if ($_POST['me_action'] == 'LOADROW') { $id = tep_db_prepare_input($_POST['grabid']); $row_class = tep_db_prepare_input($_POST['row_class']); $q = "SELECT e.elements_id, e.elements_code, CONCAT('elements/', ei.image_path, ei.image_filename) AS elements_image"; $q .= ", ed.name AS elements_name FROM elements e"; $q .= " LEFT JOIN elements_images ei ON ei.elements_id=e.elements_id AND ei.elements_sample_name='EC1'"; $q .= " LEFT JOIN elements_description ed ON ed.elements_id=e.elements_id AND ed.languages_id=1"; $q .= " WHERE e.elements_id={$id}"; $r = tep_db_query($q); if (tep_db_num_rows($r) == 0) { $row = 'FAILED'; } else { $detail = tep_db_fetch_array($r); $id = $detail['elements_id']; $img = webImage($detail['elements_image'], '80', '80', $id); $imgsrc = webImageSource($detail['elements_image']); $name = $detail['elements_name']; $act = '<input type="button" name="copy" value="Copy" title="Copy to New Element Structure" />'; $row = '<tr id="id-' . $id . '" class="' . $row_class . '">'; foreach ($header as $td => $h) { if ($td == 'id') { $content = '<a href="?open=element&id=' . $id . '&hidemenu=true" class="view_webpage">' . $id . '</a>'; } elseif ($td == 'img') { $content = $imgsrc == '' ? $img : '<a href="' . $imgsrc . '" class="view_image">' . $img . '</a>'; } else { $content = ${$td}; if ($td == 'act') { $content .= '<input type="hidden" name="id" value="' . $id . '" />'; } } $row .= '<td class="' . $td . '">' . $content . '</td>';
$value = '<div>'; $value .= '<a href="?open=product-detail&products_id=' . $i['products_id'] . '" target="_blank" title="View/Manage Product Detail">' . $product['p']['products_model'] . '</a>'; $length = ''; if (!is_null($article)) { $length = textLength($article['length']); } else { if ($product['pnc']['products_length'] > 0) { $length = textLength($product['pnc']['products_length']); } } if ($length != '') { $value .= '-' . str_replace(' ', '', $length); } $value .= '</div>'; $value .= '<div class="thumb smallText" style="display:none;">EAN ' . $i['products_ean'] . '</div>'; $img_zoom = webImageSource($product['p']['products_image'], '500'); if ($img_zoom != '') { $thumb = '<div class="thumb" style="display:none;"><a href="' . $img_zoom . '" class="view_image">' . webImage($product['p']['products_image'], '80', '80', '', 'img-border img-padding') . '</a></div>'; $value = $thumb . $value; } break; case 'source': //EAN $value = $i['products_ean']; break; case 'price': //Price / Piece $value = displayCurrency($order_currency, $i[$items_colname_price]); break; case 'countpro': //Order Qty
$form .= '</form>'; $form .= '<form name="colpat_save" action="?open=color-pattern&id=' . $cpid . '" method="post">'; $form .= '<input type="hidden" name="me_action" value="COLPATSAVE" />'; $form .= '<div><table class="form" border="0" cellpadding="0" cellspacing="0">'; $form .= '<tr>'; $form .= '<td width="150">ID</td>'; $form .= '<td><input type="text" name="color_pattern_id" value="' . $color_pattern_id . '" readonly="readonly" class="readonly input" /></td>'; $form .= '</tr>'; /* $form .= '<tr>'; $form .= '<td>Default Color</td>'; $form .= '<td><input type="text" name="default_color_id" class="input iColorPicker" style="background-color:#'.$cpdef.'" value="#'.$cpdef.'" id="cp_def_color" /></td>'; $form .= '</tr>'; */ if ($color_pattern_id != '') { $webimage = webImageSource('color-pattern-' . $color_pattern_id . '.png'); $webimage = $webimage == '' ? '<span class="notice">No Image Found</span>' : '<img src="' . $webimage . '" width="18" height="18" style="border:1px solid #ccc" /> <span class="notice">' . $webimage . '</span>'; $form .= '<tr>'; $form .= '<td>Default Web BG</td>'; $form .= '<td>' . $webimage . '</td>'; $form .= '</tr>'; } $form .= '</table></div>'; $form .= '<div id="cp-description-tabs" style="margin:20px;">'; $form .= '<ul>'; foreach ($languages as $lid => $l) { $form .= '<li><a href="#cp_desc_' . $lid . '"><span>' . $l['name'] . '</span></a></li>'; } $form .= '</ul>'; foreach ($languages as $lid => $l) { $form .= '<div id="cp_desc_' . $lid . '">';
$q .= " AND ("; $q .= " p.products_image IS NOT NULL"; $q .= " AND p.products_image <> ''"; $q .= " )"; $q .= " AND ("; $q .= " SELECT COUNT( 1 ) = 1"; $q .= " FROM products_use_elements"; $q .= " WHERE products_id = p.products_id"; $q .= " )"; $q .= " GROUP BY p.products_id"; $dbq = tep_db_query($q); echo "<h1>SAVING PATH => {$saved_path}</h1><br/><br/>"; $n_success = 0; $n_failed = 0; while ($row = tep_db_fetch_array($dbq)) { $img_src = webImageSource($row['products_image'], '500', '500'); if ($img_src != '') { $filename = str_replace("http://www.julie-grace.de/images/imagecache/", '', $img_src); // echo $filename."<br/>"; $img80 = webImage($row['products_image'], '80', '80'); if (copy($img_src, $saved_path . $filename)) { echo "Success copy {$row['products_id']} image {$img80} source => {$img_src} <br/>"; $n_success++; } else { echo "Failed copy {$row['products_id']} image {$img80} source => {$img_src} <br/>"; $n_failed++; } } else { echo "Products image {$row['products_id']} doesn't exists <br/>"; } }
$pdf->AddPage(); $pdf->setFont('Arial', '', '10'); $ypos = $margin_top; } if ($counter % $product_per_col == 0) { $ypos = $margin_top; } $ypos += $spacing; if ($counter % $product_per_page >= $product_per_col) { $xpos = $margin_left + 100; } else { $xpos = $margin_left; } $box_pad = 2; $img_path = DIR_WS_IMAGES . 'imagecache/'; $img_file = basename(webImageSource($e['image'], '', '80', '80')); $img = $img_path . $img_file; if ($img != $img_path) { $test = getimagesize($img); if ($test[2] == 2) { $pdf->Image($img, $xpos + $box_pad, $ypos + $box_pad, $img_size, $img_size); } } $box_size = $img_size + 2 * $box_pad; $pdf->SetDrawColor(200, 200, 200); $pdf->SetLineWidth(0.2); $pdf->Rect($xpos, $ypos, $box_size, $box_size); $text_middling = 1; $xpos += $img_size + $spacing; $ypos += $text_middling; $data_array = array();
$products_total = count($products); switch (count($products)) { case 0: break; case 1: $pid = $products[0]['products_id']; break; default: $result['status'] = 'MOREFOUND'; } } } if (!$cancel && $pid != 0) { $p = $class_pm->retrieveDetail($pid, 'p,pnc'); $pa = $class_pa->retrieveList($pid); $products_image = webImageSource($p['p']['products_image'], '150', '150'); $products_options = array(); $default_length = $p['pnc']['products_length'] > 0 ? textLength($p['pnc']['products_length']) : '-'; // $products_options[] = $p['p']['products_ean'].','.$default_length; $products_options[] = '0;' . $p['p']['products_ean'] . ',' . $default_length; if ($default_length != '-') { // foreach($pa as $a) $products_options[] = $a['products_ean'].','.textLength($a['length']); foreach ($pa as $a) { $products_options[] = $a['products_articles_id'] . ';' . $a['products_ean'] . ',' . textLength($a['length']); } } $bestgood_status = $class_pm->retrieveBestGoodStatus($pid); $result['status'] = 'FOUND'; $result['products_id'] = $pid; $result['products_code'] = $p['p']['products_model']; $result['products_image'] = $products_image;
$name = $detail->detail['name']; $info = $detail->detail['supplier']; $pri = displayCurrency('EUR', $detail->detail['price']); $info2 = $stock_text; $ws = $detail->log['weekly_sold']; $dioh_text = $detail->displayDIOH($stock_data['stock']); $pri3 = '<span title="Sold ' . $detail->log['sold_monthly_1'] . $piece_qty_type . ' in the last 30 days">' . $dioh_text . '</span>'; $pri2 = displayCurrency('EUR', $stock_price); $act = '<input type="button" name="del" value="Delete" />'; $row = '<tr id="id-' . $id . '" class="' . $row_class . '">'; foreach ($header as $td => $h) { if ($td == 'id') { $content = '<a href="?open=element&id=' . $id . '&hidemenu=true" class="view_webpage" title="Manage Element Detail">' . $id . '</a>'; } elseif ($td == 'img') { $imgsrc = webImageSource($detail->image); $content = $imgsrc == '' ? $img : '<a href="' . webImageSource($detail->image) . '" class="view_image" title="Element Image ' . $id . '">' . $img . '</a>'; } elseif ($td == 'info') { if ($info == '') { $info = 'UNSET'; } $content = '<a href="?open=elements-suppliers&id=' . $id . '&hidemenu=true" class="view_webpage" title="Manage Supplier Data">' . $info . '</a>'; } else { $content = ${$td}; if ($td == 'act') { $content .= '<input type="hidden" name="id" value="' . $id . '" />'; } } $row .= '<td class="' . $td . '">' . $content . '</td>'; } $row .= '</tr>'; }
$content .= '</div>'; $content .= '</td></tr>'; $content .= '</table>'; $content .= '</div>'; } else { $content .= '<div style="padding:20px;">'; $content .= '<form name="upload_shape_image" action="?open=customers-images&id=' . $id . '#pei-tab2" method="post" enctype="multipart/form-data">'; $content .= '<input type="hidden" name="me_action" value="UPLOADSHAPEIMAGE" />'; $content .= '<input type="hidden" name="image_id" value="' . $id . '" />'; $content .= '<input type="hidden" name="customers_id" value="' . $uploaded_image['customers_id'] . '" />'; $content .= '<strong>Upload Shape Image:</strong><br />'; $content .= '<input type="file" name="shape_image" onchange="upload_shape_image.submit();" />'; $content .= '</form>'; $content .= '</div>'; } $content .= '</div>'; $content .= '</div>'; $title = "Uploaded Image ID: {$id}"; } else { $content = ''; $title = ''; } $javascript = ' $("#pei-tabs").tabs(); $("#fullsize").click(function() { window.open("' . webImageSource($uploaded_image['customers_image']) . '"); }); $("#downsize").click(function() { location.href = url + "&downsizeme=true"; }); ';
$diff_articles[] = $difart; } if (!isset($products_sold[$difart])) { $products_sold[$difart] = 0; } if (!isset($products_sales[$difart])) { $products_sales[$difart] = 0; } if (!isset($products_vc[$difart])) { $products_vc[$difart] = 0; } $products_sold[$difart] += $row['order_quantity']; $products_sales[$difart] += $row['price']; $products_vc[$difart] += $row['vc_value']; if (!isset($products_image[$difart])) { $pimg = webImageSource($row['products_image'], '500'); $thumb = $pimg == '' ? '' : '<div class="thumb" style="display:none"><a href="' . $pimg . '" class="view_image" title="Image of ' . $row['products_model'] . '">' . webImage($row['products_image'], '80', '80', $row['products_model'], 'img-border img-padding') . '</a></div>'; $products_image[$difart] = $thumb; } if (!isset($products_link[$difart])) { $products_link[$difart] = '<a href="?open=product-detail&products_id=' . $row['products_id'] . '" target="_blank">' . $difart . '</a>'; } } arsort($products_sold); arsort($products_sales); arsort($products_vc); $products_sold_filtered = array(); $products_sales_filtered = array(); $products_vc_filtered = array(); foreach ($products_sold as $artno => $ps) { if ($ps >= $min_sold_per_month) {
$link = 'http://www.zalando.de/damen/?q=' . $products['products_ean']; break; case '10': //EB.DE $link = 'http://www.ebay.de/sch/i.html?_from=R40&_sacat=0&_nkw=' . $products['products_ean'] . '&_rdc=1'; break; } } if (!is_null($link)) { $products_sp_link[$row['jng_sp_id']] = $link; } $products_sp[$row['jng_sp_id']] = $row; } $main_image = webImageSource($products['products_image'], IMAGE_SIZE_BIG_1); $clear_image = webImageSource($products_ci['products_clear_image'], IMAGE_SIZE_BIG_1); $pure_image = webImageSource($products['products_pure_image'], IMAGE_SIZE_BIG_1); //GET EXTRA IMAGES DATA (PUT HERE SINCE ITS VALUE WILL USED ON Main Image SECTION) $extra_images_query = tep_db_query("SELECT * FROM products_extra_images WHERE products_id={$products_id} ORDER BY products_extra_images_id"); $extra_images = array(); $add_have_set_to_default = false; $alternate_main_image_key = null; $x = 0; while ($row = tep_db_fetch_array($extra_images_query)) { $extra_images[$x] = $row; if ($row['alternate_main_image'] == 1) { $add_have_set_to_default = true; $alternate_main_image_key = $x; } $x++; } $depot_stock = $class_pm->stockRetrieve(WAREHOUSE_ID_FOR_HANDLING_ORDERS, $products_id, '*');
function webImageWithDetailLinkStars($image, $thumb_width, $thumb_height, $thumb_title = '', $thumb_class = '', $link_title = '', $detail_width = '500', $detail_height = '500', $stars = '0', $max_stars = '3', $link = '', $link_class = '', $brand_id = '', $obj_product = '') { global $DIAMOND_BRAND_IDS; $pimg = webImage($image, $thumb_width, $thumb_height, $thumb_title, $thumb_class); $main_image = webImageSource($image, $detail_width, $detail_height); $gold_icon = ''; $diamond_icon = ''; if ($main_image != '') { $link_target = $link != '' ? $link : $main_image; $link_class = $link_class != '' ? $link_class : 'view_image'; $pimg = '<a href="' . $link_target . '" class="' . $link_class . '"' . ($link_title == '' ? '' : ' title="' . $link_title . '"') . '>' . $pimg . '</a>'; $thumb_image_source = webImageSource($image, $thumb_width, $thumb_height); list($width, $height) = getimagesize($thumb_image_source); $icon_tpos = $height; $icon_lpos = $width; if (is_object($obj_product) && $obj_product->is_killed) { /*Displaying icon stack-ly please used this $icon_tpos -= 20; $icon_lpos = $width - 20; */ //Icon displayed on same row $icon_tpos = $height - 20; $icon_lpos -= 20; $killed_icon = drawKilledIcon('Killed Product', 'position:absolute;margin:' . $icon_tpos . 'px 0 0 ' . $icon_lpos . 'px'); } if (in_array($brand_id, $DIAMOND_BRAND_IDS) || is_object($obj_product) && in_array($obj_product->brand_id, $DIAMOND_BRAND_IDS)) { /*Displaying icon stack-ly please used this $icon_tpos -= 20; $icon_lpos = $width - 20; */ //Icon displayed on same row $icon_tpos = $height - 20; $icon_lpos -= 20; $diamond_icon = drawDiamondIcon('Diamond Product', 'position:absolute;margin:' . $icon_tpos . 'px 0 0 ' . $icon_lpos . 'px'); } if (is_object($obj_product) && ($obj_product->metal_stamp_code > 0 && $obj_product->metal_stamp_code != 925)) { /*Displaying icon stack-ly please used this $icon_tpos -= 20; $icon_lpos = $width - 25; */ //Icon displayed on same row $icon_tpos = $height - 20; $icon_lpos -= 25; $style = 'position:absolute;margin:' . $icon_tpos . 'px 0 0 ' . $icon_lpos . 'px'; $gold_icon = drawGoldIcon($obj_product->metal_stamp_code, $obj_product->metal_stamp_info, '', $style); } } $pimg = '<div align="center"><div style="width:' . $width . 'px;">' . $gold_icon . $diamond_icon . $killed_icon . $pimg . '<br/>' . drawStars($stars, $max_stars) . '</div></div>'; return $pimg; }
function getDesignFinalize($status) { $query = "SELECT p.project_id, p.project_category, p.project_image, p.project_link, p.project_name, p.project_description, p.project_qty, p.project_status, p.project_priority,p.reminder, pf.create_date,pf.eat_status,pf.eat_update_time,pf.minierp_status,pf.minierp_update_time,pf.pricing_status,pf.pricing_update_time,pf.brand_status,pf.description_status,pf.description_update_time FROM projectplan_newdesign p left join projectplan_finalizing pf on p.project_id=pf.project_id where p.project_status=7 order by create_date desc "; $result = tep_db_query($query); $design_items = array(); while ($row = tep_db_fetch_array($result)) { $design_items[] = $row; } $design = array(); if (count($design_items) > 0) { $o = array(); $o['u'] = 'Picture'; $o['c'] = 'Title'; $o['l'] = 'Design Description'; $o['d'] = 'Date'; $o['h'] = '<div style="text-align:center;width:75px;">Update EAT<br/>on Date</div>'; $o['tp'] = '<div style="text-align:center;width:75px;">Update MiniERP<br/>on Date</div>'; $o['j'] = '<div style="text-align:center;width:75px;">Description<br/>on Date</div>'; $o['k'] = '<div style="text-align:center;width:75px;">Pricing<br/>on Date</div>'; $o['t'] = 'Action'; $design[] = $o; $stock_updated = array(); foreach ($design_items as $row) { $order_date = strtotime($row['create_date']); $order_id = $row['project_id']; $o['d'] = date('d-M-y', $order_date); $o['c'] = $row['project_name']; $description = '<a href="?open=project_plan_description&id=' . $order_id . '&hidemenu=true" class="view_webpage" title="View Full Description">'; $description .= substr($row['project_description'], 0, 30) . '...'; $description .= '</a>'; $o['l'] = $description; $el_img_src = webImageSource($row['project_image']); $el_img_link = '<a href="' . $el_img_src . '" class="view_image" title="Design Id ' . $row['project_id'] . '">' . webImage($row['project_image'], '80', '80') . '</a>'; $o['u'] = '<img class="thumb" style="display:none;">' . $el_img_link . '</img>'; $selected = 'selected="selected"'; //$o['e'] = 'EAT Status'; $eat_select = '<select name="cbostatuseat" style="width:75px;" >'; $eat_select .= '<option value="0">NA</option>'; $sel = $row['eat_status'] == 1 ? $selected : ''; $eat_select .= '<option value="1" ' . $sel . '>Done</option>'; $eat_select .= '</select>'; $o['h'] = $eat_select; $eat_date = strtotime($row['eat_update_time']); $year = date('Y', $eat_date); if ($year == 1999) { $eat_date = '<br/> '; } else { $eat_date = '<br/>' . date('d-M-y', $eat_date); } $o['h'] .= $eat_date; //$o['m'] = 'MiniERP Status'; $eat_select = '<select name="cbostatusminierp" style="width:75px;" >'; $eat_select .= '<option value="0">NA</option>'; $sel = $row['minierp_status'] == 1 ? $selected : ''; $eat_select .= '<option value="1" ' . $sel . '>Done</option>'; $eat_select .= '</select>'; $o['tp'] = $eat_select; $minierp_date = strtotime($row['minierp_update_time']); $year = date('Y', $minierp_date); if ($year == 1999) { $minierp_date = '<br/> '; } else { $minierp_date = '<br/>' . date('d-M-y', $minierp_date); } $o['tp'] .= $minierp_date; //$o['r'] = 'Description Status'; $eat_select = '<select name="cbostatusdesc" style="width:75px;" >'; $eat_select .= '<option value="0">NA</option>'; $sel = $row['description_status'] == 1 ? $selected : ''; $eat_select .= '<option value="1" ' . $sel . '>Done</option>'; $eat_select .= '</select>'; $o['j'] = $eat_select; $description_date = strtotime($row['description_update_time']); $year = date('Y', $description_date); if ($year == 1999) { $description_date = '<br/> '; } else { $description_date = '<br/>' . date('d-M-y', $description_date); } $o['j'] .= $description_date; //$o['p'] = 'Pricing Status'; $eat_select = '<select name="cbostatusprice" style="width:75px;" >'; $eat_select .= '<option value="0">NA</option>'; $sel = $row['pricing_status'] == 1 ? $selected : ''; $eat_select .= '<option value="1" ' . $sel . '>Done</option>'; $eat_select .= '</select>'; $o['k'] = $eat_select; $pricing_date = strtotime($row['pricing_update_time']); $year = date('Y', $pricing_date); if ($year == 1999) { $pricing_date = '<br/> '; } else { $pricing_date = '<br/>' . date('d-M-y', $pricing_date); } $o['k'] .= $pricing_date; $action = ''; $action .= '<input type="button" class="btnfndone" name="finished" value="Done" title="Finish Design" style="width:50px;"/>'; $action .= '<input type="button" class="btnfncancel" name="cancel" value="Cancel" title="Cancel Design" style="width:50px;" />'; $action .= '<input type="hidden" id="oiid-' . $row['project_id'] . '" name="oi_id" value="' . $row['project_id'] . '" >'; $o['t'] = $action; $design[] = $o; } $result = tep_draw_table('spo', $design); $result .= '</div>'; } else { $result = '<h3>No New Design</h3>'; } return $result; }