本文整理汇总了PHP中HomeView类的典型用法代码示例。如果您正苦于以下问题:PHP HomeView类的具体用法?PHP HomeView怎么用?PHP HomeView使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了HomeView类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: updateUser
public static function updateUser()
{
// Process updating of user information
$users = UsersDB::getUsersBy('userId', $_SESSION['arguments']);
if (empty($users)) {
HomeView::show();
header('Location: /' . $_SESSION['base']);
} elseif ($_SERVER["REQUEST_METHOD"] == "GET") {
$_SESSION['users'] = $users;
UserView::showUpdate();
} else {
$parms = $users[0]->getParameters();
$parms['userName'] = array_key_exists('userName', $_POST) ? $_POST['userName'] : "";
$parms['password'] = array_key_exists('password', $_POST) ? $_POST['password'] : "";
$newUser = new User($parms);
$newUser->setUserId($users[0]->getUserId());
$user = UsersDB::updateUser($newUser);
if ($user->getErrorCount() != 0) {
$_SESSION['users'] = array($newUser);
return;
UserView::showUpdate();
} else {
HomeView::show();
header('Location: /' . $_SESSION['base']);
}
}
}
开发者ID:raroseman,项目名称:cs4413-Hoodflix,代码行数:27,代码来源:UserController.class.php
示例2: run
public function run($page)
{
switch ($page) {
case 'index':
$users = new UsersController();
$users->runIndex();
break;
default:
$home_view = new HomeView();
$home_view->runIndex();
break;
}
}
开发者ID:nelaulloa,项目名称:SeedFramework,代码行数:13,代码来源:index.php
示例3: updateUser
public static function updateUser()
{
$users = UsersDB::getUsersBy('userID', $_SESSION['arguments']);
if (empty($users)) {
HomeView::show();
header('Location: /' . $_SESSION['base']);
} elseif ($_SERVER["REQUEST_METHOD"] == "GET") {
$_SESSION['users'] = $users;
UserView::showUpdate();
} else {
$parms = $users[0]->getParameters();
$parms['userName'] = array_key_exists('userName', $_POST) ? $_POST['userName'] : $users[0]->getUsername();
$parms['rank'] = array_key_exists('rank', $_POST) ? $_POST['rank'] : $users[0]->getRank();
$newUser = new User($parms);
$newUser->setUserID($users[0]->getUserID());
$user = UsersDB::updateUser($newUser);
if ($user->getErrorCount() != 0) {
$_SESSION['user'] = $newUser;
UserView::showUpdate();
} else {
HomeView::show();
header('Location: /' . $_SESSION['base']);
}
}
}
开发者ID:keithcruz,项目名称:webtech,代码行数:25,代码来源:UserController.class.php
示例4: updateSubmission
public static function updateSubmission()
{
// Process updating submissions
$submissions = SubmissionsDB::getSubmissionsBy('submissionId', $_SESSION['arguments']);
if (empty($submissions)) {
HomeView::show();
header('Location: /' . $_SESSION['base']);
} elseif ($_SERVER["REQUEST_METHOD"] == "GET") {
$_SESSION['submissions'] = $submissions;
SubmissionView::showUpdate();
} else {
$parms = $submissions[0]->getParameters();
$parms['submissionFile'] = array_key_exists('submissionFile', $_POST) ? $_POST['submissionFile'] : "";
$newSubmission = new Submission($parms);
$newSubmission->setSubmissionId($submissions[0]->getSubmissionId());
$submission = SubmissionsDB::updateSubmission($newSubmission);
if ($submission->getErrorCount() != 0) {
$_SESSION['submissions'] = array($newSubmission);
SubmissionView::showUpdate();
} else {
HomeView::show();
header('Location: /' . $_SESSION['base']);
}
}
}
开发者ID:bennilyn,项目名称:examples,代码行数:25,代码来源:SubmissionController.class.php
示例5: testShowHomeViewWithNullUser
public function testShowHomeViewWithNullUser()
{
ob_start();
$return = HomeView::show(null);
$output = ob_get_clean();
$this->assertFalse(empty($output), "It should show a Home view when passed a null user");
}
开发者ID:bennilyn,项目名称:examples,代码行数:7,代码来源:HomeViewTest.php
示例6: updateReview
public static function updateReview()
{
// Process updating review
$reviews = ReviewsDB::getReviewsBy('reviewId', $_SESSION['arguments']);
if (empty($reviews)) {
HomeView::show();
header('Location: /' . $_SESSION['base']);
} elseif ($_SERVER["REQUEST_METHOD"] == "GET") {
$_SESSION['reviews'] = $reviews;
ReviewView::showUpdate();
} else {
$parms = $reviews[0]->getParameters();
$parms['score'] = array_key_exists('score', $_POST) ? $_POST['score'] : $reviews[0]->getScore();
$parms['review'] = array_key_exists('review', $_POST) ? $_POST['review'] : $reviews[0]->getReview();
$newReview = new Review($parms);
$newReview->setReviewId($reviews[0]->getReviewId());
$review = ReviewsDB::updateReview($newReview);
if ($review->getErrorCount() != 0) {
$_SESSION['reviews'] = array($newReview);
ReviewView::showUpdate();
} else {
HomeView::show();
header('Location: /' . $_SESSION['base']);
}
}
}
开发者ID:bennilyn,项目名称:examples,代码行数:26,代码来源:ReviewController.class.php
示例7: showDetails
public static function showDetails()
{
$base = $_SESSION['base'];
echo '<img src="/' . $base . '/resources/images/botspace-logo.png" alt="botspace logo" style="width:627px;height:126px;">';
if (HomeView::userLoggedIn()) {
HomeView::showHobbyistGreeting($_SESSION['user']);
} else {
HomeView::showGuestGreeting();
}
echo '<aside><section>';
echo '<h2>Robot Showcase</h2>';
echo '<ul>';
echo '<li><a href="">Robot 1</a></li>';
echo '<li><a href="">Robot 2</a></li>';
echo '<li><a href="">Robot 3</a></li>';
echo '</ul></section>';
echo '<section>';
echo '<h2>Hobbyist Showcase</h2>';
echo '<ul>';
echo '<li><a href="">Human 1</a></li>';
echo '<li><a href="">Human 2</a></li>';
echo '<li><a href="">Human 3</a></li>';
echo '</ul></section>';
echo '<aside>';
}
开发者ID:mr-augustine,项目名称:sensor-data-repo,代码行数:25,代码来源:HomeView.class.php
示例8: updateTournament
public static function updateTournament()
{
$tournaments = TournamentsDB::getTournamentsBy('tournamentID', $_SESSION['arguments']);
if (empty($tournaments)) {
HomeView::show();
header('Location: /' . $_SESSION['base']);
} elseif ($_SERVER["REQUEST_METHOD"] == "GET") {
$_SESSION['tournament'] = $tournaments[0];
TournamentView::showUpdate();
} else {
$parms = $tournaments[0]->getParameters();
$parms['name'] = array_key_exists('name', $_POST) ? $_POST['name'] : $tournaments[0]->getName();
$parms['startDate'] = array_key_exists('startDate', $_POST) ? $_POST['startDate'] : $tournaments[0]->getDate();
$parms['startTime'] = array_key_exists('startTime', $_POST) ? $_POST['startTime'] : $tournaments[0]->getTime();
$parms['numParticipants'] = array_key_exists('numParticipants', $_POST) ? $_POST['numParticipants'] : $tournaments[0]->getName();
$newTournament = new Tournament($parms);
$newTournament->setTournamentID($tournaments[0]->getTournamentID());
$tournament = TournamentsDB::updateTournament($newTournament);
if ($tournament->getErrorCount() != 0) {
$_SESSION['tournament'] = $newTournament;
TournamentView::showUpdate();
} else {
HomeView::show();
header('Location: /' . $_SESSION['base']);
}
}
}
开发者ID:keithcruz,项目名称:webtech,代码行数:27,代码来源:TournamentController.class.php
示例9: updateUser
private function updateUser($userId)
{
$users = UsersDB::getUsersBy('user_id', $userId);
if (empty($users)) {
HomeView::show();
header('Location: /' . $_SESSION['base']);
} else {
if ($_SERVER['REQUEST_METHOD'] == 'GET') {
$_SESSION['user'] = $users[0];
UserView::showUpdate();
} else {
$params = $users[0]->getParameters();
$params['username'] = array_key_exists('username', $_POST) ? $_POST['username'] : "";
$params['password'] = array_key_exists('password', $_POST) ? $_POST['password'] : "";
$updatedUser = new User($params);
$updatedUser->setUserId($users[0]->getUserId());
$plaintextPassword = $updatedUser->getPassword();
$hashedPassword = password_hash($plaintextPassword, PASSWORD_DEFAULT);
$updatedUser->setPassword($hashedPassword);
$returnedUser = UsersDB::updateUser($updatedUser);
if ($returnedUser->getErrorCount() == 0) {
// TODO: Log out the current user before diplaying the HomeView; LogoutController::LogoutCurrentUser()
HomeView::show();
header('Location: /' . $_SESSION['base']);
} else {
$_SESSION['user'] = $updatedUser;
UserView::showUpdate();
}
}
}
}
开发者ID:mr-augustine,项目名称:sensor-data-repo,代码行数:31,代码来源:UserController.class.php
示例10: show
private function show()
{
$arguments = array_key_exists('arguments', $_SESSION) ? $_SESSION['arguments'] : 0;
// Identify the target user
$users = UsersDB::getUsersBy('user_id', $arguments);
$user = $users[0];
if (!is_null($user)) {
// Prepare all data to be displayed in the target user's ProfileView
// --all of their datasets
// --all of the sensors for each dataset
// TODO: add 'member since'
$datasets = DatasetsDB::getDatasetsBy('user_id', $user->getUserId());
foreach ($datasets as $dataset) {
$sensors = SensorsDB::getSensorsBy('dataset_id', $dataset->getDatasetId());
$dataset->setSensors($sensors);
}
$_SESSION['user'] = $user;
$_SESSION['datasets'] = $datasets;
ProfileView::show();
} else {
$_SESSION['user'] = null;
// TODO:: Consider showing a 'Specified user does not exist' page
HomeView::show();
}
}
开发者ID:mr-augustine,项目名称:sensor-data-repo,代码行数:25,代码来源:ProfileController.class.php
示例11: updateDataset
private function updateDataset()
{
$dataset = $_SESSION['dataset'];
if (empty($dataset)) {
HomeView::show();
header('Location: /' . $_SESSION['base']);
} elseif ($_SERVER['REQUEST_METHOD'] == 'GET') {
DatasetView::showUpdate();
} else {
$params = $dataset->getParameters();
$params['dataset_name'] = array_key_exists('dataset_name', $_POST) ? $_POST['dataset_name'] : '';
$params['description'] = array_key_exists('description', $_POST) ? $_POST['description'] : '';
$updatedDataset = new Dataset($params);
$updatedDataset->setDatasetId($dataset->getDatasetId());
$returnedDataset = DatasetsDB::updateDataset($updatedDataset);
if ($returnedDataset->getErrorCount() == 0) {
// Show the Dataset view which should display the updated params
DatasetView::show();
header('Location: /' . $_SESSION['base'] . '/dataset/show/' . $dataset->getDatasetId());
} else {
// Carry over the sensors, if any
$updatedDataset->setSensors($dataset->getSensors());
$_SESSION['dataset'] = $updatedDataset;
DatasetView::showUpdate();
}
}
}
开发者ID:mr-augustine,项目名称:sensor-data-repo,代码行数:27,代码来源:DatasetController.class.php
示例12: updateSensor
private function updateSensor()
{
$sensor = $_SESSION['sensor'];
if (empty($sensor)) {
HomeView::show();
header('Location: /' . $_SESSION['base']);
} elseif ($_SERVER['REQUEST_METHOD'] == 'GET') {
SensorView::showUpdate();
} else {
$params = $sensor->getParameters();
$params['sensor_name'] = array_key_exists('sensor_name', $_POST) ? $_POST['sensor_name'] : '';
$params['description'] = array_key_exists('description', $_POST) ? $_POST['description'] : '';
$updatedSensor = new Sensor($params);
$updatedSensor->setSensorId($sensor->getSensorId());
$returnedSensor = SensorsDB::updateSensor($updatedSensor);
if ($returnedSensor->getErrorCount() == 0) {
// Show the Sensor View which should display the updated params
SensorView::show();
header('Location: /' . $_SESSION['base'] . '/sensor/show/' . $sensor->getSensorId());
} else {
// Carry over the measurements, if any
$updatedSensor->setMeasurements($sensor->getMeasurements());
$_SESSION['sensor'] = $updatedSensor;
SensorView::showUpdate();
}
}
}
开发者ID:mr-augustine,项目名称:sensor-data-repo,代码行数:27,代码来源:SensorController.class.php
示例13: run
public static function run()
{
$action = $_SESSION['action'];
$arguments = $_SESSION['arguments'];
switch ($action) {
case "show":
$users = UsersDB::getUsersBy('userId', $arguments);
if (count($users) > 0) {
$user = $users[0];
if (self::setProfileDataForUser($user->getUserId()) == true) {
ProfileView::show();
} else {
HomeView::show();
}
}
// $user = null;
// $userData = null;
// $users = UsersDB::getUsersBy('userId', $arguments);
// if (count($users) > 0) {
// $user = $users[0];
// $userDataArray = UserDataDB::getUserDataBy('userId', $user->getUserId());
// if (count($userDataArray) > 0)
// $userData = $userDataArray[0];
// }
// $_SESSION['user'] = $user;
// $_SESSION['userData'] = $userData;
// ProfileView::show();
break;
case "update":
break;
default:
}
}
开发者ID:mr-augustine,项目名称:sensor-data-repo,代码行数:33,代码来源:ProfileController.class.php
示例14: show
public static function show()
{
MasterView::showHeader(null);
MasterView::showNav();
HomeView::showContent();
MasterView::showFooter(null);
}
开发者ID:mikeschap,项目名称:WithTheClothesOnYourBack,代码行数:7,代码来源:HomeView.class.php
示例15: run
public static function run()
{
$user = null;
$userIsLegit = false;
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
$user = new User($_POST);
if ($user->getErrorCount() == 0) {
$checkUserArray = UsersDB::getUsersBy('username', $user->getUserName());
if (count($checkUserArray) > 0) {
$checkUser = $checkUserArray[0];
$user->setUserId($checkUser->getUserId());
$userIsLegit = password_verify($_POST['password'], $checkUser->getPassword());
}
}
} else {
LoginView::show();
return;
}
if ($userIsLegit) {
$_SESSION['authenticatedUser'] = $user;
$_SESSION['authenticated'] = true;
HomeView::show();
} else {
$user->setError('username', 'USERNAME_PASSWORD_COMBO_INVALID');
$_SESSION['user'] = $user;
LoginView::show();
}
}
开发者ID:mr-augustine,项目名称:sensor-data-repo,代码行数:28,代码来源:LoginController.class.php
示例16: testShowHomeViewWithNullUser
public function testShowHomeViewWithNullUser()
{
ob_start();
$_SESSION = array('user' => null, 'base' => 'mvcdbcrud');
$return = HomeView::show();
$output = ob_get_clean();
$this->assertFalse(empty($output), "It should show a Home view when passed a null user");
}
开发者ID:keithcruz,项目名称:webtech,代码行数:8,代码来源:HomeViewTest.php
示例17: run
public static function run()
{
if (isset($_COOKIE["user"])) {
ProfileView::show();
} else {
HomeView::show();
}
}
开发者ID:mikeschap,项目名称:WithTheClothesOnYourBack,代码行数:8,代码来源:ProfileController.class.php
示例18: show
public static function show()
{
$_SESSION['headertitle'] = "ClassBash Home Page";
MasterView::showHeader();
MasterView::showNavbar();
HomeView::showDetails();
$_SESSION['footertitle'] = "<h3>The footer goes here</h3>";
MasterView::showFooter();
}
开发者ID:bennilyn,项目名称:examples,代码行数:9,代码来源:HomeView.class.php
示例19: show
public static function show($user)
{
$base = $_SESSION['base'];
$footer = "Contact Information: <a href='mailto:[email protected]'>[email protected]</a>";
MasterView::showHeader("Hock League");
MasterView::showNav(null);
HomeView::showDetails($user);
MasterView::showFooter($footer);
}
开发者ID:Trivette,项目名称:cs4413,代码行数:9,代码来源:HomeView.class.php
示例20: run
public static function run()
{
if ($_SERVER["REQUEST_METHOD"] == "POST") {
HomeView::show();
} else {
// Initial link
ReviewView::show();
}
}
开发者ID:bennilyn,项目名称:examples,代码行数:9,代码来源:ReviewController.class.php
注:本文中的HomeView类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论