$depot_refill = $class_do->refillOpenOrdersQuantity(SEGMENT_ID_DEFAULT, $products_id, '*');
 $elements_status_raw = true;
 $elements_usage = $class_pm->retrieveElementsUsage($products_id);
 if (count($elements_usage) > 0) {
     $elements_stock = $class_es->retrieveList(WAREHOUSE_ID_ELEMENTS, 'elements_id IN (' . implode(',', array_keys($elements_usage)) . ')');
     foreach ($elements_usage as $eid => $eu) {
         if ($eu['quantity'] > $elements_stock[$eid]) {
             $elements_status_raw = false;
             break;
         }
     }
 } else {
     $elements_status_raw = '<span class="green" title="No Element used Found for this product">NEF</span>';
 }
 $elements_status = is_bool($elements_status_raw) ? '<span class="' . ($elements_status_raw ? 'green">OK</span>' : 'red">NS') . '</span>' : $elements_status_raw;
 $products_agegroup_options = $class_pm->productAgeGroupName();
 $products_brand = $products['products_brand_id'] > 0 ? $class_pb->retrieveDetail($products['products_brand_id']) : '';
 $date_added = date('Y-m-d', strtotime($products['products_date_added']));
 $date_added_time = date('H:i:s', strtotime($products['products_date_added']));
 $last_modified = date('Y-m-d', strtotime($products['products_last_modified']));
 $last_modified_time = date('H:i:s', strtotime($products['products_last_modified']));
 $code_changable = ' readonly="readonly" ';
 if ($pc !== false) {
     $price_changable = ' readonly="readonly" ';
     if ($pc['allow_modification'] == '1') {
         $allow_share = true;
         if ($pc['visible_status'] == 'A') {
             $visible_status_A = 'checked="checked"';
             $visible_status_N = '';
         } else {
             $visible_status_A = '';
 $xml_ptag_sizegrid = $xmlt->drawTag($xml_ptags, 'P_TAG', '', array('identifier' => 'name', 'key' => 'Großenraster'));
 $xml_ptag_sizegrid_values = $xmlt->drawTag($xml_ptag_sizegrid, 'VALUES');
 $xmlt->drawTag($xml_ptag_sizegrid_values, 'VALUE', '', array('identifier' => 'name', 'key' => $zade_sizegrid));
 //P_TAG: Season
 if (isset($catalogs[$pid]['zade'])) {
     $zade_season = $catalogs[$pid]['zade']['navigation3'];
     $xml_ptag_nav3 = $xmlt->drawTag($xml_ptags, 'P_TAG', '', array('identifier' => 'name', 'key' => 'Season'));
     $xml_ptag_nav3_values = $xmlt->drawTag($xml_ptag_nav3, 'VALUES');
     $xmlt->drawTag($xml_ptag_nav3_values, 'VALUE', '', array('identifier' => 'name', 'key' => $zade_season));
 }
 //P_TAG: Age Group
 $age_groups = explode(',', $parent_data['p']['products_agegroup']);
 $xml_ptag_ageg = $xmlt->drawTag($xml_ptags, 'P_TAG', '', array('identifier' => 'name', 'key' => 'Altersgruppe'));
 $xml_ptag_ageg_values = $xmlt->drawTag($xml_ptag_ageg, 'VALUES');
 foreach ($age_groups as $age_gid) {
     $age_group = $class_pm->productAgeGroupName($age_gid);
     if ($age_group != '') {
         $xmlt->drawTag($xml_ptag_ageg_values, 'VALUE', '', array('identifier' => 'name', 'key' => $age_group));
     }
 }
 //P_TAG: Materials (We send again as attributes for filtering and perhaps mapping)
 $xml_ptag_mat = $xmlt->drawTag($xml_ptags, 'P_TAG', '', array('identifier' => 'name', 'key' => 'Material'));
 $xml_ptag_mat_values = $xmlt->drawTag($xml_ptag_mat, 'VALUES');
 foreach ($materials as $mat_name) {
     if ($mat_name != '') {
         $xmlt->drawTag($xml_ptag_mat_values, 'VALUE', '', array('identifier' => 'name', 'key' => $mat_name));
     }
 }
 //P_BULLETS (Selling Point) //NEED FURTHER DISCUSS FOR THIS
 $selling_points = trim($parent_data['pd'][$lid]['products_selling_points']);
 if ($selling_points != '') {
$content .= '<div id="matinfo-reload" style="display:none;"><a href="' . $_SERVER['REQUEST_URI'] . '" target="_self">&raquo; Reload Page to see Materials Info update</a></div>';
$content .= '</div>';
//#block-step-3
$content .= '<h3>Step 4: Finalize Product Price</h3>';
$content .= '<div id="block-step-4" style="' . $div_closer_style . '">';
$content .= '<iframe src="/?open=products-price&amp;pids=' . $products_id . '&amp;hidemenu=true&amp;hidecopyurl=true" width="1100" height="540" style="border:none;overflow:hidden;" scrolling="no"></iframe>';
$content .= '</div>';
//#block-step-5
$content .= '<h3>Step 5: Finalize Product Info</h3>';
$content .= '<div id="block-step-5">';
$content .= '<div class="box ui-corner-all" style="margin-bottom:10px;"><table border="0" cellpadding="0" cellspacing="0"><tr><td class="tac" style="width:50px;"><input id="mktemplate" type="checkbox" /></td><td><label for="mktemplate" class="red"><h3 style="margin:0;padding:0;">Set Product as Template</h3><div>When checked, all unfinalize products from the same draft will be overwritten by this product data</div></label></td></tr></table></div>';
$content .= '<div style="float:left;width:600px;">';
$content .= '<div><table class="form" border="0" cellpadding="0" cellspacing="0">';
$content .= '<tr><td width="220">Sales Partners</td><td>' . $spadded . '</td></tr>';
$content .= '<tr><td>Gender Target</td><td><select id="pro-gender" class="input">' . loadComboListFromArray($class_pm->productGenderName(), null, $product['p']['products_gender']) . '"</select></td></tr>';
$content .= '<tr><td>Age Group Target</td><td><select id="pro-agegroup" class="input">' . loadComboListFromArray($class_pm->productAgeGroupName(), null, $product['p']['products_agegroup']) . '"</select></td></tr>';
$content .= '<tr><td>Attribute - Collection</td><td>' . $class_pm->drawAttributes($products_id, 'L') . '</td></tr>';
$content .= '<tr><td>Attribute - Symbol</td><td>' . $class_pm->drawAttributes($products_id, 'Y') . '</td></tr>';
$content .= '<tr><td>Attribute - Topic</td><td>' . $class_pm->drawAttributes($products_id, 'O') . '</td></tr>';
//$content .= '<tr><td class="bold">Fashion Grade</td><td>';
//$content .= '<div id="btn-fashion-show" style="display:none; float:left;" title="Click to add" class="ui-state-default ui-corner-all "><span class="pointer ui-icon ui-icon-plus"></span></div>';
//$content .= '<div id="fashion-content">';
//$content .= '<select id="cmb-attr-F" class="input" style="float:left;">';
//$content .= '<option value="0">Please select fashion grade...</option>';
//$content .= $class_s->drawComboOptions('', 'F', null, '', 'sd.name');
//$content .= '</select>';
//$content .= ' <span id="btn-fashion-add" style="float:left;margin-left:10px;" class="ui-icon ui-icon-circle-plus pointer" title="add"></span>';
//$content .= ' <span id="btn-fashion-cancel" style="float:left;" class="ui-icon ui-icon-circle-close pointer" title="cancel"></span>';
//$content .= '</div>';
//$content .= '<div class="fashion-separator" style="display:none;clear:both;height:10px;"></div>';
//$current_styles = $class_s->retrieveList('F', "shp.products_id='$products_id'");