<commit_before><?php
require ("Include/Config.php");
require ("Include/Functions.php");
require ("Include/Header.php");
require ("Include/ReportFunctions.php");

if ($nChurchLatitude == 0 || $nChurchLongitude == 0) {

	require ("Include/GeoCoder.php");
	$myAddressLatLon = new AddressLatLon;

	// Try to look up the church address to center the map.
	// Read values from config table into local variables
	// **************************************************
	$sSQL = "SELECT cfg_name, IFNULL(cfg_value, cfg_default) AS value FROM config_cfg WHERE cfg_section='ChurchInfoReport'";
	$rsConfig = mysql_query($sSQL);			// Can't use RunQuery -- not defined yet
	if ($rsConfig) {
		while (list($cfg_name, $cfg_value) = mysql_fetch_row($rsConfig)) {
			$$cfg_name = $cfg_value;
		}
	}

	$myAddressLatLon->SetAddress ($sChurchAddress, $sChurchCity, $sChurchState, $sChurchZip);
	$ret = $myAddressLatLon->Lookup ();
	if ($ret == 0) {
		$nChurchLatitude = $myAddressLatLon->GetLat ();
		$nChurchLongitude = $myAddressLatLon->GetLon ();

		$sSQL = "UPDATE config_cfg SET cfg_value=' . $nChurchLatitude . ' WHERE cfg_name=\"nChurchLatitude\"";
		RunQuery ($sSQL);
		$sSQL = "UPDATE config_cfg SET cfg_value=' . $nChurchLongitude . ' WHERE cfg_name=\"nChurchLongitude\"";
		RunQuery ($sSQL);
	}
}

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

  <head>
    <script src="http://maps.google.com/maps?file=api&v=1&key=<?php echo $sGoogleMapKey; ?>" type="text/javascript"></script>

  </head>
  <body>
    <div id="map" style="width: 600px; height: 450px"></div>


    <script type="text/javascript">
    //<![CDATA[
   
    var map = new GMap(document.getElementById("map"));
    map.addControl(new GSmallMapControl());
    map.addControl(new GMapTypeControl());
    map.centerAndZoom(new GPoint(<?php echo $nChurchLongitude . ", " . $nChurchLatitude; ?>), 4);

	var churchPt = new GPoint (<?php echo $nChurchLongitude . ", " . $nChurchLatitude; ?> );
	var churchMark = new GMarker (churchPt);
	<?php 
		$churchDescription = $sChurchName;
		$churchDescription .= "<p>" . $sChurchAddress . "<p>" . $sChurchCity . ", " . $sChurchState . "  " . $sChurchZip;
	?>
	GEvent.addListener(churchMark, "click", function() {churchMark.openInfoWindowHtml("<?php echo $churchDescription; ?>");});
	map.addOverlay (churchMark);

<?php
	$sSQL = "SELECT fam_ID, fam_Name, fam_latitude, fam_longitude, fam_Address1, fam_City, fam_State, fam_Zip FROM family_fam";
	$rsFams = RunQuery ($sSQL);
	while ($aFam = mysql_fetch_array($rsFams)) {
		extract ($aFam);
		if ($fam_longitude != 0 && $fam_latitude != 0) {
?>
			var famPt<?php echo $fam_ID; ?> = new GPoint (<?php echo $fam_longitude . ", " . $fam_latitude; ?> );
			var famMark<?php echo $fam_ID; ?> = new GMarker (famPt<?php echo $fam_ID; ?>);
			<?php 
				$famDescription = MakeSalutationUtility ($fam_ID);
				$famDescription .= "<p>" . $fam_Address1 . "<p>" . $fam_City . ", " . $fam_State . "  " . $fam_Zip;
			?>
			GEvent.addListener(famMark<?php echo $fam_ID; ?>, "click", function() {famMark<?php echo $fam_ID; ?>.openInfoWindowHtml("<?php echo $famDescription; ?>");});

			map.addOverlay (famMark<?php echo $fam_ID; ?>);
<?php
		}

	}
?>

    //]]>
    </script>

  </body>
</html>
<commit_msg>Fixed update of church coords<commit_after><?php
require ("Include/Config.php");
require ("Include/Functions.php");
require ("Include/Header.php");
require ("Include/ReportFunctions.php");

