{% extends "layout.html" %}
{% block title %}Mantenimiento de lugares
{% endblock %}

{% set nav_active = 'tablas' %}
{% block content %}

{% if message_success %}
<div class="alert alert-success alert-dismissible" role="alert">
	{{message_success}}
	<button type="button" class="close" data-dismiss="alert" aria-label="Close">
		<span aria-hidden="true">&times;</span>
	</button>
</div>
{% endif %}
{% if message_error %}
<div class="alert alert-success alert-dismissible" role="alert">
	{{message_error}}
	<button type="button" class="close" data-dismiss="alert" aria-label="Close">
		<span aria-hidden="true">&times;</span>
	</button>
</div>
{% endif %}

<div class="box">
	<div class="box-header with-border">
		<h3 class="box-title">Lugares</h3>
		<div class="box-tools pull-right">
			<button class="btn btn-box-tool" data-widget="collapse">
				<i class="fa fa-minus"></i>
			</button>

			<button class="btn btn-box-tool" data-widget="remove">
				<i class="fa fa-times"></i>
			</button>
		</div>
	</div>
	<div class="box-body">
		<div class="row">
			<div class="col-md-12">

				<p class=" bg-verdelight text-center">Agregar Provincia</p>
				<form class="form-" action="accion_lugar.php" method="POST">
					<div class="row">
						<div class="col-md-4"></div>
						<div class="col-md-4">
							<div class="form-group mr-3">
								<label for="tipo">Provincia</label>
								<input type="text" class="form-control ml-1" id="tipo" name="provincia">
							</div>
						</div>
						<div class="col-md-4">
							<button type="submit" class="btn btn-verdedark ml-3" style="margin-top: 1.5em;">Agregar</button>
						</div>
					</div>
				</form>
				<hr>
				<p class="bg-verdelight text-center">Agregar Distrito</p>
				<form class="form-" action="accion_lugar.php" method="POST">
					<div class="row">
						<div class="col-md-4">
							<div class="form-group">
								<label for="padre_p">Provincia</label>
								<select class="form-control ml-2" name="padre" id="padre_p">
									{% for provincia in provincias %}
									<option value="{{provincia.id}}">{{provincia.nombre}}</option>
									{% endfor %}
								</select>
							</div>
						</div>
						<div class="col-md-4">
							<div class="form-group mr-3">
								<label for="tipo">Distrito</label>
								<input class="form-control ml-2" name="distrito" type="text">
							</div>
						</div>
						<div class="col-md-4">
							<button type="submit" class="btn btn-verdedark" style="margin-top: 1.5em;">Agregar</button>
						</div>
					</div>
				</form>
				<hr>
				<p class="bg-verdelight text-center">Agregar CCNN / CCPP</p>
				<form action="accion_lugar.php" method="POST">
					<div class="row">
						<div class="col-md-4">
							<div class="form-group mr-3">
								<label for="padre_d">Distrito</label>
								<select class="form-control ml-2" name="padre" id="padre_d">
									{% for distrito in distritos %}
									<option value="{{distrito.id}}">{{distrito.nombre}}</option>
									{% endfor %}
								</select>
							</div>
						</div>
						<div class="col-md-4">
							<div class="form-group mr-3">
								<label for="tipo">CCNN/CCPP</label>
								<input class="form-control ml-2" name="anexo" type="text">
							</div>
						</div>
						<div class="col-md-4">
							<button type="submit" class="btn btn-verdedark ml-3" style="margin-top: 1.5em;">Agregar</button>
						</div>
					</div>
				</form>

				<div class="row mt-5" style="margin-top: 50px;">
					<div class="col-md-4">
						<form action="accion_lugar.php" method="post">
							<div class="form-group">
								<label>Provincias</label>
								<select class="form-control" name="item" id="provincia">
									{% for provincia in provincias %}
									<option value="{{provincia.id}}">{{provincia.nombre}}</option>
									{% endfor %}
								</select>
								<input class="form-control mt-2" name="item_post" placeholder="Editar provincia"
									type="text">
								<button class="btn btn-verdedark" name="editar" type="submit"
									style="margin-top: 30px;">Editar</button>
								<button class="btn btn-warning" name="delete" type="submit"
									style="margin-top: 30px;">Eliminar</button>
							</div>
						</form>
						<small>* Esta acci&oacute;n no tiene confirmaci&oacute;n</small>
					</div>
					<div class="col-md-4">
						<form action="accion_lugar.php" method="post">
							<div class="form-group">
								<label for="distrito">Distritos</label>
								<select class="form-control" name="item" id="distrito">
									{% for distrito in distritos %}
									<option class="distrito_option" padre="{{distrito.padre}}" value="{{distrito.id}}">
										{{distrito.nombre}}</option>
									{% endfor %}
								</select>
								<input class="form-control mt-2" name="item_post" placeholder="Editar provincia"
									type="text">
								<button class="btn btn-verdedark" name="editar" type="submit"
									style="margin-top: 30px;">Editar</button>
								<button class="btn btn-warning" name="delete" type="submit"
									style="margin-top: 30px;">Eliminar</button>
							</div>
						</form>
						<small>* Esta acci&oacute;n no tiene confirmaci&oacute;n</small>
					</div>
					<div class="col-md-4">
						<form action="accion_lugar.php" method="post">
							<div class="form-group">
								<label for="">CCPP/CCNN</label>
								<select class="form-control" name="item" id="anexo">
									{% for anexo in anexos %}
									<option class="anexo_option" padre="{{anexo.padre}}" value="{{anexo.id}}">
										{{anexo.nombre}}</option>
									{% endfor %}
								</select>
								<input class="form-control mt-2" name="item_post" placeholder="Editar provincia"
									type="text">
								<button class="btn btn-verdedark" name="editar" type="submit"
									style="margin-top: 30px;">Editar</button>
								<button class="btn btn-warning" name="delete" type="submit"
									style="margin-top: 30px;">Eliminar</button>
							</div>
						</form>
						<small>* Esta acci&oacute;n no tiene confirmaci&oacute;n</small>
					</div>
				</div>

			</div>
		</div>
	</div>
</div>

{% endblock %}