Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- function shiping_charge($comp_id, $subcat_id, $country_id, $qty)
- {
- if (!($select_price = mysql_query("select * from fixed_shipping_price FP, ship_con_com SC where FP.f_sp_subcat2='{$subcat_id}' and SC.f_spid=FP.f_sp_id and SC.shcc_conid='{$country_id}' and SC.shcc_comid='{$comp_id}'"))) {
- exit(mysql_error());
- }
- $seelct_num = mysql_num_rows($select_price);
- if ($seelct_num == 0) {
- $select_defalut = mysql_fetch_array(mysql_query("select * from fixed_shipping_price where f_sp_subcat2='{$subcat_id}'"));
- $shipping_price = $select_defalut['f_sp_default_value'] * $qty;
- } else {
- $select_ship = mysql_fetch_array($select_price);
- $shipping_price = $select_ship['shcc_price'] * $qty;
- }
- return $shipping_price;
- }
- function main()
- {
- include("language.php");
- $amt = mysql_real_escape_string($_SESSION['amt']);
- $amt = $_SESSION['total_amount'];
- $amtpaypal = mysql_real_escape_string($_SESSION['amtpaypal']);
- if (isset($_SESSION['memid'])) {
- $memid = mysql_real_escape_string($_SESSION['memid']);
- } else {
- $memid = mysql_real_escape_string($_SESSION['normal_memid']);
- }
- $price = mysql_real_escape_string($_SESSION['total_amount']);
- $rs0 = mysql_fetch_array(mysql_query("select * from zw_websetting"));
- $weburl = $rs0['weburl'];
- $date = date("Y-m-d");
- $sessionid = session_id();
- $productid = mysql_real_escape_string($_SESSION['cartproid123']);
- $cartvalue = mysql_real_escape_string($_REQUEST['cartvalue']);
- $product_fetch = mysql_fetch_array(mysql_query("select * from products where id='{$productid}' and user_id!='{$memid}'"));
- $name = $product_fetch['product_name'];
- $retail_price = $product_fetch['retail_price'];
- $buynow = $product_fetch['buynow_price'];
- $shipping_price = $product_fetch['shipping_charge'];
- $mrchnt_id = mysql_real_escape_string($_SESSION['merchantid']);
- $empid = mysql_real_escape_string($_SESSION['memid']);
- $shipping_cost = mysql_real_escape_string($_SESSION['ship_ment']);
- $upgrade = mysql_real_escape_string($_REQUEST['upgrade']);
- $rs0 = mysql_fetch_array(mysql_query("select * from zw_websetting"));
- $paypal_currency = $rs0['paypalcurrency'];
- $plan_query = mysql_query("select * from plans where id='{$upgrade}'");
- $plan_fetch = mysql_fetch_array($plan_query);
- $emp_select = mysql_fetch_array(mysql_query("select * from job_seeker where id='{$empid}'"));
- $emp_grade1 = $emp_select['memid'];
- $plan_select = mysql_fetch_array(mysql_query("select * from plans where id='{$emp_grade1}'"));
- $emp_grade = $plan_select['planname'];
- $payment_modes = $plan_select['payment_modes'];
- $exp_payments = explode("|", $payment_modes);
- if (isset($_REQUEST['contine_order'])) {
- $ship_country = mysql_real_escape_string($_REQUEST['ship_country']);
- $ship_company = mysql_real_escape_string($_REQUEST['ship_company']);
- $cargo_id = mysql_real_escape_string($_REQUEST['hidden_val']);
- $company_id = mysql_real_escape_string($_REQUEST['hidden_val1']);
- $value = mysql_real_escape_string($_REQUEST['hidden_val2']);
- if (!($select_cart = mysql_query("select * from products PR, cart CR, cart_insert CI where CI.session_id='{$sessionid}' and CR.product_id=CI.product_id and PR.id=CR.product_id"))) {
- exit(mysql_error());
- }
- while ($fetch_array = mysql_fetch_array($select_cart)) {
- $selet_cargo_price = mysql_fetch_array(mysql_query("select * from cargo_shipping_cost where cargo_ship_cost_id='{$cargo_id}'"));
- $subcat_id = $fetch_array['sub_subcat'];
- $toatl_qty = $fetch_array['qty'];
- $shipping_price = shiping_charge($company_id, $subcat_id, $ship_country, $toatl_qty);
- $total_ship = $shipping_price + $fetch_array['shipping_charge'];
- $cart_sele_pro_id = $fetch_array['product_id'];
- if (!($update_cart = mysql_query("update cart set shipping_country='{$selet_cargo_price['cargo_cost_con_id']}', shipping_company='{$company_id}', shipping_qty='{$total_ship}' where product_id='{$cart_sele_pro_id}'"))) {
- exit(mysql_error());
- }
- }
- echo "<script>window.location='order_details.php'</script>";
- exit();
- }
- echo "<s";
- echo "cript src=\"change_country.js\" type=\"text/javascript\" ></script>";
- echo "<s";
- echo "cript type=\"text/javascript\">function change_ajax(div_id,values) {if(values.indexOf(' ')>0) { alert(\"White Spaces Restricted\"); values=values.replace(/ /g,''); }\$(document).ready(function() {\$.ajaxSetup({ cache: false });\$('#'+div_id).load('";
- echo $weburl;
- echo "/ajax.php?'+values); }); }function value_cargo(val_id,com_id,total,hidden_id) {var hidden=document.getElementById(hidden_id);document.getElementById(\"hidden_val1\").value=com_id;document.getElementById(\"hidden_val2\").value=total;hidden.value=val_id; }</script><center><!-- " . __FILE__ . " body--><div class=\"div\">";
- include("shopping_header.php");
- echo "<div class=\"clr\"></div><br /><form action=\"#\" name=\"ship_count_form\" id=\"ship_count_form\" method=\"post\"><input type=\"hidden\" name=\"hidden_val\" id=\"hidden_val\" value=\"\" /><input type=\"hidden\" name=\"hidden_val1\" id=\"hidden_val1\" value=\"\" /><input type=\"hidden\" name=\"hidden_val2\" id=\"hidden_val2\" value=\"\" /><fieldset class=\"shopping_cart\" ><legend >Select Your Shipping Country</legend><br />";
- echo "<s";
- echo "elect name=\"ship_country\" id=\"ship_country\" style=\"color:#666666;\" ";
- echo " onchange=\"change_country(this.value)\">";
- display_country();
- echo "</select><!--<input type=\"text\" value=\"\$99.00\" disabled=\"disabled\" style=\"width:65px; margin-right:5px; height:22px; font-weight:bold; color:#666;\" /> --><br /><br /><div id=\"ship_companies\"></div><br /><!--<a href=\"order_details.php\"> --><button name=\"contine_order\" class=\"button2\">Continue To Order</button><!--</a> --><br /><br /></fieldset></form></div><br /></center>";
- }
- session_start();
- include_once("conn.php");
- include("template_shop.php");
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement