$vc_units[] = $unit_price; $vc_labels[] = 'Packaging Cost in Bali'; $vc_params[] = 'cost_packaging_product'; $vc_units[] = $unit_price; $vc_labels[] = 'Packaging Cost in HH'; $vc_params[] = 'cost_packaging_inhh'; $vc_units[] = $unit_price; //SUBMIT ACTION if (isset($_POST['me_action'])) { if ($_POST['me_action'] == 'SAVEVCPARAMS') { $jng_sp_id = tep_db_prepare_input($_POST['jng_sp_id']); $sda = array(); foreach ($vc_params as $colname) { $sda[$colname] = tep_db_prepare_input($_POST[$colname]); } $class_sp->update($jng_sp_id, $sda); $messagebox->add("Changes have been saved.", 'green'); } } //START TEMPLATE $sp_data = $class_sp->retrieveList(); $sp_data_keys = array_keys($sp_data); $session_page = 'sp-products-manage'; $show_sp_combo = true; if (isset($_GET['jng_sp_id']) && $_GET['jng_sp_id'] != '') { $jng_sp_id = tep_db_prepare_input($_GET['jng_sp_id']); $show_sp_combo = false; } elseif (isset($_POST['jng_sp_id']) && $_POST['jng_sp_id'] != '') { $jng_sp_id = tep_db_prepare_input($_POST['jng_sp_id']); } elseif (isset($_SESSION[$session_page]['jng_sp_id'])) { $jng_sp_id = $_SESSION[$session_page]['jng_sp_id'];
$delivery_time = tep_db_prepare_input($_POST['delivery_time']); $package_prefix = tep_db_prepare_input($_POST['package_prefix']); $sp_type = tep_db_prepare_input($_POST['sp_type']); $languages_id = tep_db_prepare_input($_POST['languages_id']); $use_payone = tep_db_prepare_input($_POST['use_payone']); $use_easylog = tep_db_prepare_input($_POST['use_easylog']); $use_amazon_logistic = tep_db_prepare_input($_POST['use_amvd_logistic']); $billing_address = tep_db_prepare_input($_POST['billing_address']); $amazon_vat = tep_db_prepare_input($_POST['amazon_vat']); $sql_data_array = array('jng_id' => $jng_id, 'name' => $name, 'website' => $website, 'contact_person' => $contact_person, 'email' => $email, 'provision' => $provision, 'provision_rate' => $provision_rate, 'brand_id' => $brand_id, 'delivery_time' => $delivery_time, 'package_prefix' => $package_prefix, 'sp_type' => $sp_type, 'languages_id' => $languages_id, 'tb_used' => $tb_used, 'tb_channel' => $tb_channel, 'active_status' => $active_status, 'use_in_forecast' => $use_in_forecast, 'use_payone' => $use_payone, 'use_easylog' => $use_easylog, 'use_amvd_logistic' => $use_amazon_logistic, 'amazon_vat' => $amazon_vat, 'billing_address' => $billing_address); if ($jng_sp_id == '') { tep_db_perform('jng_sp', $sql_data_array); $jng_sp_id = tep_db_insert_id(); $action = 'insert'; } else { $class_sp->update($jng_sp_id, $sql_data_array); $action = 'update'; } $location = "?open=sp-detail&id={$jng_sp_id}&action={$action}"; if ($hidemenuscript != '') { $location .= '&hidemenu=true'; } header("Location: {$location}"); exit; } } //START TEMPLATE if (isset($_GET['action'])) { $post_action_run = true; if ($_GET['action'] == 'insert') { $messagebox->add('New Sales Partner is added.', 'green');