$content .= '<table class="sticky-tablehead" border="0" cellpadding="0" cellspacing="0">'; $content .= '<thead><tr>'; foreach ($product_table_header as $k => $v) { $content .= '<th>' . $v . '</th>'; } $content .= '</tr></thead>'; $content .= '<tbody id="table-loader">'; $items_as_products = array(); $products = array(); $articles = array(); foreach ($booking->items as $psid => $qty) { $stock = $class_pm->stockRetrieveDetailByPSID($psid); $items_as_products[$stock['products_id']][$stock['articles_id']] = $stock; $products[$stock['products_id']] = $class_pm->retrieveDetail($stock['products_id'], 'p,pnc'); if ($stock['articles_id'] > 0) { $article = $class_pa->retrieveDetail($stock['articles_id']); $articles[$stock['products_id']][$stock['articles_id']] = textLength($article['length']); } else { $articles[$stock['products_id']][$stock['articles_id']] = textLength($products[$stock['products_id']]['pnc']['products_length']); } } $counter = 0; foreach ($items_as_products as $pid => $adata) { $counter++; $product = $products[$pid]; $alist = $articles[$pid]; $content .= '<tr class="' . ($counter % 2 == 0 ? 'e' : 'o') . '">'; foreach ($product_table_header as $k => $v) { switch ($v) { case $hn_product: $value = webImage($product['p']['products_image'], IMAGE_SIZE_THUMBNAIL_1, IMAGE_SIZE_THUMBNAIL_1, 'Product ' . $pid);
$worst_status = 12; $worst_status_date = 0; $tables = array(); $tables[] = $header; foreach ($items as $ikey => $i) { $total_products++; $item_object = $order_object->getItem($i[$items_colname_id]); if (statusIsCancelled($i['status'])) { $total_products_canceled++; } else { if ($i['status'] > 8) { $total_products_sent++; } } $product = $class_pm->retrieveDetail($i['products_id'], 'p,pnc'); $article = $i['products_articles_id'] > 0 ? $class_pa->retrieveDetail($i['products_articles_id']) : null; $ordered_qty = intval($i[$items_colname_qty]); if ($i['status'] == 8) { if ($i['stock_status'] == 'D') { $total_products_depot_ready++; if ($i['print_count'] == '1') { $total_products_depot_ready_printed++; } } if ($i['mode'] == modeKey('MMO')) { $do = $class_do->retrieveDetailTransmigran($source, $i[$items_colname_id]); if ($i['stock_status'] != 'D' || $i['stock_status'] == 'D' && $do['status'] == 8) { $i['status'] = $do['status']; $i['status_date'] = $do['status_date']; } }
$img_counter = 0; foreach ($product_images as $pi) { $img_location = is_file($pi) ? $pi : DIR_WS_IMAGES . $pi; if (is_file($img_location)) { //CREATE IMAGE ARCHIVE FOR UPLOAD $img_counter++; $suffix = $img_counter == 1 ? '.MAIN' : '.PT' . str_pad($img_counter - 1, 2, '0', STR_PAD_LEFT); $new_filename = $p['p']['products_ean'] . $suffix . '.jpg'; $new_location = $dest_path . $new_filename; copy($img_location, $new_location); $temp_images[] = $new_location; } } } else { $articles = array(); $articles[] = $class_pa->retrieveDetail($pdata['products_articles_id']); if (count($articles) > 0) { foreach ($articles as $a) { $img_counter = 0; foreach ($product_images as $pi) { $img_location = is_file($pi) ? $pi : DIR_WS_IMAGES . $pi; if (is_file($img_location)) { //CREATE IMAGE ARCHIVE FOR UPLOAD $img_counter++; $suffix = $img_counter == 1 ? '.MAIN' : '.PT' . str_pad($img_counter - 1, 2, '0', STR_PAD_LEFT); $new_filename = $a['products_ean'] . $suffix . '.jpg'; $new_location = $dest_path . $new_filename; copy($img_location, $new_location); $temp_images[] = $new_location; } }
$pdf->Cell($col_subcol_width[1], $lineheight, 'Pos.', 1, 0, 'C', true); $pdf->Cell($col_subcol_width[2], $lineheight, 'Bild', 1, 0, 'C', true); $pdf->Cell($col_subcol_width[3], $lineheight, 'Größe', 1, 0, 'C', true); $pdf->Cell($col_subcol_width[4], $lineheight, 'Produktkategorie', 1, 0, 'C', true); $pdf->Cell($col_subcol_width[5], $lineheight, 'Article', 1, 0, 'C', true); $pdf->Cell($col_subcol_width[6], $lineheight, 'EAN', 1, 0, 'C', true); $pdf->Cell($col_subcol_width[7], $lineheight, 'Preis', 1, 0, 'C', true); $pdf->Cell($col_subcol_width[8], $lineheight, 'Menge', 1, 0, 'C', true); $pdf->ypos += $lineheight; $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; }
/** * Generate family match key * @param Int $products_id * @param Int $articles_id * @return String */ function refreshFamilyMatchKey($products_id, $articles_id = null) { //$group_ref_el_cat = array('casting', 'findings', 'handmade', 'chains', 'pearl'); $group_ref_el_cat = $this->el_cat_searchkey; //Old Key formula : brand_id-categories_id-[el_id-qty] >> 13.12.10 changed to exclude brand_id //New Key formula : categories_id-[el_id-qty] use_class('element'); use_class('products_minierp'); use_class('products_articles'); $class_pa = new products_articles(); $class_pm = new products_minierp(); if (is_null($products_id)) { $articles = $class_pa->retrieveDetail($articles_id); $products_id = $articles['products_id']; } $family_searchkey = ''; $key1 = array(); $key2 = array(); $el_used = $class_pm->retrieveElementsUsage($products_id, $articles_id); if (count($el_used) > 0) { //$p_data = $class_pm->retrieveDetail($products_id, 'p,cat'); $p_data = $class_pm->retrieveDetail($products_id, 'cat'); //$key1[] = $p_data['p']['products_brand_id']; $key1[] = $p_data['categories_id']; foreach ($el_used as $dt) { $elid = $dt['elements_id']; $el = new element($elid); if (in_array($el->attributes['category']['id'], $group_ref_el_cat)) { $key2[] = $elid; $key2[] = $dt['quantity']; } } if (count($key2) > 0) { $family_searchkey = implode('-', array_merge($key1, $key2)); if (is_null($articles_id)) { tep_db_perform('products', array('family_searchkey' => $family_searchkey), 'update', "products_id={$products_id}"); //update also articles if exist $articles = $class_pa->retrieveList($products_id); foreach ($articles as $article) { $articles_id = $article['products_articles_id']; $this->refreshFamilyMatchKey($products_id, $articles_id); } } else { tep_db_perform('products_articles', array('family_searchkey' => $family_searchkey), 'update', "products_articles_id={$articles_id}"); } } } return $family_searchkey; }
$order_id = $class_jo->importOrder($order); if (!is_null($order_id) && $order_id != '') { $orders_created_collection[] = $order_id; $orders_created++; $n_items = count($_POST['articles']); $n_item = 0; $leadtime_start_date = $timestamp; if ($n_items > 0) { foreach ($_POST['articles'] as $article_raw) { $n_item++; $article = explode('-', $article_raw); $pid = $article[0]; $aid = $article[1]; $ean = $article[2]; $product = $class_pm->retrieveDetail($pid, 'p,pnc'); $article = $aid == '0' ? null : $class_pa->retrieveDetail($aid); $item = array(); $item['jng_sp_orders_id'] = $order_id; $item['products_id'] = $pid; $item['products_articles_id'] = $aid; $item['products_ean'] = $ean; $product_length = is_null($article) ? $product['pnc']['products_length'] : $article['length']; $product_length = $product_length > 0 ? '' : textLength($product_length, false); $article_number = $product['p']['products_model'] . ($product_length == '' ? '' : "_{$product_length}"); $item['article_number'] = $article_number; $item['article_reference_number'] = 'null'; $item['billing_text'] = ''; $item['order_quantity'] = $cdata[3]; $item['delivery_time'] = 'null'; $item['delivery_replacement_time'] = 'null'; $price = $product['p']['products_price'];
$row[] = 'Pearl Shine'; $row[] = 'Pearl Surface'; $row[] = 'Diamond Total Weight'; $row[] = 'Diamond Color'; $row[] = 'Diamond Clarity'; $row[] = 'Diamond Stone Cut'; $row[] = 'Diamond Girlde'; $row[] = 'Diamond Polish'; $row[] = 'Diamond Certificate Type'; $table[] = $row; foreach ($preorder->items as $i) { $pid = $i['products_id']; $aid = $i['articles_id']; $pdata = $class_pm->retrieveDetail($pid, 'p,pd,pd2,pnc,cat'); $obj_product = new Product($pid); $adata = $aid == 0 ? null : $class_pa->retrieveDetail($aid); if (is_null($adata)) { $ean = $pdata['p']['products_ean']; $length = $pdata['pnc']['products_length']; } else { $ean = $adata['products_ean']; $length = $adata['length']; } $colors = $class_pm->loadColorPatternNames($pid, '2'); $colors_main = ''; if (is_array($colors)) { foreach ($colors as $c) { $colors_main = $c; break; } } else {
function getEANReturnResult($partner_type, $products_data, $sp_id = '0') { use_class('jng_sp'); use_class('orders'); use_class('jng_sp_orders'); use_class('Product'); use_class('products_ean'); use_class('products_minierp'); use_class('products_articles'); use_class('products_brand'); $class_sp = new jng_sp(); $class_orders = new orders(); $class_jo = new jng_sp_orders(); $class_pean = new products_ean(); $class_pm = new products_minierp(); $class_pa = new products_articles(); $class_pb = new products_brand(); $result = "no data"; $product_id = $products_data["products_id"]; $product_article_id = $products_data["products_articles_id"]; if ($product_article_id > 0) { $articles_data = $class_pa->retrieveDetail($product_article_id); } $p_ean = $class_pean->getEAN($product_id, $product_article_id); $p = $class_pm->retrieveDetail($product_id, 'p,pd,cat,pnc'); //GETTING BRAND NAME $p_brand_id = $p['p']['products_brand_id']; $brand_data = $class_pb->retrieveDetail($p_brand_id); $brand_name = strtoupper(trim($brand_data['brand_name'])); $p_brand = $brand_name == '' ? 'JULIE & GRACE' : $brand_name; $p_code = $p['p']['products_model']; $p_category = mb_strtoupper($class_pm->retrieveCategoryName($p['categories_id'], 2)); //$p_shortname = "925 SILBER"; //it was $label_material //$p_shortname = ($sp_id=='5') ? strtoupper($p['pd']['2']['products_short_name']) : "925 SILBER"; $sp_used_am_logistic = array_keys(getSalesPartnerUseAmazonLogistic()); if (in_array($sp_id, $sp_used_am_logistic)) { $p_shortname = strtoupper($p['pd']['2']['products_short_name']); } else { $obj_product = new product($product_id); $metal_stamp_code = $obj_product->metal_stamp_code; $metal_stamp_info = $metal_stamp_code == 925 ? 'SILBER' : $obj_product->metal_stamp_info; $metal_stamp_info = $this->convertToGermanHex($metal_stamp_info); $p_shortname = strtoupper("{$metal_stamp_code} {$metal_stamp_info}"); } $p_length = $product_article_id > 0 ? $articles_data['length'] : $p['pnc']['products_length']; $p_length = $p_length > 0 ? strtoupper(str_replace(' ', '', textLength($p_length))) : ''; $p_targetaudience = strtoupper(LABEL_TARGET_AUDIENCE); //FOR TEMPORARY WE USING ONLY DAMEN if ($partner_type == 'sp') { $order_qty = intval($products_data["order_quantity"]); $p_price = $products_data['price']; } elseif ($partner_type == 'jg') { $order_qty = $products_data["products_quantity"]; $p_price = $products_data['final_price']; } elseif ($partner_type == 'dp') { $order_qty = $products_data["quantity"]; $p_price = '0'; } else { $order_qty = ''; $p_price = ''; } if ($p_ean != '') { $return_label = $p_ean . ";" . $p_category . ";" . $p_shortname . ";" . $p_price . " EUR;{$order_qty};{$sp_id};{$p_code};{$p_brand};{$p_length};{$p_targetaudience};{$p_brand_id}"; $result = $return_label; } return $result; }
foreach ($overlap_products as $pid => $articles) { $product = $class_pm->retrieveDetail($pid, 'p,pnc'); foreach ($articles as $aid => $adata) { $counter++; $td = array(); foreach ($header as $k => $v) { switch ($v) { case $hn_no: $value = $counter; break; case $hn_prod: $value = webImage($product['p']['products_image'], IMAGE_SIZE_THUMBNAIL_1, IMAGE_SIZE_THUMBNAIL_1, 'Product ' . $pid); $value .= '<br />' . $pid; break; case $hn_arts: $article = $class_pa->retrieveDetail($aid); $length = $aid == '0' ? $product['pnc']['products_length'] : $article['length']; $value = $length > 0 ? textLength($length) : '-'; break; case $hn_name: $value = '<ul>'; foreach ($adata['orders'] as $bname) { $value .= '<li>' . $bname . '</li>'; } $value .= '</ul>'; break; case $hn_stock: $value = $adata['stock']; break; case $hn_book: $value = $adata['qty'];
$message .= '<a href="http://manobo.de/?open=depot-order&id=' . $order_id . '">DP-' . $order_id . '</a>'; } elseif ($newstatus == '8') { $subject = 'MANUAL SET STATUS!'; $message = 'A Product from Depot Order has been set manually as received in HH by ' . $session_userinfo['username'] . ': '; $message .= '<a href="http://manobo.de/?open=depot-order&id=' . $order_id . '">DP-' . $order_id . '</a>'; } if ($subject != '' && $message != '') { tep_mail(EMAIL_NAME_DEBUGR, EMAIL_ADDRESS_DEBUGR, $subject, $message, FROM_EMAIL_NAME, FROM_EMAIL_ADDRESS, false); } unset($class_do->items[$order_id]); } } $do = $class_do->retrieveDetail($order_id); $do_timestamp = strtotime($do['order_date']); $product = $class_pm->retrieveDetail($do['products_id']); $article = $do['articles_id'] == 0 ? null : $class_pa->retrieveDetail($do['articles_id']); $length = $article == null ? $product['pnc']['products_length'] : $article['length']; $length_text = $length == 0 ? '' : '<tr><td>Product Length</td><td>' . textLength($length) . '</td></tr>'; $group_name = $do['group_name']; if (count($do) == 0) { $content .= '<h3 class="red">Depot Order ' . $order_id . ' is not found in Database'; } else { $statusName = statusNameShort(); $bih_start_date = $do['order_date']; $bih_end_date = null; if ($do['trans_type'] == 'SP') { use_class('jng_sp_orders'); $class_jo = new jng_sp_orders(); $itrans = $class_jo->retrieveItemDetail($do['trans_id']); $otrans = $class_jo->retrieveDetail($itrans['jng_sp_orders_id']); $bih_start_date = $otrans['order_date'];