forked from lucasfrag/kali-linux-tools-interface
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsearch-tools.php
More file actions
100 lines (85 loc) · 3.69 KB
/
Copy pathsearch-tools.php
File metadata and controls
100 lines (85 loc) · 3.69 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
<?php
$searchtext = $_POST["searchtext"];
include('assets/includes/config.php');
$con = getConnectionDB() or die ("Could not connect to database.");
$sql = $con->prepare("SELECT * FROM tools WHERE fullname LIKE '$searchtext%' OR name LIKE '$searchtext%' ORDER BY name;");
$sql->execute();
$resultados = $sql->fetchAll(PDO::FETCH_ASSOC);
// FOREACH BEGINS
foreach ($resultados as $resultado) {
$id = $resultado['id'];
$name = $resultado['name'];
$category = $resultado['category'];
$category2 = $resultado['category2'];
$released = $resultado['released'];
$categories = $resultado['categories'];
$avatar = $resultado['avatar'];
if (is_null($avatar)) {
$avatar = 'assets/img/kali.png';
}
?>
<div class="col-sm-12 col-md-12 col-lg-6 col-xl-6 filter <?php echo $categories ?>">
<?php
if (is_null($released)) {
echo "
<div class='card zoom-effect bg-white mb-3 text-white'>
<div class='card-body'>
<div class='row'>
<div class='col'>
<span class='h2 font-weight-bold mb-0'>$name</span>
<h5 class='card-title text-uppercase text-muted mb-0'>$category";
if (!is_null($category2)) {
echo ", $category2";
}
echo "</h5>
</div>
<div class='col-auto'>
<div class='icon icon-shape text-white rounded-circle shadow'";
echo " style='background-image: url($avatar); background-size: cover; background-position: center'> ";
echo "
</div>
</div>
</div>
<p class='mt-3 mb-0 text-muted'>
<span class='text-danger mr-2'>Unavailable</span>
<span class='text-nowrap'></span>
</p>
</div>
</div>
";
} else {
echo "
<a href='selected-tool.php?id=$id' style='text-decoration: none;'>
<div class='card zoom-effect mb-3 text-white bg-success'>
<div class='card-body'>
<div class='row'>
<div class='col'>
<span class='h2 font-weight-bold mb-0 text-white'>$name</span>
<h5 class='card-title text-uppercase mb-0' style='color: #84edff;'>$category";
if (!is_null($category2)) {
echo ", $category2";
}
echo "</h5>
</div>
<div class='col-auto'>
<div class='icon icon-shape text-white rounded-circle shadow'";
echo " style='background-image: url($avatar); background-size: cover; background-position: center'> ";
echo "
</div>
</div>
</div>
<p class='mt-3 mb-0 text-muted'>
<span class='text-white mr-2'>Available</span>
<span class='text-nowrap'></span>
</p>
</div>
</div>
</a>
";
}
?>
</div>
<?php
// FOREACH ENDS
}
?>