<?php
$pgtitle = "Firewall: Countryblock";
	//	TomSchaefer.org countryblock package 2010
	//
	//	Notes: Find: ^(.*)$
	//		Replace: ob_start();\n$results = exec("cat countries.txt | grep XX");\nob_end_clean();\n\tif ($results == 'XX')\n\t\techo "\1";\n\telse\n\t\techo "\1";\n
	//
	//
	//
	//
	//require_once('config.inc');
	require("guiconfig.inc");
	include("head.inc");

	//set the config as a global variable
	global $config;

	$global_usage = '/usr/local/www/packages/countryblock/global_usage';
	//$fh = fopen($global_usage, 'r');

	//phpinfo();
	
if (count($_POST)>0) {

	conf_mount_rw();

	$ent = array();

	if ($_POST['enable'] == 1) {
		//echo "enabled";
		$config['installedpackages']['countryblock_settings']['config'][0]['enable'] = 1;
	//touch countries-white.txt to fix bug
		exec("touch /usr/local/www/packages/countryblock/countries-white.txt");	
	//Process list by downloading and extracting
		$myFile = "countries.txt";
		$fileContents = file_get_contents($myFile);
		$lines = explode(PHP_EOL, $fileContents);
	//Remove DIR lists to eliminate duplates
		exec("rm -R lists");
	//Process each list URL, Extract, and put in DIR lists
		exec("mkdir lists");
		foreach ($lines as $line) {
			//echo("fetch -o lists http://www.countryipblocks.net/e_country_data/{$line}_cidr.txt");
			//Fetch countries from server
			//exec("fetch -o lists/temp http://127.0.0.1//packages/countryblock/CIDR/{$line}_cidr.txt");
			//Pull from local file since https or http on other ports may be used
			exec("cat CIDR/{$line}_cidr.txt >> lists/countries.txt");
			//exec("fetch -o lists/temp http://www.countryipblocks.net/e_country_data/{$line}_cidr.txt");
			//Remove cat lists/temp since fetch is not used
			//Thank you g4m3c4ck, 'He got a real pretty mouth ain't he', 1 Feb 2011
			//exec("cat lists/temp >> lists/countries.txt");
		 	$filename = basename($line);
		 	//Extract list
		 	//exec("gzip -d lists/$filename");
		 	}
	//Prep pfctl
	mwexec("rm lists/temp");
	//mwexec("touch lists/ipfw.ipfw");
       //Now clear ipfw, and process each list to ipfw commands
	   	//mwexec("pfctl -t countryblock -T kill");
		//mwexec("sed -i -e '/countryblock/d' /tmp/rules.debug");
		mwexec("sh execute.sh");
				
	}
	else {
		//echo "disabled";
		$config['installedpackages']['countryblock_settings']['config'][0]['enable'] = 0;
		//Clear Lists
		mwexec("pfctl -t countryblock -T kill");
		mwexec("rm -R /usr/local/www/packages/countryblock/lists");
		mwexec("sed -i -e '/countryblock/d' /tmp/rules.debug");
		mwexec("pfctl -o basic -f /tmp/rules.debug");
		//Clear errorOUT.txt
		mwexec("rm errorOUT.txt");
		
	}


	//write_config();
	//services_dnsmasq_configure();
	sleep(1);
	$savemsg_cb = "Country Block settings have been saved/updated. ";
	conf_mount_ro();
}
?>

<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
<?php include("fbegin.inc"); ?>

<?php if ($input_errors) print_input_errors($input_errors); ?>
<?php if ($savemsg) print_info_box($savemsg); ?>
<form method=POST action="">
<?php
ob_start();
$resultstop = exec("pfctl -s rules | grep -c countryblock");
ob_end_clean();
if ($config['installedpackages']['countryblock_settings']['config'][0]['enable'] == 1) {
	echo "<input name='enable' type='checkbox' value='1' checked>\n";
}
elseif ($resultstop > '0') {
echo "<input name='enable' type='checkbox' value='1' checked>\n";
}
else {
	echo "<input name='enable' type='checkbox' value='1'>\n";
}
?><strong>Enable Country Block</strong><br><br>
<?php if ($savemsg_cb) print_info_box($savemsg_cb); 
		//if ($output) print_info_box($output,$output2);
		echo($output);
		echo($output2);
	?>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr><td class="tabnavtbl">
<?php
	$tab_array = array();
	$tab_array[0] = array("Countries", true, "countryblock.php");
	$tab_array[1] = array("Settings", false, "settings.php");
	$tab_array[2] = array("Whitelist", false, "whitelist.php");
	$tab_array[3] = array("Interfaces", false, "countryblock_if.php");
	$tab_array[4] = array("Help", false, "help.php");
	$tab_array[5] = array("Email", false, "email.php");
	display_top_tabs($tab_array);
?>  
  </td></tr>
  <tr> 
    <td>
	<div id="mainarea">
        <table class="tabcont" width="100%" border="0" cellpadding="0" cellspacing="0">
       <tr> 
	<td class="listhdrr">Main</td>
    
	  </tr>
      
    <tr> 
	<td class="listlr" valign="middle">
    
<?php

conf_mount_rw();
mwexec("touch countries.txt");
//$myFile = "countries.txt";
//$fh = fopen($myFile, 'a+');



	if(isset($_POST['formSubmit'])) 
    {
		$aCountry = $_POST['formCountry'];
	
		
		if(empty($aCountry)) 
        {
			$output = "<b>You didn't select any Countries.";
			exec("rm countries.txt");
		} 
        else 
        {
		
            $N = count($aCountry);

			$myFile = "countries.txt";
			$fh = fopen($myFile, 'w+');
			$output = "<b>You selected $N Countries";
			
			for($i=0; $i < $N; $i++)
			{
				//echo($aCountry[$i] . " ");
				fwrite($fh, $aCountry[$i] . "\n");
			}
			echo("</p>");
		}
	}
conf_mount_ro();
?>


<script type="text/javascript" src="jquery.min.js"></script>

<script type="text/javascript" src="ddaccordion.js">

/***********************************************
* Accordion Content script- (c) Dynamic Drive DHTML code library (www.dynamicdrive.com)
* Visit http://www.dynamicDrive.com for hundreds of DHTML scripts
* This notice must stay intact for legal use
***********************************************/

</script>


<script type="text/javascript">


ddaccordion.init({
	headerclass: "expandable", //Shared CSS class name of headers group that are expandable
	contentclass: "categoryitems", //Shared CSS class name of contents group
	revealtype: "click", //Reveal content when user clicks or onmouseover the header? Valid value: "click", "clickgo", or "mouseover"
	mouseoverdelay: 200, //if revealtype="mouseover", set delay in milliseconds before header expands onMouseover
	collapseprev: true, //Collapse previous content (so only one open at any time)? true/false 
	defaultexpanded: [0], //index of content(s) open by default [index1, index2, etc]. [] denotes no content
	onemustopen: false, //Specify whether at least one header should be open always (so never all headers closed)
	animatedefault: false, //Should contents open by default be animated into view?
	persiststate: true, //persist state of opened contents within browser session?
	toggleclass: ["", "openheader"], //Two CSS classes to be applied to the header when it's collapsed and expanded, respectively ["class1", "class2"]
	togglehtml: ["prefix", "", ""], //Additional HTML added to the header when it's collapsed and expanded, respectively  ["position", "html1", "html2"] (see docs)
	animatespeed: "fast", //speed of animation: integer in milliseconds (ie: 200), or keywords "fast", "normal", or "slow"
	oninit:function(headers, expandedindices){ //custom code to run when headers have initalized
		//do nothing
	},
	onopenclose:function(header, index, state, isuseractivated){ //custom code to run whenever a header is opened or closed
		//do nothing
	}
})


</script>

<style type="text/css">

a img {border:none; }

.arrowlistmenu{
width: 180px; /*width of accordion menu*/
}

.arrowlistmenu .menuheader{ /*CSS class for menu headers in general (expanding or not!)*/
font: bold 14px Arial;
color: white;
background: black url(titlebar.png) repeat-x center left;
margin-bottom: 10px; /*bottom spacing between header and rest of content*/
text-transform: uppercase;
padding: 4px 0 4px 10px; /*header text is indented 10px*/
cursor: hand;
cursor: pointer;
}

.arrowlistmenu .openheader{ /*CSS class to apply to expandable header when it's expanded*/
background-image: url(titlebar-active.png);
}

.arrowlistmenu ul{ /*CSS for UL of each sub menu*/
list-style-type: none;
margin: 0;
padding: 0;
margin-bottom: 8px; /*bottom spacing between each UL and rest of content*/
}

.arrowlistmenu ul li{
padding-bottom: 2px; /*bottom spacing between menu items*/
}

.arrowlistmenu ul li a{
color: #A70303;
background: url(arrowbullet.png) no-repeat center left; /*custom bullet list image*/
display: block;
padding: 2px 0;
padding-left: 19px; /*link text is indented 19px*/
text-decoration: none;
font-weight: bold;
border-bottom: 1px solid #dadada;
font-size: 90%;
}

.arrowlistmenu ul li a:visited{
color: #A70303;

}

.arrowlistmenu ul li a:hover{ /*hover state CSS*/
color: #A70303;
background-color: #F3F3F3;
}

</style>

<script type="text/javascript" src="public_smo_scripts.js"></script>

</head>



<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
	<td >
	

	</form>
	
	<form action="<?php echo htmlentities($_SERVER['PHP_SELF']); ?>" method="post">
	<p>
    	<?php 
		$countif = "interfaces.txt";
		if (file_exists($countif)) {
			$countif =  count(file($countif)); 
			echo "$countlines"; 
		} else {
				echo "<span style='color:red'>Warning! No Interfaces Selected Click <a href='countryblock_if.php' target='_parent'><img src='../../themes/nervecenter/images/icons/icon_cablenic.gif' ALT='if'></a></span>";
		}
			
		?>
        </p>
		<h3><p>Check the country that you would like to block completely. Currently 
		<?php 
		$countfile = "countries.txt";
		if (file_exists($countfile)) {
			$countlines =  count(file($countfile)); 
			echo "$countlines"; 
		} else {
				echo "0 ";
		}
			
		?> 
            
      of 252 selected. </h3><input type="checkbox" name="checkall" onClick="checkUncheckAll(this);"/>select/unselect
      
<br/>
	

<table style="width: 50%">
	<tr>
		<td><div class="arrowlistmenu">

<h3 class="menuheader expandable">Top Spammers</h3>
<ul class="categoryitems">
<?php 
ob_start();
$results = exec("cat countries.txt | grep KR");
ob_end_clean();
	if ($results == 'KR') 
		echo "<li><input name='formCountry[]' type='checkbox' value='KR' checked/>Korea</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='KR'/>Korea</li>";

