Exemple #1
0
<?php

switch ($action) {
    case "index":
        Mvc::View(basename(__FILE__, ".php"));
        break;
    case "UserList":
        Mvc::View(basename(__FILE__, ".php"), "list");
        break;
    case "GetIdByLogin":
        $log = $_REQUEST["login"];
        $r = $db->QueryOne("select id from Users where Login='******' ");
        die($r["id"]);
        break;
    case "UserData":
        $db->Query("select id, Login, FirstName, LastName,Permission, Mail from Users order by Login");
        while ($buf = $db->Fetch()) {
            $data[] = array("id" => $buf["id"], "Login" => $buf["Login"], "FirstName" => $buf["FirstName"], "LastName" => $buf["LastName"], "Permission" => $buf["Permission"], "Mail" => $buf["Mail"]);
        }
        $db->StopFetch();
        if ($data == null) {
            die("{\"data\": []}");
        }
        die("{\"data\": " . json_encode($data) . "}");
        break;
        // ACTION =========================
    // ACTION =========================
    case "Create":
        $login = $_REQUEST["login"];
        $pas = $_REQUEST["password"];
        $fir = $_REQUEST["firstname"];
Exemple #2
0
<?php

switch ($action) {
    // ACTION =========================
    case "index":
        Mvc::View(basename(__FILE__, ".php"));
        break;
    default:
        echo "Action not found";
        break;
}