0) $_SESSION["reorder_order"] = $reorder; //BUILD SELECT OPTIONS $q = "SELECT * FROM ACU_products_options WHERE active='Y' AND products_id='$products_id' ORDER BY order_placement"; $results = mysqli_query($connection,$q); while ($row = mysqli_fetch_array($results)) { $db_products_options_id = $row["products_options_id"]; $q2 = "SELECT * FROM ACU_products_options_ext WHERE active='Y' AND products_options_id='$db_products_options_id' ORDER BY order_placement"; $results2 = mysqli_query($connection,$q2); while ($row2 = mysqli_fetch_array($results2)) { $db_products_options_ext_id = $row2["products_options_ext_id"]; $db_subtract_options = $row2["subtract_options"]; if($db_subtract_options) { $subtract_arr[$db_products_options_ext_id] = $db_subtract_options; } } } if(!$_POST && !$_GET) { $q = "SELECT * FROM ACU_products_options WHERE active='Y' AND products_id='$products_id' ORDER BY order_placement"; $results = mysqli_query($connection,$q); while ($row = mysqli_fetch_array($results)) { $db_products_options_id = $row["products_options_id"]; $db_options_name = $row["options_name"]; $q2 = "SELECT * FROM ACU_products_options_ext WHERE active='Y' AND products_options_id='$db_products_options_id' ORDER BY order_placement LIMIT 1"; $results2 = mysqli_query($connection,$q2); while ($row2 = mysqli_fetch_array($results2)) { $db_products_options_ext_id = $row2["products_options_ext_id"]; if($subtract_arr[$db_products_options_ext_id]) { $tmp = $subtract_arr[$db_products_options_ext_id]; $frags = explode(",",$tmp); while(list($k1,$v1)=each($frags)) { $take_out_arr[] = $v1; } } } } } reset($_POST); while(list($k,$v)=each($_POST)) { //$db_products_options_ext_id if($subtract_arr[$v]) { $tmp = $subtract_arr[$v]; $frags = array(); $frags = explode(",",$tmp); while(list($k1,$v1)=each($frags)) { $take_out_arr[] = $v1; } } } reset($_POST); while(list($k,$v)=each($_POST)) { if(in_array($v, $take_out_arr)) { $$k = ""; $q = "SELECT options_ext_name,products_options_id FROM ACU_products_options_ext WHERE products_options_ext_id='$v'"; $results = mysqli_query($connection,$q); $row = mysqli_fetch_array($results); extract($row); $q = "SELECT options_name FROM ACU_products_options WHERE products_options_id='$products_options_id'"; $results = mysqli_query($connection,$q); $row = mysqli_fetch_array($results); extract($row); $options_ext_name = trim($options_ext_name); $current_selections[$products_options_id] = $options_ext_name; $this_id = str_replace("selected_","",$k); $q = "SELECT products_options_ext_id,options_ext_name from ACU_products_options_ext where products_options_id='$this_id' AND options_ext_name='$options_ext_name' and products_options_ext_id!='$v' and active='Y'"; //print "$q
"; $results = mysqli_query($connection,$q); while ($row = mysqli_fetch_array($results)) { $tmp = $row['products_options_ext_id']; $options_ext_name = $row['options_ext_name']; $finaltmp .= "$tmp,"; } $finaltmp = substr($finaltmp,0,-1); if($finaltmp) { $name = "selected_$this_id"; #print "$name = $finaltmp ($options_ext_name)
"; $$name = $finaltmp; } } } $q = "SELECT * FROM ACU_products where products_id='$products_id'"; $results = mysqli_query($connection,$q); $row = mysqli_fetch_array($results); extract($row); if($sale_price > 0) { if(!$sale_perc) { $real_price = $retail_price; $retail_price = $sale_price; } } $i = 0; $q = "SELECT * FROM ACU_products_options WHERE active='Y' AND products_id='$products_id' ORDER BY order_placement"; $results = mysqli_query($connection,$q); while ($row = mysqli_fetch_array($results)) { $db_products_options_id = $row["products_options_id"]; $db_options_name = $row["options_name"]; $db_helpcopy = $row["helpcopy"]; $this_var_is_qty = "n"; if($db_options_name == "Quantity") { $this_var_is_qty = "y"; $display_units = "y"; } $current_options_ext_name = $current_selections[$db_products_options_id]; $q2 = "SELECT * FROM ACU_products_options_ext WHERE active='Y' AND products_options_id='$db_products_options_id' ORDER BY order_placement"; $results2 = mysqli_query($connection,$q2); if(mysqli_num_rows($results2) > 0) { $name = "selected_$db_products_options_id"; $tmp = $$name; $html.= ""; $html.= "
$db_options_name "; if($db_helpcopy) $html.= ""; $html.= "
"; $html.= ""; $html.= ""; $html.= ""; $html.= ""; $html.= ""; } } //END if ($do == "addtocart" && $submit_x) { include_once("cart.php"); die(); } include_once("auth.inc"); $printed_category_array = array(); function print_categories($cc_categories_id) { global $printed_category_array; $q = "SELECT * FROM ACU_categories where categories_id='$cc_categories_id'"; $results = mysqli_query($connection,$q); $row = mysqli_fetch_array($results); $printed_category_array[$cc_categories_id] = $row["category"]; $parent_categories_id = $row["parent_categories_id"]; if ($parent_categories_id > 0) print_categories($parent_categories_id); return $printed_category_array; } $return_page = "products.php"; include_once("topnav.inc"); ?>