ob_start();
$results = exec("cat countries.txt | grep CN");
ob_end_clean();
	if ($results == 'CN')
		echo "<li><input name='formCountry[]' type='checkbox' value='CN' checked/>China</li>";
	else 
		echo "<li><input name='formCountry[]' type='checkbox' value='CN'/>China</li>";
ob_start();
$results = exec("cat countries.txt | grep IN");
ob_end_clean();
	if ($results == 'IN')
		echo "<li><input name='formCountry[]' type='checkbox' value='IN' checked/>India</li>";
	else 
		echo "<li><input name='formCountry[]' type='checkbox' value='IN' />India</li>";
ob_start();
$results = exec("cat countries.txt | grep RU");
ob_end_clean();
	if ($results == 'RU')
		echo "<li><input name='formCountry[]' type='checkbox' value='RU' checked/>Russia</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='RU' />Russia</li>";

ob_start();
$results = exec("cat countries.txt | grep TR");
ob_end_clean();
	if ($results == 'TR')
		echo "<li><input name='formCountry[]' type='checkbox' value='TR' checked/>Turkey</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='TR' />Turkey</li>";

ob_start();
$results = exec("cat countries.txt | grep VN");
ob_end_clean();
	if ($results == 'VN')
		echo "<li><input name='formCountry[]' type='checkbox' value='VN' checked/>Vietnam</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='VN' />Vietnam</li>";

ob_start();
$results = exec("cat countries.txt | grep UA");
ob_end_clean();
	if ($results == 'UA')
		echo "<li><input name='formCountry[]' type='checkbox' value='UA' checked/>Ukraine</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='UA' />Ukraine</li>";

ob_start();
$results = exec("cat countries.txt | grep BR");
ob_end_clean();
	if ($results == 'BR')
		echo "<li><input name='formCountry[]' type='checkbox' value='BR' checked/>Brazil</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='BR' />Brazil</li>";

ob_start();
$results = exec("cat countries.txt | grep VE");
ob_end_clean();
	if ($results == 'VE')
		echo "<li><input name='formCountry[]' type='checkbox' value='VE' checked/>Venezuela</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='VE' />Venezuela</li>";

ob_start();
$results = exec("cat countries.txt | grep PK");
ob_end_clean();
	if ($results == 'PK')
		echo "<li><input name='formCountry[]' type='checkbox' value='PK' checked/>Pakistan</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='PK' />Pakistan</li>";



?>

</ul>

<h3 class="menuheader expandable">A&#39;s</h3>
<ul class="categoryitems">
<?php 
ob_start();
$results = exec("cat countries.txt | grep AF");
ob_end_clean();
	if ($results == 'AF')
		echo "<li><input name='formCountry[]' type='checkbox' value='AF' checked/>Afghanistan</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='AF' />Afghanistan</li>";

ob_start();
$results = exec("cat countries.txt | grep AX");
ob_end_clean();
	if ($results == 'AX')
		echo "<li><input name='formCountry[]' type='checkbox' value='AX' checked/>Aland Islands</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='AX' />Aland Islands</li>";

ob_start();
$results = exec("cat countries.txt | grep AL");
ob_end_clean();
	if ($results == 'AL')
		echo "<li><input name='formCountry[]' type='checkbox' value='AL' checked/>Albania</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='AL' />Albania</li>";

ob_start();
$results = exec("cat countries.txt | grep DZ");
ob_end_clean();
	if ($results == 'DZ')
		echo "<li><input name='formCountry[]' type='checkbox' value='DZ' checked/>Algeria</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='DZ' />Algeria</li>";

ob_start();
$results = exec("cat countries.txt | grep AS");
ob_end_clean();
	if ($results == 'AS')
		echo "<li><input name='formCountry[]' type='checkbox' value='AS' checked/>American Samoa</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='AS' />American Samoa</li>";

ob_start();
$results = exec("cat countries.txt | grep AD");
ob_end_clean();
	if ($results == 'AD')
		echo "<li><input name='formCountry[]' type='checkbox' value='AD' checked/>Andorra</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='AD' />Andorra</li>";

ob_start();
$results = exec("cat countries.txt | grep AO");
ob_end_clean();
	if ($results == 'AO')
		echo "<li><input name='formCountry[]' type='checkbox' value='AO' checked/>Angola</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='AO' />Angola</li>";

ob_start();
$results = exec("cat countries.txt | grep AI");
ob_end_clean();
	if ($results == 'AI')
		echo "<li><input name='formCountry[]' type='checkbox' value='AI' checked/>Anguilla</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='AI' />Anguilla</li>";

ob_start();
$results = exec("cat countries.txt | grep AQ");
ob_end_clean();
	if ($results == 'AQ')
		echo "<li><input name='formCountry[]' type='checkbox' value='AQ' checked/>Antarctica</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='AQ' />Antarctica</li>";

ob_start();
$results = exec("cat countries.txt | grep AG");
ob_end_clean();
	if ($results == 'AG')
		echo "<li><input name='formCountry[]' type='checkbox' value='AG' checked/>Antigua And Barbuda</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='AG' />Antigua And Barbuda</li>";

ob_start();
$results = exec("cat countries.txt | grep AR");
ob_end_clean();
	if ($results == 'AR')
		echo "		<li><input name='formCountry[]' type='checkbox' value='AR' checked/>Argentina</li>";
	else
		echo "		<li><input name='formCountry[]' type='checkbox' value='AR' />Argentina</li>";

ob_start();
$results = exec("cat countries.txt | grep AM");
ob_end_clean();
	if ($results == 'AM')
		echo "<li><input name='formCountry[]' type='checkbox' value='AM' checked/>Armenia</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='AM' />Armenia</li>";

ob_start();
$results = exec("cat countries.txt | grep AW");
ob_end_clean();
	if ($results == 'AW')
		echo "<li><input name='formCountry[]' type='checkbox' value='AW' checked/>Aruba</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='AW' />Aruba</li>";

ob_start();
$results = exec("cat countries.txt | grep AP");
ob_end_clean();
	if ($results == 'AP')
		echo "<li><input name='formCountry[]' type='checkbox' value='AP' checked/>Asia Pacific</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='AP' />Asia Pacific</li>";

ob_start();
$results = exec("cat countries.txt | grep AU");
ob_end_clean();
	if ($results == 'AU')
		echo "<li><input name='formCountry[]' type='checkbox' value='AU' checked/>Australia</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='AU' />Australia</li>";

ob_start();
$results = exec("cat countries.txt | grep AT");
ob_end_clean();
	if ($results == 'AT')
		echo "<li><input name='formCountry[]' type='checkbox' value='AT' checked/>Austria</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='AT' />Austria</li>";

ob_start();
$results = exec("cat countries.txt | grep AZ");
ob_end_clean();
	if ($results == 'AZ')
		echo "<li><input name='formCountry[]' type='checkbox' value='AZ' checked/>Azerbaijan</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='AZ' />Azerbaijan</li>";
?>
</ul>

<h3 class="menuheader expandable">B&#39;s</h3>
<ul class="categoryitems">
<?php 
ob_start();
$results = exec("cat countries.txt | grep BS");
ob_end_clean();
	if ($results == 'BS')
		echo "<li><input name='formCountry[]' type='checkbox' value='BS' checked/>Bahamas</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='BS' />Bahamas</li>";

ob_start();
$results = exec("cat countries.txt | grep BH");
ob_end_clean();
	if ($results == 'BH')
		echo "<li><input name='formCountry[]' type='checkbox' value='BH' checked/>Bahrain</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='BH' />Bahrain</li>";

ob_start();
$results = exec("cat countries.txt | grep BD");
ob_end_clean();
	if ($results == 'BD')
		echo "<li><input name='formCountry[]' type='checkbox' value='BD' checked/>Bangladesh</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='BD' />Bangladesh</li>";

ob_start();
$results = exec("cat countries.txt | grep BB");
ob_end_clean();
	if ($results == 'BB')
		echo "<li><input name='formCountry[]' type='checkbox' value='BB' checked/>Barbados</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='BB' />Barbados</li>";

ob_start();
$results = exec("cat countries.txt | grep BY");
ob_end_clean();
	if ($results == 'BY')
		echo "<li><input name='formCountry[]' type='checkbox' value='BY' checked/>Belarus</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='BY' />Belarus</li>";

ob_start();
$results = exec("cat countries.txt | grep BE");
ob_end_clean();
	if ($results == 'BE')
		echo "<li><input name='formCountry[]' type='checkbox' value='BE' checked/>Belgium</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='BE' />Belgium</li>";

ob_start();
$results = exec("cat countries.txt | grep BZ");
ob_end_clean();
	if ($results == 'BZ')
		echo "<li><input name='formCountry[]' type='checkbox' value='BZ' checked/>Belize</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='BZ' />Belize</li>";

ob_start();
$results = exec("cat countries.txt | grep BJ");
ob_end_clean();
	if ($results == 'BJ')
		echo "<li><input name='formCountry[]' type='checkbox' value='BJ' checked/>Benin</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='BJ' />Benin</li>";

ob_start();
$results = exec("cat countries.txt | grep BM");
ob_end_clean();
	if ($results == 'BM')
		echo "<li><input name='formCountry[]' type='checkbox' value='BM' checked/>Bermuda</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='BM' />Bermuda</li>";

ob_start();
$results = exec("cat countries.txt | grep BT");
ob_end_clean();
	if ($results == 'BT')
		echo "<li><input name='formCountry[]' type='checkbox' value='BT' checked/>Bhutan</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='BT' />Bhutan</li>";
/*
ob_start();
$results = exec("cat countries.txt | grep XA");
ob_end_clean();
	if ($results == 'XA')
		echo "<li><input name='formCountry[]' type='checkbox' value='XA' checked/>Bogons</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='XA' />Bogons</li>";
*/
ob_start();
$results = exec("cat countries.txt | grep BO");
ob_end_clean();
	if ($results == 'BO')
		echo "<li><input name='formCountry[]' type='checkbox' value='BO' checked/>Bolivia</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='BO' />Bolivia</li>";
		
ob_start();
$results = exec("cat countries.txt | grep BQ");
ob_end_clean();
	if ($results == 'BQ')
		echo "<li><input name='formCountry[]' type='checkbox' value='BQ' checked/>Bonaire, Saint Eustatius and Saba</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='BQ' />Bonaire, Saint Eustatius and Saba</li>";

