array( 'path' => 'images/brands', 'width' => 115, 'height' => 115, 'forced' => false, 'fixed' => 3) ); // Styles define('STYLES_ENABLED', false); // image settings define('IMAGES_MAX', 5); define('IMAGES_ZOOM', false); $staff_images = array( 'small' => array( 'path' => 'images/staff', 'width' => 95, 'height' => 95, 'forced' => false, 'fixed' => 3) ); // hide products define('PRODUCTS_HIDDEN', false); // complimented items define('COMPLIMENTED_MAX', 3); define('DELIVERY_HEAVY', false); // browse settings define("MAX_PER_PAGE", 15); //16 define('MAX_PER_ROW', 4); // item settings define('ITEMS_SIZES', true); define('ITEMS_HIDDEN', false); define('ITEMS_ORGPRICE', false); define('ITEMS_CODE', false); define('ITEMS_STOCK', true); define('ITEMS_INSTORE', false); define('SIZE_PRICES_ENABLED', true); define('FRONTPAGE_ITEMS', 8); define('FRONTPAGE_FEATURED_PRODUCTS', 8); define('FRONTPAGE_FEATURED_BRANDS', 16); define('FRONTPAGE_BRANDS_COLS', 1); // shop order status $orders_statuses=array(0 => 'Order Received', 1 => 'Payment Accepted', 2 => 'Payment Rejected', 3 => 'Picked', 4 => 'Posted', 5 => 'Out of Stock', 6 => 'Refunded'); //NEWS define('NEWS_ENABLED', true); define('ADMIN_NEWS_ITEMS_PER_PAGE', 25); define('NEWS_IMAGES', 1); define('BLOGS_ENABLED', false); define('TESTIMONIALS_ENABLED', false); //Size Guide Settings define('SIZE_GUIDE_ENABLED', true); define('FILE_MAX', '10mb'); //E-mail Marketing Suite Settings define('EZINE_ENABLED', true); define('EZINE_ENABLED_ADV', true); define('EZINE_NOTIFY_LOCATION', SITE_URL."/email.tracking.php"); define('EZINE_SENDMAIL', "/usr/sbin/sendmail"); define('EZINE_RETURN_ADDRESS', "rejected@jelli.co.za"); define('EZINE_COMPANYNAME', 'Jelli'); define('EZINE_MAIL_FROM', "noreply@jelli.co.za"); define('EZINE_BOUNCED_ENABLED', false); define('EZINE_BOUNCED_MAX', 5); define('EZINE_BATCH_SIZE', 5000); define('EZINE_TINY', false); define('EZINE_HTML', false); define('EZINE_EZINE', true); define('EZINE_MAX_PRODUCT', 3); $product_images = array( 'tiny' => array( 'path' => 'shop/images/products/tiny', 'width' => 31, 'height' => 31 ), 'mini' => array( 'path' => 'images/products/mini', 'width' => 70, 'height' => 70 ), 'small' => array( 'path' => 'shop/images/products/small', 'width' => 69, 'height' => 65, 'fixed' => 1 ), 'browse' => array( 'path' => 'shop/images/products/browse', 'width' => 215, 'height' => 210, 'fixed' => 1 ), 'medium' => array( 'path' => 'shop/images/products/medium', 'width' => 410, 'height' => 800, 'fixed' => 0 ), 'large' => array( 'path' => 'shop/images/products/large', 'width' => 525, 'height' => 9000, 'fixed' => 0 ), 'zoom' => array( 'path' => 'shop/images/products/zoom', 'width' => 1400, 'height' => 1400 ) ); define('PAF_ENABLED', false); define('ENABLE_CURRENCIES', false); name=MYSQL_DB; $this->host=MYSQL_HOST; $this->username=MYSQL_USER; $this->password=MYSQL_PASS; $this->connection(); mysql_set_charset('utf8', $this->mysql_link); } function connection() { $this->mysql_link=mysql_connect($this->host,$this->username,$this->password); mysql_select_db($this->name, $this->mysql_link); } function query($sql_query) { $this->sql_query=$sql_query; $this->sql_result=mysql_query($this->sql_query); $this->error=mysql_error(); if (!$this->sql_result && DEV_MODE == true) {echo "" . $sql_query . "