"; $found = "y"; } if($found == "n") $photo_string = ""; print $photo_string; //TEMPLATES echo ""; echo "
"; $q = "SELECT * FROM ACU_products_files WHERE products_id='$products_id' AND template=1"; $res = mysqli_query($connection,$q); while($row = mysqli_fetch_array($res)) { extract($row); $file = "docs/template-$products_files_id.$suffix"; if(is_file($file)) { if (is_file("productphotos/$products_id-2-og.jpg")) { $pic = "productphotos/$products_id-2-og.jpg"; echo "
"; } echo "
Download Template
"; } } echo "
"; $q = "SELECT * FROM ACU_products_files WHERE products_id='$products_id' AND template=2"; $res = mysqli_query($connection,$q); while($row = mysqli_fetch_array($res)) { extract($row); $file = "docs/template-$products_files_id.$suffix"; if(is_file($file)) { if (is_file("productphotos/$products_id-3-og.jpg")) { $pic = "productphotos/$products_id-3-og.jpg"; echo "
"; } echo "
Download Template
"; } } echo "
"; $q = "SELECT * FROM ACU_products_files WHERE products_id='$products_id' AND template=3"; $res = mysqli_query($connection,$q); while($row = mysqli_fetch_array($res)) { extract($row); $file = "docs/template-$products_files_id.$suffix"; if(is_file($file)) { if (is_file("productphotos/$products_id-4-og.jpg")) { $pic = "productphotos/$products_id-4-og.jpg"; echo "
"; } echo "
Download Template
"; } } echo "
"; //END ?>

"; $total_cost = $retail_price + $total_amount_extra; if($total_percentage) { $extra_cost = $total_cost * $total_percentage; $total_cost = $total_cost + $extra_cost; } $display_total_cost = number_format($total_cost,2); $show_now = "N"; if($sale_perc) { $show_now = "Y"; $display_total_cost = str_replace(",","",$display_total_cost); $sale_perc = $sale_perc / 100; $discount_off = $display_total_cost * $sale_perc; $sale_price = $display_total_cost - $discount_off; $diff = $display_total_cost - $sale_price; $price_html.= "   Reg: \$$display_total_cost"; $price_top.= "   Reg: \$$display_total_cost"; $display_total_cost = $display_total_cost - $diff; $total_cost = $total_cost - $diff; $display_total_cost = number_format($display_total_cost,2); } else { if($real_price) { $show_now = "Y"; $display_total_cost = str_replace(",","",$display_total_cost); $sale_price = str_replace(",","",$sale_price); $real_price = str_replace(",","",$real_price); $diff = $real_price - $sale_price; $display_orig = $display_total_cost + $diff; $display_orig = number_format($display_orig,2); $price_html.= "   Reg: \$$display_orig"; $price_top.= "   Reg: \$$display_orig"; } } $total_cost = round($total_cost,2); if ($show_now == "Y") $price_html.= "
"; $price_html.= "   "; if ($show_now == "Y") $price_html.= " Now: "; $price_html.= "\$$display_total_cost
"; if($number_units) { $per_unit = $total_cost / $number_units; $per_unit = number_format($per_unit,2); $price_html.= "   Per Unit Cost: \$$per_unit"; } $price_html.= "

"; if ($show_now == "Y") $price_top .= "
"; $price_top.= "   "; if ($show_now == "Y") $price_top.= " Now: "; $price_top.= "\$$display_total_cost

"; ?>


  Shipping Estimate



Share This Estimate