ob_start();
$results = exec("cat countries.txt | grep BA");
ob_end_clean();
	if ($results == 'BA')
		echo "<li><input name='formCountry[]' type='checkbox' value='BA' checked/>Bosnia And Gerzegovia</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='BA' />Bosnia And Gerzegovia</li>";

ob_start();
$results = exec("cat countries.txt | grep BW");
ob_end_clean();
	if ($results == 'BW')
		echo "<li><input name='formCountry[]' type='checkbox' value='BW' checked/>Botswana</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='BW' />Botswana</li>";

ob_start();
$results = exec("cat countries.txt | grep BV");
ob_end_clean();
	if ($results == 'BV')
		echo "<li><input name='formCountry[]' type='checkbox' value='BV' checked/>Bouvet Island</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='BV' />Bouvet Island</li>";

//ob_start();
//$results = exec("cat countries.txt | grep BR");
//ob_end_clean();
//	if ($results == 'BR')
//		echo "<li><input name='formCountry[]' type='checkbox' value='BR' checked/>Brazil</li>";
//	else
//		echo "<li><input name='formCountry[]' type='checkbox' value='BR' />Brazil</li>";

ob_start();
$results = exec("cat countries.txt | grep IO");
ob_end_clean();
	if ($results == 'IO')
		echo "<li><input name='formCountry[]' type='checkbox' value='IO' checked/>British India Ocean Territory</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='IO' />British India Ocean Territory</li>";

ob_start();
$results = exec("cat countries.txt | grep BN");
ob_end_clean();
	if ($results == 'BN')
		echo "<li><input name='formCountry[]' type='checkbox' value='BN' checked/>Brunei Darussalam</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='BN' />Brunei Darussalam</li>";

ob_start();
$results = exec("cat countries.txt | grep BG");
ob_end_clean();
	if ($results == 'BG')
		echo "<li><input name='formCountry[]' type='checkbox' value='BG' checked/>Bulgaria</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='BG' />Bulgaria</li>";

ob_start();
$results = exec("cat countries.txt | grep BF");
ob_end_clean();
	if ($results == 'BF')
		echo "<li><input name='formCountry[]' type='checkbox' value='BF' checked/>Burkina Faso</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='BF' />Burkina Faso</li>";

ob_start();
$results = exec("cat countries.txt | grep BI");
ob_end_clean();
	if ($results == 'BI')
		echo "<li><input name='formCountry[]' type='checkbox' value='BI' checked/>Burundi</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='BI' />Burundi</li>";
?>
</ul>
<h3 class="menuheader expandable">C&#39;s</h3>
<ul class="categoryitems">
<?php
ob_start();
$results = exec("cat countries.txt | grep KH");
ob_end_clean();
	if ($results == 'KH')
		echo "<li><input name='formCountry[]' type='checkbox' value='KH' checked/>Cambodia</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='KH' />Cambodia</li>";

ob_start();
$results = exec("cat countries.txt | grep CM");
ob_end_clean();
	if ($results == 'CM')
		echo "<li><input name='formCountry[]' type='checkbox' value='CM' checked/>Cameroon</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='CM' />Cameroon</li>";

ob_start();
$results = exec("cat countries.txt | grep CA");
ob_end_clean();
	if ($results == 'CA')
		echo "<li><input name='formCountry[]' type='checkbox' value='CA' checked/>Canada</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='CA' />Canada</li>";

ob_start();
$results = exec("cat countries.txt | grep CV");
ob_end_clean();
	if ($results == 'CV')
		echo "<li><input name='formCountry[]' type='checkbox' value='CV' checked/>Cape Verde</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='CV' />Cape Verde</li>";

ob_start();
$results = exec("cat countries.txt | grep KY");
ob_end_clean();
	if ($results == 'KY')
		echo "<li><input name='formCountry[]' type='checkbox' value='KY' checked/>Cayman Islands</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='KY' />Cayman Islands</li>";

ob_start();
$results = exec("cat countries.txt | grep CF");
ob_end_clean();
	if ($results == 'CF')
		echo "<li><input name='formCountry[]' type='checkbox' value='CF' checked/>Central African Republic</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='CF' />Central African Republic</li>";

ob_start();
$results = exec("cat countries.txt | grep TD");
ob_end_clean();
	if ($results == 'TD')
		echo "<li><input name='formCountry[]' type='checkbox' value='TD' checked/>Chad</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='TD' />Chad</li>";

ob_start();
$results = exec("cat countries.txt | grep CL");
ob_end_clean();
	if ($results == 'CL')
		echo "<li><input name='formCountry[]' type='checkbox' value='CL' checked/>Chile</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='CL' />Chile</li>";

ob_start();
$results = exec("cat countries.txt | grep CX");
ob_end_clean();
	if ($results == 'CX')
		echo "<li><input name='formCountry[]' type='checkbox' value='CX' checked/>Christmas Island</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='CX' />Christmas Island</li>";

ob_start();
$results = exec("cat countries.txt | grep CC");
ob_end_clean();
	if ($results == 'CC')
		echo "<li><input name='formCountry[]' type='checkbox' value='CC' checked/>Cocos (Keeling) Islands</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='CC' />Cocos (Keeling) Islands</li>";

ob_start();
$results = exec("cat countries.txt | grep CO");
ob_end_clean();
	if ($results == 'CO')
		echo "<li><input name='formCountry[]' type='checkbox' value='CO' checked/>Colombia</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='CO' />Colombia</li>";

ob_start();
$results = exec("cat countries.txt | grep KM");
ob_end_clean();
	if ($results == 'KM')
		echo "<li><input name='formCountry[]' type='checkbox' value='KM' checked/>Comoros</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='KM' />Comoros</li>";

ob_start();
$results = exec("cat countries.txt | grep CG");
ob_end_clean();
	if ($results == 'CG')
		echo "<li><input name='formCountry[]' type='checkbox' value='CG' checked/>Congo - Brazzaville</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='CG' />Congo - Brazzaville</li>";


ob_start();
$results = exec("cat countries.txt | grep CD");
ob_end_clean();
	if ($results == 'CD')
		echo "<li><input name='formCountry[]' type='checkbox' value='CD' checked/>Congo, The Democratic Republic of the</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='CD' />Congo, The Democratic Republic of the</li>";

ob_start();
$results = exec("cat countries.txt | grep CK");
ob_end_clean();
	if ($results == 'CK')
		echo "<li><input name='formCountry[]' type='checkbox' value='CK' checked/>Cook Islands</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='CK' />Cook Islands</li>";

ob_start();
$results = exec("cat countries.txt | grep CR");
ob_end_clean();
	if ($results == 'CR')
		echo "<li><input name='formCountry[]' type='checkbox' value='CR' checked/>Costa Rica</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='CR' />Costa Rica</li>";

ob_start();
$results = exec("cat countries.txt | grep CI");
ob_end_clean();
	if ($results == 'CI')
		echo "<li><input name='formCountry[]' type='checkbox' value='CI' checked/>C�te d�Ivoire</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='CI' />C�te d�Ivoire</li>";

ob_start();
$results = exec("cat countries.txt | grep HR");
ob_end_clean();
	if ($results == 'HR')
		echo "<li><input name='formCountry[]' type='checkbox' value='HR' checked/>Croatia</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='HR' />Croatia</li>";

ob_start();
$results = exec("cat countries.txt | grep CU");
ob_end_clean();
	if ($results == 'CU')
		echo "<li><input name='formCountry[]' type='checkbox' value='CU' checked/>Cuba</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='CU' />Cuba</li>";
		
ob_start();
$results = exec("cat countries.txt | grep CW");
ob_end_clean();
	if ($results == 'CW')
		echo "<li><input name='formCountry[]' type='checkbox' value='CW' checked/>Curacao</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='CW' />Curacao</li>";


ob_start();
$results = exec("cat countries.txt | grep CY");
ob_end_clean();
	if ($results == 'CY')
		echo "<li><input name='formCountry[]' type='checkbox' value='CY' checked/>Cyprus</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='CY' />Cyprus</li>";

ob_start();
$results = exec("cat countries.txt | grep CZ");
ob_end_clean();
	if ($results == 'CZ')
		echo "<li><input name='formCountry[]' type='checkbox' value='CZ' checked/>Czech Republic</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='CZ' />Czech Republic</li>";

?>
</ul>
<h3 class="menuheader expandable">D&#39;s</h3>
<ul class="categoryitems">
<?php
ob_start();
$results = exec("cat countries.txt | grep DK");
ob_end_clean();
	if ($results == 'DK')
		echo "<li><input name='formCountry[]' type='checkbox' value='DK' checked/>Denmark</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='DK' />Denmark</li>";

ob_start();
$results = exec("cat countries.txt | grep DJ");
ob_end_clean();
	if ($results == 'DJ')
		echo "<li><input name='formCountry[]' type='checkbox' value='DJ' checked/>Djibouti</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='DJ' />Djibouti</li>";

ob_start();
$results = exec("cat countries.txt | grep DM");
ob_end_clean();
	if ($results == 'DM')
		echo "<li><input name='formCountry[]' type='checkbox' value='DM' checked/>Dominica</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='DM' />Dominica</li>";

ob_start();
$results = exec("cat countries.txt | grep DO");
ob_end_clean();
	if ($results == 'DO')
		echo "<li><input name='formCountry[]' type='checkbox' value='DO' checked/>Dominican Republic</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='DO' />Dominican Republic</li>";

?>
</ul>
<h3 class="menuheader expandable">E&#39;s</h3>
<ul class="categoryitems">
<?php
//ob_start();
//$results = exec("cat countries.txt | grep XX");
//ob_end_clean();
//	if ($results == 'XX')
//		echo "<li><input name='formCountry[]' type='checkbox' value='East_Timor' checked/>East Timor</li>";
//	else
//		echo "<li><input name='formCountry[]' type='checkbox' value='East_Timor' />East Timor</li>";

ob_start();
$results = exec("cat countries.txt | grep EC");
ob_end_clean();
	if ($results == 'EC')
		echo "<li><input name='formCountry[]' type='checkbox' value='EC' checked/>Ecuador</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='EC' />Ecuador</li>";

ob_start();
$results = exec("cat countries.txt | grep EG");
ob_end_clean();
	if ($results == 'EG')
		echo "<li><input name='formCountry[]' type='checkbox' value='EG' checked/>Egypt</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='EG' />Egypt</li>";

ob_start();
$results = exec("cat countries.txt | grep SV");
ob_end_clean();
	if ($results == 'SV')
		echo "<li><input name='formCountry[]' type='checkbox' value='SV' checked/>El Salvador</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='SV' />El Salvador</li>";