"; $this->error=mysql_error(); echo $this->error; } //echo mysql_error(); } function num_rows() { $mysql_rows = mysql_num_rows( $this->sql_result ); return $mysql_rows; } function fetch_array() { if ( $this->num_rows() > 0 ) { $mysql_array = mysql_fetch_array( $this->sql_result ); if (!is_array( $mysql_array )) { return FALSE; } return $mysql_array; } } function insert_id() { return mysql_insert_id(); } } ?>'; print_r($str); echo ''; } function pagination($total, $per_page, $page, $start){ $requiredPages = ceil($total/$per_page); $whichPage= $start/$per_page+1; $start = "-".$per_page; echo ""; } function clean_value_dot($input) { $counter=0; while($counter0) { $newarray= preg_grep("([a-zA-Z0-9_-])", $array); } if(sizeof($newarray)>0) { foreach ($newarray as $a) { $output.=$a; } } return $output; } function is_sub_category($parent) { $subcat = new sql(); $subcat->query("SELECT id FROM categories WHERE sub_id = $parent"); $id = array(); if ($subcat->num_rows() > 0) { $i = 1; while ($data = $subcat->fetch_array()) { $id[$i] = $data['id']; $i++; } return $id; } else { return $id; } } function clean_image_value($input) { $counter=0; while($counter0) { $newarray= preg_grep("([a-zA-Z0-9_.])", $array); } if(sizeof($newarray)>0) { foreach ($newarray as $a) { $output.=$a; } } return $output; } function get_image_size($folder,$pic) { $command=IMAGE_IDENTIFY . ' ' . SITE_PATH . '/' . $folder . '/' . $pic; //echo $command; $details=shell_exec($command); //echo $details; $array=split(" ", $details); $resolution=$array[2]; //echo $resolution; $array=split("x", $resolution); $array2['width']=$array[0]; $array2['height']=$array[1]; return $array2; } function image_resize($width, $height, $folder, $pic) { $command=IMAGE_MOGRIFY . " -resize " . $width . 'x' . $height . ' ' . SITE_PATH . '/' . $folder .'/' .$pic; // echo $command."\n"; exec($command, $result); } function image_colorspace($folder, $pic, $colorspace = "RGB") { $command=IMAGE_MOGRIFY . " -colorspace $colorspace " . SITE_PATH . '/' . $folder .'/' .$pic; //echo $command; exec($command, $result); } function image_crop($folder, $pic, $width, $height, $x, $y) { $command=IMAGE_MOGRIFY ." -crop ${width}x${height}+${x}+${y} " . SITE_PATH .'/'. $folder . $pic; //echo $command; shell_exec($command); } function image_crop_centercrop($folder, $pic, $width, $height, $x, $y) { $command=IMAGE_MOGRIFY ." -gravity center -crop ${width}x${height}+${x}+${y} " . SITE_PATH .'/'. $folder . $pic; //echo $command; shell_exec($command); } function clean_db($text) { return mysql_real_escape_string($text); } /* function clean_page($text) { return htmlentities(convert_smart_quotes(stripslashes($text))); } */ function clean_page($text) { //return htmlentities(stripslashes($text)); return htmlentities(convert_smart_quotes(stripslashes($text)), ENT_COMPAT, 'utf-8'); } function convert_smart_quotes($string) { $search = array(chr(145), chr(146), chr(147), chr(148), chr(151)); $replace = array("'", "'", '"', '"', '-'); return str_replace($search, $replace, $string); } function format_page($text) { return str_replace("\n", "
",htmlentities(stripslashes($text))); } function validate_email($email) { if(eregi("^[a-z0-9\._-]+@+[a-z0-9\._-]+\.+[a-z]{2,4}$", $email)) return TRUE; else return FALSE; } function print_formatted_array($array) { echo '
';
	echo print_r($array);
	echo '
