testpagina

[insert_php]
global $current_user; get_currentuserinfo();
[/insert_php]
[insert_php]
if ( is_user_logged_in() ) {
include “api/v2/hidden/dbase.php”;// ServerName
$servername = “localhost”;
// Create connection
$conn = mysqli_connect($servername, $username, $password, $database);
// Check
if (!$conn) {
die(“Connection failed: ” . mysqli_connect_error());
}
echo ““;

$user = get_current_user_id();
$sql =”SELECT meta_value FROM www_usermeta WHERE user_id = $user AND meta_key = ‘www_user_level'”;
$result = mysqli_query($conn, $sql);
$value = mysqli_fetch_object($result);
if ($value->meta_value > 5) {
$datum_nu = date(‘Y-m-d’);
$sql =”SELECT device_id FROM tragatta_linkeddevices WHERE user_id = ‘$current_user->user_login'”;
$result2 = mysqli_query($conn, $sql);
if (mysqli_num_rows($result2) >0) {
while($row2 = mysqli_fetch_assoc($result2)) {
$related_device_id =$row2[‘device_id’];
$sql = “SELECT * FROM tragattaWedstrijd WHERE deviceId=’$related_device_id’ AND (datum>=’$datum_nu’ OR datum=’0000-00-00′) ORDER BY datum, tijd”;
$result = mysqli_query($conn, $sql);
if (mysqli_num_rows($result) > 0) {
while($row = mysqli_fetch_assoc($result)) {
$wedstrijdID = $row[‘wedstrijdID’];
$naam =$row[‘naam’];
$status = $row[‘status’];
$url = “wedstrijd/”.$wedstrijdID;
$content = urlencode(strip_tags(trim($url)));

$alt=”Scan this QR code”;
$size = “150”;
$align = “”;
$class = “”;
$credit_footer = “

“;

$preoutput = ‘

‘;
$output = “”;
$image = ‘https://chart.googleapis.com/chart?chs=’ . $size . ‘x’ . $size . ‘&cht=qr&chld=H|1&chl=’ . $content;
if ($align == “right”) {
$align = ‘ align=”right”‘;
}
if ($align == “left”) {
$align = ‘ align=”left”‘;
}
if ($class != “”) {
$class = ‘ class=”‘ . $class . ‘”‘;
}

$output = $preoutput . ‘' . $alt . '‘;

echo “

“;
echo “

“.$row[‘naam’].”

“;
echo “

“;
echo “

“;
echo “

“;
echo “

“;

$urlstring = “wedstrijdID=”.$wedstrijdID. “&naam=”.$naam . “&un=”.$related_device_id . “&status=” . $status;
echo “

“;
echo “

“;

echo “

“;
echo “

“;
echo “

“;
echo “

“;

echo “

“;

echo “

start om ” . $output . $credit_footer . “
op “.date(‘d-m-Y’,strtotime($row[‘datum’])).”
aantal ronden
status “;
echo “
ga naar deelnemers
ga naar parcours
“;
echo “

“;

echo “

“;
echo “

“;

echo “

“;
}
}
}
}

} else {
echo “Je bent niet ingelogd met de rol organisator.”;
}
}else {
echo “Je moet ingelogd zijn als organisator.”;
}

if($_POST && isset($_POST[‘nickname’])){
$nickname = $_POST[‘nickname’];
$personal_swwaarde = $_POST[‘personal_swwaarde’];
$deviceId = $_POST[‘deviceId’];
$sql = “UPDATE tragattaboat SET nickname=’$nickname’, personal_swwaarde=’$personal_swwaarde’ WHERE deviceId=’$deviceId'”;

$result = $conn->query($sql);

}

[/insert_php]