-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcadLivrosPDF.php
357 lines (263 loc) · 10.3 KB
/
cadLivrosPDF.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
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
<?php
include_once "conexao.php";
include_once "Usuario.php";
include_once "codigosRecaptcha.php";
include_once "dadosSistema.php";
include_once "verificaTempoSessao.php";
if(!isset($_SESSION)) session_start();
$conexao = conexao::getConexao();
if(!isset($_SESSION["usuario"])){
header("location: index.php");
}
$dados = $_SESSION["usuario"];
$nivelAcesso = $dados->getNivelAcesso();
if($nivelAcesso != "A"){
header("location: index.php");
}
//Código acima - verificação de login
?>
<!DOCTYPE html>
<html lang="pt-br">
<head>
<title><?php echo Info::$nomeSistema ?> - Cadastro de Livros em PDF</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<script src="./scripts/jquery.min.js"></script>
<script src="./scripts/MaskaraJquery/jquery.mask.js"></script>
<script src="./scripts/cadastroLivro.js"></script>
<script src="./scripts/controleGeneros.js"></script>
<script src="./scripts/controleAutor.js"></script>
<script src="https://www.google.com/recaptcha/api.js" async defer></script>
<link rel="stylesheet" type="text/css" href="./css/fontawesome-free-5.12.1-web/css/all.min.css">
<link rel="stylesheet" type="text/css" href="./css/fontawesome-free-5.12.1-web/css/brands.min.css">
<link rel="stylesheet" type="text/css" href="./css/fontawesome-free-5.12.1-web/css/solid.min.css">
<link rel="stylesheet" type="text/css" href="./css/fontawesome-free-5.12.1-web/css/svg-with-js.min.css">
<link rel="stylesheet" type="text/css" href="./css/fontawesome-free-5.12.1-web/css/regular.min.css">
<link rel="stylesheet" type="text/css" href="./css/fontawesome-free-5.12.1-web/css/v4-shims.min.css">
<link rel="shortcut icon" type="image/jpg" <?php echo "href='".Info::$logoSistema."'" ?> sizes="50x50">
<link rel="stylesheet" type="text/css" href="./css/config.css">
<link rel="stylesheet" type="text/css" href="./css/cadLivro.css">
</head>
<body>
<section id='MoldalAviso'></section>
<!--Moldal de Loading-->
<section id="moldalLoading">
<div></div>
</section>
<!--Moldal de gêneros-->
<section class="MoldalOpcoes">
<section class="telas">
<div class="fechaMoldalOpcoes">×</div>
<header>
<div>
<img <?php echo "src='". Info::$logoSistema ."'" ?>>
<h5><?php echo Info::$nomeSistema; ?> - Selecionar Genêro</h5>
</div>
<div>
<?php
echo "<img title='". Info::$nomeEtec ."' src='". Info::$logoEtec ."'>
<img title='". Info::$nomeCentro ."' src='". Info::$logoCentro ."'>";
?>
</div>
</header>
<section style="grid-template-rows: 1fr 70px;">
<table>
<thead>
<tr>
<th>Nome</th>
</tr>
</thead>
<tbody id="generosT"></tbody>
</table>
<footer style="display: flex;align-items: center;justify-content: center;">
<div><button class="btns carregarMaisT" onclick="carregaMaisGeneros(this)"><i class='fas fa-plus' title="Carregar Mais"></i></button></div>
</footer>
</section>
</section>
</section>
<!--Moldal do autor-->
<section class="MoldalOpcoes">
<section class="telas">
<div class="fechaMoldalOpcoes">×</div>
<header>
<div>
<img <?php echo "src='". Info::$logoSistema ."'" ?>>
<h5><?php echo Info::$nomeSistema; ?> - Selecionar Autor</h5>
</div>
<div>
<?php
echo "<img title='". Info::$nomeEtec ."' src='". Info::$logoEtec ."'>
<img title='". Info::$nomeCentro ."' src='". Info::$logoCentro ."'>";
?>
</div>
</header>
<section>
<main>
<input type="text" name="textPesquisa" placeholder="Pesquisar autor..." onkeyup="pesquisaAutor(this)">
<button><i class='fas fa-search'></i></button>
</main>
<table>
<thead>
<tr>
<th>Nome</th>
<th>Nacionalidade</th>
<th>Colaboradores</th>
<th class='opcoesMoldalTable'>Opcões</th>
</tr>
</thead>
<tbody id="autorT"></tbody>
</table>
<footer>
<div><button class="adicionar" onclick="abreMoldalAutor(1, null)">Adicionar Autor</button></div>
<div><button class="btns carregarMaisT" onclick="carregaMaisAutor(this)"><i class='fas fa-plus' title="Carregar Mais"></i></button></div>
</footer>
</section>
</section>
</section>
<section class="MoldalOpcoes"></section>
<!--Moldals de cadastro-->
<section class="MoldaCad"> <!--Editora-->
<section class="telas">
<div class="fechaMoldalCad" onclick="fechaMoldalCad()">×</div>
<header>
<div>
<img <?php echo "src='". Info::$logoSistema ."'" ?>>
<h5><?php echo Info::$nomeSistema; ?> - <span class="tituloCad">Cadastro da Editora</span></h5>
</div>
<div>
<?php
echo "<img title='". Info::$nomeEtec ."' src='". Info::$logoEtec ."'>
<img title='". Info::$nomeCentro ."' src='". Info::$logoCentro ."'>";
?>
</div>
</header>
<section>
<form action="javascript: void(0)">
<input type="text" name="nome" placeholder="Nome" class="inputsE" maxlength="100" onkeyup="limpaCamposE(0)">
<br><span class="spanCad spanCadE">Digite o nome da editora</span><br>
<input type="text" name="cnpj" placeholder="CNPJ" maxlength="14" class="inputsE">
<br><br>
<input type="submit" value="Cadastrar Editora" class="btnCadSub">
</form>
</section>
</section>
</section>
<section class="MoldaCad"> <!--Autor-->
<section class="telas">
<div class="fechaMoldalCad" onclick="fechaMoldalCad()">×</div>
<header>
<div>
<img <?php echo "src='". Info::$logoSistema ."'" ?>>
<h5><?php echo Info::$nomeSistema; ?> - <span class="tituloCad">Cadastro do Autor</span></h5>
</div>
<div>
<?php
echo "<img title='". Info::$nomeEtec ."' src='". Info::$logoEtec ."'>
<img title='". Info::$nomeCentro ."' src='". Info::$logoCentro ."'>";
?>
</div>
</header>
<section>
<form action="javascript: void(0)">
<input type="text" name="nome" placeholder="Nome" class="inputsA" maxlength="100" onkeyup="limpaCamposA(0)">
<br><span class="spanCad spanCadA">Digite o nome do autor</span><br>
<input type="text" name="nacionalidade" placeholder="Nacionalidade" class="inputsA" maxlength="40" onkeyup="limpaCamposA(1)">
<br><span class="spanCad spanCadA">Digite a nacionalidade do autor</span><br>
<input type="text" name="colaboradores" placeholder="Colaboradores" maxlength="255" class="inputsA">
<br><br><br>
<input type="submit" value="Cadastrar Autor" class="btnCadSub">
</form>
</section>
</section>
</section>
<nav id="menu">
<ul>
<li id="mn"><a href="javascript: history.go(-1)"><span><i class="fas fa-arrow-left"></i></span></a> <h5>Livros</h5></li>
<li id="imgInicial">
<?php
echo "<a href='". Info::$siteEtec ."' target='_blank'><img title='". Info::$nomeEtec ."' src='". Info::$logoEtec ."'></a>
<a href='Inicio.php'><img title='". Info::$nomeSistema ."' src='". Info::$logoSistema ."'></a>
<a href='". Info::$siteCentro ."' target='_blank'><img title='". Info::$nomeCentro ."' src='". Info::$logoCentro ."'></a>";
?>
</li>
</ul>
</nav>
<section id="container">
<form action="javascript: void(0)" name="formCad" id="formCad">
<div id="containerImg">
<label for="imagem"><img src="./Imagens/ImgAlerta.jpg" id="imagemPreview"></label>
<input type="file" name="imagem" id="imagem" accept="Image/jpeg" class="inputV">
<br><span class="spanAlerta">Selecione uma imagem de capa</span>
</div>
<div class="inputs" id="input1">
<div class="inputFlexContainer">
<input type="text" name="titulo" placeholder="Titulo" class="inputV" maxlength="100">
</div>
<span class="spanAlerta"><br>Digite o titulo</span><br><br>
<fieldset class="inputFlexContainer"><legend>Data de Publicação</legend>
<input type="date" name="datapublicacao" class="inputV" alt="8">
</fieldset>
<br><span class="spanAlerta">Digite a data de publicação</span><br><br>
</div>
<div class="inputs" id="input2">
<div>
<div class="inputComBTN">
<select class="inputV" size="5" id="generosSelecionados"></select>
<input type="hidden" name="generos" id="generos">
<button class="btnAbreMoldal">Adicionar Genêro</button>
</div>
<br><span class="spanAlerta">Selecione pelo menos um genêro</span><br><br>
</div>
<div class="divide">
<div>
<div class="inputFlexContainer">
<input type="number" name="volume" placeholder="Volume" min="0" id="volume">
</div>
<br><br><br>
</div>
<div>
<div class="inputFlexContainer">
<input type="number" name="edicao" placeholder="Edição" min="0" id="edicao">
</div>
<br><br><br>
</div>
</div>
<div>
<div class="inputFlexContainer">
<input type="text" name="idioma" placeholder="Idioma" class="inputV" maxlength="30">
</div>
<br><span class="spanAlerta">Digite o idioma</span><br><br>
</div>
<div style="grid-column: 3/1">
<div>
<div class="dividePDF" style="margin: 0" class="inputFlexContainer">
<input type="text" id="pdf_url" name="pdf_url" placeholder="PDF do Livro" readonly class="inputV"><label for="pdf_livro">...</label>
<input type="file" id="pdf_livro" name="pdf_livro" accept="application/pdf">
</div>
<br><span class="spanAlerta">Selecione o PDF do livro</span><br><br>
</div>
</div>
<div class="divide">
<div style="grid-column: 3/1">
<div class="inputComBTN">
<select class="inputV" size="5" id="autoresSelecionados"></select>
<input type="hidden" name="autores" id="autores">
<button class="btnAbreMoldal">Adicionar Autor</button>
</div>
<br><span class="spanAlerta">Selecione pelo menos um autor</span><br><br>
</div>
</div>
<div style="overflow: hidden;">
<div class="g-recaptcha" <?php echo "data-sitekey='$codChaveDiv'"; ?>></div>
</div>
</div>
<div id="btnCad">
<input type="submit" name="btnCadLivro" value="Cadastrar Livro" onclick="executaCadastro()">
</div>
</form>
</section>
<!--Botão para ajuda-->
<a href="ajuda.php#CadLivroPDF"><div id="btnhelp" title="Ajuda" style="bottom: 40px"><i class="fas fa-question"></i></div></a>
<footer><h5><?php echo Info::$copyright; ?></h5></footer>
</body>
</html>