File: D:/HostingSpaces/SBogers64/klimroosbudel.nl/wwwroot/kms/app/controllers/c_home_streamer.class.php
<?php
/**
* c_home.class.php
* Created by Komma Mediadesign.
* Author: mike
* Date: 3/19/13
*/
class Home_Streamer extends Controller
{
public function __construct()
{
parent::__construct();
}
/*
* Gets the dashboard of our homepage
*/
public function index()
{
Url_Pin::set();
$Db = new DatabaseHandler();
$Db->setTableName('klim_home_streamer');
$Db->addRule('id', 1);
if ($data = $Db->select()) {
$streamer = $data['streamer'];
$this->View->setData('streamer', $streamer);
}
// Set title of this page
$this->View->setData('page_title', 'Home zin - '.SITE_NAME);
// Render the view
$this->View->render('v_home_streamer');
}
public function validate()
{
$Db = new DatabaseHandler();
$Db->setTableName('klim_home_streamer');
$Db->setData(['streamer'=> $_POST['streamer']]);
$Db->addRule('id', 1);
if ($Db->update()) {
$this->Alert->set('De zin is aangepast', 'success');
} else {
$this->Alert->set('Er is helaas iets misgegaan', 'error');
}
Url_Pin::redirect();
}
}