'Store Default'"); // if orderby isn't set in the category, grab it from the product if (!$orderby) $orderby = $SC['settings']['Order_Products_By']; // if not set at category OR product, then set it to "Name" if(!$orderby || $orderby == "null") $orderby = "Name"; // grab the settings for ordering products from the category if (!$orderhow) $orderhow = @get_field_val("Categories","Order_Products_How","record_number = $cat_rn AND Order_Products_How <> 'Store Default'"); // if orderhow isn't set in the category, grab it from the product if (!$orderhow) $orderhow = $SC['settings']['Order_Products_How']; if($orderhow) { if ($orderhow == "Ascending") $orderhow = "ASC"; if ($orderhow == "Descending") $orderhow = "DESC"; } else { $orderhow = "ASC"; } // if random is set, then we need to grab a random subset of the existing product records....need to unset limit, grab random records from result of all products, and return that array if ($random && isset($limit)) { $random_limit = str_replace("LIMIT 0,","",$limit) + 1; unset($limit); } // if out of stock items are set to not be displayed in store settings if($SC['inventory_control'] && $SC['out_of_stock_behavior'] == "1") { $products = sc_query( "SELECT prod.record_number, cat.record_number AS Category FROM Products prod INNER JOIN REL_Products__Categories rel_p_c ON rel_p_c.Products_rn = prod.record_number INNER JOIN Categories cat ON rel_p_c.Categories_rn = cat.record_number INNER JOIN REL_Products__Warehouses rel_p_w ON rel_p_w.Products_rn = prod.record_number WHERE cat.record_number = $cat_rn AND rel_p_w.Stock > 0 $exclude GROUP BY rel_p_w.Products_rn ORDER BY prod.$orderby $orderhow $limit", MYSQL_BOTH,1); } else { $products = sc_query( "SELECT prod.record_number, cat.record_number AS Category FROM Categories cat, Products prod, REL_Products__Categories rel_p_c WHERE cat.record_number = rel_p_c.Categories_rn AND prod.record_number = rel_p_c.Products_rn AND cat.record_number = $cat_rn AND prod.Not_For_Sale != 1 $exclude ORDER BY prod.$orderby $orderhow $limit", MYSQL_BOTH,1); } if ($random) { $prod_count = count($products); // if less products are returned then the limit, then use the number of products as the limit for generating random numbers if ($prod_count < $random_limit) $random_limit = $prod_count; $prod_rns = array(); // loop while the number of random prod rns is less than what we need while(count($prod_rns) < $random_limit) { $rand = rand(0,$prod_count-1); if (!in_array($rand,$prod_rns)) $prod_rns[] = $rand; } // grab the products randomly from the original products array foreach($prod_rns as $prod_rn) $random_products[] = $products[$prod_rn]; return $random_products; } return $products; } ?>
"; $data = inputs2array($html); // now, data looks like this: // $data['fname'] == 'Fred'; // $data['lname'] == 'Flintstone'; Function returns false on error, or if there are no matches **************************************************************************************************************/ function inputs2array($html) { // make sure we have input! if (!$html) return false; // pull out the field names and values from the input tags :) preg_match_all("/< ?input[^>]+name ?= ?['|\"]([^>'\"]+)['|\"][^>]+value ?= ?['|\"]([^>'\"]+)['|\"][^>]+>/",$html,$matches); // see if there were any matches. index 1 has the entire field. 2 has the field names, 3 has the field values. if (is_array($matches[1])) { // grab the arrays we need, to make the for loop a little more readable $fnames =& $matches[1]; $values =& $matches[2]; for($x=0;$fnames[$x];$x++) { $data[$fnames[$x]] = $values[$x]; } return $data; } else { return false; } } ?>Query from count_records(): $query
"; } else { $result = mysql_query ($query); if (is_resource($result)) { while ($row = mysql_fetch_array ($result)) { $records[] = $row; } return $records[0][0]; } else { return 0; } } } ?>Query from get_sum(): $qry
"; } else { $result = mysql_query($qry); if (is_resource($result)) { while ($row = mysql_fetch_array ($result)) { $records[] = $row; } return $records[0][0]; } } } ?>Payment Gateways cannot be edited in demo mode."; return; } elseif ($table == 'Payment_Gateways') { // this code will disable all payment gateways IF one is being enabled. This will keep the cart from allowing // more than one enabled gateway if ($data['Enabled'] == 1) sc_query('UPDATE Payment_Gateways SET Enabled = 0'); } if ($SC['demo_mode']) { // deal with Nav Blocks in demo mode if ($table == 'Navigation_Block') { // remove Show_When from data...it's off limits unset($data['Show_When']); // if content has PHP in it, wipe it out if (strstr($data['Content'],'Field Sets cannot be added in demo mode."; return; } elseif ($table == 'Field_Definition') { print "
Field Definitions cannot be added in demo mode.
"; return; } } // $data must be an array...if it's not...bail if (!is_array($data)) return; // make sure record exists before we try to update it! $existing_record = get_field_val($table,"record_number",$where); if (isset($existing_record)) { foreach(array_keys($data) as $field_name) { $data[$field_name] = sc_mysql_escape($data[$field_name]); // if set string isn't set, set it....else append with a comma in between if (!$set_string) { $set_string = "`$field_name` = '$data[$field_name]'"; } else { $set_string = "$set_string, `$field_name` = '$data[$field_name]'"; } } $query = "UPDATE $table SET $set_string WHERE $where"; if ($test) print "$query
"; mysql_query($query) or sc_show_diag("Query Failed: ". mysql_error()); } } ?> and tags // $height - height of popup // $width - width of popup // $scrollbars - set to 'yes' or 'no' // $resizable - set to 'yes' or 'no' // // File modified on 03/08/2005 - bug fix for problems causing the JS Popup function to not appear function Popup_Window($page, $link_content, $width, $height, $scrollbars, $resizable,$class="product_options_details_link"){ return "$link_content"; } ?> Number of elements in array: ".count($array)." Key Value "; foreach(array_keys($array) as $key) { print " $key "; if (is_array($array[$key])) { sc_print_array($array[$key]); } else { print $array[$key]; } print " "; } print ""; } } ?>"; } ?>"; if ($return_var) { return $stylesheet; } else { print $stylesheet; } } ?> $value) { if (is_array($data[$key])) { $data[$key] = urlencode_all($data[$key]); } else { $data[$key] = urlencode($data[$key]); } } return $data; } ?> 0 GROUP BY ps.Product_rn ORDER BY ps.Quantity DESC LIMIT 0,$result_qty "; } else { $qry = " SELECT ps.Product_rn ,p.* FROM Products_Sold ps LEFT JOIN Products p ON p.record_number = ps.Product_rn WHERE p.record_number != 432 AND p.Not_For_Sale != 1 ORDER BY ps.Quantity DESC LIMIT 0,$result_qty "; } return sc_query($qry,MYSQL_ASSOC,1); } ?>"; // for each possible value of $basis, determine number of times this discount has been used, and store in $total_used if ($basis == "order") { if ($SC['order']) { // loop through items in order for($x=0;$SC['order'][$x];$x++) { $item = $SC['order'][$x]; if ($item['discount']['rn'] == $discount['rn']) { $total_used = $total_used + $item['discount']['use_count']; } } } else { $total_used = 0; } } // check $total_used against $limit, and alter discount accordingly if ($total_used > $limit) { //print "here..............
"; } return $discount; } ?>Powered by Squirrelcart PHP Shopping Cart Software"; } else { $image_tag = @get_image("Cart_Images","powered by sc $logo",0,0,0,"Powered by Squirrelcart PHP Shopping Cart Software"); if (!$image_tag) { // image was uploaded, but never added to the cart images table....add it below $data['Name'] = "powered by sc $logo"; $data['Image'] = "squirrelcart/images/cart/powered_by_sc_".$logo.".gif"; @add_record("Cart_Images",$data); $image_tag = get_image("Cart_Images","powered by sc $logo",0,0,0,"Powered by Squirrelcart PHP Shopping Cart Software"); } $sc_logo = "$image_tag

"; } print $sc_logo; } ?>
Fatal error: Call to undefined function get_tables() in /var/www/vhosts/handmadebymachine.com/httpdocs/store/squirrelcart/functions/common/mysql/sc_db_connect.func.php on line 69