2013-11-26 13:45:07 +01:00
|
|
|
<?php
|
|
|
|
|
2014-03-05 21:19:12 +01:00
|
|
|
use ninja\mailers\Mailer;
|
|
|
|
|
2013-11-26 13:45:07 +01:00
|
|
|
class HomeController extends BaseController {
|
|
|
|
|
|
|
|
protected $layout = 'master';
|
2014-03-05 21:19:12 +01:00
|
|
|
protected $mailer;
|
|
|
|
|
|
|
|
public function __construct(Mailer $mailer)
|
|
|
|
{
|
|
|
|
parent::__construct();
|
|
|
|
|
|
|
|
$this->mailer = $mailer;
|
|
|
|
}
|
2013-11-26 13:45:07 +01:00
|
|
|
|
|
|
|
public function showWelcome()
|
|
|
|
{
|
2014-03-20 23:12:07 +01:00
|
|
|
return View::make('public.splash');
|
2013-11-26 13:45:07 +01:00
|
|
|
}
|
2014-01-02 14:21:15 +01:00
|
|
|
|
2014-02-26 17:08:40 +01:00
|
|
|
public function showAboutUs()
|
|
|
|
{
|
2014-03-20 23:12:07 +01:00
|
|
|
return View::make('public.about_us');
|
2014-02-26 17:08:40 +01:00
|
|
|
}
|
|
|
|
|
2014-02-26 17:50:27 +01:00
|
|
|
public function showContactUs()
|
|
|
|
{
|
2014-03-20 23:12:07 +01:00
|
|
|
return View::make('public.contact_us');
|
2014-02-26 17:50:27 +01:00
|
|
|
}
|
|
|
|
|
2014-03-11 18:37:54 +01:00
|
|
|
public function showTerms()
|
|
|
|
{
|
2014-03-20 23:12:07 +01:00
|
|
|
return View::make('public.terms');
|
2014-03-11 18:37:54 +01:00
|
|
|
}
|
|
|
|
|
2014-03-05 21:19:12 +01:00
|
|
|
public function doContactUs()
|
|
|
|
{
|
|
|
|
$email = Input::get('email');
|
|
|
|
$name = Input::get('name');
|
|
|
|
$message = Input::get('message');
|
|
|
|
|
|
|
|
$data = [
|
|
|
|
'name' => $name,
|
|
|
|
'email' => $email,
|
|
|
|
'text' => $message
|
|
|
|
];
|
|
|
|
|
2014-03-19 19:54:27 +01:00
|
|
|
$this->mailer->sendTo(CONTACT_EMAIL, CONTACT_EMAIL, 'Invoice Ninja Feedback', 'contact', $data);
|
2014-03-05 21:19:12 +01:00
|
|
|
|
|
|
|
Session::flash('message', 'Successfully sent message');
|
|
|
|
return Redirect::to('/contact');
|
|
|
|
}
|
|
|
|
|
2014-01-08 21:09:47 +01:00
|
|
|
public function showComingSoon()
|
|
|
|
{
|
|
|
|
return View::make('coming_soon');
|
|
|
|
}
|
|
|
|
|
2014-01-02 14:21:15 +01:00
|
|
|
public function logError()
|
|
|
|
{
|
2014-01-09 00:22:56 +01:00
|
|
|
return Utils::logError(Input::get('error'), 'JavaScript');
|
2014-01-02 14:21:15 +01:00
|
|
|
}
|
2013-11-26 13:45:07 +01:00
|
|
|
}
|