This repository was archived by the owner on Jan 25, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfaq.php
More file actions
139 lines (115 loc) · 5.1 KB
/
faq.php
File metadata and controls
139 lines (115 loc) · 5.1 KB
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
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, shrink-to-fit=no">
<title>FAQ</title>
<link rel="stylesheet" href="assetsFAQ/bootstrap/css/bootstrap.min.css">
<link rel="stylesheet" href="assetsFAQ/fonts/fontawesome-all.min.css">
<link rel="stylesheet" href="assetsFAQ/css/Footer-Dark.css">
<link rel="stylesheet" href="assetsFAQ/css/Navegacin-APS.css">
<link rel="stylesheet" href="assetsFAQ/css/Search-Input-responsive.css">
<link rel="stylesheet" href="assetsFAQ/css/Sidebar-1.css">
<link rel="stylesheet" href="assetsFAQ/css/Sidebar-Menu-1.css">
<link rel="stylesheet" href="assetsFAQ/css/Sidebar-Menu.css">
<link rel="stylesheet" href="assetsFAQ/css/Sidebar.css">
<link rel="stylesheet" href="assetsFAQ/css/simple-footer.css">
<link rel="stylesheet" href="assetsFAQ/css/styles.css">
<!-- Script de Búsqueda -->
<?php
function Search($input){
require('../../database_conn.php');
$conexion = conexion();
$query = "SELECT * FROM FAQ";
if($input != NULL){
$query = "SELECT *
FROM FAQ
WHERE Head LIKE '%".$input."%' or
Body LIKE '%".$input."%'";
}
$resultados = mysqli_query($conexion,$query);
$count = mysqli_num_rows($resultados);
if($count > 0){
while($rows = mysqli_fetch_assoc($resultados)){
echo "<div class='row' style='margin-top: 1%;'>
<div class='col'>
<h1 class='text-left'>".$rows['Head']."</h1>
<p class='text-justify'>".$rows['Body']."</p>
</div>
</div>";
}
}else{
echo "<div class='row' style='margin-top: 1%;'>
<div class='col'>
<h1 class='text-left'>No se encontraron resultados</h1>
<p class='text-justify'>#Consejo: Cuantas menos palabras busques mejor.</p>
</div>
</div>";
}
}
?>
<!-- Listener de retorno de carro para la barrita de búsqueda -->
<script>
function pressed(e) {
// Has the enter key been pressed?
if ( (window.event ? event.keyCode : e.which) == 13) {
// If it has been so, manually submit the <form>
document.forms[0].submit();
}
}
</script>
</head>
<body>
<!-- Barra de navegación -->
<?php include "_navbar.php"; ?>
<div>
<!-- Barra de navegación Izquierda -->
<div id="wrapper">
<div class="shadow-sm" id="sidebar-wrapper" style="width: 15%;background-color: transparent;">
<ul class="sidebar-nav">
<li style="margin-top: 15%;">
<a class="border rounded shadow-sm" href="/faq.php" style="color: #103567;">Preguntas Comunes</a>
</li>
<li>
<a class="border rounded shadow-sm" href="/contact.php" style="color: #103567;">Contacta</a>
</li>
</ul>
</div>
</div>
<!-- Contenedor Central -->
<div class="container" style="margin-left: 15%;">
<div class="col-xl-8">
<div class="row">
<div class="col-md-4 col-lg-10 col-xl-12 text-center">
<div class="row">
<div class="col">
<h1 class="text-left" style="color: #103567;padding-top: 20px;padding-bottom: 20px;">FAQ-Preguntas Frecuentes</h1>
</div>
</div>
<div class="row" style = "margin-bottom: 10%;">
<div class="col">
<div class="d-table mt-5 mt-md-0 search-area" style="width: 500px;">
<i class="fas fa-search float-left search-icon"></i>
<?php
$input = $_GET['input'];
$direccion = $_SERVER['PHP_SELF'];
echo "<form action='$direccion' method='get'>
<input onkeydown='pressed(event)' class='float-left float-sm-right custom-search-input' type='search' name='input' placeholder='Buscar un Tema Concreto' style='width: 100%;'>
</form>";
?>
</div>
</div>
</div>
<?php
Search($input);
?>
</div>
</div>
</div>
</div>
</div>
<script src="assetsFAQ/js/jquery.min.js"></script>
<script src="assetsFAQ/bootstrap/js/bootstrap.min.js"></script>
<script src="assetsFAQ/js/Sidebar-Menu.js"></script>
</body>
</html>