dolist(); if(count($lstObj) == 0){ $url = "index.php?option=com_areas&controller=areas&action=add"; header("location: ".$url); exit(0); } $data["lstObj"] = $lstObj; $data["lsTitle"] = "AREAS::::::::::::::"; $data["content"] = "components".DS."com_areas".DS."views".DS."dolist.php"; $data["title"] = "AREAS::::::::::::::"; $this->view->show("template.php", $data); } public function add(){ $data["frm_title"] = "AGREGAR AREA::::::::::"; $data["content"] = "components".DS."com_areas".DS."views".DS."form.php"; $data["title"] = "Add Area:::::::::::::"; $this->view->show("template.php", $data); } public function save(){ $title = $_POST['txtTitle']; $desc = $_POST['description']; $message = "Area Added"; require("components".DS."com_areas".DS."models".DS."areasModel.php"); $area = new areasModel(); $data_sql['name'] = $title; $data_sql['description'] = $desc; $data_sql['date_create'] = date("Y-m-d H:i:s"); $data_sql['state'] = 1; list($query, $id, $message) = $area->addItem($data_sql); $url = "index.php?option=com_areas&controller=reports&action=dolist"; header("location: ".$url); exit(); } public function setTitle($type){ $html_title = ""; switch ($type){ case 1: $html_title = "Lista de Informes"; break; case 2: $html_title = "Lista de Reportes"; break; default: $html_title = "Lista de Reportes"; break; } return $html_title; } } ?>