ob_start();
$results = exec("cat countries.txt | grep GQ");
ob_end_clean();
	if ($results == 'GQ')
		echo "<li><input name='formCountry[]' type='checkbox' value='GQ' checked/>Equatorial Guinea</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='GQ' />Equatorial Guinea</li>";

ob_start();
$results = exec("cat countries.txt | grep ER");
ob_end_clean();
	if ($results == 'ER')
		echo "<li><input name='formCountry[]' type='checkbox' value='ER' checked/>Eritrea</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='ER' />Eritrea</li>";

ob_start();
$results = exec("cat countries.txt | grep EE");
ob_end_clean();
	if ($results == 'EE')
		echo "<li><input name='formCountry[]' type='checkbox' value='EE' checked/>Estonia</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='EE' />Estonia</li>";

ob_start();
$results = exec("cat countries.txt | grep ET");
ob_end_clean();
	if ($results == 'ET')
		echo "<li><input name='formCountry[]' type='checkbox' value='ET' checked/>Ethiopia</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='ET' />Ethiopia</li>";

ob_start();
$results = exec("cat countries.txt | grep EU");
ob_end_clean();
	if ($results == 'EU')
		echo "<li><input name='formCountry[]' type='checkbox' value='EU' checked/>European Union</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='EU' />European Union</li>";


?>
</ul>

<h3 class="menuheader expandable">F&#39;s</h3>
<ul class="categoryitems">
<?php
ob_start();
$results = exec("cat countries.txt | grep FK");
ob_end_clean();
	if ($results == 'FK')
		echo "<li><input name='formCountry[]' type='checkbox' value='FK' checked/>Falkland Islands</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='FK' />Falkland Islands</li>";

ob_start();
$results = exec("cat countries.txt | grep FO");
ob_end_clean();
	if ($results == 'FO')
		echo "<li><input name='formCountry[]' type='checkbox' value='FO' checked/>Faroe Islands</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='FO' />Faroe Islands</li>";

ob_start();
$results = exec("cat countries.txt | grep FJ");
ob_end_clean();
	if ($results == 'FJ')
		echo "<li><input name='formCountry[]' type='checkbox' value='FJ' checked/>Fiji Islands</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='FJ' />Fiji Islands</li>";

ob_start();
$results = exec("cat countries.txt | grep FI");
ob_end_clean();
	if ($results == 'FI')
		echo "<li><input name='formCountry[]' type='checkbox' value='FI' checked/>Finland</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='FI' />Finland</li>";

ob_start();
$results = exec("cat countries.txt | grep FR");
ob_end_clean();
	if ($results == 'FR')
		echo "<li><input name='formCountry[]' type='checkbox' value='FR' checked/>France</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='FR' />France</li>";

ob_start();
$results = exec("cat countries.txt | grep GF");
ob_end_clean();
	if ($results == 'GF')
		echo "<li><input name='formCountry[]' type='checkbox' value='GF' checked/>French Guiana</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='GF' />French Guiana</li>";

ob_start();
$results = exec("cat countries.txt | grep PF");
ob_end_clean();
	if ($results == 'PF')
		echo "<li><input name='formCountry[]' type='checkbox' value='PF' checked/>French Polynesia</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='PF' />French Polynesia</li>";

ob_start();
$results = exec("cat countries.txt | grep TF");
ob_end_clean();
	if ($results == 'TF')
		echo "<li><input name='formCountry[]' type='checkbox' value='TF' checked/>French Southern territories</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='TF' />French Southern territories</li>";

?>
</ul>

<h3 class="menuheader expandable">G&#39;s</h3>
<ul class="categoryitems">
<?php
ob_start();
$results = exec("cat countries.txt | grep GA");
ob_end_clean();
	if ($results == 'GA')
		echo "<li><input name='formCountry[]' type='checkbox' value='GA' checked/>Gabon</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='GA' />Gabon</li>";

ob_start();
$results = exec("cat countries.txt | grep GM");
ob_end_clean();
	if ($results == 'GM')
		echo "<li><input name='formCountry[]' type='checkbox' value='GM' checked/>Gambia</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='GM' />Gambia</li>";

ob_start();
$results = exec("cat countries.txt | grep GE");
ob_end_clean();
	if ($results == 'GE')
		echo "<li><input name='formCountry[]' type='checkbox' value='GE' checked/>Georgia</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='GE' />Georgia</li>";

ob_start();
$results = exec("cat countries.txt | grep DE");
ob_end_clean();
	if ($results == 'DE')
		echo "<li><input name='formCountry[]' type='checkbox' value='DE' checked/>Germany</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='DE' />Germany</li>";

ob_start();
$results = exec("cat countries.txt | grep GH");
ob_end_clean();
	if ($results == 'GH')
		echo "<li><input name='formCountry[]' type='checkbox' value='GH' checked/>Ghana</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='GH' />Ghana</li>";

ob_start();
$results = exec("cat countries.txt | grep GI");
ob_end_clean();
	if ($results == 'GI')
		echo "<li><input name='formCountry[]' type='checkbox' value='GI' checked/>Gibraltar</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='GI' />Gibraltar</li>";

ob_start();
$results = exec("cat countries.txt | grep GR");
ob_end_clean();
	if ($results == 'GR')
		echo "<li><input name='formCountry[]' type='checkbox' value='GR' checked/>Greece</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='GR' />Greece</li>";

ob_start();
$results = exec("cat countries.txt | grep GL");
ob_end_clean();
	if ($results == 'GL')
		echo "<li><input name='formCountry[]' type='checkbox' value='GL' checked/>Greenland</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='GL' />Greenland</li>";

ob_start();
$results = exec("cat countries.txt | grep GD");
ob_end_clean();
	if ($results == 'GD')
		echo "<li><input name='formCountry[]' type='checkbox' value='GD' checked/>Grenada</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='GD' />Grenada</li>";

ob_start();
$results = exec("cat countries.txt | grep GP");
ob_end_clean();
	if ($results == 'GP')
		echo "<li><input name='formCountry[]' type='checkbox' value='GP' checked/>Guadeloupe</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='GP' />Guadeloupe</li>";

ob_start();
$results = exec("cat countries.txt | grep GU");
ob_end_clean();
	if ($results == 'GU')
		echo "<li><input name='formCountry[]' type='checkbox' value='GU' checked/>Guam</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='GU' />Guam</li>";

ob_start();
$results = exec("cat countries.txt | grep GT");
ob_end_clean();
	if ($results == 'GT')
		echo "<li><input name='formCountry[]' type='checkbox' value='GT' checked/>Guatemala</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='GT' />Guatemala</li>";

ob_start();
$results = exec("cat countries.txt | grep GG");
ob_end_clean();
	if ($results == 'GG')
		echo "<li><input name='formCountry[]' type='checkbox' value='GG' checked/>Guernsey</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='GG' />Guernsey</li>";


ob_start();
$results = exec("cat countries.txt | grep GN");
ob_end_clean();
	if ($results == 'GN')
		echo "<li><input name='formCountry[]' type='checkbox' value='GN' checked/>Guinea</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='GN' />Guinea</li>";

ob_start();
$results = exec("cat countries.txt | grep GW");
ob_end_clean();
	if ($results == 'GW')
		echo "<li><input name='formCountry[]' type='checkbox' value='GW' checked/>Guinea-Bissau</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='GW' />Guinea-Bissau</li>";

ob_start();
$results = exec("cat countries.txt | grep GY");
ob_end_clean();
	if ($results == 'GY')
		echo "<li><input name='formCountry[]' type='checkbox' value='GY' checked/>Guyana</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='GY' />Guyana</li>";

?>	
</ul>

<h3 class="menuheader expandable">H&#39;s</h3>
<ul class="categoryitems">
<?php
ob_start();
$results = exec("cat countries.txt | grep HT");
ob_end_clean();
	if ($results == 'HT')
		echo "<li><input name='formCountry[]' type='checkbox' value='HT' checked/>Haiti</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='HT' />Haiti</li>";

ob_start();
$results = exec("cat countries.txt | grep HM");
ob_end_clean();
	if ($results == 'HM')
		echo "<li><input name='formCountry[]' type='checkbox' value='HM' checked/>Heard Island and McDonald Islands</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='HM' />Heard Island and McDonald Islands</li>";

ob_start();
$results = exec("cat countries.txt | grep VA");
ob_end_clean();
	if ($results == 'VA')
		echo "<li><input name='formCountry[]' type='checkbox' value='VA' checked/>Holy See (Vatican City State)</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='VA' />Holy See (Vatican City State)</li>";

ob_start();
$results = exec("cat countries.txt | grep HN");
ob_end_clean();
	if ($results == 'HN')
		echo "<li><input name='formCountry[]' type='checkbox' value='HN' checked/>Honduras</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='HN' />Honduras</li>";

ob_start();
$results = exec("cat countries.txt | grep HK");
ob_end_clean();
	if ($results == 'HK')
		echo "<li><input name='formCountry[]' type='checkbox' value='HK' checked/>Hong Kong</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='HK' />Hong Kong</li>";

ob_start();
$results = exec("cat countries.txt | grep HU");
ob_end_clean();
	if ($results == 'HU')
		echo "<li><input name='formCountry[]' type='checkbox' value='HU' checked/>Hungary</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='HU' />Hungary</li>";

?>		
</ul>
</div>
</td>
		<td><div class="arrowlistmenu">
<h3 class="menuheader expandable">I&#39;s</h3>
<ul class="categoryitems">
<?php
ob_start();
$results = exec("cat countries.txt | grep IS");
ob_end_clean();
	if ($results == 'IS')
		echo "<li><input name='formCountry[]' type='checkbox' value='IS' checked/>Iceland</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='IS' />Iceland</li>";

//ob_start();
//$results = exec("cat countries.txt | grep IN");
//ob_end_clean();
//	if ($results == 'IN')
//		echo "<li><input name='formCountry[]' type='checkbox' value='IN' checked/>India</li>";
//	else
//		echo "<li><input name='formCountry[]' type='checkbox' value='IN' />India</li>";

ob_start();
$results = exec("cat countries.txt | grep ID");
ob_end_clean();
	if ($results == 'ID')
		echo "<li><input name='formCountry[]' type='checkbox' value='ID' checked/>Indonesia</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='ID' />Indonesia</li>";

ob_start();
$results = exec("cat countries.txt | grep IR");
ob_end_clean();
	if ($results == 'IR')
		echo "<li><input name='formCountry[]' type='checkbox' value='IR' checked/>Iran</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='IR' />Iran</li>";

ob_start();
$results = exec("cat countries.txt | grep IQ");
ob_end_clean();
	if ($results == 'IQ')
		echo "<li><input name='formCountry[]' type='checkbox' value='IQ' checked/>Iraq</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='IQ' />Iraq</li>";

