brigate/WebContent/home-contatto.jsp
2020-04-24 16:44:53 +02:00

146 lines
4.9 KiB
Plaintext
Raw Permalink Blame History

<%@page import="util.Data"%>
<%@page import="bean.Contatto"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="ISO-8859-1"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Contatto</title>
<link rel="stylesheet"
href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css"
integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh"
crossorigin="anonymous">
<link rel="stylesheet" href="css/stile.css">
</head>
<body>
<jsp:include page="nav.jsp"></jsp:include>
<div style="margin: 25px">
<%
Contatto c = (Contatto) request.getAttribute("contatto");
if (c == null) {
out.print("ERRORE");
} else {
%>
<h4><%=c.getNome() + " " + c.getCognome()%>
<%
if (c.getServizio_sociale() != null && !c.getServizio_sociale().equals("-")) {
%>(contatto ottenuto tramite
<%=c.getServizio_sociale()%>)
<%
}
%>
</h4>
Indirizzo:
<%=c.getIndirizzo() + " (zona " + c.getArea() + ")"%><br>
Telefono:
<%=c.getTelefono()%><br>
<%
if (c.getEmail() != null) {
%>
Email:
<%=c.getEmail()%><br>
<%
}
%><br>
<%=c.getNumero_persone()%>
persone (<%=c.getComposizione_nucleo()%>)<br> Note sacchetto:
<%=c.getNote_sacchetto()%><br> <br>
<%
if (c.getUltima_consegna() == null) {
out.print("Non ha ancora ricevuto consegne");
} else {
out.print("Ultimo ordine consegnato il" + Data.formatta(c.getUltima_consegna()));
}
%>
<br> <br>
<form action="ordini-ctrl" method="post">
<input type="hidden" name="azione" value="aggiungi"> <input
type="hidden" name="numero" value="<%=c.getTelefono()%>"> <input
type="submit" value="Aggiungi agli ordini"
class="btn btn-primary btn-sm">
</form>
<br>
<p style="display: inline-block;">
<a class="btn btn-warning btn-sm" data-toggle="collapse"
href="#collapseExample" role="button" aria-expanded="false"
aria-controls="collapseExample"> Aggiorna dati </a>
</p>
<form action="contatti-ctrl" method="post"
style="display: inline-block">
<input type="hidden" name="azione" value="elimina"> <input
type="hidden" name="id" value="<%=c.getTelefono()%>"> <input
type="submit" value="Elimina contatto" class="btn btn-danger btn-sm">
</form>
<div class="collapse" id="collapseExample">
<form action="contatti-ctrl" method="post">
<div class="cinquanta">
<div class="form-group">
<label>Nome*</label> <input type="text" name="nome"
value="<%=c.getNome()%>" class="form-control form-control-sm">
</div>
<div class="form-group">
<label>Cognome*</label> <input type="text" name="cognome"
value="<%=c.getCognome()%>" class="form-control form-control-sm">
</div>
<div class="form-group">
<label>Quartiere*</label> <input type="text" name="area"
value="<%=c.getArea()%>" class="form-control form-control-sm">
</div>
<div class="form-group">
<label>Indirizzo*</label> <input type="text" name="indirizzo"
value="<%=c.getIndirizzo()%>"
class="form-control form-control-sm">
</div>
<div class="form-group">
<label>Numero di telefono*</label> <input type="number"
value="<%=c.getTelefono()%>" name="telefono"
class="form-control form-control-sm">
</div>
<div class="form-group">
<label>Email</label> <input type="email" name="email"
value="<%=c.getEmail()%>" class="form-control form-control-sm">
</div>
</div>
<div class="cinquanta">
<div class="form-group">
<label>Numero persone</label> <input type="number" name="numero"
value="<%=c.getNumero_persone()%>"
class="form-control form-control-sm number">
</div>
<div class="form-group">
<label>Composizione nucleo abitativo</label> <input type="text"
name="composizioneNucleo" value="<%=c.getComposizione_nucleo()%>"
class="form-control form-control-sm">
</div>
<div class="form-group">
<label style="vertical-align: top">Note sacchetto
(allergie, diete, necessit<69>...)</label>
<textarea name="noteSacchetto"
class="form-control form-control-sm"
value="<%=c.getNote_sacchetto()%>"></textarea>
</div>
</div>
<input type="hidden" name="azione" value="modifica"><br>
<button type="submit" class="btn btn-light btn-sm">Modifica</button>
</form>
</div>
<%
}
%>
</div>
<script src="https://code.jquery.com/jquery-3.4.1.slim.min.js"
integrity="sha384-J6qa4849blE2+poT4WnyKhv5vZF5SrPo0iEjwBvKU7imGFAV0wwj1yYfoRSJoZ+n"
crossorigin="anonymous"></script>
<script
src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js"
integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo"
crossorigin="anonymous"></script>
<script
src="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js"
integrity="sha384-wfSDF2E50Y2D1uUdj0O3uMBJnjuUD4Ih7YwaYd1iqfktj0Uod8GCExl3Og8ifwB6"
crossorigin="anonymous"></script>
</body>
</html>