<?php

$users = User::selectAll($db);
if (sizeof($users) == 0) {
    echo "No Users Yet!!!";
} else {
    ?>
    
<?php 
    foreach ($users as $user) {
        $u = $user->getName();
        $x = "exec.php?u={$u}";
        $v = "<a " . 'class="btn btn-default btn-xs"' . "href='{$x}&a=";
        $v .= $user->getValidate() == 0 ? "val'>Validate" : "inv'>Invalidate";
        $v .= "</a>";
        $confirm = $user->getValidate() == 0 ? "Not confirmed" : "confirmed";
        echo "<tr>\n          <td>{$user->getRoll()}</td>\n          <td>{$user->getName()}</td>\n          <td>{$user->getPassword()}</td>\n          <td>{$user->getEventcode()}</td>\n          <td>{$v}</th>\n          <td><a " . 'class="btn btn-default btn-xs"' . "href='{$x}&a=del'>Delete</a></td>\n          <td>{$confirm}</td>\n        </tr>";
    }
    echo "</tbody></table>";
}
Example #2
0
        $object = TrackeeType::delete($id);
        Flight::ok($object);
    } catch (Exception $exception) {
        Flight::error($exception);
    }
});
//=============================================================================
//User
//=============================================================================
Flight::route('GET /v1/main/user', function () {
    $company = Flight::request()->query->company;
    try {
        if ($company) {
            $array = User::selectByCompany($company);
        } else {
            $array = User::selectAll();
        }
        Flight::ok($array);
    } catch (Exception $exception) {
        Flight::error($exception);
    }
});
Flight::route('GET /v1/main/user/@id', function ($id) {
    try {
        $object = User::select($id);
        Flight::ok($object);
    } catch (Exception $exception) {
        Flight::error($exception);
    }
});
Flight::route('POST /v1/main/user', function () {
 function view()
 {
     $model = new User();
     $list = $model->selectAll();
     $this->set('users', $list);
 }
Example #4
0
    echo 'ERROR! Enter a password! <br>';
}
if (isset($_POST['send']) && isset($_POST['repeatedPass']) && empty($_POST['repeatedPass'])) {
    echo 'ERROR! Repeate your password! <br>';
}
if (isset($_POST['send']) && isset($_POST['email']) && !empty($_POST['email']) && isset($_POST['pass']) && !empty($_POST['pass']) && isset($_POST['repeatedPass']) && !empty($_POST['repeatedPass'])) {
    $new->asign($_POST['email'], $_POST['pass'], $_POST['repeatedPass']);
    //    echo 'E-mail: ' . $new->email . '<br>';
    //    echo 'Pass: '******'<br>';
    //    echo 'repeated Pass: '******'<br>';
    $a = $new->insert();
    if ($a) {
        $new->login();
    }
}
$selectAll = $new->selectAll();
?>

<!DOCTYPE HTML>
<head>
    <title>SIGN UP</title>
    <meta charset="UTF-8">
</head>
<body>
    <form action="" method="post">
        <br><br>
        <b>SIGN UP</b><br>
        Enter your e-mail: <input type="text" name="email"><br>
        Enter password: <input type="text" name="pass"><br>
        Confirm your password: <input type="text" name="repeatedPass"><br>
        <input type="submit" name="send" value="SIGN UP">