// echo "<pre>";var_dump($attribute_data);die(); $class_ea->update($attr, $attrid, $attribute_data); $messagebox->add("{$attributes[$attr]} Attribute ID: <strong>{$_POST['attribute_id']}</strong> is updated.", 'green'); } //DELETE OLD IMAGE AFTER UPDATES TO NEW IMAGE if ($delete_old_image && $old_image_filename != '') { $delete_file = $uploaddir . $old_image_filename; if (file_exists($delete_file)) { unlink($delete_file); } } } } //START TEMPLATE if ($attrid != 'new') { $ad = $class_ea->retrieveDetail($attr, $attrid); if (count($ad) > 0) { $attribute_id = $attrid; foreach ($ad as $r => $data) { foreach ($data as $field => $value) { $attribute_data[$field] = $value; if ($attr == 'mat' && $field == 'material_name') { list($material_name[2], $material_name[1], $material_name[3]) = split(",", $value); } } } $attr_buttons .= '<input type="submit" class="blue" name="submit" value="Save" title="Save Changes" />'; $attr_buttons .= '<input type="submit" name="delete" value="Delete" title="Delete ' . $attributes[$attr] . ' Attribute" disabled="disabled" />'; } else { $messagebox->add("{$attributes[$attr]} Attribute ID: <strong>{$cpid}</strong> is not found on database."); $attrid = 'new';
$jng_warehouses_id = '1'; $type = isset($_GET['type']) ? strtoupper(tep_db_prepare_input($_GET['type'])) : 'FULL'; $catid = isset($_GET['catid']) ? tep_db_prepare_input($_GET['catid']) : '0'; $catname = isset($_GET['catname']) ? tep_db_prepare_input($_GET['catid']) : '0'; $catid = intval($catid); $elements = array(); //$stocks = $class_es->retrieveAll($jng_warehouses_id); $q = "SELECT es.elements_id, es.stock"; $q .= " FROM elements_stock es"; $q .= " LEFT JOIN element e ON e.elements_id=es.elements_id"; $q .= " WHERE es.jng_warehouses_id={$jng_warehouses_id}"; if ($catid > 0) { $q .= " AND e.attribute_category_id={$catid}"; use_class('elements_attributes'); $class_ea = new elements_attributes(); $ea_detail = $class_ea->retrieveDetail('cat', $catid); $catname = $ea_detail[0]['name']; } $q .= " ORDER BY e.attribute_category_id, e.elements_id"; $r = tep_db_query($q); $stocks = array(); while ($row = tep_db_fetch_array($r)) { $stocks[$row['elements_id']] = $row['stock']; } $booked = elements_minierp::elementsAllBookedCount($jng_warehouses_id); $stocks_table = array(); $total_qty_stock = 0; $total_qty_booked = 0; $total_qty_total = 0; $total_matexp_avl = 0; $total_matexp_tot = 0;