Update file index.php
This commit is contained in:
parent
6d330ac927
commit
8cfbf83f39
@ -29,7 +29,36 @@ $pdo = sqlConnect($sqlDatabaseHost, $sqlDatabaseName, $sqlDatabaseUser, $sqlData
|
||||
</nav>
|
||||
|
||||
<main>
|
||||
<div class="content"></div>
|
||||
<div class="content">
|
||||
<?php
|
||||
|
||||
echo ('<form action="#" method="get">');
|
||||
$shapePath = '<path d="M10.25 3.75c-3.59 0-6.5 2.91-6.5 6.5s2.91 6.5 6.5 6.5c1.795 0 3.419-.726 4.596-1.904 1.178-1.177 1.904-2.801 1.904-4.596 0-3.59-2.91-6.5-6.5-6.5zm-8.5 6.5c0-4.694 3.806-8.5 8.5-8.5s8.5 3.806 8.5 8.5c0 1.986-.682 3.815-1.824 5.262l4.781 4.781-1.414 1.414-4.781-4.781c-1.447 1.142-3.276 1.824-5.262 1.824-4.694 0-8.5-3.806-8.5-8.5z"></path>';
|
||||
textInput("text", $shapePath, "search", "Chercher", "");
|
||||
echo ('</form>');
|
||||
|
||||
$search = isset($_GET['$search']) ? '%' . $_GET['search'] . '%' : '%%';
|
||||
|
||||
$sqlRequest = "SELECT username, display_name, level, profile_picture FROM users WHERE ID LIKE :search OR username LIKE :search OR display_name LIKE :search OR level LIKE :search";
|
||||
$request = $pdo->prepare($sqlRequest);
|
||||
$request->bindParam(":search", $search);
|
||||
$request->execute();
|
||||
$result = $request->fetchAll(PDO::FETCH_ASSOC);
|
||||
|
||||
if ($result) {
|
||||
foreach($result as $row) {
|
||||
$pubDateTime = strtotime($row['date']);
|
||||
$pubDate = date('d/m/Y', $pubDateTime);
|
||||
$userName = $row['username'];
|
||||
$userDisplayName = $row['display_name'];
|
||||
$userLevel = $row['level'];
|
||||
$userPPURL = $row['profile_picture'] == NULL ? "https://abs.twimg.com/sticky/default_profile_images/default_profile_400x400.png" : $row['profile_picture'];
|
||||
|
||||
userWidget($userPPURL, $userDisplayName, $userName, $userLevel, $certificationColors, $rootPageURL);
|
||||
}
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</main>
|
||||
<footer>
|
||||
<div class="panel-content">
|
||||
|
Loading…
x
Reference in New Issue
Block a user