//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){
if(count($check_fav) == '0'){ $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 . "'" ;
<?php include './config.php'; if(isset($_POST['list_price_c']) && $_POST['list_price_c'] != '') { $id = $_POST['id']; $list_price = $_POST['list_price_c']; $discount = $_POST['discount_c']; $special = number_format(($_POST['special']), 2, '.', ''); $user_id = $_POST['user_id']; $discount_return = number_format(($_POST['discount_c']), 2, '.', ''); $check = checkSpecial($user_id,$id); //echo count($check); if(count($check) <= 0){ $query = "INSERT INTO sohorepro_special_pricing SET sp_user_id = '" .$user_id."', sp_product_id = '" .$id."', sp_list_price = '" . $list_price . "', sp_discount = '" . $discount . "', sp_special_price = '" . $special . "' "; $sql_result = mysql_query($query); $query_fav = "UPDATE sohorepro_favorites SET list_price = '" . $list_price . "', discount_price = '" . $discount . "', sell_price = '" . $special . "' WHERE comp_id = '".$user_id."' AND product_id = '".$id."' "; mysql_query($query_fav); if ($sql_result) { echo $list_price.'~'.$discount_return.'~'.$special.'~';
$newArgs = str_replace(",i,", ",{$key2},", $newArgs); addTexture($currentID, $newArgs); } } } if (!$done) { addTexture($currentID, $functionArgs); } // texture:id=chisel.stonebrick_fancy,filename=assets/chisel/textures/blocks/stonebrick/fancy.png // block:id=%stonebricksmooth,data=9,stdrot=true,allfaces=0:chisel.stonebrick_fancy // code... } elseif (strpos($line, 'registerAll') !== false) { if (is_null($currentID)) { continue; } $done = checkSpecial($currentID); if (!$done) { addBlocID($currentID, substr($line, strlen($currentID) * 2 + 29, -3)); $currentID = null; } } else { continue; } // echo "$line_num:$line\n"; } function addTexture($currentID, $args) { global $texturesList; $functionArgs = explode(",", $args); if (!array_key_exists($currentID, $texturesList)) { $texturesList[$currentID] = array();