Beispiel #1
0
            }
            header('Content-Type: application/json');
            echo json_encode(array("transactions" => $temp_array));
            mysqli_close($this->connection);
        } else {
            $json['error'] = ' wrong username or password';
            echo json_encode($json);
            mysqli_close($this->connection);
        }
    }
}
$transactionList = new TransactionList();
if (isset($_POST['userid']) && isset($_POST['numOfTransactions'])) {
    $userid = $_POST['userid'];
    $numOfTransactions = $_POST['numOfTransactions'];
    if (!empty($userid)) {
        $transactionList->getLastXTransactions($userid, $numOfTransactions);
    }
} else {
    if (isset($_POST['userid'])) {
        $userid = $_POST['userid'];
        //$password = $_POST['password'];
        if (!empty($userid)) {
            //$encrypted_password = md5($password);
            $transactionList->getLastTenTransactions($userid);
        }
    } else {
        $json['error'] = 'You may not be logged in. Please try again later.  ';
        echo json_encode($json);
    }
}