-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathsearch.php
151 lines (100 loc) · 4.32 KB
/
search.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
<!doctype html>
<html lang="pt-br">
<head>
<!-- meta tags requeridos -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>Search</title>
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="../node_modules/bootstrap/compiler/bootstrap.css">
<link rel="stylesheet" href="../node_modules/bootstrap/compiler/style.css">
<!-- Meus Css -->
<link rel="stylesheet" href="../public/styles/main.css">
<link rel="stylesheet" href="../public/styles/index.css">
<link rel="stylesheet" href="../public/styles/search.css">
<link rel="stylesheet" href="../public/styles/responsive.css">
<!-- Icone CSS -->
<link rel="icon" href="../public/img/Icone-novo.png">
</head>
<body>
<?php
require_once('../functions/client_functions.php');
require_once('global.php');
//caminho desse arquivo até o public/
$path = '../';
function noResult(){
echo('<h1 style="color:white">Nenhum resultado encontrado</h1>');
}
?>
<div class="porfora">
<div class="container pordentro">
<br>
<ul class="nav nav-tabs ">
<li class="nav-item">
<a class="nav-link disabled active" href="#">Pesquisa</a>
</li>
</ul>
<br>
<?php
$products = new Product();
if (isset($_GET['search']))
{
$search = $_GET['search'];
if ($search == ''){
noResult();
}else{
$productsSearch = $products->searchGenreConsoleProducts($search);
if(sizeof($productsSearch) == 0){
noResult();
}else{
listProducts($path, $productsSearch);
}
}
} else if(isset($_GET['searchgame']))
{
$searchgame = trim($_GET['searchgame']);
if($searchgame != ''){
$game = $products->searchGame($searchgame);
if(sizeof($game) == 0){
noResult();
}else{
listProducts($path, $game);
}
}else{
noResult();
}
} else {
noResult();
}
// se tiver logado voltar para o index de cliente logadp
//se não, votar o index de cliente não logado
if (session_status() == PHP_SESSION_NONE) {
echo("
</div>
<div class='back'>
<a href='../private/client/index.php'>
<h3>Voltar</h3>
</a>
</div>
");
}else{
echo("
</div>
<div class='back'>
<a href='../index.php'>
<h3>Voltar</h3>
</a>
</div>
");
}
?>
</div>
</div>
<div class="trasicion"></div>
<?php
footer_client();
scripts($path);
contact_modal();
?>
</body>
</html>