ob_start();
$results = exec("cat countries.txt | grep IE");
ob_end_clean();
	if ($results == 'IE')
		echo "<li><input name='formCountry[]' type='checkbox' value='IE' checked/>Ireland</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='IE' />Ireland</li>";

ob_start();
$results = exec("cat countries.txt | grep IM");
ob_end_clean();
	if ($results == 'IM')
		echo "<li><input name='formCountry[]' type='checkbox' value='IM' checked/>Isle of Man</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='IM' />Isle of Man</li>";


ob_start();
$results = exec("cat countries.txt | grep IL");
ob_end_clean();
	if ($results == 'IL')
		echo "<li><input name='formCountry[]' type='checkbox' value='IL' checked/>Israel</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='IL' />Israel</li>";

ob_start();
$results = exec("cat countries.txt | grep IT");
ob_end_clean();
	if ($results == 'IT')
		echo "<li><input name='formCountry[]' type='checkbox' value='IT' checked/>Italy</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='IT' />Italy</li>";

?>
</ul>

<h3 class="menuheader expandable">J&#39;s</h3>
<ul class="categoryitems">
<?php
ob_start();
$results = exec("cat countries.txt | grep JM");
ob_end_clean();
	if ($results == 'JM')
		echo "<li><input name='formCountry[]' type='checkbox' value='JM' checked/>Jamaica</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='JM' />Jamaica</li>";

ob_start();
$results = exec("cat countries.txt | grep JP");
ob_end_clean();
	if ($results == 'JP')
		echo "<li><input name='formCountry[]' type='checkbox' value='JP' checked/>Japan</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='JP' />Japan</li>";
		
ob_start();
$results = exec("cat countries.txt | grep JE");
ob_end_clean();
	if ($results == 'JE')
		echo "<li><input name='formCountry[]' type='checkbox' value='JE' checked/>Jersey</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='JE' />Jersey</li>";

ob_start();
$results = exec("cat countries.txt | grep JO");
ob_end_clean();
	if ($results == 'JO')
		echo "<li><input name='formCountry[]' type='checkbox' value='JO' checked/>Jordan</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='JO' />Jordan</li>";

?>		
</ul>

<h3 class="menuheader expandable">K&#39;s</h3>
<ul class="categoryitems">
<?php
ob_start();
$results = exec("cat countries.txt | grep KZ");
ob_end_clean();
	if ($results == 'KZ')
		echo "<li><input name='formCountry[]' type='checkbox' value='KZ' checked/>Kazakstan</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='KZ' />Kazakstan</li>";

ob_start();
$results = exec("cat countries.txt | grep KE");
ob_end_clean();
	if ($results == 'KE')
		echo "<li><input name='formCountry[]' type='checkbox' value='KE' checked/>Kenya</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='KE' />Kenya</li>";

ob_start();
$results = exec("cat countries.txt | grep KI");
ob_end_clean();
	if ($results == 'KI')
		echo "<li><input name='formCountry[]' type='checkbox' value='KI' checked/>Kiribati</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='KI' />Kiribati</li>";

ob_start();
$results = exec("cat countries.txt | grep KP");
ob_end_clean();
	if ($results == 'KP')
		echo "<li><input name='formCountry[]' type='checkbox' value='KP' checked/>Korea, Democratic Replublic</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='KP' />Korea, Democratic Replublic</li>";

//ob_start();
//$results = exec("cat countries.txt | grep KR");
//ob_end_clean();
//	if ($results == 'KR')
//		echo "<li><input name='formCountry[]' type='checkbox' value='KR' checked/>Korea</li>";
//	else
//		echo "<li><input name='formCountry[]' type='checkbox' value='KR' />Korea</li>";

ob_start();
$results = exec("cat countries.txt | grep CS");
ob_end_clean();
	if ($results == 'CS')
		echo "<li><input name='formCountry[]' type='checkbox' value='CS' checked/>Kosovo</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='CS' />Kosovo</li>";

ob_start();
$results = exec("cat countries.txt | grep KW");
ob_end_clean();
	if ($results == 'KW')
		echo "<li><input name='formCountry[]' type='checkbox' value='KW' checked/>Kuwait</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='KW' />Kuwait</li>";

ob_start();
$results = exec("cat countries.txt | grep KG");
ob_end_clean();
	if ($results == 'KG')
		echo "<li><input name='formCountry[]' type='checkbox' value='KG' checked/>Kyrgyzstan</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='KG' />Kyrgyzstan</li>";

?>		
</ul>

<h3 class="menuheader expandable">L&#39;s</h3>
<ul class="categoryitems">
<?php
ob_start();
$results = exec("cat countries.txt | grep LA");
ob_end_clean();
	if ($results == 'LA')
		echo "<li><input name='formCountry[]' type='checkbox' value='LA' checked/>Lao Democratic Republic</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='LA' />Lao Democratic Republic</li>";

ob_start();
$results = exec("cat countries.txt | grep LV");
ob_end_clean();
	if ($results == 'LV')
		echo "<li><input name='formCountry[]' type='checkbox' value='LV' checked/>Latvia</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='LV' />Latvia</li>";

ob_start();
$results = exec("cat countries.txt | grep LB");
ob_end_clean();
	if ($results == 'LB')
		echo "<li><input name='formCountry[]' type='checkbox' value='LB' checked/>Lebanon</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='LB' />Lebanon</li>";

ob_start();
$results = exec("cat countries.txt | grep LS");
ob_end_clean();
	if ($results == 'LS')
		echo "<li><input name='formCountry[]' type='checkbox' value='LS' checked/>Lesotho</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='LS' />Lesotho</li>";

ob_start();
$results = exec("cat countries.txt | grep LR");
ob_end_clean();
	if ($results == 'LR')
		echo "<li><input name='formCountry[]' type='checkbox' value='LR' checked/>Liberia</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='LR' />Liberia</li>";

ob_start();
$results = exec("cat countries.txt | grep LY");
ob_end_clean();
	if ($results == 'LY')
		echo "<li><input name='formCountry[]' type='checkbox' value='LY' checked/>Libyan Arab Jamahiriya</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='LY' />Libyan Arab Jamahiriya</li>";

ob_start();
$results = exec("cat countries.txt | grep LI");
ob_end_clean();
	if ($results == 'LI')
		echo "<li><input name='formCountry[]' type='checkbox' value='LI' checked/>Liechtenstein</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='LI' />Liechtenstein</li>";

ob_start();
$results = exec("cat countries.txt | grep LT");
ob_end_clean();
	if ($results == 'LT')
		echo "<li><input name='formCountry[]' type='checkbox' value='LT' checked/>Lithuania</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='LT' />Lithuania</li>";

ob_start();
$results = exec("cat countries.txt | grep LU");
ob_end_clean();
	if ($results == 'LU')
		echo "<li><input name='formCountry[]' type='checkbox' value='LU' checked/>Luxembourg</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='LU' />Luxembourg</li>";

?>		
</ul>

<h3 class="menuheader expandable">M&#39;s</h3>
<ul class="categoryitems">
<?php
ob_start();
$results = exec("cat countries.txt | grep MO");
ob_end_clean();
	if ($results == 'MO')
		echo "<li><input name='formCountry[]' type='checkbox' value='MO' checked/>Macao</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='MO' />Macao</li>";

ob_start();
$results = exec("cat countries.txt | grep MK");
ob_end_clean();
	if ($results == 'MK')
		echo "<li><input name='formCountry[]' type='checkbox' value='MK' checked/>Macedonia</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='MK' />Macedonia</li>";

ob_start();
$results = exec("cat countries.txt | grep MG");
ob_end_clean();
	if ($results == 'MG')
		echo "<li><input name='formCountry[]' type='checkbox' value='MG' checked/>Madagascar</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='MG' />Madagascar</li>";

ob_start();
$results = exec("cat countries.txt | grep MW");
ob_end_clean();
	if ($results == 'MW')
		echo "<li><input name='formCountry[]' type='checkbox' value='MW' checked/>Malawi</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='MW' />Malawi</li>";

ob_start();
$results = exec("cat countries.txt | grep MY");
ob_end_clean();
	if ($results == 'MY')
		echo "<li><input name='formCountry[]' type='checkbox' value='MY' checked/>Malaysia</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='MY' />Malaysia</li>";

ob_start();
$results = exec("cat countries.txt | grep MV");
ob_end_clean();
	if ($results == 'MV')
		echo "<li><input name='formCountry[]' type='checkbox' value='MV' checked/>Maldives</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='MV' />Maldives</li>";

ob_start();
$results = exec("cat countries.txt | grep ML");
ob_end_clean();
	if ($results == 'ML')
		echo "<li><input name='formCountry[]' type='checkbox' value='ML' checked/>Mali</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='ML' />Mali</li>";

ob_start();
$results = exec("cat countries.txt | grep MT");
ob_end_clean();
	if ($results == 'MT')
		echo "<li><input name='formCountry[]' type='checkbox' value='MT' checked/>Malta</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='MT' />Malta</li>";

ob_start();
$results = exec("cat countries.txt | grep MH");
ob_end_clean();
	if ($results == 'MH')
		echo "<li><input name='formCountry[]' type='checkbox' value='MH' checked/>Marshall Islands</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='MH' />Marshall Islands</li>";

ob_start();
$results = exec("cat countries.txt | grep MQ");
ob_end_clean();
	if ($results == 'MQ')
		echo "<li><input name='formCountry[]' type='checkbox' value='MQ' checked/>Martinique</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='MQ' />Martinique</li>";

ob_start();
$results = exec("cat countries.txt | grep MR");
ob_end_clean();
	if ($results == 'MR')
		echo "<li><input name='formCountry[]' type='checkbox' value='MR' checked/>Mauritania</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='MR' />Mauritania</li>";

ob_start();
$results = exec("cat countries.txt | grep MU");
ob_end_clean();
	if ($results == 'MU')
		echo "<li><input name='formCountry[]' type='checkbox' value='MU' checked/>Mauritius</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='MU' />Mauritius</li>";

ob_start();
$results = exec("cat countries.txt | grep YT");
ob_end_clean();
	if ($results == 'YT')
		echo "<li><input name='formCountry[]' type='checkbox' value='YT' checked/>Mayotte</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='YT' />Mayotte</li>";

ob_start();
$results = exec("cat countries.txt | grep MX");
ob_end_clean();
	if ($results == 'MX')
		echo "<li><input name='formCountry[]' type='checkbox' value='MX' checked/>Mexico</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='MX' />Mexico</li>";

ob_start();
$results = exec("cat countries.txt | grep FM");
ob_end_clean();
	if ($results == 'FM')
		echo "<li><input name='formCountry[]' type='checkbox' value='FM' checked/>Micronesia</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='FM' />Micronesia</li>";

