<?php include './config.php'; include './auth.php'; $id = $_GET['id']; $can_id = $_GET['can_id']; $ord_id = $_GET['ord_id']; $active_super_category = getSuperCategoryActive(); $editProductsName = editPdoructs($id); $editProducts = editPdoructsOrder($id,$ord_id); $active_category = getCategoryActive(); $ca_id = $editProducts[0]['category_id']; $super_id = $editProducts[0]['supercategory_id']; $active_sub_category = getSubCategoryActive($super_id,$ca_id); $qty = getQty($id,$ord_id); $price = getPriceE($id,$ord_id); ?> <!DOCTYPE html> <html> <head> <title>Edit Sub Category</title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <link href="style/style.css" rel="stylesheet" type="text/css" media="all" /> <script type="text/javascript" src="js/jquery.min.js"></script> </head> <body> <div id="popup_content"> <!--your content start--> <div id="msg" style="color:#007F2A; font-size: 13px;"></div>
$sql_sort_id = mysql_query("SELECT sort_id FROM sohorepro_favorites WHERE comp_id = '".$comp_id."' ORDER BY sort_id DESC LIMIT 1"); $object_order_sort = mysql_fetch_assoc($sql_sort_id); if (count($object_order_sort['sort_id']) > 0) { $order_sort_id = ($object_order_sort['sort_id'] + 1); } else{ $order_sort_id = '0'; } //$query_fav = mysql_query("INSERT INTO sohorepro_favorites SET usr_id = '".$user_id."', comp_id = '".$fav_comp_id."', product_id = '".$fav_prod_id."', sort_id = '" . $order_sort_id . "' "); $spl_check_fav = checkSpecial($fav_cmp_id, $fav_prod_id); $spl_prod_fav = editPdoructs($fav_prod_id); $list_price_fav = (count($spl_check_fav) > 0) ? $spl_check_fav[0]['sp_list_price'] : $spl_prod_fav[0]['list_price']; $disc_price_fav = (count($spl_check_fav) > 0) ? $spl_check_fav[0]['sp_discount'] : $spl_prod_fav[0]['discount']; $sell_price_fav = (count($spl_check_fav) > 0) ? $spl_check_fav[0]['sp_special_price'] : $spl_prod_fav[0]['price']; $query_fav_list = "INSERT INTO sohorepro_favorites SET usr_id = '" . $user_id . "', comp_id = '" . $fav_comp_id . "', product_id = '" . $fav_prod_id . "', list_price = '" . $list_price_fav ."', discount_price = '" . $disc_price_fav ."', sell_price = '" . $sell_price_fav ."', sort_id = '" . $order_sort_id . "'" ; $query_fav = mysql_query($query_fav_list);
//echo '<pre>'; //print_r($all_faverites); //echo '</pre>'; foreach ($all_faverites as $fav){ $list_price = editPdoructs($fav['product_id']); $discoutn_price = editPdoructs($fav['product_id']); $sell_price = editPdoructs($fav['product_id']); //echo $fav['product_id'].' LIST PRICE :'.$list_price[0]['list_price'].' DISCOUNT PRICE :'.$discoutn_price[0]['discount'].' SELL PRICE :'.$sell_price[0]['price'].'<br>'; $spl_check_fav = checkSpecial($fav['comp_id'], $fav['product_id']); $spl_prod_fav = editPdoructs($fav['product_id']); $list_price_fav = (count($spl_check_fav) > 0) ? $spl_check_fav[0]['sp_list_price'] : $spl_prod_fav[0]['list_price']; $disc_price_fav = (count($spl_check_fav) > 0) ? $spl_check_fav[0]['sp_discount'] : $spl_prod_fav[0]['discount']; $sell_price_fav = (count($spl_check_fav) > 0) ? $spl_check_fav[0]['sp_special_price'] : $spl_prod_fav[0]['price']; $query = "UPDATE sohorepro_favorites SET list_price = '" . $list_price_fav . "', discount_price = '" . $disc_price_fav . "', sell_price = '" . $sell_price_fav . "' WHERE product_id = '".$fav['product_id']."' AND comp_id = '".$fav['comp_id']."' "; $result = mysql_query($query); } if($result){ echo 'Updated Successfully';
<?php include './config.php'; include './auth.php'; $id = $_GET['id']; $editProducts = editPdoructs($id); $active_super_category = getSuperCategoryActiveA(); $active_category = getCategoryActive(); $super_id = $editProducts[0]['supercategory_id']; $ca_id = $editProducts[0]['category_id']; $active_sub_category = getSubCategoryActive($super_id, $ca_id); if ($_REQUEST['edi_prod'] == '1') { extract($_POST); $sql = "UPDATE sohorepro_products\n\t\t\tSET supercategory_id = '" . $supercategory_name . "', \n category_id = '" . $category_name . "',\n subcategory_id = '" . $subcategory_name . "', \n product_name = '" . mysql_real_escape_string($product_name) . "',\n list_price = '" . $price . "',\n discount = '" . $discount . "', \n price = '" . $sell_price . "', \n\t\t\t\tstatus = '" . $status . "' WHERE id = " . $id . " "; $sql_result = mysql_query($sql); if ($sql_result) { $result = "success"; } else { $result = "failure"; } } ?> <!doctype html> <html> <head> <meta charset="utf-8"> <title>Soho-repro</title> <link href="style/style.css" rel="stylesheet" type="text/css" media="all" /> <script type="text/javascript" src="js/jquery.min.js"></script> </head>