<h2><?=$title?></h2>
<?php
if ($this-> session-> flashdata('message')){
echo " <div class='warning'>";
echo $this-> session-> flashdata('message');
echo " </div> ";
}
?>
<?php
echo img('../images/products/'.$photo_info['photo_thumb']);
echo form_open('admin/categories/update_photo/'.$photo_info['photo_id']);

echo "<p><label for='photo_prjId'>Project ID</label><br/>";
$data = array('name'=>'photo_prjId','id'=>'photo_prjId','rows'=>1, 'cols'=>'100', 'value' => $photo_info['photo_prjId']);
echo form_input($data) ."</p>";

echo "<p><label for='photo_image'>Image</label><br/>";
$data = array('name'=>'photo_image','id'=>'photo_image','rows'=>3, 'cols'=>'100', 'value' => $photo_info['photo_image']);
echo form_input($data) ."</p>";

echo "<p><label for='photo_thumb'>Thumbnail</label><br/>";
$data = array('name'=>'photo_thumb','id'=>'photo_thumb','rows'=>1, 'cols'=>'40', 'value' => $photo_info['photo_thumb']);
echo form_input($data) ."</p>";

echo "<p><label for='photo_order'>Order</label><br/>";
$data = array('name'=>'photo_order','id'=>'photo_order','rows'=>1, 'cols'=>'40', 'value' => $photo_info['photo_order']);
echo form_input($data) ."</p>";

echo "<p><label for='published'>Published</label><br/>";
$options = array('Yes' => 'Yes', 'No' => 'No');
echo form_dropdown('published',$options, $photo_info['published']) ."</p>";

if(count($photo_details)==2){
$lang='both';
foreach($photo_details as $phode=>$list){

		if($list['lang_id']==1){ 
		$desc = 'Description Greek';
		$ext = 'description_gr';
		}
		else{
		$desc = 'Description English';
		$ext = 'description_en';
		}
		echo "<p><label for='description'>".$desc."</label><br/>";
		$data = array('name'=>$ext,'id'=>$ext,'rows'=>1, 'cols'=>'40', 'value' => $list['description']);
		echo form_input($data) ."</p>";
}
}
elseif(count($photo_details)==1){

foreach($photo_details as $phode=>$list){
				if($list['lang_id']==1){
				$lang='gr';
				$desc = 'Description Greek';
				$ext = 'description_gr';
				$flag='gr';
				}
				else{
				$lang='en';
				$desc = 'Description English';
				$ext = 'description_en';
				$flag='en';
				}
		echo "<p><label for='description'>".$desc."</label><br/>";
		$data = array('name'=>$ext,'id'=>$ext,'rows'=>1, 'cols'=>'40', 'value' => $list['description']);
		echo form_input($data) ."</p>";
		}
				if ($flag=='en'){		
				$desc = 'Description Greek';
				$ext = 'description_gr';
				}
				else
				{
				$desc = 'Description English';
				$ext = 'description_en';
				}
		echo "<p><label for='description'>".$desc."</label><br/>";
		$data = array('name'=>$ext,'id'=>$ext,'rows'=>1, 'cols'=>'40');
		echo form_input($data) ."</p>";
		}
		
		else{
		$lang='none';
		echo "<p><label for='description_gr'>Description Greek</label><br/>";
		$data = array('name'=>'description_gr','id'=>'description_gr','rows'=>1, 'cols'=>'40');
		echo form_input($data) ."</p>";
		echo "<p><label for='description_en'>Description English</label><br/>";
		$data = array('name'=>'description_en','id'=>'description_en','rows'=>1, 'cols'=>'40');
		echo form_input($data) ."</p>";
		}

echo form_hidden('photo_id',$photo_info['photo_id']);
echo form_hidden('lang',$lang);
echo form_submit('submit','update page');
echo form_close();
?>
