<?php
	$query = "Select facebook, twitter, myspace, google_plus from storePrefs";
	$rt=mysql_query($query);          // query executed 
		echo mysql_error();                    // if any error is there that will be printed to the screen
		
if (mysql_num_rows($rt) == 0) {
	//not found, do nothing
} else {
	while($nt=mysql_fetch_array($rt)){
		if ($nt[facebook]!==""){			
			$fblink=$nt[facebook];
		}
		if ($nt[twitter]!==""){
			$twitterlink=$nt[twitter];
		}
		if ($nt[google_plus]!==""){
			$googlelink=$nt[google_plus];
		}

	}
}
	mysql_close;

?>

<div id="home-icons">
<a href="coupons-m.php"><img src="custom/images/coupons-icon.png" /></a>
<a href="specials-m.php"><img src="custom/images/specials-icon.png" /></a>
<a href="docs/Catering%20Menu.pdf" target="_blank"><img src="custom/images/catering-icon.png" /></a>
<?php
if(!empty($fblink)){
	echo '<a href="'.$fblink.'" target="blank"><img src="custom/images/facebook-icon.png" style="padding-right:.3em;" /></a>';
}
if(!empty($twitterlink)){
	echo '<a href="'.$twitterlink.'" target="blank"><img src="custom/images/twitter-icon.png" style="padding-right:.3em;"/></a>';
}
if(!empty($googlelink)){
	echo '<a href="'.$googlelink.'" target="blank"><img src="custom/images/google-plus-icon.png" style="padding-right:.3em;"/></a>';
}
if(!empty($orderurl)){
	echo '<a href="'.$orderurl.'"><img src="custom/images/order-icon.png" style="padding-right:.3em;"/></a>';
}
?>
<!--<a href="more.php"><img src="images/more-icon.png" /></a>-->
</div>