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

?>
<p><? //=anchor('admin/pages/create','Create new Page')?> </p>
<?php
	if(count($page_title)){
	?> <h3>Τίτλος Σελίδας</h3>
    <?
		echo "<table border='1' cellspacing='0' cellpadding='3' width='800'>\n";
		echo "<tr valign='top'>\n";
		echo "<th>Title</th>\n<th>Language</th>\n<th>Status</th>\n<th>Actions</th>\n";
		echo "</tr>\n";
		foreach($page_title as $key=>$list){
			if ($list['lang_id']==1){
			$lang = 'Greek';
			}
			elseif ($list['lang_id']==2){
			$lang='English';
			}
			echo "<tr valign='top'>\n";
			echo "<td>".$list['title']."</td>\n";
			echo "<td align='center'>".$lang."</td>\n";
			echo "<td align='center'>".$list['status']."</td>\n";
			echo "<td align='center'>";
			echo anchor('admin/main/edit_title/'.$list['title_id'], 'edit');
			echo "</td>\n";
			echo "</tr>\n";
		}
		echo "</table>";
		$id = $list['id'];
	}
	
	$page_content = $this->MDashboard->getPageContent($id);
	if(count($page_content)){

	?> 
    <br /><br />
   	<h3>Περιεχόμενα Σελίδας</h3>
    <p><?=anchor('admin/main/create_section/'.$list['page_id'],'Δημιουργία Νέου Περιεχομένου')?> </p>
    <?
		echo "<table border='1' cellspacing='0' cellpadding='3' width='800'>\n";
		echo "<tr valign='top'>\n";
		echo "<th>Text</th>\n<th>Language</th>\n<th>Actions</th>\n";
		echo "</tr>\n";
		foreach($page_content as $cont=>$content){
		$lang='';
		if ($content['lang_id']==1){
			$lang = 'Greek';
			}
			elseif ($content['lang_id']==2){
			$lang='English';
			}
			echo "<tr valign='top'>\n";
			echo "<td>".$content['content']."</td>\n";
			echo "<td align='center'>".$lang."</td>\n";
			echo "<td align='center'>";
			echo anchor('admin/main/edit_section/'.$content['section_id'],'edit');
			echo " | ";
			echo anchor('admin/main/delete_section/'.$content['section_id'],'delete');
			echo "</td>\n";
			echo "</tr>\n";
		}
		echo "</table>";
	}

	if(count($clients_titles)){
	?> <h3>Πελάτες</h3>
    <?
		echo "<table border='1' cellspacing='0' cellpadding='3' width='800'>\n";
		echo "<tr valign='top'>\n";
		echo "<th>Title</th>\n<th>Clients</th>\n<th>Language</th>\n<th>Actions</th>\n";
		echo "</tr>\n";
		foreach($clients_titles as $key=>$ccategory){
			if ($ccategory['lang_id']==1){
			$lang = 'Greek';
			}
			elseif ($ccategory['lang_id']==2){
			$lang='English';
			}
			echo "<tr valign='top'>\n";
			echo "<td>".$ccategory['cat_name']."</td>\n";
			echo "<td>".$ccategory['name']."</td>\n";
			echo "<td align='center'>".$lang."</td>\n";
			echo "<td align='center'>";
			echo anchor('admin/main/edit_client/'.$ccategory['id'], 'edit');
			echo "</td>\n";
			echo "</tr>\n";
		}
		echo "</table>";
		$id = $ccategory['id'];
	}

?>