ob_start();
$results = exec("cat countries.txt | grep MD");
ob_end_clean();
	if ($results == 'MD')
		echo "<li><input name='formCountry[]' type='checkbox' value='MD' checked/>Moldova</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='MD' />Moldova</li>";

ob_start();
$results = exec("cat countries.txt | grep MC");
ob_end_clean();
	if ($results == 'MC')
		echo "<li><input name='formCountry[]' type='checkbox' value='MC' checked/>Monaco</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='MC' />Monaco</li>";

ob_start();
$results = exec("cat countries.txt | grep MN");
ob_end_clean();
	if ($results == 'MN')
		echo "<li><input name='formCountry[]' type='checkbox' value='MN' checked/>Mongolia</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='MN' />Mongolia</li>";

ob_start();
$results = exec("cat countries.txt | grep ME");
ob_end_clean();
	if ($results == 'ME')
		echo "<li><input name='formCountry[]' type='checkbox' value='ME' checked/>Montenegro</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='ME' />Montenegro</li>";

ob_start();
$results = exec("cat countries.txt | grep MS");
ob_end_clean();
	if ($results == 'MS')
		echo "<li><input name='formCountry[]' type='checkbox' value='MS' checked/>Montserrat</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='MS' />Montserrat</li>";

ob_start();
$results = exec("cat countries.txt | grep MA");
ob_end_clean();
	if ($results == 'MA')
		echo "<li><input name='formCountry[]' type='checkbox' value='MA' checked/>Morocco</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='MA' />Morocco</li>";

ob_start();
$results = exec("cat countries.txt | grep MZ");
ob_end_clean();
	if ($results == 'MZ')
		echo "<li><input name='formCountry[]' type='checkbox' value='MZ' checked/>Mozambique</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='MZ' />Mozambique</li>";

ob_start();
$results = exec("cat countries.txt | grep MM");
ob_end_clean();
	if ($results == 'MM')
		echo "<li><input name='formCountry[]' type='checkbox' value='MM' checked/>Myanmar</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='MM' />Myanmar</li>";

?>		
</ul>

<h3 class="menuheader expandable">N&#39;s</h3>
<ul class="categoryitems">
<?php
ob_start();
$results = exec("cat countries.txt | grep NA");
ob_end_clean();
	if ($results == 'NA')
		echo "<li><input name='formCountry[]' type='checkbox' value='NA' checked/>Namibia</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='NA' />Namibia</li>";

ob_start();
$results = exec("cat countries.txt | grep NR");
ob_end_clean();
	if ($results == 'NR')
		echo "<li><input name='formCountry[]' type='checkbox' value='NR' checked/>Nauru</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='NR' />Nauru</li>";

ob_start();
$results = exec("cat countries.txt | grep NP");
ob_end_clean();
	if ($results == 'NP')
		echo "<li><input name='formCountry[]' type='checkbox' value='NP' checked/>Nepal</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='NP' />Nepal</li>";

ob_start();
$results = exec("cat countries.txt | grep NL");
ob_end_clean();
	if ($results == 'NL')
		echo "<li><input name='formCountry[]' type='checkbox' value='NL' checked/>Netherlands</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='NL' />Netherlands</li>";

ob_start();
$results = exec("cat countries.txt | grep AN");
ob_end_clean();
	if ($results == 'AN')
		echo "<li><input name='formCountry[]' type='checkbox' value='AN' checked/>Netherlands Antilles</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='AN' />Netherlands Antilles</li>";

ob_start();
$results = exec("cat countries.txt | grep NC");
ob_end_clean();
	if ($results == 'NC')
		echo "<li><input name='formCountry[]' type='checkbox' value='NC' checked/>New Caledonia</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='NC' />New Caledonia</li>";

ob_start();
$results = exec("cat countries.txt | grep NZ");
ob_end_clean();
	if ($results == 'NZ')
		echo "<li><input name='formCountry[]' type='checkbox' value='NZ' checked/>New Zealand</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='NZ' />New Zealand</li>";

ob_start();
$results = exec("cat countries.txt | grep NI");
ob_end_clean();
	if ($results == 'NI')
		echo "<li><input name='formCountry[]' type='checkbox' value='NI' checked/>Nicaragua</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='NI' />Nicaragua</li>";

ob_start();
$results = exec("cat countries.txt | grep NE");
ob_end_clean();
	if ($results == 'NE')
		echo "<li><input name='formCountry[]' type='checkbox' value='NE' checked/>Niger</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='NE' />Niger</li>";

ob_start();
$results = exec("cat countries.txt | grep NG");
ob_end_clean();
	if ($results == 'NG')
		echo "<li><input name='formCountry[]' type='checkbox' value='NG' checked/>Nigeria</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='NG' />Nigeria</li>";

ob_start();
$results = exec("cat countries.txt | grep NU");
ob_end_clean();
	if ($results == 'NU')
		echo "<li><input name='formCountry[]' type='checkbox' value='NU' checked/>Niue</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='NU' />Niue</li>";

ob_start();
$results = exec("cat countries.txt | grep NF");
ob_end_clean();
	if ($results == 'NF')
		echo "<li><input name='formCountry[]' type='checkbox' value='NF' checked/>Norfolk Island</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='NF' />Norfolk Island</li>";

//ob_start();
//$results = exec("cat countries.txt | grep XX");
//ob_end_clean();
//	if ($results == 'XX')
//		echo "<li><input name='formCountry[]' type='checkbox' value='North_Korea' checked/>North Korea</li>";
//	else
//		echo "<li><input name='formCountry[]' type='checkbox' value='North_Korea' />North Korea</li>";

ob_start();
$results = exec("cat countries.txt | grep MP");
ob_end_clean();
	if ($results == 'MP')
		echo "<li><input name='formCountry[]' type='checkbox' value='MP' checked/>Northern Mariana Islands</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='MP' />Northern Mariana Islands</li>";

ob_start();
$results = exec("cat countries.txt | grep NO");
ob_end_clean();
	if ($results == 'NO')
		echo "<li><input name='formCountry[]' type='checkbox' value='NO' checked/>Norway</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='NO' />Norway</li>";

?>		
</ul>

<h3 class="menuheader expandable">O&#39;s</h3>
<ul class="categoryitems">
<?php
ob_start();
$results = exec("cat countries.txt | grep OM");
ob_end_clean();
	if ($results == 'OM')
		echo "<li><input name='formCountry[]' type='checkbox' value='OM' checked/>Oman</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='OM' />Oman</li>";


?>		
</ul>

<h3 class="menuheader expandable">P&#39;s</h3>
<ul class="categoryitems">
<?php
//ob_start();
//$results = exec("cat countries.txt | grep PK");
//ob_end_clean();
//	if ($results == 'PK')
//		echo "<li><input name='formCountry[]' type='checkbox' value='PK' checked/>Pakistan</li>";
//	else
//		echo "<li><input name='formCountry[]' type='checkbox' value='PK' />Pakistan</li>";

ob_start();
$results = exec("cat countries.txt | grep PW");
ob_end_clean();
	if ($results == 'PW')
		echo "<li><input name='formCountry[]' type='checkbox' value='PW' checked/>Palau</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='PW' />Palau</li>";

ob_start();
$results = exec("cat countries.txt | grep PS");
ob_end_clean();
	if ($results == 'PS')
		echo "<li><input name='formCountry[]' type='checkbox' value='PS' checked/>Palestine</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='PS' />Palestine</li>";

ob_start();
$results = exec("cat countries.txt | grep PA");
ob_end_clean();
	if ($results == 'PA')
		echo "<li><input name='formCountry[]' type='checkbox' value='PA' checked/>Panama</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='PA' />Panama</li>";

ob_start();
$results = exec("cat countries.txt | grep PG");
ob_end_clean();
	if ($results == 'PG')
		echo "<li><input name='formCountry[]' type='checkbox' value='PG' checked/>Papua New Guinea</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='PG' />Papua New Guinea</li>";

ob_start();
$results = exec("cat countries.txt | grep PY");
ob_end_clean();
	if ($results == 'PY')
		echo "<li><input name='formCountry[]' type='checkbox' value='PY' checked/>Paraguay</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='PY' />Paraguay</li>";

ob_start();
$results = exec("cat countries.txt | grep PE");
ob_end_clean();
	if ($results == 'PE')
		echo "<li><input name='formCountry[]' type='checkbox' value='PE' checked/>Peru</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='PE' />Peru</li>";

ob_start();
$results = exec("cat countries.txt | grep PH");
ob_end_clean();
	if ($results == 'PH')
		echo "<li><input name='formCountry[]' type='checkbox' value='PH' checked/>Philippines</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='PH' />Philippines</li>";

ob_start();
$results = exec("cat countries.txt | grep PN");
ob_end_clean();
	if ($results == 'PN')
		echo "<li><input name='formCountry[]' type='checkbox' value='PN' checked/>Pitcairn</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='PN' />Pitcairn</li>";

ob_start();
$results = exec("cat countries.txt | grep PL");
ob_end_clean();
	if ($results == 'PL')
		echo "<li><input name='formCountry[]' type='checkbox' value='PL' checked/>Poland</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='PL' />Poland</li>";

ob_start();
$results = exec("cat countries.txt | grep PT");
ob_end_clean();
	if ($results == 'PT')
		echo "<li><input name='formCountry[]' type='checkbox' value='PT' checked/>Portugal</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='PT' />Portugal</li>";

ob_start();
$results = exec("cat countries.txt | grep PR");
ob_end_clean();
	if ($results == 'PR')
		echo "<li><input name='formCountry[]' type='checkbox' value='PR' checked/>Puerto Rico</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='PR' />Puerto Rico</li>";

?>		
</ul>

<h3 class="menuheader expandable">Q&#39;s</h3>
<ul class="categoryitems">
<?php
ob_start();
$results = exec("cat countries.txt | grep QA");
ob_end_clean();
	if ($results == 'QA')
		echo "<li><input name='formCountry[]' type='checkbox' value='QA' checked/>Qatar</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='QA' />Qatar</li>";

?>		
</ul>
</div>
</td>
		<td><div class="arrowlistmenu">

<h3 class="menuheader expandable">R&#39;s</h3>
<ul class="categoryitems">
<?php
ob_start();
$results = exec("cat countries.txt | grep RE");
ob_end_clean();
	if ($results == 'RE')
		echo "<li><input name='formCountry[]' type='checkbox' value='RE' checked/>R�union</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='RE' />R�union</li>";

