-
Notifications
You must be signed in to change notification settings - Fork 0
/
pesquisa.php
197 lines (135 loc) · 6.56 KB
/
pesquisa.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
<?php
session_start();
if(isset($_SESSION['logado'])){
if(!$_SESSION['logado']){
header("Location: index.php");
}else{
if(!($_SESSION['tipoUsu'] == "3")) {
header("Location: index.php");
}
}
}else{
header("Location: index.php");
}
include "bancoDados.class.php";
$banco = new bancoDadosBTCC("root", "", "localhost", "bd_btcc");
$_SESSION['tipo'] = "0";
$_SESSION['campo'] = " ";
?>
<!DOCTYPE html>
<html>
<title>Pesquisar</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta charset="utf-8">
<!-- ///////////////////////////////////// W3.css //////////////////////////////////////////////////////////////-->
<link rel="stylesheet" type="text/css" href="css/w3.css">
<link rel="stylesheet" href="css/w3-theme-red.css">
<!-- ///////////////////////////////////// ICONS Google //////////////////////////////////////////////////////////////-->
<link rel="stylesheet" href="css/icon.css">
<!-- ///////////////////////////////////// Bootstrap //////////////////////////////////////////////////////////////-->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<!-- ///////////////////////////////////// Js //////////////////////////////////////////////////////////////-->
<script src="js/jquery.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<script language="JavaScript" src="js/jquery.js" type="text/javascript"></script>
<script language="JavaScript" src="js/jquery.validate.js" type="text/javascript"></script>
<link type="text/css" rel="stylesheet" href="js/jquery-ui.css" />
<!-- ///////////////////////////////////// icons //////////////////////////////////////////////////////////////-->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<body>
<!-- ///////////////////////////////////// Side Bar //////////////////////////////////////////////////////////////-->
<div class="w3-sidebar w3-light-gray w3-bar-block w3-card w3-animate-left w3-mobile" style="display:none" id="mySidebar">
<button class="w3-bar-item w3-button w3-small w3-theme-btcc" onclick="w3_close()">Fechar</button>
<a href="index.php"><img src="images/logobtcc.png" class="w3-center" style="width:100%;"></a>
<a href="admin.php" class="w3-bar-item w3-button"><b>Home</b></a>
<a href="cadastrarTcc.php" class="w3-bar-item w3-button">Cadastrar TCC</a>
<a href="cadastrarUsu.php" class="w3-bar-item w3-button">Cadastrar Usuário</a>
<a href="pesquisa.php" class="w3-bar-item w3-button w3-gray">Pesquisa</a>
<a href="index.php" class="w3-bar-item w3-button">Voltar</a>
<a href="index.php?des=true" class="w3-bar-item w3-button">Deslogar</a>
</div>
<div id="main">
<div class="w3-theme-d5 w3-card">
<button id="openNav" class="w3-button w3-xlarge w3-theme-d5" onclick="w3_open()">☰</button>
</div>
<div class="w3-container w3-center w3-light-gray">
<br><h1 class="w3-animate-top">Pesquisar</h1><br>
</div>
<!--//////////////////////////////////// select pesquisar ///////////////////////////////////////////////////// -->
<div class="w3-responsive">
<div class="w3-container">
<div class="w3-row">
<div class="w3-col m12">
<form class="w3-container w3-animate-left" align="justify" id="cadastroUsuario" name="cadastroUsuario" method="post" action="<?php echo $_SERVER['PHP_SELF'];?>">
<div class="w3-row w3-section">
<div class="w3-col" style="width:30px"><span class="glyphicon glyphicon-list-alt"></span></div>
<div class="w3-rest">
<label class="w3-left"><b>Tipo de pesquisa:</b></label>
<select class="w3-select w3-border" name="sltTipo" id="sltTipo" >
<option value="0" disabled selected>Selecione o tipo da pesquisa</option>
<option value="1">Por RM</option>
<option value="2">Por CPF</option>
<option value="3">Por Primeiro Nome Usuario</option>
<option value="4">Por Ultimo Nome Usuario</option>
<option value="5">Por Código TCC</option>
<option value="6">Por Titulo TCC</option>
<option value="7">Por Coleção TCC</option>
<option value="8">Todas as Reservas</option>
<option value="9">Todas as Devolucoes</option>
<option value="10">Todos os Usuarios</option>
<option value="11">Todos os TCCs</option>
<option value="12">Todos as Sugestoes</option>
</select><br><br>
</div>
</div>
<div class="w3-row w3-section">
<div class="w3-col" style="width:30px"><span class="glyphicon glyphicon-search"></span></div>
<div class="w3-rest">
<label class="w3-center"><b>Pesquisa:</b></label> <input class="w3-input w3-border" type="text" name="txtPesquisa" id="txtPesquisa" placeholder="Digite o que deseja pesquisar"/>
<br><br>
</div>
</div>
<div class="w3-container w3-center">
<input type="submit" name="btnPesquisar" value= "Pesquisar" class="w3-theme-cinza w3-button w3-round-xlarge w3-card" style="width:50%;"></p>
</div>
<br/>
<br/>
<?php
if ($_SERVER["REQUEST_METHOD"] == "POST") {
// PEGA O VALOR DOS INPUTS
if(isset($_REQUEST['sltTipo'])){
$_SESSION['tipo'] = htmlspecialchars($_REQUEST['sltTipo']);
}else{
$_SESSION['tipo'] = "0";
}
$_SESSION['campo'] = htmlspecialchars($_REQUEST['txtPesquisa']);
}
?>
<div class="w3-container w3-center">
<h3 class="w3-center w3-gray"><em>RESULTADOS</em></h3><br>
</div>
<iframe src="iframes/resultadoPesquisaAdmin.php" height="500px" width="100%" MARGINWIDTH="0" style="border: none;"></iframe>
<br><br><br><br>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- ///////////////////////////////////// Funçoes SideBar //////////////////////////////////////////////////////////////-->
<script>
function w3_open() {
document.getElementById("main").style.marginLeft = "20%";
document.getElementById("mySidebar").style.width = "20%";
document.getElementById("mySidebar").style.display = "block";
document.getElementById("openNav").style.display = 'none';
}
function w3_close() {
document.getElementById("main").style.marginLeft = "0%";
document.getElementById("mySidebar").style.display = "none";
document.getElementById("openNav").style.display = "inline-block";
}
</script>
</body>
</html>