-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
182 lines (132 loc) · 4.95 KB
/
index.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
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0"/>
<title>Skyflix - O Sistema de locadora mais maneiro do Brasil</title>
<!-- CSS -->
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<link href="css/materialize.css" type="text/css" rel="stylesheet" media="screen,projection"/>
<link href="css/style.css" type="text/css" rel="stylesheet" media="screen,projection"/>
</head>
<body>
<nav class="light-blue lighten-1" role="navigation">
<div class="nav-wrapper container"><a id="logo-container" href="#" class="brand-logo center">Skyflix</a>
<ul class="right hide-on-med-and-down">
<li><a href="#">Navbar Link</a></li>
</ul>
<ul id="nav-mobile" class="side-nav">
<li><a href="#">Navbar Link</a></li>
</ul>
<a href="#" data-activates="nav-mobile" class="button-collapse"><i class="material-icons">menu</i></a>
</div>
</nav>
<div class="content container" style="margin-left: 400px;">
<div class="section">
<!-- Icon Section -->
<div class="row">
<div class="col s12">
<?php
if (!isset($_POST['action'])) {
$_POST['action'] = "";
}
switch ($_POST['action']) {
case "":
?>
<h3 class="center ">Catálogo de filmes</h3><br>
<b>Quantidade de filmes:</b>
<?php
include('back-end/QtidadFilmes.php');
?>
<br>
<br>
<div class="row">
<form name="alugar" method="post" >
<?php
include('back-end/MostrarFilm.php');
while($mostra_dados = mysql_fetch_array($pega_dados)){
$cod_filme = $mostra_dados['cod_filme'];
$titulo = $mostra_dados['titulo'];
$nome_categoria= $mostra_dados['nome_categoria'];
?>
<!-- CARD -->
<div class="col m3">
<div class="card grey lighten-4 ">
<div class="card-content white-text center">
<span class="card-title light-blue-text"><?=$titulo?></span><br>
<i class="large material-icons light-blue-text">movie</i>
</div>
<div class="card-content white center">
<b>(<?=$titulo?>)</b><BR><BR>
<b>ATORES:</b> Fulano, Cicrano Beltrano
</div>
<div class="card-action white center">
<a onclick="document.alugar.cod_filme.value=<?=$cod_filme?>; alugar.submit();" class="waves-effect waves-light btn">Alugar</a>
</div>
</div>
</div>
<?php
}
?>
<input type="hidden" name="cod_filme" value="" />
<input type="hidden" name="action" value="alugar" />
</form>
<?php
break;
case 'salvar_aluguel':
echo "salvarr";
include('back-end/inserirLocacao.php');
header('location:index.php');
?>
<?php
break;
case 'alugar':
$cod_filme = $_POST['cod_filme'];
?>
<form name="locacao" method="post">
<div class="row padding">
<div class="input-field col s6">
<select name="id_usuario">
<option value="" disabled selected>Selecione um cliente</option>
<?php
include('back-end/MostrarCli.php');
while($mostra_dados = mysql_fetch_array($pega_dados)){
$cod_cliente = $mostra_dados['cod_cliente'];
$nome_cliente = $mostra_dados['nome_cliente'];
?>
<option value="<?=$cod_cliente?>"><?=$nome_cliente?></option>
<?php
}
?>
</select>
<label>Cliente</label>
</div>
</div>
<div class="row padding left">
<input type="submit" value="Alugar" class="waves-effect waves-light btn-large ">
</div>
<input type="hidden" name="action" value="salvar_aluguel">
<input type="hidden" name="id_filme" value="<?=$cod_filme?>">
</form>
<?php
break;
default:
break;
}
?>
</div>
</div>
</div>
</div>
<?php
include('nav.php');
?>
<!-- Scripts-->
<script src="https://code.jquery.com/jquery-2.1.1.min.js"></script>
<script src="js/materialize.js"></script>
<script src="js/init.js"></script>
<script type="text/javascript">
$(".button-collapse").sideNav();
</script>
</body>
</html>