<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
<head>
	<title>Christian Furry Fellowship at St. Fred's Cathedral - Hymnal</title>
<link rel="shortcut icon" href="cfficon.ico" />
	<link rel="stylesheet" type="text/css" href="stfred-2015.css" />
</head>
<body>
	
<?php
	require("fred-topwrap.php");
?>
	<!--Page content below -->


<h2>St. Fred's Online Hymnal</h2>
	<p style="text-align:center;">	This page is still partially under construction.  Songs will be added to the hymnal as they are completed.<br/>
	Songs marked with an asterisk (*) have yet to be added.<br/>
	Songs not in bold are copyrighted.  We ask that these not be copied. <br/>
	Songs in <b>bold</b> are public domain and may be copied and disseminated freely.<br/>  
	Songs in <i>italics</i> are not found in our sister hymnal.
	</p>
<div  style="height:700px; overflow:auto;">
	<table border="1px" class="hymnTable">
	<colgroup>
		<col span="1" style="text-align:right;width:30px;">
	</colgroup>
	<thead>
		<tr>
			<th>#</th>
			<th>Title</th>
			<th>Lyrics</th>
			<th>MP3</th>
			<th>MIDI</th>
			<th>NWC</th>
			<th>Alternate</th>
		</tr>
	</thead>	
	
	<?php
	 include("music/new_hymnal/hymnarray.php");
	 
			// AUTOMAGIC HYMNAL BUILDING SCRIPT -- UNDER PROGRESS
			$hymnalFolder = "music/new_hymnal/";
			$hymnMusicFolder ="music/new_hymnal/z_/";
			$hymnalImageFolder = "music/new_hymnal/images/";
			
		foreach ($hymnArray as $key => $hymnName)
		  {

				//FILTER OUTPUT FOR DIGIT NUMBER											
				if ($key < 10){
					$hymnCode = "00" . $key;
				}
				else if ($key < 100){
					$hymnCode = "0" . $key;
				}
				else {
					$hymnCode = $key;
				}
								
				echo "<tr>" . "\n";
				//echo "<td>" . $hymnCode . "</td>" . "\n";
				echo "<td>" . "<a href=\"" . $hymnalFolder . "hymndisplay.php?hymn=" . $hymnCode .  "\" target=\"hymnpage\">" . $hymnCode . "</a>" . "</td>" . "\n";
				echo "<td>" . $hymnName . "</td>" . "\n";
				
				//TEST FOR $hymnCode.TXT FILE
				if (is_file( $hymnMusicFolder . $hymnCode . ".txt" ))	{
					echo "<td class=\"icon\"><a href=\"" . $hymnMusicFolder . $hymnCode  . ".txt\" target=\"wurdz\"><img src=\"" . $hymnalImageFolder . "text-x-preview.png\" class=\"icon\" alt=\"Lyrics\"/></a></td>" . "\n";		}
				else {	echo "<td class=\"icon\"></td>" . "\n";	}				
				//TEST FOR $hymnCode.MP3 FILE
				if (is_file( $hymnMusicFolder . $hymnCode . ".mp3" ))		{
					echo "<td class=\"icon\"><a href=\"" . $hymnMusicFolder . $hymnCode  . ".mp3\" target=\"empeethree\"><img src=\"" . $hymnalImageFolder . "audio-x-generic.png\" class=\"icon\" alt=\"MP3\"/></a></td>" . "\n";		}
				else {	echo "<td class=\"icon\"></td>" . "\n";	}
				//TEST FOR $hymnCode.MID FILE
				if (is_file( $hymnMusicFolder . $hymnCode . ".mid" ))		{
					echo "<td class=\"icon\"><a href=\"" . $hymnMusicFolder . $hymnCode  . ".mid\" target=\"moosic\"><img src=\"" . $hymnalImageFolder . "audio-midi.png\" class=\"icon\" alt=\"MIDI\"/></a></td>" . "\n";		}
				else {	echo "<td class=\"icon\"></td>" . "\n";	}
				//TEST FOR $hymnCode.NWC FILE
				if (is_file( $hymnMusicFolder . $hymnCode . ".nwc" ))		{
					echo "<td class=\"icon\"><a href=\"" . $hymnMusicFolder . $hymnCode  . ".nwc\" target=\"doriginul\"><img src=\"" . $hymnalImageFolder . "nted.png\" class=\"icon\" alt=\"NWC source\"/></a></td>" . "\n";	}
				else {	echo "<td class=\"icon\"></td>" . "\n";	}
				//TEST FOR $hymnCodeZ.MP3 FILE
				if (is_file( $hymnMusicFolder . $hymnCode . "z.mp3" ))		{
					echo "<td class=\"icon\"><a href=\"" . $hymnMusicFolder . $hymnCode . "z.mp3\" target=\"empeethree\"><img src=\"" . $hymnalImageFolder . "emblem-music.png\" class=\"icon\" alt=\"Alt\"/></a></td>" . "\n";	}
				else {	echo "<td class=\"icon\"></td>" . "\n";	}	
							
				echo "</tr>" . "\n";			  
				  													
		  }//end foreach
	?>

	</table>
</div>


<!-- End Content -->

<?php
	require("fred-bottomwrap.php");
?>
</body>
</html>
