-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
nuova struttura sito
- Loading branch information
Showing
108 changed files
with
2,989 additions
and
2,219 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
<?php | ||
|
||
namespace Fantamanajer\Controllers; | ||
|
||
use Fantamanajer\Models\Article; | ||
use FirePHP; | ||
use Lib\FormException; | ||
|
||
class ArticlesController extends ApplicationController { | ||
|
||
public function index() { | ||
$articles = Article::getByChampionship($this->currentChampionship->getId()); | ||
$this->templates['content']->assign('articles', $articles); | ||
} | ||
|
||
public function team_index() { | ||
$articles = Article::getByTeam($this->request->getParam('team_id')); | ||
$this->templates['content']->assign('articles', $articles); | ||
$this->view = 'index'; | ||
$this->noLayout = true; | ||
} | ||
|
||
public function build() { | ||
$this->templates['content']->assign('article', new Article()); | ||
} | ||
|
||
public function create() { | ||
try { | ||
$article = new Article(); | ||
$article->setTeamId($_SESSION['team']->id); | ||
$article->setMatchday($this->currentMatchday); | ||
$article->setCreatedAt('now'); | ||
$article->save(); | ||
$this->redirectTo("articles"); | ||
} catch(FormException $e) { | ||
die($e->getMessage()); | ||
$this->setFlash(self::FLASH_NOTICE, $e->getMessage()); | ||
$this->renderAction("articles_new"); | ||
} | ||
|
||
} | ||
|
||
public function edit() { | ||
$article = Article::getById($this->route['params']['id']); | ||
FirePHP::getInstance()->log($article); | ||
if (($article) == FALSE) { | ||
$this->send404(); | ||
} | ||
$this->templates['content']->assign('article', $article); | ||
} | ||
|
||
public function update() { | ||
try { | ||
$article = Article::getById($this->route['params']['id']); | ||
$article->save(); | ||
$this->setFlash(self::FLASH_SUCCESS, "Modificato con successo"); | ||
$this->redirectTo("articles"); | ||
} catch(FormException $e) { | ||
$this->setFlash(self::FLASH_NOTICE, $e->getMessage()); | ||
$this->renderAction("articles"); | ||
} | ||
} | ||
|
||
public function delete() { | ||
$article = Article::getById($this->route['params']['id']); | ||
$article->delete(); | ||
$this->redirectTo("articles"); | ||
} | ||
} | ||
|
||
|
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<?php | ||
|
||
namespace Fantamanajer\Controllers; | ||
use \Fantamanajer\Models as Models; | ||
|
||
class ClubsController extends ApplicationController { | ||
|
||
public function index() { | ||
$this->templates['content']->assign('clubs',Models\Club::getBySeason($this->currentSeason)); | ||
} | ||
|
||
public function show() { | ||
if (($club = Models\View\ClubStats::getById($this->route['params']['id'])) == FALSE) { | ||
Request::send404(); | ||
} | ||
|
||
$clubs = Models\Club::getList(); | ||
|
||
$this->templates['header']->assign('title',$club->getName()); | ||
$this->quickLinks->set('id',$clubs,""); | ||
$members = Models\View\MemberStats::getByField('club_id',$club->id); | ||
$this->templates['content']->assign('members',$members); | ||
$this->templates['content']->assign('club',$club); | ||
$this->templates['operation']->assign('clubs',$clubs); | ||
} | ||
|
||
public function probabiliFormazioni() { | ||
$clubs = Models\Club::getList(); | ||
$newClub = array(); | ||
foreach ($clubs as $club) { | ||
$newClub[strtolower($club->nome)] = $club->id; | ||
} | ||
|
||
$this->templates['content']->assign('elencoClub', $newClub); | ||
} | ||
|
||
public function probabiliFormazioni_html() { | ||
$url = "http://www.gazzetta.it/Calcio/prob_form/"; | ||
echo utf8_encode(\Fantamanajer\Lib\FileSystem::contenutoCurl($url)); | ||
} | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.