if ($nChurchLatitude == 0 || $nChurchLongitude == 0) {

	require ("Include/GeoCoder.php");
	$myAddressLatLon = new AddressLatLon;

	// Try to look up the church address to center the map.
	// Read values from config table into local variables
	// **************************************************
	$sSQL = "SELECT cfg_name, IFNULL(cfg_value, cfg_default) AS value FROM config_cfg WHERE cfg_section='ChurchInfoReport'";
	$rsConfig = mysql_query($sSQL);			// Can't use RunQuery -- not defined yet
	if ($rsConfig) {
		while (list($cfg_name, $cfg_value) = mysql_fetch_row($rsConfig)) {
			$$cfg_name = $cfg_value;
		}
	}

	$myAddressLatLon->SetAddress ($sChurchAddress, $sChurchCity, $sChurchState, $sChurchZip);
	$ret = $myAddressLatLon->Lookup ();
	if ($ret == 0) {
		$nChurchLatitude = $myAddressLatLon->GetLat ();
		$nChurchLongitude = $myAddressLatLon->GetLon ();

		$sSQL = "UPDATE config_cfg SET cfg_value='" . $nChurchLatitude . "' WHERE cfg_name=\"nChurchLatitude\"";
		RunQuery ($sSQL);
		$sSQL = "UPDATE config_cfg SET cfg_value='" . $nChurchLongitude . "' WHERE cfg_name=\"nChurchLongitude\"";
		RunQuery ($sSQL);
	}
}

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

  <head>
    <script src="http://maps.google.com/maps?file=api&v=1&key=<?php echo $sGoogleMapKey; ?>" type="text/javascript"></script>

  </head>
  <body>
    <div id="map" style="width: 600px; height: 450px"></div>


    <script type="text/javascript">
    //<![CDATA[
   
    var map = new GMap(document.getElementById("map"));
    map.addControl(new GSmallMapControl());
    map.addControl(new GMapTypeControl());
    map.centerAndZoom(new GPoint(<?php echo $nChurchLongitude . ", " . $nChurchLatitude; ?>), 4);

	var churchPt = new GPoint (<?php echo $nChurchLongitude . ", " . $nChurchLatitude; ?> );
	var churchMark = new GMarker (churchPt);
	<?php 
		$churchDescription = $sChurchName;
		$churchDescription .= "<p>" . $sChurchAddress . "<p>" . $sChurchCity . ", " . $sChurchState . "  " . $sChurchZip;
	?>
	GEvent.addListener(churchMark, "click", function() {churchMark.openInfoWindowHtml("<?php echo $churchDescription; ?>");});
	map.addOverlay (churchMark);

<?php
	$sSQL = "SELECT fam_ID, fam_Name, fam_latitude, fam_longitude, fam_Address1, fam_City, fam_State, fam_Zip FROM family_fam";
	$rsFams = RunQuery ($sSQL);
	while ($aFam = mysql_fetch_array($rsFams)) {
		extract ($aFam);
		if ($fam_longitude != 0 && $fam_latitude != 0) {
?>
			var famPt<?php echo $fam_ID; ?> = new GPoint (<?php echo $fam_longitude . ", " . $fam_latitude; ?> );
			var famMark<?php echo $fam_ID; ?> = new GMarker (famPt<?php echo $fam_ID; ?>);
			<?php 
				$famDescription = MakeSalutationUtility ($fam_ID);
				$famDescription .= "<p>" . $fam_Address1 . "<p>" . $fam_City . ", " . $fam_State . "  " . $fam_Zip;
			?>
			GEvent.addListener(famMark<?php echo $fam_ID; ?>, "click", function() {famMark<?php echo $fam_ID; ?>.openInfoWindowHtml("<?php echo $famDescription; ?>");});

			map.addOverlay (famMark<?php echo $fam_ID; ?>);
<?php
		}

	}
?>

    //]]>
    </script>

  </body>
</html>

{'fraction_non_alphanumeric': 0.1964179104477612, 'fraction_numerical': 0.007761194029850746, 'mean_word_length': 4.4435418359057675, 'pattern_counts': {'":': 0, '<': 73, '<?xml version=': 0, '>': 81, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2108294', 'n_tokens_mistral': 2612, 'n_tokens_neox': 2391, 'n_words': 496}