ob_start();
$results = exec("cat countries.txt | grep RO");
ob_end_clean();
	if ($results == 'RO')
		echo "<li><input name='formCountry[]' type='checkbox' value='RO' checked/>Romania</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='RO' />Romania</li>";

//ob_start();
//$results = exec("cat countries.txt | grep RU");
//ob_end_clean();
//	if ($results == 'RU')
//		echo "<li><input name='formCountry[]' type='checkbox' value='RU' checked/>Russian Federation</li>";
//	else
//		echo "<li><input name='formCountry[]' type='checkbox' value='RU' />Russian Federation</li>";

ob_start();
$results = exec("cat countries.txt | grep RW");
ob_end_clean();
	if ($results == 'RW')
		echo "<li><input name='formCountry[]' type='checkbox' value='RW' checked/>Rwanda</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='RW' />Rwanda</li>";

?>		
</ul>

<h3 class="menuheader expandable">S&#39;s</h3>
<ul class="categoryitems">
<?php
ob_start();
$results = exec("cat countries.txt | grep BL");
ob_end_clean();
	if ($results == 'BL')
		echo "<li><input name='formCountry[]' type='checkbox' value='BL' checked/>Saint Barthelemy</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='BL' />Saint Barthelemy</li>";
		
ob_start();
$results = exec("cat countries.txt | grep SH");
ob_end_clean();
	if ($results == 'SH')
		echo "<li><input name='formCountry[]' type='checkbox' value='SH' checked/>Saint Helena</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='SH' />Saint Helena</li>";

ob_start();
$results = exec("cat countries.txt | grep KN");
ob_end_clean();
	if ($results == 'KN')
		echo "<li><input name='formCountry[]' type='checkbox' value='KN' checked/>Saint Kitts and Nevis</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='KN' />Saint Kitts and Nevis</li>";

ob_start();
$results = exec("cat countries.txt | grep LC");
ob_end_clean();
	if ($results == 'LC')
		echo "<li><input name='formCountry[]' type='checkbox' value='LC' checked/>Saint Lucia</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='LC' />Saint Lucia</li>";
		
ob_start();
$results = exec("cat countries.txt | grep MF");
ob_end_clean();
	if ($results == 'MF')
		echo "<li><input name='formCountry[]' type='checkbox' value='MF' checked/>Saint Martin</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='MF' />Saint Martin</li>";

ob_start();
$results = exec("cat countries.txt | grep PM");
ob_end_clean();
	if ($results == 'PM')
		echo "<li><input name='formCountry[]' type='checkbox' value='PM' checked/>Saint Pierre and Miquelon</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='PM' />Saint Pierre and Miquelon</li>";

ob_start();
$results = exec("cat countries.txt | grep VC");
ob_end_clean();
	if ($results == 'VC')
		echo "<li><input name='formCountry[]' type='checkbox' value='VC' checked/>Saint Vincent and the Grenadines</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='VC' />Saint Vincent and the Grenadines</li>";

ob_start();
$results = exec("cat countries.txt | grep WS");
ob_end_clean();
	if ($results == 'WS')
		echo "<li><input name='formCountry[]' type='checkbox' value='WS' checked/>Samoa</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='WS' />Samoa</li>";

ob_start();
$results = exec("cat countries.txt | grep SM");
ob_end_clean();
	if ($results == 'SM')
		echo "<li><input name='formCountry[]' type='checkbox' value='SM' checked/>San Marino</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='SM' />San Marino</li>";

ob_start();
$results = exec("cat countries.txt | grep ST");
ob_end_clean();
	if ($results == 'ST')
		echo "<li><input name='formCountry[]' type='checkbox' value='ST' checked/>Sao Tome and Principe</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='ST' />Sao Tome and Principe</li>";

ob_start();
$results = exec("cat countries.txt | grep SA");
ob_end_clean();
	if ($results == 'SA')
		echo "<li><input name='formCountry[]' type='checkbox' value='SA' checked/>Saudi Arabia</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='SA' />Saudi Arabia</li>";

ob_start();
$results = exec("cat countries.txt | grep SN");
ob_end_clean();
	if ($results == 'SN')
		echo "<li><input name='formCountry[]' type='checkbox' value='SN' checked/>Senegal</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='SN' />Senegal</li>";

ob_start();
$results = exec("cat countries.txt | grep RS");
ob_end_clean();
	if ($results == 'RS')
		echo "<li><input name='formCountry[]' type='checkbox' value='RS' checked/>Serbia</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='RS' />Serbia</li>";

ob_start();
$results = exec("cat countries.txt | grep SC");
ob_end_clean();
	if ($results == 'SC')
		echo "<li><input name='formCountry[]' type='checkbox' value='SC' checked/>Seychelles</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='SC' />Seychelles</li>";

ob_start();
$results = exec("cat countries.txt | grep SL");
ob_end_clean();
	if ($results == 'SL')
		echo "<li><input name='formCountry[]' type='checkbox' value='SL' checked/>Sierra Leone</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='SL' />Sierra Leone</li>";

ob_start();
$results = exec("cat countries.txt | grep SG");
ob_end_clean();
	if ($results == 'SG')
		echo "<li><input name='formCountry[]' type='checkbox' value='SG' checked/>Singapore</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='SG' />Singapore</li>";
		
ob_start();
$results = exec("cat countries.txt | grep SX");
ob_end_clean();
	if ($results == 'SX')
		echo "<li><input name='formCountry[]' type='checkbox' value='SX' checked/>Sint Maarten</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='SX' />Sint Maarten</li>";

ob_start();
$results = exec("cat countries.txt | grep SK");
ob_end_clean();
	if ($results == 'SK')
		echo "<li><input name='formCountry[]' type='checkbox' value='SK' checked/>Slovakia</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='SK' />Slovakia</li>";

ob_start();
$results = exec("cat countries.txt | grep SI");
ob_end_clean();
	if ($results == 'SI')
		echo "<li><input name='formCountry[]' type='checkbox' value='SI' checked/>Slovenia</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='SI' />Slovenia</li>";

ob_start();
$results = exec("cat countries.txt | grep SB");
ob_end_clean();
	if ($results == 'SB')
		echo "<li><input name='formCountry[]' type='checkbox' value='SB' checked/>Solomon Islands</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='SB' />Solomon Islands</li>";

ob_start();
$results = exec("cat countries.txt | grep SO");
ob_end_clean();
	if ($results == 'SO')
		echo "<li><input name='formCountry[]' type='checkbox' value='SO' checked/>Somalia</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='SO' />Somalia</li>";

ob_start();
$results = exec("cat countries.txt | grep ZA");
ob_end_clean();
	if ($results == 'ZA')
		echo "<li><input name='formCountry[]' type='checkbox' value='ZA' checked/>South Africa</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='ZA' />South Africa</li>";

ob_start();
$results = exec("cat countries.txt | grep GS");
ob_end_clean();
	if ($results == 'GS')
		echo "<li><input name='formCountry[]' type='checkbox' value='GS' checked/>South Georgia and the South Sandwich Islands</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='GS' />South Georgia and the South Sandwich Islands</li>";

//ob_start();
//$results = exec("cat countries.txt | grep XX");
//ob_end_clean();
//	if ($results == 'XX')
//		echo "		<li><input name='formCountry[]' type='checkbox' value='South_Korea' checked/>South Korea</li>";
//	else
//		echo "		<li><input name='formCountry[]' type='checkbox' value='South_Korea' />South Korea</li>";

ob_start();
$results = exec("cat countries.txt | grep ES");
ob_end_clean();
	if ($results == 'ES')
		echo "<li><input name='formCountry[]' type='checkbox' value='ES' checked/>Spain</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='ES' />Spain</li>";

ob_start();
$results = exec("cat countries.txt | grep LK");
ob_end_clean();
	if ($results == 'LK')
		echo "<li><input name='formCountry[]' type='checkbox' value='LK' checked/>Sri Lanka</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='LK' />Sri Lanka</li>";

ob_start();
$results = exec("cat countries.txt | grep SD");
ob_end_clean();
	if ($results == 'SD')
		echo "<li><input name='formCountry[]' type='checkbox' value='SD' checked/>Sudan</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='SD' />Sudan</li>";

ob_start();
$results = exec("cat countries.txt | grep SR");
ob_end_clean();
	if ($results == 'SR')
		echo "<li><input name='formCountry[]' type='checkbox' value='SR' checked/>Suriname</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='SR' />Suriname</li>";

ob_start();
$results = exec("cat countries.txt | grep SJ");
ob_end_clean();
	if ($results == 'SJ')
		echo "<li><input name='formCountry[]' type='checkbox' value='SJ' checked/>Svalbard and Jan Mayen</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='SJ' />Svalbard and Jan Mayen</li>";

ob_start();
$results = exec("cat countries.txt | grep SZ");
ob_end_clean();
	if ($results == 'SZ')
		echo "<li><input name='formCountry[]' type='checkbox' value='SZ' checked/>Swaziland</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='SZ' />Swaziland</li>";

ob_start();
$results = exec("cat countries.txt | grep SE");
ob_end_clean();
	if ($results == 'SE')
		echo "<li><input name='formCountry[]' type='checkbox' value='SE' checked/>Sweden</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='SE' />Sweden</li>";

ob_start();
$results = exec("cat countries.txt | grep CH");
ob_end_clean();
	if ($results == 'CH')
		echo "<li><input name='formCountry[]' type='checkbox' value='CH' checked/>Switzerland</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='CH' />Switzerland</li>";

ob_start();
$results = exec("cat countries.txt | grep SY");
ob_end_clean();
	if ($results == 'SY')
		echo "<li><input name='formCountry[]' type='checkbox' value='SY' checked/>Syria</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='SY' />Syria</li>";

?>		
</ul>

<h3 class="menuheader expandable">T&#39;s</h3>
<ul class="categoryitems">
<?php
ob_start();
$results = exec("cat countries.txt | grep TW");
ob_end_clean();
	if ($results == 'TW')
		echo "<li><input name='formCountry[]' type='checkbox' value='TW' checked/>Taiwan</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='TW' />Taiwan</li>";

ob_start();
$results = exec("cat countries.txt | grep TJ");
ob_end_clean();
	if ($results == 'TJ')
		echo "<li><input name='formCountry[]' type='checkbox' value='TJ' checked/>Tajikistan</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='TJ' />Tajikistan</li>";

ob_start();
$results = exec("cat countries.txt | grep TZ");
ob_end_clean();
	if ($results == 'TZ')
		echo "<li><input name='formCountry[]' type='checkbox' value='TZ' checked/>Tanzania</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='TZ' />Tanzania</li>";

