@extends('layout.base')

@section('content')
<div class="row page-heading">
	<h3>Desistir - {{$venta->unidad()->descripcion}} - {{$venta->proyecto()->descripcion}}</h3>
</div>
<br />
<form method="post" class="form-horizontal" action="{{url('', ['p' => 'ventas', 'a' => 'desistiendo', 'venta' => $venta->id])}}">
<div class="form-group">
	<div class="col-md-2">Fecha</div>
	<?php $f = \Carbon\Carbon::today(config('app.timezone')) ?>
	<div class="col-md-1"><select name="day" class="form-control">
	@for ($i = 0; $i < 31; $i ++)
		<option value="{{$i + 1}}"
		@if ($i + 1 == $f->day)
			selected="selected"
		@endif
		>{{str_pad($i + 1, 2, '0', STR_PAD_LEFT)}}</option>
	@endfor
	</select></div>
	<div class="col-md-1"><select name="month" class="form-control">
	@for ($i = 0; $i < 12; $i ++)
		<option value="{{$i + 1}}"
		@if ($i + 1 == $f->month)
			selected="selected"
		@endif
		>{{str_pad($i + 1, 2, '0', STR_PAD_LEFT)}}</option>
	@endfor
	</select></div>
	<div class="col-md-2"><select name="year" class="form-control">
	@for ($i = $f->year; $i > $f->year - 5; $i --)
		<option value="{{$i}}">{{$i}}</option>
	@endfor
	</select></div>
</div>
<div class="form-group">
	<div class="col-md-2">Devoluci&oacute;n [$]</div>
	<div class="col-md-3"><input type="text" name="pago" class="form-control" /></div>
</div>
<div class="form-group">
	<div class="col-md-offset-2 col-md-2"><input type="submit" class="form-control" value="Desistir" /></div>
</div>
</form>
@endsection