$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']); $returnable = $item['order_quantity']; $return_data = $class_jo->retrieveReturnItem($item['jng_sp_orders_items_id']); if (!is_null($return_data)) { foreach ($return_data as $rd) { if ($rd['return_id'] != $return_id) { $returnable -= $rd['return_quantity']; } } } $return_qty = '<select id="return_qty">'; for ($q = 1; $q <= $returnable; $q++) { $sel = $q == $return['return_quantity'] ? 'selected="selected"' : ''; $return_qty .= '<option value="' . $q . '" ' . $sel . '>' . $q . '</option>'; } $return_qty .= '</select>';
if ($returnable > 0) { $o = array(); $order_date = strtotime($row['order_date']); $item_count = "{$row['order_item_count']}/{$row['order_item_total']}"; $info = array(); $info[] = 'No: <a href="?open=sp-order&id=' . $row['jng_sp_orders_id'] . '" target="_blank" title="View Order Detail">' . $row['order_id'] . '</a> <span class="notice">(' . $item_count . ')</span>'; $info[] = 'Date: ' . date('d-M-y', $order_date); $info[] = 'Cust: ' . $row['customer_name']; $info[] = 'Product: <a href="?open=product-detail&products_id=' . $row['products_id'] . '" target="_blank" title="View product detail">' . $row['article_number'] . '</a>'; $info[] = 'Qty: ' . $row['order_quantity'] . ' • ' . 'Price: ' . $row['price']; $info[] = 'Status: ' . $itemStatus[$row['status']]; $o['c'] = implode('<br />', $info); $pimg = webImageSource($row['products_image'], '500'); $thumb = $pimg == '' ? '' : webImage($row['products_image'], '80', '80', $row['products_id'], 'img-border img-padding'); $o['a'] = $thumb; $return_reason_combo = $class_jo->returnReasonCombo('reason', '', 'reason-' . $row['jng_sp_orders_items_id']); $return_qty_combo = 'Return Qty <select id="qty-' . $row['jng_sp_orders_items_id'] . '">'; for ($q = 1; $q <= $returnable; $q++) { $sel = $q == $returnable ? 'selected="selected"' : ''; $return_qty_combo .= '<option value="' . $q . '" ' . $sel . '>' . $q . '</option>'; } $return_qty_combo .= '</select>'; $shipping_cost = 'Shipping: <select id="shipping-' . $row['jng_sp_orders_items_id'] . '">'; $shipping_cost .= '<option value="1">Paid</option>'; $shipping_cost .= '<option value="0">UnPaid</option>'; $shipping_cost .= '</select>'; $cust_comment = '<textarea name="comment" id="comment-c-' . $row['jng_sp_orders_items_id'] . '" style="font-size:10px;">' . $default_comment . '</textarea>'; $jng_comment = '<textarea name="comment" id="comment-j-' . $row['jng_sp_orders_items_id'] . '" style="font-size:10px;">' . $default_comment . '</textarea>'; $return_info = '<table border="0" cellpadding="0" cellspacing="0">'; $return_info .= '<tr><td>' . $return_qty_combo . '</td>'; $return_info .= '<td>' . $shipping_cost . '</td></tr>';