$delete_file = $uploaddir . $p['products_pure_image'];
    if (file_exists($delete_file)) {
        unlink($delete_file);
        tep_db_perform('products', array('products_pure_image' => ''), 'update', 'products_id=' . $pid);
    }
}
//SUBMIT ACTION
$class_pa->processAction();
//HANDLE POST/GET ACTION THAT RELATED TO ARTICLES
$class_pm->drawAttributesPostAction();
if (isset($_POST['me_action'])) {
    $pid = tep_db_prepare_input($_POST['products_id']);
    if ($_POST['me_action'] == 'SAVECOGSMANUAL') {
        $cogs_value = tep_db_prepare_input($_POST['cogs']);
        $obj_product = new Product($pid);
        $obj_product->saveCOGSManual($cogs_value);
        echo utf8_encode($obj_product->getProductCOGSObject()->drawDetailTable());
        exit;
    } elseif ($_POST['me_action'] == 'FINALIZETRADEBYTE') {
        //Update table 'products'
        $sda = array();
        $sda['products_gender'] = tep_db_prepare_input($_POST['products_gender']);
        $sda['products_agegroup'] = tep_db_prepare_input($_POST['products_agegroup']);
        tep_db_perform('products', $sda, 'update', "products_id={$pid}");
        //Update table 'jng_sp_catalog'
        $update_tb_status = false;
        //ZADE UPDATE
        $catalog = $class_jc->retrieveDetail(null, '8', $pid);
        if ($catalog !== false) {
            $sda = array();
            $sda['navigation3'] = tep_db_prepare_input($_POST['zade_season']);