'; echo '
'; } function cat_has_items($id) { $db = new sql(); $db->query("SELECT * FROM items_categories WHERE cat_id = $id AND item_id IN (SELECT id FROM items WHERE id>0 AND hidden = 0)"); if ($db->num_rows()>0) { return true; } else { return false; } } function brand_has_items($id) { $db = new sql(); $db->query("SELECT * FROM items_brands WHERE brand_id = $id AND item_id IN (SELECT id FROM items WHERE id>0 AND hidden = 0)"); if ($db->num_rows()>0) { return true; } else { return false; } } function category_data($catid) { $db = new sql(); $db->query("SELECT * FROM categories WHERE id='$catid'"); if($db->num_rows()>0) { return $db->fetch_array(); } else { return ""; } } function start_tracking() { if($_REQUEST['ref']!='' ) { setcookie("ref", $_REQUEST['ref'], time()+(2600*24*30*6), "/"); $_COOKIE['ref']=$_REQUEST['ref']; $parse = parse_url($_SERVER['HTTP_REFERER']); $se = $parse["host"]; $raw_var = explode("&", $parse["query"] ); foreach ($raw_var as $one_var) { $raw = explode("=", $one_var); $var[$raw[0]] = urldecode ($raw[1]); } $se = explode (".", $se); switch ($se[1]) { case 'yahoo': $keywords = $var['p']; break; case 'aol': $keywords = $var['query']; break; default: $keywords = $var['q']; } if($keywords!='') { setcookie("keywords", $keywords, time()+(2600*24*30*6), "/"); $_COOKIE['keywords']=$keywords; } //echo ""; } } function track ($type, $value) { $site='number8'; if($_COOKIE['ref']!='') { $url="http://projects.mtcserver.com/tracking/log.php"; $url.="?ip=" . urlencode($_SERVER['REMOTE_ADDR']); $url.="&site=" . urlencode($site); $url.="&type=" . urlencode($type); $url.="&campaign=" . urldecode($_COOKIE['ref']); $url.="&keywords=" . urlencode($_COOKIE['keywords']); $url.="&value=" . urlencode($value); $fh=fopen($url, 'r'); $test=fgetc($fh); fclose($fh); } } function size_details($id) { $db = new sql(); $db->query("SELECT * FROM items_sizes WHERE uniqueid='$id'"); return $db->fetch_array(); } function process_size($size, $item_id) { $db = new SQl; $db->query("SELECT * FROM items_sizes WHERE id='" . $size['itemID'] ."' AND item_id='" .$item_id."'"); if($size['style_value_1']!='' && $size['style_value_2']!='') { $sizename=$size['style_value_1'] . " / " . $size['style_value_2']; } else if($size['style_value_1']!='') { $sizename=$size['style_value_1']; }else if($size['style_value_2']!='') { $sizename=$size['style_value_2']; } // $db->query("UPDATE items_sizes SET stock = 0 WHERE id='" . $size['itemID'] ."'"); if($db->num_rows() > 0) { if($size['prodID'] > 0) { echo "updating " . $sizename . "
"; $sql = "UPDATE items_sizes SET `stock`='" . $size['stock_level'] ."', `price`='" . $size['price_web'] ."', `price_rrp`='" . $size['price_rrp'] ."', `vatID`='" . $size['vatID'] ."', `style_1`='" . clean_db($size['style_name_1']) ."', `style_1_value`='" . clean_db($size['style_value_1']) ."', `style_2`='" . clean_db($size['style_name_2']) ."', `style_2_value`='" . clean_db($size['style_value_2']) ."', `name`='" . clean_db($size['item_name']) ."', `barcode`='" . clean_db($size['barcode']) ."', `ref`='" . clean_db($size['itemRef']) ."', `available`='" .$size['available'] ."', `size`='$sizename' WHERE id='" . $size['itemID'] ."'"; if($size['itemID'] == '58878' || $size['itemID'] == '58879' || $size['itemID'] == '58880' || $size['itemID'] == '58881') echo str_replace(array("\r\n", "\r", "\n", "\t"), '', $sql) . "\n"; $db->query($sql); } } else { if($size['prodID'] > 0) { $sql = "INSERT INTO items_sizes (`uniqueid`, `id`, `item_id`, `stock`, `price`, `price_rrp`, `vatID`, `style_1`, `style_1_value`, `style_2`, `style_2_value`, `name`, `barcode`, `ref`, `available`, `size`) VALUES ('', '" .$size['itemID']."', '" . $item_id ."', '" . $size['stock_level'] ."', '" . $size['price_web'] ."', '" . $size['price_rrp'] ."', '" . $size['vatID'] . "', '" . clean_db($size['style_name_1']) ."', '" . clean_db($size['style_value_1']) ."', '" . clean_db($size['style_name_2']) ."', '" . clean_db($size['style_value_2']) ."', '" . clean_db($size['item_name']) ."', '" . clean_db($size['barcode']) ."', '" . clean_db($size['itemRef']) ."', '" .$size['available'] ."', '" . clean_db($sizename) ."' )"; if($size['itemID'] == '58878' || $size['itemID'] == '58879' || $size['itemID'] == '58880' || $size['itemID'] == '58881') echo str_replace(array("\r\n", "\r", "\n", "\t"), '', $sql) . "\n"; $db->query($sql); } } } function get_product_image($type = "", $filename = ""){ /* deliver.php?time=1714436151&v=b8c2b2584857153b468ed5338ca57102ebb52d2e&type=medium&file=1317126787_PCB047-01.jpg */ if($type != "" && $filename != "") { $type = urlencode($type); $filename = urlencode($filename); $time = time(); $enctime = sha1($time) ; $return = SITE_URL."/images/deliver.jpg?time=$time&v=$enctime&type=$type&file=$filename"; // $return = SITE_URL."images/deliver.php?time=".time()."&v="sha1(time())."&type=".urlencode($type)."&file=".urlencode($filename); return $return; } } // BLOG FUNCTIONS function clean_value_spaces($input, $dot = false) { $counter=0; while($counter0) { if($dot) { $newarray= preg_grep("([.a-zA-Z0-9_-])", $array); } else { $newarray= preg_grep("([a-zA-Z0-9_-])", $array); } } if(sizeof($newarray)>0) { foreach ($newarray as $a) { $output.=$a; }} return $output; } function validate_date($date) { $arr=split("/",$date); // splitting the array $dd=$arr[0]; $mm=$arr[1]; // first element of the array is month // second element is date $yy=$arr[2]; // third element is year if($dd=='' || !is_numeric($dd)) $dd=0; if($mm=='' || !is_numeric($mm)) $mm=0; if($yy=='' || !is_numeric($yy) ) $yy=0; try { //echo "comparing:" . $mm ." " . $dd ." " . $yy; if(checkdate($mm,$dd,$yy)){ return true; }else { return false; } } catch (Exception $e) { echo "Exception:" . $e . "
"; return false; } } function format_page_htmlallowed($text) { //return str_replace("\n", "
", stripslashes($text)); return stripslashes($text); } function date_print($date) { $date=date_convert_db_to_dmy($date); if(validate_date($date)) { echo $date; } else { echo "dd/mm/yyyy"; } } function date_convert_db_to_dmy($date) { $array = explode("-", $date); return $array[2] . "/" . $array[1] . "/" . $array[0]; } function date_convert_dmy_to_db($date) { $array = explode("/", $date); return $array[2] . "-" . $array[1] . "-" . $array[0]; } function curPageName() { return substr($_SERVER["SCRIPT_NAME"],strrpos($_SERVER["SCRIPT_NAME"],"/")+1); } function p($t, $striptags=false, $htmlentities=false) { $t = stripslashes($t); if ($striptags)$t = strip_tags($t); if($htmlentities) $t = htmlentities($t, ENT_QUOTES); return $t; } /* * Run the sync between products and EPOS. */ function run_epos() { set_time_limit(180); $db = new sql(); $db2 = new sql(); // Update Main Item Prices && Stock $query = "SELECT `code`, SUM(`quantity`) as `quantity`, `price` FROM `epos_pastel` WHERE `price` > 0 AND `code` != '' AND `code` IN (SELECT `code` FROM `items`) GROUP BY `code`"; $db->query($query); // echo($query."
"); if ($db->num_rows() > 0) { while ($row = $db->fetch_array()) { $query = "UPDATE `items` SET `stock` = '%d' , `price` = '%.2f' WHERE `code` = '%s'"; $query = sprintf($query, $row['quantity'], $row['price'], $row['code']); // echo($query."
"); $db2->query($query); } } // Update Sizes $query = 'SELECT `items`.`id` as `item_id`, `items`.`price` as `item_price`, `epos_pastel`.* FROM `items` LEFT JOIN `epos_pastel` ON `items`.`code` = `epos_pastel`.`code` WHERE `epos_pastel`.`pastel_code` IS NOT NULL AND `epos_pastel`.`price` > 0'; $db->query($query); // echo($query); if ($db->num_rows() > 0) { while ($row = $db->fetch_array()) { $query = "SELECT `id` from `items_sizes` WHERE `item_id` = '%d' AND `size_code` = '%s'"; $query = sprintf($query, $row['item_id'], $row['pastel_code']); $db2->query($query); if($row['item_price'] == $row['price']) { $row['price'] = 0; } if ($db2->num_rows() > 0) { // UPDATE if exists $size_id = $db2->fetch_array(); $size_id = $size_id['id']; $query = "UPDATE `items_sizes` SET `stock` = '%d', `price` = '%.2f', `barcode` = '%s' WHERE `id` = '%d'"; $query = sprintf($query, $row['quantity'], $row['price'], clean_db($row['barcode']), $size_id); //echo($query."
"); $db2->query($query); } else { $query = "SELECT `id`, `title` FROM `epos_pastel` WHERE `code` = '%s'"; $query = sprintf($query, $row['code']); $db2->query($query); if($db2->num_rows() > 1) { // ADD if doesn't exist and MORE than 1 of the size. $query = "INSERT INTO `items_sizes` SET `id` = `uniqueid`, `item_id` = '%d', `size_code` = '%s', `stock` = '%d', `price` = '%.2f', `barcode` = '%s', `size` = '%s'"; $query = sprintf($query, $row['item_id'], $row['pastel_code'], $row['quantity'], $row['price'], clean_db($row['barcode']), clean_db($row['title'])); //echo($query."
"); $db2->query($query); $query = 'UPDATE `items_sizes` SET `id` = %d WHERE `uniqueid` = %d'; $query = sprintf($query, $db2->insert_id(), $db2->insert_id()); $db2->query($query); } } } } } 'United Kingdom', 'AF' => 'Afghanistan', 'AL' => 'Albania', 'DZ' => 'Algeria', 'AS' => 'American Samoa', 'AD' => 'Andorra', 'AO' => 'Angola', 'AI' => 'Anguilla', 'AQ' => 'Antarctica', 'AG' => 'Antigua and Barbuda', 'AR' => 'Argentina', 'AM' => 'Armenia', 'AW' => 'Aruba', 'AU' => 'Australia', 'AT' => 'Austria', 'AZ' => 'Azerbaijan', 'BS' => 'Bahamas', 'BH' => 'Bahrain', 'BD' => 'Bangladesh', 'BB' => 'Barbados', 'BY' => 'Belarus', 'BE' => 'Belgium', 'BZ' => 'Belize', 'BJ' => 'Benin', 'BM' => 'Bermuda', 'BT' => 'Bhutan', 'BO' => 'Bolivia', 'BA' => 'Bosnia and Herzegovina', 'BW' => 'Botswana', 'BV' => 'Bouvet Island', 'BR' => 'Brazil', 'IO' => 'British Indian Ocean Territory', 'BN' => 'Brunei Darussalam', 'BG' => 'Bulgaria', 'BF' => 'Burkina Faso', 'BI' => 'Burundi', 'KH' => 'Cambodia', 'CM' => 'Cameroon', 'CA' => 'Canada', 'CV' => 'Cape Verde', 'KY' => 'Cayman Islands', 'CF' => 'Central African Republic', 'TD' => 'Chad', 'CL' => 'Chile', 'CN' => 'China', 'CX' => 'Christmas Island', 'CC' => 'Cocos (Keeling) Islands', 'CO' => 'Colombia', 'KM' => 'Comoros', 'CG' => 'Congo', 'CK' => 'Cook Islands', 'CR' => 'Costa Rica', 'CS' => 'country.CS', 'HR' => 'Croatia', 'CU' => 'Cuba', 'CY' => 'Cyprus', 'CZ' => 'Czech Republic', 'CI' => "Côte d'Ivoire", 'DK' => 'Denmark', 'DJ' => 'Djibouti', 'DM' => 'Dominica', 'DO' => 'Dominican Republic', 'TP' => 'East Timor', 'EC' => 'Ecuador', 'EG' => 'Egypt', 'SV' => 'El salvador', 'GQ' => 'Equatorial Guinea', 'ER' => 'Eritrea', 'EE' => 'Estonia', 'ET' => 'Ethiopia', 'FK' => 'Falkland Islands', 'FO' => 'Faroe Islands', 'FJ' => 'Fiji', 'FI' => 'Finland', 'FR' => 'France', 'GF' => 'French Guiana', 'PF' => 'French Polynesia', 'TF' => 'French Southern Territories', 'GA' => 'Gabon', 'GM' => 'Gambia', 'GE' => 'Georgia', 'DE' => 'Germany', 'GH' => 'Ghana', 'GI' => 'Gibraltar', 'GR' => 'Greece', 'GL' => 'Greenland', 'GD' => 'Grenada', 'GP' => 'Guadeloupe', 'GU' => 'Guam', 'GT' => 'Guatemala', 'GN' => 'Guinea', 'GW' => 'Guinea-Bissau', 'GY' => 'Guyana', 'HT' => 'Haiti', 'HM' => 'Heard Island and McDonald Islands', 'VA' => 'Holy See (Vatican City State)', 'HN' => 'Honduras', 'HK' => 'Hong Kong', 'HU' => 'Hungary', 'IS' => 'Iceland', 'IN' => 'India', 'ID' => 'Indonesia', 'IR' => 'Iran', 'IQ' => 'Iraq', 'IE' => 'Ireland', 'IL' => 'Israel', 'IT' => 'Italy', 'JM' => 'Jamaica', 'JP' => 'Japan', 'JO' => 'Jordan', 'KZ' => 'Kazakstan', 'KE' => 'Kenya', 'KI' => 'Kiribati', 'KW' => 'Kuwait', 'KG' => 'Kyrgystan', 'LA' => 'Lao', 'LV' => 'Latvia', 'LB' => 'Lebanon', 'LS' => 'Lesotho', 'LR' => 'Liberia', 'LY' => 'Libyan Arab Jamahiriya', 'LI' => 'Liechtenstein', 'LT' => 'Lithuania', 'LU' => 'Luxembourg', 'MO' => 'Macau', 'MK' => 'Macedonia (FYR)', 'MG' => 'Madagascar', 'MW' => 'Malawi', 'MY' => 'Malaysia', 'MV' => 'Maldives', 'ML' => 'Mali', 'MT' => 'Malta', 'MH' => 'Marshall Islands', 'MQ' => 'Martinique', 'MR' => 'Mauritania', 'MU' => 'Mauritius', 'YT' => 'Mayotte', 'MX' => 'Mexico', 'FM' => 'Micronesia', 'MD' => 'Moldova', 'MC' => 'Monaco', 'MN' => 'Mongolia', 'MS' => 'Montserrat', 'MA' => 'Morocco', 'MZ' => 'Mozambique', 'MM' => 'Myanmar', 'NA' => 'Namibia', 'NR' => 'Nauru', 'NP' => 'Nepal', 'NL' => 'Netherlands', 'AN' => 'Netherlands Antilles', 'NC' => 'New Caledonia', 'NZ' => 'New Zealand', 'NI' => 'Nicaragua', 'NE' => 'Niger', 'NG' => 'Nigeria', 'NU' => 'Niue', 'NF' => 'Norfolk Island', 'KP' => 'North Korea', 'MP' => 'Northern Mariana Islands', 'NO' => 'Norway', 'OM' => 'Oman', 'PK' => 'Pakistan', 'PW' => 'Palau', 'PS' => 'Palestinian Territory Occupied', 'PA' => 'Panama', 'PG' => 'Papua New Guinea', 'PY' => 'Paraguay', 'PE' => 'Peru', 'PH' => 'Philippines', 'PN' => 'Pitcairn', 'PL' => 'Poland', 'PT' => 'Portugal', 'PR' => 'Puerto Rico', 'QA' => 'Qatar', 'RE' => 'Reunion', 'RO' => 'Romania', 'RU' => 'Russian Federation', 'RW' => 'Rwanda', 'SH' => 'Saint Helena', 'KN' => 'Saint Kitts and Nevis', 'LC' => 'Saint Lucia', 'PM' => 'Saint Pierre and Miquelon', 'VC' => 'Saint Vincent and the Grenadines', 'WS' => 'Samoa', 'SM' => 'San Marino', 'ST' => 'Sao Tome and Principe', 'SA' => 'Saudi Arabia', 'SN' => 'Senegal', 'SC' => 'Seychelles', 'SL' => 'Sierra Leone', 'SG' => 'Singapore', 'SK' => 'Slovakia', 'SI' => 'Slovenia', 'SB' => 'Solomon Islands', 'SO' => 'Somalia', 'ZA' => 'South Africa', 'GS' => 'South Georgia', 'KR' => 'South Korea', 'ES' => 'Spain', 'LK' => 'Sri Lanka', 'SD' => 'Sudan', 'SR' => 'Suriname', 'SJ' => 'Svalbard and Jan Mayen Islands', 'SZ' => 'Swaziland', 'SE' => 'Sweden', 'CH' => 'Switzerland', 'SY' => 'Syria', 'TW' => 'Taiwan', 'TJ' => 'Tajikistan', 'TZ' => 'Tanzania', 'TH' => 'Thailand', 'TG' => 'Togo', 'TK' => 'Tokelau', 'TO' => 'Tonga', 'TT' => 'Trinidad and Tobago', 'TN' => 'Tunisia', 'TR' => 'Turkey', 'TM' => 'Turkmenistan', 'TC' => 'Turks and Caicos Islands', 'TV' => 'Tuvalu', 'UG' => 'Uganda', 'UA' => 'Ukraine', 'AE' => 'United Arab Emirates', 'US' => 'United States', 'UM' => 'United States Minor Outlying Islands', 'UY' => 'Uruguay', 'UZ' => 'Uzbekistan', 'VU' => 'Vanuatu', 'VE' => 'Venezuela', 'VN' => 'Viet Nam', 'VG' => 'Virgin Islands (British)', 'VI' => 'Virgin Islands (U.S.)', 'WF' => 'Wallis and Futuna Islands', 'EH' => 'Western Sahara', 'YE' => 'Yemen', 'YU' => 'Yugoslavia', 'ZR' => 'Zaire', 'ZM' => 'Zambia', 'ZW' => 'Zimbabwe'); $state_list = array( 'AL'=>"Alabama", 'AK'=>"Alaska", 'AZ'=>"Arizona", 'AR'=>"Arkansas", 'CA'=>"California", 'CO'=>"Colorado", 'CT'=>"Connecticut", 'DE'=>"Delaware", 'DC'=>"District Of Columbia", 'FL'=>"Florida", 'GA'=>"Georgia", 'HI'=>"Hawaii", 'ID'=>"Idaho", 'IL'=>"Illinois", 'IN'=>"Indiana", 'IA'=>"Iowa", 'KS'=>"Kansas", 'KY'=>"Kentucky", 'LA'=>"Louisiana", 'ME'=>"Maine", 'MD'=>"Maryland", 'MA'=>"Massachusetts", 'MI'=>"Michigan", 'MN'=>"Minnesota", 'MS'=>"Mississippi", 'MO'=>"Missouri", 'MT'=>"Montana", 'NE'=>"Nebraska", 'NV'=>"Nevada", 'NH'=>"New Hampshire", 'NJ'=>"New Jersey", 'NM'=>"New Mexico", 'NY'=>"New York", 'NC'=>"North Carolina", 'ND'=>"North Dakota", 'OH'=>"Ohio", 'OK'=>"Oklahoma", 'OR'=>"Oregon", 'PA'=>"Pennsylvania", 'RI'=>"Rhode Island", 'SC'=>"South Carolina", 'SD'=>"South Dakota", 'TN'=>"Tennessee", 'TX'=>"Texas", 'UT'=>"Utah", 'VT'=>"Vermont", 'VA'=>"Virginia", 'WA'=>"Washington", 'WV'=>"West Virginia", 'WI'=>"Wisconsin", 'WY'=>"Wyoming"); $counties = array( "Aberdeenshire"=>"Aberdeenshire", "Angus/Forfarshire"=>"Angus/Forfarshire", "Argyllshire"=>"Argyllshire", "Ayrshire"=>"Ayrshire", "Banffshire"=>"Banffshire", "Bedfordshire"=>"Bedfordshire", "Berkshire"=>"Berkshire", "Berwickshire"=>"Berwickshire", "Blaenau Gwent"=>"Blaenau Gwent", "Bridgend"=>"Bridgend", "Buckinghamshire"=>"Buckinghamshire", "Buteshire"=>"Buteshire", "Caerphilly"=>"Caerphilly", "Caithness"=>"Caithness", "Cambridgeshire"=>"Cambridgeshire", "Cardiff"=>"Cardiff", "Carmarthenshire"=>"Carmarthenshire", "Ceredigion"=>"Ceredigion", "Cheshire"=>"Cheshire", "Clackmannanshire"=>"Clackmannanshire", "Conwy"=>"Conwy", "Cornwall"=>"Cornwall", "Cromartyshire"=>"Cromartyshire", "Cumberland"=>"Cumberland", "Denbighshire"=>"Denbighshire", "Derbyshire"=>"Derbyshire", "Devon"=>"Devon", "Dorset"=>"Dorset", "Dumfriesshire"=>"Dumfriesshire", "Dunbartonshire/Dumbartonshire"=>"Dunbartonshire/Dumbartonshire", "Durham"=>"Durham", "East Lothian"=>"East Lothian", "Essex"=>"Essex", "Fife"=>"Fife", "Flintshire"=>"Flintshire", "Gloucestershire"=>"Gloucestershire", "Gwynedd"=>"Gwynedd", "Hampshire"=>"Hampshire", "Herefordshire"=>"Herefordshire", "Hertfordshire"=>"Hertfordshire", "Huntingdonshire"=>"Huntingdonshire", "Inverness-shire"=>"Inverness-shire", "Isle of Anglesey"=>"Isle of Anglesey", "Kent"=>"Kent", "Kincardineshire"=>"Kincardineshire", "Kinross-shire"=>"Kinross-shire", "Kirkcudbrightshire"=>"Kirkcudbrightshire", "Lanarkshire"=>"Lanarkshire", "Lancashire"=>"Lancashire", "Leicestershire"=>"Leicestershire", "Lincolnshire"=>"Lincolnshire", "Merthyr Tydfil"=>"Merthyr Tydfil", "Middlesex"=>"Middlesex", "Midlothian/Edinburghshire"=>"Midlothian/Edinburghshire", "Monmouthshire"=>"Monmouthshire", "Morayshire"=>"Morayshire", "Nairnshire"=>"Nairnshire", "Neath Port Talbot"=>"Neath Port Talbot", "Newport"=>"Newport", "Norfolk"=>"Norfolk", "Northamptonshire"=>"Northamptonshire", "Northumberland"=>"Northumberland", "Nottinghamshire"=>"Nottinghamshire", "Orkney"=>"Orkney", "Oxfordshire"=>"Oxfordshire", "Peeblesshire"=>"Peeblesshire", "Pembrokeshire"=>"Pembrokeshire", "Perthshire"=>"Perthshire", "Powys"=>"Powys", "Renfrewshire"=>"Renfrewshire", "Rhondda Cynon Taff"=>"Rhondda Cynon Taff", "Ross-shire"=>"Ross-shire", "Roxburghshire"=>"Roxburghshire", "Rutland"=>"Rutland", "Selkirkshire"=>"Selkirkshire", "Shetland"=>"Shetland", "Shropshire"=>"Shropshire", "Somerset"=>"Somerset", "Staffordshire"=>"Staffordshire", "Stirlingshire"=>"Stirlingshire", "Suffolk"=>"Suffolk", "Surrey"=>"Surrey", "Sussex"=>"Sussex", "Sutherland"=>"Sutherland", "Swansea"=>"Swansea", "Torfaen"=>"Torfaen", "Vale of Glamorgan"=>"Vale of Glamorgan", "Warwickshire"=>"Warwickshire", "West Lothian/Linlithgowshire"=>"West Lothian/Linlithgowshire", "Westmorland"=>"Westmorland", "Wigtownshire"=>"Wigtownshire", "Wiltshire"=>"Wiltshire", "Worcestershire"=>"Worcestershire", "Wrexham"=>"Wrexham", "Yorkshire"=>"Yorkshire");