<h2><?=$title?></h2>
<?php
if ($this-> session-> flashdata('message')){
echo " <div class='warning'>";
echo $this-> session-> flashdata('message');
echo " </div> ";
}

?>
    <p><?=anchor('admin/main/create_code/','Εισαγωγή Νέου Κωδικού')?> </p>
    <?
	if(count($codes)){
		echo "<table border='1' cellspacing='0' cellpadding='3' width='400'>\n";
		echo "<tr valign='top'>\n";
		echo "<th>Όνομα</th>\n<th>Κωδικός</th>\n<th>Επιλογές</th>\n";
		echo "</tr>\n";
		foreach($codes as $cont=>$code){
			echo "<tr valign='top'>\n";
			echo "<td>".$code['name']."</td>\n";
			echo "<td align='center'>".$code['code']."</td>\n";
			echo "<td align='center'>";
			echo anchor('admin/main/edit_code/'.$code['id'],'edit');
			echo " | ";
			echo anchor('admin/main/delete_code/'.$code['id'],'delete');
			echo "</td>\n";
			echo "</tr>\n";
		}
		echo "</table>";
	}


?>
