public function processRequest(User $user = NULL) { parent::displayHeader($user, 'Journeys List'); $dbConnection = DbConnectionUtil::getDbConnection(); $journeyIdList = Journey::loadAllJourneyIdList($dbConnection); $journeyDataList = array(); foreach ($journeyIdList as $journeyId) { $journeyDataList[] = Journey::loadJourneyById($dbConnection, $journeyId); } ?> <div class="imageDetailsView"> <?php foreach ($journeyDataList as $journeyData) { $journeyDetailUrl = UrlFormatter::formatRoutingItemUrl('views/JourneyDetailsView', array(JourneyDetailsView::GET_PARAM_JOURNEY_ID => $journeyData->getId())); ?> <div style="display:inline-block" class="searchResultItem"> <label for="journey_name_field">Journey Name</label> <br/> <a href="<?php echo $journeyDetailUrl; ?> "><span id="journey_name_field" class="imageDetailsField"><?php echo $journeyData->getTitle(); ?> </span></a> <br/> <label for="journey_date_field">Journey Date</label> <br/> <span id="journey_date_field" class="imageDetailsField"><?php echo $journeyData->getCreationDate(); ?> </span> </div> <div style="clear:both"></div> <?php } ?> </div> <?php parent::displayFooter(); }
public function processRequest(User $user = NULL) { $journeyId = RequestParser::parseRequestParam($_GET, self::GET_PARAM_JOURNEY_ID, RequestParser::PARAM_FILTER_TYPE_INT); $baseUrl = Settings::getSetting('APPLICATION_URL'); if (!$journeyId) { header("Location: {$baseUrl}"); exit; } // load the journey data $dbConnection = DbConnectionUtil::getDbConnection(); $journeyData = Journey::loadJourneyById($dbConnection, $journeyId); if (!$journeyData) { header("Location: {$baseUrl}"); exit; } // load the images from the journey $imageDataList = ImageData::loadImageDataListByIdSet($dbConnection, $journeyData->getImageIdList()); parent::displayHeader($user, 'Journey Details'); ?> <div class="imageDetailsView"> <label for="journey_name_field">Journey Name</label> <br/> <span id="journey_name_field" class="imageDetailsViewField"><?php echo $journeyData->getTitle(); ?> </span> <br/> <label for="journey_creation_date_field">Journey Date</label> <br/> <span id="journey_creation_date_field" class="imageDetailsViewField"><?php echo $journeyData->getCreationDate(); ?> </span> <br/> <label for="journey_comments_field">Journey Comments</label> <br/> <p id="journey_comments_field" class="imageDetailsViewField"><?php echo $journeyData->getComments(); ?> </p> </div> <div class="imageGrid"> <?php foreach ($imageDataList as $imageData) { $imageDetailsUrl = UrlFormatter::formatRoutingItemUrl('views/ImageDetailsView', array(ImageDetailsView::GET_PARAM_IMAGE_ID => $imageData->getId())); $thumbnailUrl = UrlFormatter::formatImageUrl($imageData->getThumbnailUri()); ?> <a target="_blank" href="<?php echo $imageDetailsUrl; ?> "><img src="<?php echo $thumbnailUrl; ?> "/></a> <?php } ?> </div> <?php parent::displayFooter(); }