Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified MyProject/MyProject/__pycache__/__init__.cpython-310.pyc
Binary file not shown.
Binary file modified MyProject/MyProject/__pycache__/settings.cpython-310.pyc
Binary file not shown.
Binary file modified MyProject/MyProject/__pycache__/urls.cpython-310.pyc
Binary file not shown.
Binary file modified MyProject/MyProject/__pycache__/wsgi.cpython-310.pyc
Binary file not shown.
Binary file modified MyProject/book/__pycache__/__init__.cpython-310.pyc
Binary file not shown.
Binary file modified MyProject/book/__pycache__/admin.cpython-310.pyc
Binary file not shown.
Binary file modified MyProject/book/__pycache__/apps.cpython-310.pyc
Binary file not shown.
Binary file modified MyProject/book/__pycache__/forms.cpython-310.pyc
Binary file not shown.
Binary file modified MyProject/book/__pycache__/models.cpython-310.pyc
Binary file not shown.
Binary file modified MyProject/book/__pycache__/views.cpython-310.pyc
Binary file not shown.
8 changes: 4 additions & 4 deletions MyProject/book/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ class Meta:
#widgets = {"DH_PREVISTO_SAIDA": forms.TimeInput}

class RelatorioFormulario(forms.ModelForm):
class Meta:
model = Voo
fields = ['DH_PREVISTO_SAIDA','DH_PREVISTO_CHEGADA','NM_AEROPORTO_SAIDA','NM_AEROPORTO_CHEGADA']

relatorio = forms.CharField(label="Relatorio")
DH_PREVISTO_CHEGADA_i = forms.DateField(label="data prevista de chegada inicial")
DH_PREVISTO_CHEGADA_f = forms.DateField(label="data prevista de chegada final")
class VooFormularioUpdate(forms.ModelForm):
class Meta:
model = Voo
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified MyProject/book/migrations/__pycache__/0007_user.cpython-310.pyc
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified MyProject/book/migrations/__pycache__/__init__.cpython-310.pyc
Binary file not shown.
18 changes: 15 additions & 3 deletions MyProject/book/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,21 @@ def crud(request):
# fzr pdf
@login_required(login_url='/accounts/login')
@permission_required('book.access_relatorio', raise_exception= PermissionDenied)
def relatorio(request):

return render(request, "relatorio.html")
def relatorio(request) :
if request.method == "POST" :
print('1')
form = RelatorioFormulario(request.POST)
if form.is_valid():
print('2')
relatorio = form.cleaned_data['relatorio']
DH_PREVISTO_CHEGADA_i = form.cleaned_data['DH_PREVISTO_CHEGADA_i']
DH_PREVISTO_CHEGADA_f = form.cleaned_data['DH_PREVISTO_CHEGADA_f']
print(relatorio)
print(DH_PREVISTO_CHEGADA_i)
print(DH_PREVISTO_CHEGADA_f)
return render(request, "relatorio.html")
else:
return render(request, "relatorio.html")

@login_required(login_url='/accounts/login')
@permission_required('book.add_voo')
Expand Down
Binary file modified MyProject/db.sqlite3
Binary file not shown.
88 changes: 21 additions & 67 deletions MyProject/template/relatorio.html
Original file line number Diff line number Diff line change
Expand Up @@ -48,81 +48,35 @@ <h1>Sistema de monitoramento de voos de aviões</h1>
</div>
</div>


<h1>Gerar relatórios</h1>

<div>
<p>Tipo de relatório por:</p>
<form>
<input type="radio" name="type" id="aeroporto" value="aeroporto">
<label for="aeroporto">Aeroporto</label>
<input type="radio" name="type" id="companhia" value="companhia">
<label for="companhia">Companhia</label>
<form method="POST" action="/relatorio/" >
{% csrf_token %}
<select id="relatorio" name="relatorio" class="form-select" aria-label="Default select example">
<option value="aeroporto">Aeroporto</option>
<option value="companhia">Companhia</option>
</select>
<br>
<input type="date" name="initial-date" id="DH_PREVISTO_CHEGADA_i">
<label for="DH_PREVISTO_CHEGADA_i">Data inicial</label>
<br>
<input type="date" name="final-date" id="DH_PREVISTO_CHEGADA_f">
<label for="DH_PREVISTO_CHEGADA_f">Data final</label>
<br>
<input type="submit" value="Submit">
</form>
</div>

<h4>
<td><a href="relatorioFormPage" class="btn btn-default">Adicionar Voo</a></td>
</h4>

<div class="row">
<div class="col-md-12">

<!-- Modal -->
<div class="modal fade" id="confirmModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal"><span
aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
<h4 class="modal-title" id="myModalLabel">Are you sure you want to sign out?</h4>
</div>
<div class="modal-footer">
<a href="sign-in.html" class="btn btn-primary">Yes</a>
<button type="button" class="btn btn-default" data-dismiss="modal">No</button>
</div>
</div>
</div>
</div>

<footer class="templatemo-footer">
<div class="templatemo-copyright">
<p>Copyright &copy; PCS3643 - Laboratório de Engenharia de Software I
<!-- Credit: www.templatemo.com -->
</p>
</div>
</footer>
</div>
</div>

<!-- Modal -->
<div class="modal fade" id="confirmModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal"><span
aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
<h4 class="modal-title" id="myModalLabel">Are you sure you want to sign out?</h4>
</div>
<div class="modal-footer">
<a href="sign-in.html" class="btn btn-primary">Yes</a>
<button type="button" class="btn btn-default" data-dismiss="modal">No</button>
</div>
</div>
</div>
</div>

<footer class="templatemo-footer">
<div class="templatemo-copyright">
<p>Grupo 3 &copy; PCS3643 - Laboratório de Engenharia de Software I
<!-- Credit: www.templatemo.com -->
</p>
</div>
</footer>
<footer class="templatemo-footer">
<div class="templatemo-copyright">
<p>Grupo 3 &copy; PCS3643 - Laboratório de Engenharia de Software I
<!-- Credit: www.templatemo.com -->
</p>
</div>
</div>
</footer>

</body>

</html>