Your IP : 18.218.1.38
<?php
$db = new mysqli("localhost","root","","covismlm");
function userToId($user, $col='id')
{
global $db;
$que = $db->query("SELECT * FROM user WHERE user = '$user' ") or die(mysqli_error());
$ro = mysqli_fetch_array($que);
return $ro[$col];
}
function userName($id,$col = '')
{
global $db ;
$que = $db->query("SELECT * FROM user WHERE id = '$id' ") or die(mysqli_error());
$ro = mysqli_fetch_array($que);
if (!empty($col)) {
return $ro[$col];
} else {
return htmlspecialchars($ro['firstname'] . ' ' . $ro['lastname']);
}
}
if(isset($_GET['val'])){
$search = $_GET['val'];
$search2 = userToId($search);
$entry = '';
$sql = $db->query("SELECT * FROM globeuser WHERE id='$search2' LIMIT 1");
if($search == ''){
$entry = 0;
}
elseif($search == '0'){
$entry = '';
}
elseif($sql->num_rows < 1){
$entry = 1;
}
else {
$row = $sql->fetch_assoc();
$entry = '<button class="btn btn-success float-md-right" name="GmRequestTransfer" value="'.$search2.'"> TRANSFER FUNDS TO: '.strtoupper($search).'<br>('.strtoupper(userName($search2)).')</button>';
}
echo $entry;
}
mysqli_close($db);
?>