<div class="tabbable">
	<ul class="nav nav-tabs" id="myTab">
		<li class="active"><a href="#div0" data-toggle="tab"><i class="icon-tasks"></i> <?php echo __('admin.caracteristiques_generales'); ?></a></li>
		<?php foreach($languages as $l): ?>
		<li><a href="#div<?php echo  $l->short ; ?>" data-toggle="tab"><i class="icon-flag"></i> <?php echo __('admin.informations'); ?> <img src="<?php echo  URL::to_asset('image/flag_'.strtoupper($l->short)); ?>.png" title="<?php echo $l->short; ?>" style="margin-bottom:2px;" alt=""></a></li>
		<?php endforeach; ?>
	</ul>
	
	<div class="tab-content">
		<div class="tab-pane active" id="div0">
			<table class="table table-striped">
				<tr <?php if($errors->first('customer_id')) echo 'class="error"'; ?>>
					<td style="width:300px"><?php echo __('admin.temoin'); ?> *</td>
					<td>
						<?php echo  Form::select('customer_id', $clients, Input::old('customer_id', ((isset($temoignage) && $temoignage->customer_id!='') ? $temoignage->customer_id : '')), array('style'=>'width:280px;')); ; ?>
						<?php echo  $errors->first('customer_id', '<span class="help-inline">:message</span>') ; ?>
					</td>
				</tr>
				<tr <?php if($errors->first('reference_id')) echo 'class="error"'; ?>>
					<td style="width:300px"><?php echo __('admin.reference'); ?> *</td>
					<td>
						<?php echo  Form::select('reference_id', $references, Input::old('reference_id', ((isset($temoignage) && $temoignage->reference_id!='') ? $temoignage->reference_id : '')), array('style'=>'width:600px;')); ; ?>
						<?php echo  $errors->first('reference_id', '<span class="help-inline">:message</span>') ; ?>
					</td>
				</tr>
				<tr <?php if($errors->first('youtube')) echo 'class="error"'; ?>>
					<td><?php echo __('admin.youtube_lien'); ?></td>
					<td>
						<?php echo  Form::text('youtube', Input::old('youtube', (isset($temoignage) ? $temoignage->youtube : NULL)), array('style'=>'width:587px;','placeholder'=>'Facultatif')) ; ?>
						<?php echo  $errors->first('youtube', '<span class="help-inline">:message</span>') ; ?>
						<?php if($temoignage->youtube): ?>
							<br><br>
							<iframe width="560" height="315" src="http://www.youtube.com/embed/<?php echo  $youtubeKey ; ?>?rel=0" frameborder="0" allowfullscreen></iframe>
						<?php endif; ?>
					</td>
				</tr>
				<tr <?php if($errors->first('photo')) echo 'class="error"'; ?>>
					<td>
						<?php if($photo_src): ?>
						<?php echo __('admin.modifier_la'); ?>
						<?php endif; ?>
						<?php echo __('admin.photo'); ?>
					</td>
					<td>
						<div class="fileupload fileupload-new" data-provides="fileupload">
							<div class="input-append">
								<div class="uneditable-input span3"><i class="icon-file fileupload-exists"></i> <span class="fileupload-preview"></span></div>
								<span class="btn btn-file">
									<span class="fileupload-new"><?php echo __('admin.choisir_fichier'); ?></span><span class="fileupload-exists"><?php echo __('admin.changer'); ?></span>
									<input type="file" name="photo" />
								</span>
								<a href="#" class="btn fileupload-exists" data-dismiss="fileupload"><?php echo __('admin.retirer'); ?></a>
							</div>
						</div>
						<?php echo  $errors->first('photo', '<span class="help-inline">:message</span>') ; ?>
					</td>
				</tr>
				<?php if($photo_src): ?>
				<tr <?php if($errors->first('photo')) echo 'class="error"'; ?>>
					<td><?php echo __('admin.photo_actuelle'); ?></td>
					<td>
						<img src="<?php echo $photo_src; ?>?t=<?php echo time(); ?>" alt="" title="" />
					</td>
				</tr>
				<?php endif; ?>
			</table>
		</div>
	<?php $i = 1; ?>
	<?php foreach($languages as $l): ?>
		<?php $i++; ?>
		<div class="tab-pane" id="div<?php echo  $l->short ; ?>">
		<table class="table table-striped">
			<tr>
				<td colspan="2"><strong><?php echo  $l->name ; ?></strong></td>
			</tr>
			<tr <?php if($errors->first($l->short.'_titre')) echo 'class="error"'; ?>>
				<td><?php echo __('admin.titre'); ?> *</td>
				<td>
					<?php echo  Form::text($l->short.'_titre', Input::old($l->short.'_titre', (isset($temoignage) ? $temoignage->desc[$l->id - 1]->titre : NULL)),array('style'=>'width:600px;','id'=> $l->id.'_titre')) ; ?>
					<?php echo  $errors->first($l->short.'_titre', '<span class="help-inline">:message</span>') ; ?>
				</td>
			</tr>
			<tr <?php if($errors->first($l->short.'_desc')) echo 'class="error"'; ?>>
				<td><?php echo __('admin.texte_complet'); ?></td>
				<td>
					<?php echo  Form::textarea($l->short.'_desc', Input::old($l->short.'_desc', (isset($temoignage) ? $temoignage->desc[$l->id - 1]->desc : NULL)),array('id' => 'editor'.$l->id, 'style'=>'width:600px;height:70px','class'=> $l->short.'_desc')) ; ?>
					<?php echo  $errors->first($l->short.'_desc_desc', '<span class="help-inline">:message</span>') ; ?>
				</td>
			</tr>
		</table>
		</div>
	<?php endforeach; ?>
	</div>
</div>