<ul class="nav nav-tabs">
	<li class="active"><a href="#generalinfo" data-toggle="tab"><i class="icon-list"></i> Résumé de la commande</a></li>
	<li><a href="#tabproduits" data-toggle="tab"><i class="icon-shopping-cart"></i> Produit(s)</a></li>
</ul>

<div class="tab-content">
	<div class="tab-pane active" id="generalinfo">
		<table class="table">
			<tr>
				<td width="20%"><strong>Résumé de la commande</strong></td>
				<td>
					Nombre de produit(s) : <strong><?php echo  $commande->nbarticles() ; ?> produit(s)</strong><br />
					Total HT de la commande : <strong><?php echo  $commande->total_ht ; ?> &euro; HT</strong><br />
					Total TTC de la commande : <strong><?php echo  $commande->total_ttc ; ?> &euro; TTC</strong><br />
					Montant TVA sur cette commande : <strong><?php echo  $commande->taux_tva ; ?> &euro;</strong><br />
					<u>Total à payer</u> : <strong><?php echo  number_format($commande->total_ttc + $commande->frais_port,2,',',' ') ; ?> &euro;</strong>
				</td>
			</tr>
		</table>
		<table class="table table-striped">
			<tr <?php if($errors->first('customer_id')) echo 'class="error"'; ?>>
				<td width="20%">Client</td>
				<td>
					<?php echo  Form::select('customer_id', $customers, Input::old('customer_id', (isset($commande) ? $commande->customer_id : NULL)), array('style'=>'width:400px;')); ; ?>
					<?php echo  $errors->first('customer_id', '<span class="help-inline">:message</span>') ; ?>
				</td>
			</tr>
			<tr <?php if($errors->first('statut')) echo 'class="error"'; ?>>
				<td width="20%">Statut de la commande</td>
				<td>
					<?php echo  Form::select('statut', array('en_cours'=>'En cours de validation','traite'=>'Traité'), Input::old('statut', (isset($commande) ? $commande->statut : NULL))); ; ?>
					<?php echo  $errors->first('statut', '<span class="help-inline">:message</span>') ; ?>
				</td>
			</tr>
			<tr <?php if($errors->first('commentaire')) echo 'class="error"'; ?>>
				<td width="20%">Commentaire du client</td>
				<td>
					<?php echo  Form::textarea('commentaire', Input::old('commentaire', (isset($commande) ? $commande->commentaire : '')), array('style'=>'width:70%; height:80px;')); ; ?>
					<?php echo  $errors->first('commentaire', '<span class="help-inline">:message</span>') ; ?>
				</td>
			</tr>
		</table>
	</div>
	
	<div class="tab-pane" id="tabproduits">
		<?php if($commande->commandeproduct && count($commande->commandeproduct)>=1): ?>
		<ul id="sortable3" class="unstyled">
			<?php foreach($commande->commandeproduct as $c): ?>
			<li>
				<?php
				foreach($c->product->photos_first as $d){
					$photo = $d->name;
				}
				?>
				<a href="<?php echo URL::to_route('edit_product', array($c->product_id)); ?>" target="_blank">
					<?php if(isset($photo) && $photo!=''): ?>
						<img src="<?php echo  URL::to_action('photoproduit',array('235','200',$photo)); ; ?>" alt=""/>
					<?php else: ?>
						<img src="http://placehold.it/235x200&text=CRE%20Technology">
					<?php endif; ?>
					<br /><br />
					<?php echo  $c->nom ; ?>
				</a><br />
				<table>
					<tr>
						<td style="text-align:right;width:40%;padding-right:10%;">Tarif</td>
						<td style="text-align:left;width:50%;"><strong><?php echo  $c->prix_ht ; ?> &euro; HT</strong></td>
					</tr>
					<tr>
						<td style="text-align:right;width:40%;padding-right:10%;">Prix</td>
						<td style="text-align:left;width:50%;"><strong><?php echo  $c->prix_ttc ; ?> &euro; TTC</strong></td>
					</tr>
					<tr>
						<td style="text-align:right;width:40%;padding-right:10%;">Quantité</td>
						<td style="text-align:left;width:50%;"><strong><?php echo  $c->quantite ; ?></strong></td>
					</tr>
				</table>
			</li>
			<?php endforeach; ?>
		</ul>
		<?php else: ?>
		Aucun produit.
		<?php endif; ?>
	</div>
</div>


