
<?php \Laravel\Section::start('content'); ?>

<?php echo view('customerarea.menu')->with(get_defined_vars())->render(); ?>

<div class="wrapper wrapperCompte">
	<h1>Vous pouvez modifier vos informations !</h1>
	
	<?php echo view('customerarea.notifications')->with(get_defined_vars())->render(); ?>
	
	<form method="post" action="<?php echo  URL::to_action('customerarea@infos'); ; ?>">
		<table class="table table-striped table-hover">
			<tr <?php if($errors->first('societe')) echo 'class="error"'; ?>>
				<td style="width:300px">Nom de votre Société *</td>
				<td>
					<?php echo  Form::text('societe', Input::old('societe', (isset($customer) ? $customer->societe : NULL))); ; ?>
					<?php echo  $errors->first('societe', '<span class="help-inline">:message</span>') ; ?>
				</td>
			</tr>
			<tr <?php if($errors->first('last_name')) echo 'class="error"'; ?>>
				<td style="width:300px"><?php echo __('admin.nom'); ?> *</td>
				<td>
					<?php echo  Form::text('last_name', Input::old('last_name', (isset($customer) ? $customer->last_name : NULL))); ; ?>
					<?php echo  $errors->first('last_name', '<span class="help-inline">:message</span>') ; ?>
				</td>
			</tr>
			<tr <?php if($errors->first('first_name')) echo 'class="error"'; ?>>
				<td style="width:300px"><?php echo __('admin.prenom'); ?> *</td>
				<td>
					<?php echo  Form::text('first_name', Input::old('first_name', (isset($customer) ? $customer->first_name : NULL))); ; ?>
					<?php echo  $errors->first('first_name', '<span class="help-inline">:message</span>') ; ?>
				</td>
			</tr>
			<tr <?php if($errors->first('email')) echo 'class="error"'; ?>>
				<td style="width:300px"><?php echo __('admin.adresse_email'); ?> *</td>
				<td>
					<?php echo  Form::text('email', Input::old('email', (isset($customer) ? $customer->email : NULL))); ; ?>
					<?php echo  $errors->first('email', '<span class="help-inline">:message</span>') ; ?>
				</td>
			</tr>
			<tr <?php if($errors->first('tel1')) echo 'class="error"'; ?>>
				<td style="width:300px">Téléphone 1</td>
				<td>
					<?php echo  Form::text('tel1', Input::old('tel1', (isset($customer) ? $customer->tel1 : NULL)),array('class'=>'setUcFirstOnly')); ; ?>
					<?php echo  $errors->first('tel1', '<span class="help-inline">:message</span>') ; ?>
				</td>
			</tr>
			<tr <?php if($errors->first('tel2')) echo 'class="error"'; ?>>
				<td style="width:300px">Téléphone 2</td>
				<td>
					<?php echo  Form::text('tel2', Input::old('tel2', (isset($customer) ? $customer->tel2 : NULL)),array('class'=>'setUcFirstOnly')); ; ?>
					<?php echo  $errors->first('tel2', '<span class="help-inline">:message</span>') ; ?>
				</td>
			</tr>
			<tr <?php if($errors->first('fax')) echo 'class="error"'; ?>>
				<td style="width:300px">Fax</td>
				<td>
					<?php echo  Form::text('fax', Input::old('fax', (isset($customer) ? $customer->fax : NULL)),array('class'=>'setUcFirstOnly')); ; ?>
					<?php echo  $errors->first('fax', '<span class="help-inline">:message</span>') ; ?>
				</td>
			</tr>
			<tr <?php if($errors->first('adresse1')) echo 'class="error"'; ?>>
				<td style="width:300px"><?php echo __('admin.adresse'); ?> 1</td>
				<td>
					<?php echo  Form::text('adresse1', Input::old('adresse1', (isset($customer) ? $customer->adresse1 : NULL)),array('style'=>'width:500px;')); ; ?>
					<?php echo  $errors->first('adresse1', '<span class="help-inline">:message</span>') ; ?>
				</td>
			</tr>
			<tr <?php if($errors->first('adresse2')) echo 'class="error"'; ?>>
				<td style="width:300px"><?php echo __('admin.adresse'); ?> 2</td>
				<td>
					<?php echo  Form::text('adresse2', Input::old('adresse2', (isset($customer) ? $customer->adresse2 : NULL)),array('style'=>'width:500px;')); ; ?>
					<?php echo  $errors->first('adresse2', '<span class="help-inline">:message</span>') ; ?>
				</td>
			</tr>
			<tr <?php if($errors->first('zipcode')) echo 'class="error"'; ?>>
				<td style="width:300px">Code postal</td>
				<td>
					<?php echo  Form::text('zipcode', Input::old('zipcode', (isset($customer) ? $customer->zipcode : NULL))); ; ?>
					<?php echo  $errors->first('zipcode', '<span class="help-inline">:message</span>') ; ?>
				</td>
			</tr>
			<tr <?php if($errors->first('city')) echo 'class="error"'; ?>>
				<td style="width:300px">Ville</td>
				<td>
					<?php echo  Form::text('city', Input::old('city', (isset($customer) ? $customer->city : NULL))); ; ?>
					<?php echo  $errors->first('city', '<span class="help-inline">:message</span>') ; ?>
				</td>
			</tr>
			<tr <?php if($errors->first('country_id')) echo 'class="error"'; ?>>
				<td style="width:300px"><?php echo __('admin.pays'); ?></td>
				<td>
					<?php echo  Form::select('country_id', $countries, Input::old('country_id', ((isset($customer) && $customer->country_id!='') ? $customer->country_id : (Config::get('application.language')=='it'?'114':'67')))); ; ?>
					<?php echo  $errors->first('country_id', '<span class="help-inline">:message</span>') ; ?>
				</td>
			</tr>
			<tr <?php if($errors->first('site')) echo 'class="error"'; ?>>
				<td style="width:300px">Site Web actuel</td>
				<td>
					<?php echo  Form::text('site', Input::old('site', (isset($customer) ? $customer->site : NULL))); ; ?>
					<?php echo  $errors->first('site', '<span class="help-inline">:message</span>') ; ?>
				</td>
			</tr>
			<tr <?php if($errors->first('siret')) echo 'class="error"'; ?>>
				<td style="width:300px">Numéro SIRET</td>
				<td>
					<?php echo  Form::text('siret', Input::old('siret', (isset($customer) ? $customer->siret : NULL))); ; ?>
					<?php echo  $errors->first('siret', '<span class="help-inline">:message</span>') ; ?>
				</td>
			</tr>
			<tr <?php if($errors->first('numero_tva')) echo 'class="error"'; ?>>
				<td style="width:300px">Numéro TVA</td>
				<td>
					<?php echo  Form::text('numero_tva', Input::old('numero_tva', (isset($customer) ? $customer->numero_tva : NULL))); ; ?>
					<?php echo  $errors->first('numero_tva', '<span class="help-inline">:message</span>') ; ?>
				</td>
			</tr>
			<tr <?php if($errors->first('password')) echo 'class="error"'; ?>>
				<td style="width:300px">
					<?php echo __('admin.mot_passe'); ?> 
					<?php if(!$customer): ?>
					*
					<?php endif; ?>
				</td>
				<td>
					<?php echo  Form::text('password','',array('autocomplete'=>'off')); ; ?>
					<?php echo  $errors->first('password', '<span class="help-inline">:message</span>') ; ?>
					<?php if($customer): ?>
					<br /><span class="help-inline-red"><?php echo __('admin.laisser_vide'); ?></span>
					<?php endif; ?>
				</td>
			</tr>
			<tr><td colspan="2" style="text-align:center;padding:20px 0;"><button type="submit" class="btn btn-danger btn-large">Mettre à jour mes informations</button></td></tr>
		</table>
	</form>

</div>
<div class="clear"></div>

<?php \Laravel\Section::stop(); ?>

<?php echo view('template')->with(get_defined_vars())->render(); ?>