<!doctype html>

<!--[if lt IE 7]> <html lang="cy" class="no-js lt-ie10 lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]>    <html lang="cy" class="no-js lt-ie10 lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]>    <html lang="cy" class="no-js lt-ie10 lt-ie9"> <![endif]-->
<!--[if IE 9]>    <html lang="cy" class="no-js lt-ie10"> <![endif]-->
<!--[if gt IE 9]><!--> <html lang="cy" class="no-js"> <!--<![endif]-->

<head>
	<meta charset="utf-8">
	<title>Safle Cynhyrchu S4C</title>
	<meta name="description" content="">
	<meta name="author" content="">
	<meta name="HandheldFriendly" content="True">
	<meta name="MobileOptimized" content="320">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<link href="/css/s4c-style-320-colour.css?v=1" rel="stylesheet">
    
    <link href="/production/c/master.css" rel="stylesheet" type="text/css" />
    
    <link href="/production/c/master-new.css" rel="stylesheet" type="text/css" />
    
    <!--[if lt IE 9]>
	<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
	<![endif]-->
	<script src="/js/respond.min.js"></script>
	<script src="/js/modernizr-2.5.3-min.js"></script>

	<style>
		div.container {
			font-size: 11px;
			line-height: 1.3em;
			margin: auto;
			padding: 4em 0;
			width: 690px;
		}
		table.greenlight-progs thead {

		}
		table.greenlight-progs th {
			background: url(img/headerSortArrows.png) no-repeat 98% 3px;
			border-bottom: #36312d 1px solid;
			color: #7b7b7b;
			cursor: pointer;
			font-size: 9px;
			font-weight: normal;
			letter-spacing: .05em;
			padding: 0 8px 22px 4px;
			text-transform: uppercase;
		}
		table.greenlight-progs th.headerSortDown {
			background-image: url(img/headerSortDown.png);
			color: #36312d;
		}
		table.greenlight-progs th.headerSortUp {
			background-image: url(img/headerSortUp.png);
			color: #36312d;
		}
		table.greenlight-progs td {
			border-bottom: 1px solid #c3c3c3;
			padding: 12px 4px 22px;
		}
		table.greenlight-progs tbody tr:nth-child(2n+1) {
			background: #f3f3f3;
		}
		td.title {
			font-weight: bold;
		}
		span.nowrap {
			white-space: nowrap;
		}
	</style>

</head>
<body>

<div class="container">
	<table class="greenlight-progs" cellspacing="0">
		<thead>
			<tr>
				<th scope="col" width="5%">
					Teitl
				</th>
				<th scope="col" width="5%">
					Cwmni
				</th>
				<th scope="col" width="5%">
					Comisiynydd
				</th>
				<th scope="col" width="5%">
					Nifer /Hyd
				</th>
				<th scope="col" width="5%">
					Genre
				</th>
				<th scope="col" width="5%">
					Darlledu
				</th>
				<th scope="col" width="70%">
					Disgrifiad
				</th>
			</tr>
		</thead>
		<tbody>
		
	<?php

	ini_set("auto_detect_line_endings", true);

	$row = 1;

	if (($handle = fopen("csv/Golau Gwyrdd.csv", "r")) !== FALSE) {
	
		while (($data = fgetcsv($handle, 1000, ",")) !== FALSE) {

			if ($row > 4) {

				$column1 		= $data[1];
				$column2 		= $data[2];
				$column3 		= $data[3];
				$column4 		= $data[6];
				$column5 		= $data[9];
				$column6 		= $data[11];
				$column7 		= $data[16];

				/*
					Cymraeg - 
					B (Teitl)
					C (Cwmni Cynhyrchu)
					D (Comisiynydd)
					G (Nifer x Hyd)
					J (Genre)
					L (Blwyddyn Darlledu)
					Q (Disgrifiad)
					
					English -
					B (Title)
					C (Production Company)
					D (commissioner)
					G (Episodes x Duration)
					K (Genre), 
					L (Transmission Year)
					P (Description)
				*/
	
				if(!empty($column1) && $column1 != "Teitl" && $column1 != "Title")
				{
				?>
	
			<tr>
				<td class="column1"><?php echo utf8_encode($column1) ?></td>
				<td class="column2"><?php echo htmlentities($column2) ?></td>
				<td class="column3"><?php echo htmlentities($column3) ?></td>
				<td class="column4"><?php echo htmlentities($column4) ?></td>
				<td class="column5"><?php echo htmlentities($column5) ?></td>
				<td class="column6"><?php echo htmlentities($column6) ?></td>
				<td class="column7"><?php echo utf8_encode($column7) ?></td>
			</tr>
	
			<?php
			}

			}

			$row = $row + 1;

		}
	
		fclose($handle);
	
	}
	?>
		</tbody>
	</table>
</div>

<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
<script src="js/jquery.tablesorter.min.js"></script>
<script>
$(document).ready(function(){
	$("table.greenlight-progs").tablesorter();
});

</script>
<script src="/js/menu.js"></script>
</body>
</html>