Exemplo n.º 1
0
require_once $config->getIncludeURL(Config::INCLUDES_PATH, "daos%band_search_dao.php");
require_once $config->getIncludeURL(Config::INCLUDES_PATH, "daos%band_genre_dao.php");
require_once $config->getIncludeURL(Config::INCLUDES_PATH, "daos%band_member_dao.php");
require_once $config->getIncludeURL(Config::INCLUDES_PATH, "objects%band.php");
require_once $config->getIncludeURL(Config::INCLUDES_PATH, "objects%band_member.php");
require_once $config->getIncludeURL(Config::INCLUDES_PATH, "objects%search_results.php");
require_once $config->getIncludeURL(Config::INCLUDES_PATH, "objects%search_parameters.php");
require_once $config->getIncludeURL(Config::INCLUDES_PATH, "utilities%search_utilities.php");
$bandSkeletons = null;
$dbConnection = null;
$memberID = null;
try {
    $dbConnection = DatabaseUtilities::getDatabaseConnection();
    //Get the current user's ID and details.
    $memberID = LoginController::getLoggedInMemberID();
    if ($memberID != null) {
        $inputMemberID = $_POST[MemberEditConstants::MEMBER_ID_INPUT];
        if (MemberController::processMemberViewSecurityCheck($inputMemberID, $_POST[MemberEditConstants::ENCRYPTED_ID_INPUT])) {
            //TODO: Add paging functions.
            $bandSearchResults = BandSearchController::searchBandsByMemberID($inputMemberID, 1, 10, $dbConnection);
            //If member details cannot be obtained, error
            if ($bandSearchResults != null) {
                $bandSkeletons = $bandSearchResults->getVariable(SearchResults::SKELETONS);
            }
        }
    }
} catch (Exception $ex) {
    $bandSkeletons = null;
}
$dbConnection = null;
require_once $config->getIncludeURL(Config::INCLUDES_PATH, "views%musicians%musician_bands_view.php");
Exemplo n.º 2
0
    //Get the current user's ID and details.
    $memberID = LoginController::getLoggedInMemberID();
    if ($memberID == null) {
        header("Location: login.php");
        exit;
    } else {
        $currentPage = 1;
        $pagingAmount = 10;
        if (isset($_GET[SearchConstants::PAGING_AMOUNT_ID])) {
            $pagingAmount = $_GET[SearchConstants::PAGING_AMOUNT_ID];
        }
        if (isset($_GET[SearchConstants::PAGING_AMOUNT_ID])) {
            $currentPage = $_GET[SearchConstants::CURRENT_PAGE_ID];
        }
        //TODO: Add paging functions.
        $bandSearchResults = BandSearchController::searchBandsByMemberID($memberID, $currentPage, $pagingAmount, $dbConnection);
        if ($bandSearchResults != null) {
            $bandSearchParameters = $bandSearchResults->getVariable(SearchResults::SEARCH_PARAMETERS);
            require_once $config->getIncludeURL(Config::INCLUDES_PATH, "views%my%bands_view.php");
        } else {
            $error = true;
            $errorCode = 1;
        }
    }
} catch (Exception $ex) {
    $error = true;
    $errorCode = 1;
}
$dbConnection = null;
if ($error == true) {
    ErrorUtilities::errorRedirect($errorCode);