ob_start();
$results = exec("cat countries.txt | grep TH");
ob_end_clean();
	if ($results == 'TH')
		echo "<li><input name='formCountry[]' type='checkbox' value='TH' checked/>Thailand</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='TH' />Thailand</li>";

ob_start();
$results = exec("cat countries.txt | grep TL");
ob_end_clean();
	if ($results == 'TL')
		echo "<li><input name='formCountry[]' type='checkbox' value='TL' checked/>Timor-Leste</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='TL' />Timor-Leste</li>";

ob_start();
$results = exec("cat countries.txt | grep TG");
ob_end_clean();
	if ($results == 'TG')
		echo "<li><input name='formCountry[]' type='checkbox' value='TG' checked/>Togo</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='TG' />Togo</li>";

ob_start();
$results = exec("cat countries.txt | grep TK");
ob_end_clean();
	if ($results == 'TK')
		echo "<li><input name='formCountry[]' type='checkbox' value='TK' checked/>Tokelau</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='TK' />Tokelau</li>";

ob_start();
$results = exec("cat countries.txt | grep TO");
ob_end_clean();
	if ($results == 'TO')
		echo "<li><input name='formCountry[]' type='checkbox' value='TO' checked/>Tonga</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='TO' />Tonga</li>";

ob_start();
$results = exec("cat countries.txt | grep TT");
ob_end_clean();
	if ($results == 'TT')
		echo "<li><input name='formCountry[]' type='checkbox' value='TT' checked/>Trinidad and Tobago</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='TT' />Trinidad and Tobago</li>";

ob_start();
$results = exec("cat countries.txt | grep TN");
ob_end_clean();
	if ($results == 'TN')
		echo "<li><input name='formCountry[]' type='checkbox' value='TN' checked/>Tunisia</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='TN' />Tunisia</li>";

//ob_start();
//$results = exec("cat countries.txt | grep TR");
//ob_end_clean();
//	if ($results == 'TR')
//		echo "<li><input name='formCountry[]' type='checkbox' value='TR' checked/>Turkey</li>";
//	else
//		echo "<li><input name='formCountry[]' type='checkbox' value='TR' />Turkey</li>";

ob_start();
$results = exec("cat countries.txt | grep TM");
ob_end_clean();

	if ($results == 'TM')
		echo "<li><input name='formCountry[]' type='checkbox' value='TM' checked/>Turkmenistan</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='TM' />Turkmenistan</li>";

ob_start();
$results = exec("cat countries.txt | grep TC");
ob_end_clean();
	if ($results == 'TC')
		echo "<li><input name='formCountry[]' type='checkbox' value='TC' checked/>Turks and Caicos Islands</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='TC' />Turks and Caicos Islands</li>";

ob_start();
$results = exec("cat countries.txt | grep TV");
ob_end_clean();
	if ($results == 'TV')
		echo "<li><input name='formCountry[]' type='checkbox' value='TV' checked/>Tuvalu</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='TV' />Tuvalu</li>";

?>		
</ul>

<h3 class="menuheader expandable">U&#39;s</h3>
<ul class="categoryitems">
<?php
ob_start();
$results = exec("cat countries.txt | grep UG");
ob_end_clean();
	if ($results == 'UG')
		echo "<li><input name='formCountry[]' type='checkbox' value='UG' checked/>Uganda</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='UG' />Uganda</li>";

//ob_start();
//$results = exec("cat countries.txt | grep UA");
//ob_end_clean();
//	if ($results == 'UA')
//		echo "<li><input name='formCountry[]' type='checkbox' value='UA' checked/>Ukraine</li>";
//	else
//		echo "<li><input name='formCountry[]' type='checkbox' value='UA' />Ukraine</li>";

ob_start();
$results = exec("cat countries.txt | grep AE");
ob_end_clean();
	if ($results == 'AE')
		echo "<li><input name='formCountry[]' type='checkbox' value='AE' checked/>United Arab Emirates</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='AE' />United Arab Emirates</li>";

ob_start();
$results = exec("cat countries.txt | grep GB");
ob_end_clean();
	if ($results == 'GB')
		echo "<li><input name='formCountry[]' type='checkbox' value='GB' checked/>United Kingdom</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='GB' />United Kingdom</li>";

ob_start();
$results = exec("cat countries.txt | grep US");
ob_end_clean();
	if ($results == 'US')
		echo "<li><input name='formCountry[]' type='checkbox' value='US' checked/>United States</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='US' />United States</li>";

ob_start();
$results = exec("cat countries.txt | grep UM");
ob_end_clean();
	if ($results == 'UM')
		echo "<li><input name='formCountry[]' type='checkbox' value='UM' checked/>United States Minor Outlying Islands</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='UM' />United States Minor Outlying Islands</li>";

ob_start();
$results = exec("cat countries.txt | grep UY");
ob_end_clean();
	if ($results == 'UY')
		echo "<li><input name='formCountry[]' type='checkbox' value='UY' checked/>Uruguay</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='UY' />Uruguay</li>";

ob_start();
$results = exec("cat countries.txt | grep UZ");
ob_end_clean();
	if ($results == 'UZ')
		echo "<li><input name='formCountry[]' type='checkbox' value='UZ' checked/>Uzbekistan</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='UZ' />Uzbekistan</li>";

?>		
</ul>

<h3 class="menuheader expandable">V&#39;s</h3>
<ul class="categoryitems">
<?php
ob_start();
$results = exec("cat countries.txt | grep VU");
ob_end_clean();
	if ($results == 'VU')
		echo "<li><input name='formCountry[]' type='checkbox' value='VU' checked/>Vanuatu</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='VU' />Vanuatu</li>";

//ob_start();
//$results = exec("cat countries.txt | grep VE");
//ob_end_clean();
//	if ($results == 'VE')
//		echo "<li><input name='formCountry[]' type='checkbox' value='VE' checked/>Venezuela</li>";
//	else
//		echo "<li><input name='formCountry[]' type='checkbox' value='VE' />Venezuela</li>";

//ob_start();
//$results = exec("cat countries.txt | grep VN");
//ob_end_clean();
//	if ($results == 'VN')
//		echo "<li><input name='formCountry[]' type='checkbox' value='VN' checked/>Vietnam</li>";
//	else
//		echo "<li><input name='formCountry[]' type='checkbox' value='VN' />Vietnam</li>";

ob_start();
$results = exec("cat countries.txt | grep VG");
ob_end_clean();
	if ($results == 'VG')
		echo "<li><input name='formCountry[]' type='checkbox' value='VG' checked/>Virgin Islands, British</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='VG' />Virgin Islands, British</li>";

ob_start();
$results = exec("cat countries.txt | grep VI");
ob_end_clean();
	if ($results == 'VI')
		echo "<li><input name='formCountry[]' type='checkbox' value='VI' checked/>Virgin Islands, U.S.</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='VI' />Virgin Islands, U.S.</li>";

?>		
</ul>

<h3 class="menuheader expandable">W&#39;s</h3>
<ul class="categoryitems">
<?php
ob_start();
$results = exec("cat countries.txt | grep WF");
ob_end_clean();
	if ($results == 'WF')
		echo "<li><input name='formCountry[]' type='checkbox' value='WF' checked/>Wallis and Futuna Islands</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='WF' />Wallis and Futuna Islands</li>";

ob_start();
$results = exec("cat countries.txt | grep EH");
ob_end_clean();
	if ($results == 'EH')
		echo "<li><input name='formCountry[]' type='checkbox' value='EH' checked/>Western Sahara</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='EH' />Western Sahara</li>";

?>		
</ul>

<h3 class="menuheader expandable">X&#39;s</h3>
<ul class="categoryitems">
<li>&lt;insert easter egg&gt;</li>

</ul>

<h3 class="menuheader expandable">Y&#39;s</h3>
<ul class="categoryitems">
<?php
ob_start();
$results = exec("cat countries.txt | grep YE");
ob_end_clean();
	if ($results == 'YE')
		echo "<li><input name='formCountry[]' type='checkbox' value='YE' checked/>Yemen</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='YE' />Yemen</li>";

//ob_start();
//$results = exec("cat countries.txt | grep XX");
//ob_end_clean();
//	if ($results == 'XX')
//		echo "<li><input name='formCountry[]' type='checkbox' value='Yugoslavia' checked/>Yugoslavia</li>";
//	else
//		echo "<li><input name='formCountry[]' type='checkbox' value='Yugoslavia' />Yugoslavia</li>";

?>	
</ul>

<h3 class="menuheader expandable">Z&#39;s</h3>
<ul class="categoryitems">
<?php
ob_start();
$results = exec("cat countries.txt | grep ZM");
ob_end_clean();
	if ($results == 'ZM')
		echo "<li><input name='formCountry[]' type='checkbox' value='ZM' checked/>Zambia</li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='ZM' />Zambia</li>";

ob_start();
$results = exec("cat countries.txt | grep ZW");
ob_end_clean();
	if ($results == 'ZW')
		echo "<li><input name='formCountry[]' type='checkbox' value='ZW' checked/>Zimbabwe </li>";
	else
		echo "<li><input name='formCountry[]' type='checkbox' value='ZW' />Zimbabwe </li>";

?>		

</ul>


<div>
</div>

</div>
</td>
	</tr>
</table>


	  
	  <br/><br/>
	  <input type="submit" name="formSubmit" value="Commit Countries" />
	  </p>
</form>
<br/>

	


</div>
<?php
	//This input guarantees that a POST is sent
	echo "<input type='hidden' name='zzz' value='required'>";
?>

</td>
</tr>
</table>
    </td>
	  
	 
    </tr>
   
  
</table>
</div>
<br>
<?php 
	echo "Current Status = ";
	ob_start();
	$results = exec("pfctl -s rules | grep -c countryblock");
	ob_end_clean(); 
	if ($results > '0') echo "Running";
	else
	 echo "<span style='color:red'>NOT running</span>";
		
	//Get Errors if exists
	ob_start();
	$results = exec("tail -r errorOUT.txt");
	ob_end_clean(); 
	echo "<br/><span style='color:red'>";
	echo $results;
	echo "</span>";
	
	//Get IP Count
	echo "<br>You are blocking ";
	ob_start();
	$results = exec("pfctl -T show -t countryblock |grep -v -c Z");
	ob_end_clean();
	echo $results;
	echo " Networks";
	?>
<br><br>
<input type="submit" value="Save/Update"><br><br>
<p>
<small>Lists provided by <a href="http://www.countryipblocks.net/">countryipblocks.net</a></small>
<br /><small>Created by <a href="http://www.tomschaefer.org/pfsense">TomSchaefer</a></small>
</p>
</td>
	</tr>
</table>
</form>
<?php include("fend.inc"); ?>
</body>
</html>