<table class="table table-striped">
	<tr <?php if($errors->first('nom')) echo 'class="error"'; ?>>
		<td style="width:300px">Nom de la remise *</td>
		<td>
			<?php echo  Form::text('nom', Input::old('nom', (isset($taux) ? $taux->nom : NULL)), array('style'=>'width:60%;')); ; ?>
			<?php echo  $errors->first('nom', '<span class="help-inline">:message</span>') ; ?>
		</td>
	</tr>
	<?php if($taux): ?>
		<tr><td colspan="2"><h5>Appliquer une remise pour chaque catégorie</h5></td></tr>
		<?php foreach($categories as $c): ?>
		<tr>
			<td style="width:300px"><?php echo  $c->descLocale()->name ; ?></td>
			<td>
				<?php $remise = TauxCategory::where('categoryproduct_id','=',$c->id)->where('taux_id','=',$taux->id)->first(); ?>
				<div class="input-append">
					<input type="hidden" name="categ_id[]" value="<?php echo  $c->id ; ?>" />
					<?php echo  Form::text('taux[]', (isset($remise->remise)) ? $remise->remise : '0.00', array('style'=>'width:100px;text-align:right;')) ; ?>
					<span class="add-on">%</span>
				</div>
			</td>
		</tr>
			<?php foreach($c->children as $ch): ?>
			<tr>
				<td style="padding-left: 40px;"><?php echo  $ch->desc[0]->name ; ?></td>
				<td>
					<?php $remise = TauxCategory::where('categoryproduct_id','=',$ch->id)->where('taux_id','=',$taux->id)->first(); ?>
					<div class="input-append">
						<input type="hidden" name="categ_id[]" value="<?php echo  $ch->id ; ?>" />
						<?php echo  Form::text('taux[]', (isset($remise->remise)) ? $remise->remise : '0.00', array('style'=>'width:100px;text-align:right;')) ; ?>
						<span class="add-on">%</span>
					</div>
				</td>
			</tr>
			<?php endforeach; ?>
		<?php endforeach; ?>
	<?php else: ?>
		<div style="margin-bottom: 30px;">
			<div class="alert alert-info">
				<button type="button" class="close" data-dismiss="alert">×</button>
				<i class="icon-warning-sign"></i> Vous pourrez appliquer une remise par catégorie après avoir validé la création de celle-ci en cliquant sur "<b>Créer</b>" plus bas.
			</div>
		</div>
	<?php endif; ?>
</table>
