public function action_login() { // already logged in? if (Auth::check()) { // yes, so go back to the page the user came from, or the // application dashboard if no previous page can be detected //Messages::info(__('login.already-logged-in')); Response::redirect_back(''); } // was the login form posted? if (Input::method() == 'POST') { // check the credentials. print_r(Input::all()); if (Auth::login(Input::param('email'), Input::param('password'))) { // did the user want to be remembered? if (Input::param('remember', false)) { // create the remember-me cookie Auth::remember_me(); } else { // delete the remember-me cookie if present Auth::dont_remember_me(); } // logged in, go back to the page the user came from, or the // application dashboard if no previous page can be detected Response::redirect_back('/home'); } else { // login failed, show an error message $this->error = 'test'; } } // display the login page return \View::forge('auth/login'); }
public function action_index() { if ($search = \Fuel\Core\Input::param('search')) { $data['projects'] = Model_Project::find('all', array('where' => array(array('name', 'like', "%{$search}%")), 'related' => array('client', 'project_type'))); } else { $data['projects'] = Model_Project::find('all', array('related' => array('client', 'project_type'))); } $this->template->set_global('auto_complete_list', Model_Project::get_auto_complete_list()); $this->template->title = "Projects » Listing"; $this->template->content = View::forge('admin/projects/index', $data); }
public function action_detail() { $this->setJavascript('responesive_tabs.js'); $this->setJavascript('fb_comment.js'); $aryDataTemplate['data'] = array(); $id = Input::param('id'); if ($id) { $data = Model_Blog::find($id); $aryDataTemplate['data'] = $data; $this->setPageTitle($data[BLOG_TITLE]); } $this->template->content = View_Smarty::forge('blog/detail.tpl', $aryDataTemplate); }
public function action_filter() { $user_id = \Fuel\Core\Input::param('user_id', 0); $client_id = Fuel\Core\Input::param('client_id', 0); $project_id = \Fuel\Core\Input::param('project_id', 0); $month = Fuel\Core\Input::param('month', '00'); $year = Fuel\Core\Input::param('year', date('Y')); $status = 0; $data['open_tasks'] = THelper::get_tasks($user_id, $client_id, $project_id, $month, $year, $status, array(\Fuel\Core\Input::param('sort', 'priority') => \Fuel\Core\Input::param('order', 0))); $view = \Fuel\Core\View::forge('admin/tasks/index'); $view->set_global('clients', Model_Customer::find('all', array('order_by' => array('name' => 'asc')))); $view->set_global('users', Model_User::find('all', array('order_by' => array('username' => 'asc')))); $view->set_global('years', range(2015, date('Y'))); $view->set_global('months', THelper::get_months_array()); $view->set_global('open_tasks', $data['open_tasks']); $view->set_global('admin', true); $this->template->title = 'Open Tasks'; $this->template->content = $view; }
<th> <?php $order_by_assignedto = \Fuel\Core\Input::param('sort', 'assignedto') == 'assignedto' ? \Fuel\Core\Input::param('order', 0) == 1 ? 0 : 1 : 1; echo \Fuel\Core\Html::anchor($action . 'user_id=' . \Fuel\Core\Input::param('user_id', 0) . '&project_id=' . \Fuel\Core\Input::param('project-id', 0) . '&client_id=' . \Fuel\Core\Input::param('client_id', 0) . '&year=' . \Fuel\Core\Input::param('year', date('Y')) . '&month=' . \Fuel\Core\Input::param('month', date('m')) . '&sort=assignedto' . '&order=' . $order_by_assignedto, $order_by_assignedto == 1 ? '<span class="glyphicon icon-sort-by-alphabet"></span> User' : '<span class="glyphicon icon-sort-by-alphabet-alt"></span> User', array('style' => 'color: black')); ?> </th> <th> <?php $order_by_task = \Fuel\Core\Input::param('sort', 'task') == 'task' ? \Fuel\Core\Input::param('order', 0) == 1 ? 0 : 1 : 1; echo \Fuel\Core\Html::anchor($action . 'user_id=' . \Fuel\Core\Input::param('user_id', 0) . '&project_id=' . \Fuel\Core\Input::param('project-id', 0) . '&client_id=' . \Fuel\Core\Input::param('client_id', 0) . '&year=' . \Fuel\Core\Input::param('year', date('Y')) . '&month=' . \Fuel\Core\Input::param('month', date('m')) . '&sort=task' . '&order=' . $order_by_task, $order_by_task == 1 ? '<span class="glyphicon icon-sort-by-alphabet"></span> Description' : '<span class="glyphicon icon-sort-by-alphabet-alt"></span> Description', array('style' => 'color: black')); ?> </th> <th style="width: 70px;"> <?php $order_by_priority = \Fuel\Core\Input::param('sort', 'priority') == 'priority' ? \Fuel\Core\Input::param('order', 0) == 1 ? 0 : 1 : 1; echo \Fuel\Core\Html::anchor($action . 'user_id=' . \Fuel\Core\Input::param('user_id', 0) . '&project_id=' . \Fuel\Core\Input::param('project-id', 0) . '&client_id=' . \Fuel\Core\Input::param('client_id', 0) . '&year=' . \Fuel\Core\Input::param('year', date('Y')) . '&month=' . \Fuel\Core\Input::param('month', date('m')) . '&sort=priority' . '&order=' . $order_by_priority, $order_by_priority == 1 ? '<span class="glyphicon icon-sort-by-alphabet"></span> Priority' : '<span class="glyphicon icon-sort-by-alphabet-alt"></span> Priority', array('style' => 'color: black')); ?> </th> <th>Hours Spent</th> <th style="width: 80px;"> </th> </tr> </thead> <tbody> <?php if ($open_tasks) { ?> <?php $row_counter = 0; $datestart_timestamp = strtotime(Fuel\Core\Input::param('year', date('Y')) . '-' . Fuel\Core\Input::param('month', date('m')) . '-01'); $dateend_timestamp = strtotime(date(Fuel\Core\Input::param('year', date('Y')) . '-' . Fuel\Core\Input::param('month', date('m')) . '-t')); ?>
<?php echo \Fuel\Core\Form::open(array('class' => 'form-inline', 'method' => 'get')); ?> <div class="form-group"> <input id="auto-complete" class="form-control" name="search" value="<?php echo \Fuel\Core\Input::param('search', ''); ?> " placeholder="Project Name" /> </div> <div class="btn-group" role="group" aria-label="..."> <?php echo \Fuel\Core\Html::anchor(\Fuel\Core\Uri::current(), "Cancel", ['class' => 'btn btn-default', 'type' => 'button']); ?> <?php echo Form::submit('', 'Search', array('class' => 'btn btn-success')); ?> </div> <?php echo \Fuel\Core\Form::close(); ?>