Example #1
0
$errors = null;
if (isset($_GET['checkMail'])) {
    $security->checkMail();
}
if ($user != false) {
    if (!$user['validated']) {
        $errors = "U moet uw account nog valideren.";
    } else {
        $core->loadPage("index.php");
    }
} else {
    if (isset($_GET['notValidated'])) {
        $errors = "U moet uw account nog valideren.";
    }
}
$query = $db->doquery("SELECT * FROM {{table}} WHERE active='1' LIMIT 1", "settings");
$settings = mysqli_fetch_array($query);
$mailHosts = explode(",", $settings['email_hosts']);
?>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <title>Alfa-Workshops</title>
    <link href="styles/base.css" rel="stylesheet" />
    <link href="styles/loginScreens.css" rel="stylesheet" />

</head>
<body>
Example #2
0
$core = new Core();
$db = new Database();
$db->opendb();
$security = new Security($core, $db);
$user = $security->checksession();
if (!$user) {
    $core->loadPage("login.php");
}
if (isset($_GET['logout'])) {
    $security->logout();
}
if (isset($_GET['deleteAll'])) {
    $items = explode(",", $_POST['items']);
    foreach ($items as $v) {
        if ($user['role'] == 2) {
            $db->doquery("DELETE FROM {{table}} WHERE id='" . $v . "'", "tickets");
            echo true;
        } elseif ($user['role'] == 1) {
            $q = $db->doquery("SELECT working_on FROM {{table}} WHERE id='" . $v . "' AND working_on='" . $user['id'] . "'", "tickets");
            if (mysqli_num_rows($q) > 0) {
                $db->doquery("DELETE FROM {{table}} WHERE id='" . $v . "'", "tickets");
                echo true;
            } else {
                echo "Assign ticket first to you.";
            }
        } else {
            $q = $db->doquery("SELECT user FROM {{table}} WHERE id='" . $v . "' AND user='******'id'] . "'", "tickets");
            if (mysqli_num_rows($q) > 0) {
                $db->doquery("DELETE FROM {{table}} WHERE id='" . $v . "'", "tickets");
                echo true;
            } else {