示例#1
0
function CreatePlayerComboboxes()
{
    $comboboxesCount = 5;
    $namePattern = "player";
    $users = GetAllUsers();
    if ($users->error->code != Error::NoError) {
        Site::DisplayError($users->error, "error-box");
        return;
    }
    for ($i = 1; $i <= $comboboxesCount; ++$i) {
        print "<td class=\"align-center\">";
        $name = $namePattern . $i;
        Form::Combobox($name, $name, $users);
        print "</td>";
    }
}
示例#2
0
    if ($newPassword == "") {
        array_push($errors, "Password not set");
        $success = false;
    }
    if ($success) {
        $result = RegisterNewUser($newName, $newEmail, md5($newPassword));
        if ($result !== false) {
            echo json_encode(makeUserFromRaw($result, "info", $lang));
        } else {
            echo json_encode(array("Error" => "User with this email already exists"));
        }
    } else {
        echo '{"errors":' . json_encode($errors) . '}';
    }
} else {
    $usersRaw = GetAllUsers();
    if (!isset($_GET["id"])) {
        $users = [];
        for ($i = 0; $i < count($usersRaw); $i++) {
            if (isset($_GET['type'])) {
                $newUser = makeUserFromRaw($usersRaw[$i], $_GET['type'], $lang);
            } else {
                $newUser = makeUserFromRaw($usersRaw[$i], "info", $lang);
            }
            array_push($users, $newUser);
        }
        echo json_encode($users);
    } else {
        for ($i = 0; $i < count($usersRaw); $i++) {
            if (isset($_GET['type'])) {
                $newUser = makeUserFromRaw($usersRaw[$i], $_GET['type'], $lang);
//this is the file that contains all the functions used in AJAX.
if (isset($_POST["no"]) && $_POST["no"] == "1") {
    //this is to save the details of the user coming first time to the MR Connect Portal
    SaveUser($_POST["basic"], $_POST["education"], $_POST["experience"], $_POST["contact"], $_POST["picture"]);
} else {
    if (isset($_GET["no"]) && $_GET["no"] == "2") {
        //this is the function to load the data from the database and show it to the Front end.
        LoadData($_GET["email"], $_GET["id"]);
    } else {
        if (isset($_GET["no"]) && $_GET["no"] == "3") {
            //for saving/updating the interests thing.
            SaveUpdateInterests($_GET["id"], $_GET["email"], $_GET["i1"], $_GET["i2"], $_GET["i3"], $_GET["i4"], $_GET["i5"], $_GET["i6"], $_GET["i7"]);
        } else {
            if (isset($_GET["no"]) && $_GET["no"] == "4") {
                //for getting all the users from the database
                GetAllUsers($_GET["email"]);
            } else {
                if (isset($_GET["no"]) && $_GET["no"] == "5") {
                    //for getting all the users from the database
                    UserExists($_GET["email"], $_GET["id"]);
                } else {
                    if (isset($_GET["no"]) && $_GET["no"] == "6") {
                        //for getting all the users from the database
                        SetCookieID($_GET["email"]);
                    } else {
                        if (isset($_GET["no"]) && $_GET["no"] == "7") {
                            //for getting all the users from the database
                            GetSearchList($_GET["searchKey"]);
                        } else {
                            if (isset($_GET["no"]) && $_GET["no"] == "8") {
                                //for getting all the users from the database