public function action_category() { $category = new Model_Ajax(); $content = View::factory('/admin/category'); $result = $category->read_category(); $result = $result->as_array(); $content->category = $result; $this->template->scripts = array('jquery-1.11.3.min', 'bootstrap.min', 'admin3'); $this->template->content = $content; }
public function action_charts($type = 'daily') { if (!Sentry::user()->has_access('charts_monthly')) { Response::redirect(''); } if ($type == 'daily') { // slice to remove the all form $data['json'] = Model_Ajax::chartsDaily(array_slice($this->tables, 1, count($this->tables))); } $this->template->content = View::forge('ajax/view', $data); }
public function action_cmg() { if (!Sentry::user()->has_access('customers_cmginfo_read') && !Sentry::user()->has_access('customers_all_read')) { self::no_access(); } View::set_global('columns', array_map('Inflector::humanize', Model_Ajax::getColumns('cmginfo'))); $this->template->title = 'Customers » Cmg'; $this->template->content = View::forge('customers/cmg'); }
public function action_update_id() { if (Request::initial()->is_ajax()) { $id = Arr::get($_POST, 'val', ''); $id_new = Arr::get($_POST, 'new_val', ''); $ajax = new Model_Ajax(); $res = $ajax->update_id($id, $id_new); if ($res == 0) { $res = 1; } else { $res = 0; } echo $res; } }