Index: trunk/administrator/components/com_areas/areasController.php =================================================================== diff --git a/trunk/administrator/components/com_areas/areasController.php b/trunk/administrator/components/com_areas/areasController.php --- a/trunk/administrator/components/com_areas/areasController.php (revision 3) +++ b/trunk/administrator/components/com_areas/areasController.php (revision 4) @@ -22,99 +22,33 @@ } public function add(){ - $type = $_GET['ty']; - require_once("components".DS."com_areas".DS."models".DS."areasModel.php"); - $objAreas = new areasModel(); - $lstAreas = $objAreas->dolist(); - - $html_title = $this->setTitle($type); - - $data["type"] = $type; - $data["frm_title"] = $html_title; - $data["lstAreas"] = $lstAreas; + $data["frm_title"] = "AGREGAR AREA::::::::::"; $data["content"] = "components".DS."com_areas".DS."views".DS."form.php"; - $data["title"] = "Add Report:::::::::::::"; + $data["title"] = "Add Area:::::::::::::"; $this->view->show("template.php", $data); } public function save(){ - $ty = $_POST['type']; - $area = $_POST['lstArea']; $title = $_POST['txtTitle']; $desc = $_POST['description']; - $url = explode(DS, trim(SYS_ROOT)); - array_pop($url); - array_pop($url); - array_pop($url); - $path = implode(DS, $url); - $path = $path.DS."files".DS; - $path_area = $path.DS.$area.DS; - - if($_FILES['fpname']['tmp_name'] != ""){ - if (is_uploaded_file($_FILES['fpname']['tmp_name'])){ - $psize = $_FILES ['fpname']['size']; - $pname = $_FILES ['fpname']['name']; - $man_file = new filesManager($pname); - $type = $man_file->getExtension(); - $name_file = $man_file->getName(); + $message = "Area Added"; + require("components".DS."com_areas".DS."models".DS."areasModel.php"); + $area = new areasModel(); - if($man_file->isDoc()){ - $url_user = $name_file.".".$type; - $date_current = date("YmdHis"); - $name_file_system = md5($name_file.$date_current); - $path_final = $name_file_system.".".$type; - $flag_add = false; - if(is_dir($path_area)){ - if(is_writable($path)){ - copy($_FILES['fpname']['tmp_name'], $path_area.$path_final); - $flag_add = true; - $tipo_msg = 1; - }else{ $message = "No se puede escribir."; } - }else{ - mkdir($path_area,0777,true); - copy($_FILES['fpname']['tmp_name'], $path_area.$path_final); - $flag_add = true; - } - if($flag_add){ - $message = "Added file"; - require("components".DS."com_areas".DS."models".DS."areasModel.php"); - $report = new areasModel(); - - $data_sql['idarea'] = $area; - $data_sql['title'] = $title; - $data_sql['description'] = $desc; - $data_sql['url_user'] = $pname; - $data_sql['url_system'] = $path_final; - $data_sql['type'] = $ty; - $data_sql['date_create'] = date("Y-m-d H:i:s"); - $data_sql['state'] = 1; - - list($query, $id, $message) = $report->addItem($data_sql); - } - }else{ - $message .= "Uploaded failed: No file allowed."; - $flu_insertar = false; - $tipo_msg = 2; - } - }else{ - // error por tamanio - $message .= "Uploaded failed: size exceeds the limit."; - $flu_insertar = false; - $tipo_msg = 3; - } - }else{ - echo "Error: Uploaded failed."; - $flu_insertar = false; - $tipo_msg = 3; - } + $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&ty=".$ty; + $url = "index.php?option=com_areas&controller=reports&action=dolist"; header("location: ".$url); - exit (0); + exit(); } public function setTitle($type){ Index: trunk/administrator/components/com_areas/views/dolist.php =================================================================== diff --git a/trunk/administrator/components/com_areas/views/dolist.php b/trunk/administrator/components/com_areas/views/dolist.php --- a/trunk/administrator/components/com_areas/views/dolist.php (revision 3) +++ b/trunk/administrator/components/com_areas/views/dolist.php (revision 4) @@ -33,7 +33,21 @@ name; ?> - state; ?> + + state){ + case 1: $src_image = "images/system/tick.png"; + $alt_image = "Active"; + break; + case 2: $src_image = "images/system/tick.png"; + $alt_image = "Disabled"; + break; + } + ?> + <?php echo $alt_image; ?> + +#div_addreport{ margin: 0 auto; width: 100%; padding-bottom: 10px} +#div_addreport .row_reg{margin-top: 2px; border: 0px solid #0070a3} +#div_addreport .row_reg label{float: left; width: 100px; text-align: right; padding-right: 5px; border: 0px solid #1cc; line-height: 25px} +#div_addreport .row_reg input{float: left; width: 400px; line-height: 25px} + + + +
+ +
+
+
+
+ + + +
+
+ + +
+
+
+ + + BasePath = $sBasePath ; + $oFCKeditor->BasePath = '../fckeditor/'; + $oFCKeditor->ToolbarSet = 'Basic'; + $oFCKeditor->Width = '100%'; + $oFCKeditor->Height = '200'; + $oFCKeditor->Create(); + ?> + +
+
+
+ + + + +
+