-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfilmes.php
147 lines (104 loc) · 4.09 KB
/
filmes.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
<?php
include 'header.php';
require 'repositorio_filmes.php';
$filmes = $repositorio->getListaFilmes();
$destino = 'incluir_filme.php';
if (isset($_GET['codigo']) ) {
$codigo = $_GET['codigo'];
$filme = $repositorio->buscarFilme($codigo);
$destino = "alterar_filme.php";
$oculto = '<input type="hidden" name="codigo" value="'.$codigo.'" /> ';
}
?>
<!-- Page Content -->
<div class="container">
<!-- Marketing Icons Section -->
<div class="row">
<div class="col-lg-12">
<h1 class="page-header">
Cadastrar Filme
</h1>
</div>
<p>
<!-- <a href="filme.php"><button type="button" class="btn btn-primary btn-lg">NOVO</button></a> -->
</p>
<hr>
<?php if ( !empty($m) ) { ?>
<div class="alert alert-success" role="alert"><?=$m;?></div>
<?php } ?>
<div class="col-md-8">
<p>
<strong>Inserir:</strong><br>
<form name="frmAluno" method="post" action="<?=$destino;?>">
<input type="hidden" value="<?=$a;?>" name="a">
<?= @$oculto;?>
<div class="form-group">
<input type="text" class="form-control" id="titulo" name="titulo" value="<? echo isset($filme)?$filme->getTitulo():"";?>" placeholder="Título">
</div>
<div class="form-group">
<input type="text" class="form-control" id="sinopse" name="sinopse" value="<? echo isset($filme)?$filme->getSinopse():"";?>" placeholder="Sinopse">
</div>
<div class="form-group">
<input type="text" class="form-control" id="quantidade" name="quantidade" value="<? echo isset($filme)?$filme->getQuantidade():"";?>" placeholder="Quantidade">
</div>
<div class="form-group">
<input type="text" class="form-control" id="trailer" name="trailer" value="<? echo isset($filme)?$filme->getTrailer():"";?>" placeholder="Trailer">
</div>
<button type="submit" class="btn btn-default">SALVAR</button>
</form>
</p>
</div>
<div class="col-md-3">
</div>
</div>
<div class="row">
<div class="table-responsive">
<hr>
<h2> Filmes Cadastrados</h2>
<table class="table">
<thead>
<tr>
<th>Filme</th>
<th> </th>
</tr>
</thead>
<tbody>
<?
while($filmeTemporario = array_shift($filmes)) {
?>
<tr>
<td><?=$filmeTemporario->getTitulo();?></td>
<td class="center">
<a href="filmes.php?codigo=<?=$filmeTemporario->getCodigo();?>" class="btn btn-default">Alterar</a>
<a href="excluir_filme.php?codigo=<?=$filmeTemporario->getCodigo();?>" class="btn btn-danger">Excluir</a>
</td>
</tr>
<?php } ?>
</tbody>
</table>
</div>
</div>
<!-- /.row -->
<hr>
<!-- Footer -->
<footer>
<div class="row">
<div class="col-lg-12">
<p>Copyright © </p>
</div>
</div>
</footer>
</div>
<!-- /.container -->
<!-- jQuery -->
<script src="js/jquery.js"></script>
<!-- Bootstrap Core JavaScript -->
<script src="js/bootstrap.min.js"></script>
<!-- Script to Activate the Carousel -->
<script>
$('.carousel').carousel({
interval: 5000 //changes the speed
})
</script>
</body>
</html>