##// END OF EJS Templates
modificaciones del componente areas
arturo -
r3:4
parent child
Show More
@@ -0,0 +1,56
1 <style>
No newline at end of file
2 #div_addreport{ margin: 0 auto; width: 100%; padding-bottom: 10px}
No newline at end of file
3 #div_addreport .row_reg{margin-top: 2px; border: 0px solid #0070a3}
No newline at end of file
4 #div_addreport .row_reg label{float: left; width: 100px; text-align: right; padding-right: 5px; border: 0px solid #1cc; line-height: 25px}
No newline at end of file
5 #div_addreport .row_reg input{float: left; width: 400px; line-height: 25px}
No newline at end of file
6 </style>
No newline at end of file
7 <script type="text/javascript">
No newline at end of file
8 $(function(){
No newline at end of file
9 $('#btnSave').click(function(){
No newline at end of file
10 $('#frm_addArea').submit();
No newline at end of file
11 });
No newline at end of file
12 });
No newline at end of file
13 </script>
No newline at end of file
14 <?php include("../fckeditor/fckeditor.php"); ?>
No newline at end of file
15 <div class="toolbar_right">
No newline at end of file
16 <ul>
No newline at end of file
17 <li><a>Cancel</a></li>
No newline at end of file
18 <li><a href="#" id="btnSave">Save</a></li>
No newline at end of file
19 </ul>
No newline at end of file
20 <div style="clear: both; overflow: hidden"></div>
No newline at end of file
21 </div>
No newline at end of file
22 <div style="margin: 0 auto; width: 100%;">
No newline at end of file
23 <form name="frm_addArea" id="frm_addArea" method="post" action="index.php">
No newline at end of file
24 <span style="">
No newline at end of file
25 <label class="title_form" style="text-transform: uppercase; padding-left: 10px; margin-bottom: 10px; letter-spacing: 0.1em">
No newline at end of file
26 <?php echo $frm_title; ?>
No newline at end of file
27 </label>
No newline at end of file
28 </span>
No newline at end of file
29 <div id="div_addreport">
No newline at end of file
30 <div class="row_reg">
No newline at end of file
31 <label for="lblTitle">Title:</label>
No newline at end of file
32 <input type="text" name="txtTitle" value="" class="form_input" />
No newline at end of file
33 <div style="clear: both; overflow: hidden"></div>
No newline at end of file
34 </div>
No newline at end of file
35 <div class="row_reg_content">
No newline at end of file
36 <label style="vertical-align: top;">Description:</label>
No newline at end of file
37 <span>
No newline at end of file
38 <?php
No newline at end of file
39 $oFCKeditor = new FCKeditor('description') ;
No newline at end of file
40 //$oFCKeditor->BasePath = $sBasePath ;
No newline at end of file
41 $oFCKeditor->BasePath = '../fckeditor/';
No newline at end of file
42 $oFCKeditor->ToolbarSet = 'Basic';
No newline at end of file
43 $oFCKeditor->Width = '100%';
No newline at end of file
44 $oFCKeditor->Height = '200';
No newline at end of file
45 $oFCKeditor->Create();
No newline at end of file
46 ?>
No newline at end of file
47 </span>
No newline at end of file
48 <div style="clear: both; overflow: hidden"></div>
No newline at end of file
49 </div>
No newline at end of file
50 </div>
No newline at end of file
51 <input type="hidden" name="type" value="<?php echo $type; ?>" />
No newline at end of file
52 <input type="hidden" name="option" value="com_areas" />
No newline at end of file
53 <input type="hidden" name="controller" value="areas" />
No newline at end of file
54 <input type="hidden" name="action" value="save" />
No newline at end of file
55 </form>
No newline at end of file
56 </div> No newline at end of file
@@ -1,135 +1,69
1 <?php No newline at end of file
1 <?php
2 class areasController extends ControllerBase{ No newline at end of file
2 class areasController extends ControllerBase{
3 public function dolist(){ No newline at end of file
3 public function dolist(){
4 No newline at end of file
4
5 require("components".DS."com_areas".DS."models".DS."areasModel.php"); No newline at end of file
5 require("components".DS."com_areas".DS."models".DS."areasModel.php");
6 $obj = new areasModel(); No newline at end of file
6 $obj = new areasModel();
7 No newline at end of file
7
8 $lstObj = $obj->dolist(); No newline at end of file
8 $lstObj = $obj->dolist();
9 No newline at end of file
9
10 if(count($lstObj) == 0){ No newline at end of file
10 if(count($lstObj) == 0){
11 $url = "index.php?option=com_areas&controller=areas&action=add"; No newline at end of file
11 $url = "index.php?option=com_areas&controller=areas&action=add";
12 header("location: ".$url); No newline at end of file
12 header("location: ".$url);
13 exit(0); No newline at end of file
13 exit(0);
14 } No newline at end of file
14 }
15 No newline at end of file
15
16 $data["lstObj"] = $lstObj; No newline at end of file
16 $data["lstObj"] = $lstObj;
17 $data["lsTitle"] = "AREAS::::::::::::::"; No newline at end of file
17 $data["lsTitle"] = "AREAS::::::::::::::";
18 $data["content"] = "components".DS."com_areas".DS."views".DS."dolist.php"; No newline at end of file
18 $data["content"] = "components".DS."com_areas".DS."views".DS."dolist.php";
19 $data["title"] = "AREAS::::::::::::::"; No newline at end of file
19 $data["title"] = "AREAS::::::::::::::";
20 No newline at end of file
20
21 $this->view->show("template.php", $data); No newline at end of file
21 $this->view->show("template.php", $data);
22 } No newline at end of file
22 }
23 No newline at end of file
23
24 public function add(){
24 public function add(){
No newline at end of file
25 $type = $_GET['ty']; No newline at end of file
26
25
No newline at end of file
26 $data["frm_title"] = "AGREGAR AREA::::::::::"; No newline at end of file
27 require_once("components".DS."com_areas".DS."models".DS."areasModel.php");
No newline at end of file
28 $objAreas = new areasModel();
No newline at end of file
29 $lstAreas = $objAreas->dolist();
No newline at end of file
30
No newline at end of file
31 $html_title = $this->setTitle($type);
No newline at end of file
32
No newline at end of file
33 $data["type"] = $type;
No newline at end of file
34 $data["frm_title"] = $html_title;
No newline at end of file
35 $data["lstAreas"] = $lstAreas; No newline at end of file
36 $data["content"] = "components".DS."com_areas".DS."views".DS."form.php";
27 $data["content"] = "components".DS."com_areas".DS."views".DS."form.php";
No newline at end of file
28 $data["title"] = "Add Area:::::::::::::"; No newline at end of file
37 $data["title"] = "Add Report:::::::::::::"; No newline at end of file
38 No newline at end of file
29
39 $this->view->show("template.php", $data); No newline at end of file
30 $this->view->show("template.php", $data);
40 } No newline at end of file
31 }
41 No newline at end of file
32
42 public function save(){
33 public function save(){
No newline at end of file
43 $ty = $_POST['type'];
No newline at end of file
44 $area = $_POST['lstArea']; No newline at end of file
45 $title = $_POST['txtTitle']; No newline at end of file
34 $title = $_POST['txtTitle'];
46 $desc = $_POST['description']; No newline at end of file
35 $desc = $_POST['description'];
47
36
No newline at end of file
37 $message = "Area Added";
48 $url = explode(DS, trim(SYS_ROOT));
No newline at end of file
No newline at end of file
38 require("components".DS."com_areas".DS."models".DS."areasModel.php");
49 array_pop($url);
No newline at end of file
No newline at end of file
39 $area = new areasModel(); No newline at end of file
50 array_pop($url);
No newline at end of file
51 array_pop($url);
No newline at end of file
52 $path = implode(DS, $url);
No newline at end of file
53 $path = $path.DS."files".DS;
No newline at end of file
54 $path_area = $path.DS.$area.DS; No newline at end of file
55
40
No newline at end of file
41 $data_sql['name'] = $title; No newline at end of file
56 if($_FILES['fpname']['tmp_name'] != ""){
No newline at end of file
57 if (is_uploaded_file($_FILES['fpname']['tmp_name'])){
No newline at end of file
58 $psize = $_FILES ['fpname']['size'];
No newline at end of file
59 $pname = $_FILES ['fpname']['name'];
No newline at end of file
60 $man_file = new filesManager($pname);
No newline at end of file
61 $type = $man_file->getExtension();
No newline at end of file
62 $name_file = $man_file->getName();
No newline at end of file
63
No newline at end of file
64 if($man_file->isDoc()){
No newline at end of file
65 $url_user = $name_file.".".$type;
No newline at end of file
66 $date_current = date("YmdHis");
No newline at end of file
67 $name_file_system = md5($name_file.$date_current);
No newline at end of file
68 $path_final = $name_file_system.".".$type;
No newline at end of file
69 $flag_add = false;
No newline at end of file
70 if(is_dir($path_area)){
No newline at end of file
71 if(is_writable($path)){
No newline at end of file
72 copy($_FILES['fpname']['tmp_name'], $path_area.$path_final);
No newline at end of file
73 $flag_add = true;
No newline at end of file
74 $tipo_msg = 1;
No newline at end of file
75 }else{ $message = "No se puede escribir."; }
No newline at end of file
76 }else{
No newline at end of file
77 mkdir($path_area,0777,true);
No newline at end of file
78 copy($_FILES['fpname']['tmp_name'], $path_area.$path_final);
No newline at end of file
79 $flag_add = true;
No newline at end of file
80 }
No newline at end of file
81 if($flag_add){
No newline at end of file
82 $message = "Added file";
No newline at end of file
83 require("components".DS."com_areas".DS."models".DS."areasModel.php");
No newline at end of file
84 $report = new areasModel();
No newline at end of file
85
No newline at end of file
86 $data_sql['idarea'] = $area;
No newline at end of file
87 $data_sql['title'] = $title; No newline at end of file
88 $data_sql['description'] = $desc;
42 $data_sql['description'] = $desc;
No newline at end of file
89 $data_sql['url_user'] = $pname;
No newline at end of file
90 $data_sql['url_system'] = $path_final;
No newline at end of file
91 $data_sql['type'] = $ty; No newline at end of file
92 $data_sql['date_create'] = date("Y-m-d H:i:s"); No newline at end of file
43 $data_sql['date_create'] = date("Y-m-d H:i:s");
93 $data_sql['state'] = 1; No newline at end of file
44 $data_sql['state'] = 1;
94
45
No newline at end of file
46 list($query, $id, $message) = $area->addItem($data_sql); No newline at end of file
95 list($query, $id, $message) = $report->addItem($data_sql);
No newline at end of file
96 }
No newline at end of file
97 }else{
No newline at end of file
98 $message .= "Uploaded failed: No file allowed.";
No newline at end of file
99 $flu_insertar = false;
No newline at end of file
100 $tipo_msg = 2;
No newline at end of file
101 }
No newline at end of file
102 }else{
No newline at end of file
103 // error por tamanio
No newline at end of file
104 $message .= "Uploaded failed: size exceeds the limit.";
No newline at end of file
105 $flu_insertar = false;
No newline at end of file
106 $tipo_msg = 3;
No newline at end of file
107 }
No newline at end of file
108 }else{
No newline at end of file
109 echo "Error: Uploaded failed.";
No newline at end of file
110 $flu_insertar = false;
No newline at end of file
111 $tipo_msg = 3;
No newline at end of file
112 } No newline at end of file
113
47
No newline at end of file
48 $url = "index.php?option=com_areas&controller=reports&action=dolist"; No newline at end of file
114 $url = "index.php?option=com_areas&controller=reports&action=dolist&ty=".$ty; No newline at end of file
115 No newline at end of file
49
116 header("location: ".$url);
50 header("location: ".$url);
No newline at end of file
51 exit(); No newline at end of file
117 exit (0); No newline at end of file
118 } No newline at end of file
52 }
119 No newline at end of file
53
120 public function setTitle($type){ No newline at end of file
54 public function setTitle($type){
121 $html_title = ""; No newline at end of file
55 $html_title = "";
122 No newline at end of file
56
123 switch ($type){ No newline at end of file
57 switch ($type){
124 case 1: $html_title = "Lista de Informes"; No newline at end of file
58 case 1: $html_title = "Lista de Informes";
125 break; No newline at end of file
59 break;
126 case 2: $html_title = "Lista de Reportes"; No newline at end of file
60 case 2: $html_title = "Lista de Reportes";
127 break; No newline at end of file
61 break;
128 default: $html_title = "Lista de Reportes"; No newline at end of file
62 default: $html_title = "Lista de Reportes";
129 break; No newline at end of file
63 break;
130 } No newline at end of file
64 }
131 No newline at end of file
65
132 return $html_title; No newline at end of file
66 return $html_title;
133 } No newline at end of file
67 }
134 } No newline at end of file
68 }
135 ?> No newline at end of file
69 ?>
@@ -1,47 +1,61
1 <div class="toolbar_right"> No newline at end of file
1 <div class="toolbar_right">
2 <ul> No newline at end of file
2 <ul>
3 <li><a href="index.php?option=com_areas&controller=areas&action=add">Add</a></li> No newline at end of file
3 <li><a href="index.php?option=com_areas&controller=areas&action=add">Add</a></li>
4 </ul> No newline at end of file
4 </ul>
5 <div style="clear: both; overflow: hidden"></div> No newline at end of file
5 <div style="clear: both; overflow: hidden"></div>
6 </div> No newline at end of file
6 </div>
7 <span> No newline at end of file
7 <span>
8 <label class="title_form" style="text-transform: uppercase; padding-left: 10px; margin-bottom: 10px; letter-spacing: 0.1em"> No newline at end of file
8 <label class="title_form" style="text-transform: uppercase; padding-left: 10px; margin-bottom: 10px; letter-spacing: 0.1em">
9 <?php echo $lsTitle; ?> No newline at end of file
9 <?php echo $lsTitle; ?>
10 </label> No newline at end of file
10 </label>
11 </span> No newline at end of file
11 </span>
12 <?php No newline at end of file
12 <?php
13 $num = count($lstObj); No newline at end of file
13 $num = count($lstObj);
14 ?> No newline at end of file
14 ?>
15 <table style="width: 100%"> No newline at end of file
15 <table style="width: 100%">
16 <thead> No newline at end of file
16 <thead>
17 <tr> No newline at end of file
17 <tr>
18 <th style="width: 10px;text-align: center;border: 1px solid #066">Num</th> No newline at end of file
18 <th style="width: 10px;text-align: center;border: 1px solid #066">Num</th>
19 <th style="width: 10px;text-align: center;border: 1px solid #066"><input type="checkbox" name="lstCheck" /></th> No newline at end of file
19 <th style="width: 10px;text-align: center;border: 1px solid #066"><input type="checkbox" name="lstCheck" /></th>
20 <th style="width: 400px;text-align: center;border: 1px solid #066">Name</th> No newline at end of file
20 <th style="width: 400px;text-align: center;border: 1px solid #066">Name</th>
21 <th style="width: 200px;text-align: center;border: 1px solid #066">Members</th> No newline at end of file
21 <th style="width: 200px;text-align: center;border: 1px solid #066">Members</th>
22 <th style="width: 60px;text-align: center;border: 1px solid #066">State</th> No newline at end of file
22 <th style="width: 60px;text-align: center;border: 1px solid #066">State</th>
23 </tr> No newline at end of file
23 </tr>
24 </thead> No newline at end of file
24 </thead>
25 <tbody> No newline at end of file
25 <tbody>
26 <?php No newline at end of file
26 <?php
27 if($num > 0){ No newline at end of file
27 if($num > 0){
28 for($i=0; $i<$num; $i++){ No newline at end of file
28 for($i=0; $i<$num; $i++){
29 $obj = $lstObj[$i]; No newline at end of file
29 $obj = $lstObj[$i];
30 ?> No newline at end of file
30 ?>
31 <tr> No newline at end of file
31 <tr>
32 <td style="text-align: center"><?php echo ($i+1); ?></td> No newline at end of file
32 <td style="text-align: center"><?php echo ($i+1); ?></td>
33 <td style="text-align: center"><input type="checkbox" name="chkReport" value="" class="lstChkReport" /></td> No newline at end of file
33 <td style="text-align: center"><input type="checkbox" name="chkReport" value="" class="lstChkReport" /></td>
34 <td style="text-align: center"><?php echo $obj->name; ?></td> No newline at end of file
34 <td style="text-align: center"><?php echo $obj->name; ?></td>
35 <td style="text-align: center"><?php echo "0" ?></td>
35 <td style="text-align: center"><?php echo "0" ?></td>
No newline at end of file
36 <td style="text-align: center">
36 <td style="text-align: center"><?php echo $obj->state; ?></td> No newline at end of file
No newline at end of file
37 <?php
No newline at end of file
38 $src_image = "";
No newline at end of file
39 $alt_image = "";
No newline at end of file
40 switch ($obj->state){
No newline at end of file
41 case 1: $src_image = "images/system/tick.png";
No newline at end of file
42 $alt_image = "Active";
No newline at end of file
43 break;
No newline at end of file
44 case 2: $src_image = "images/system/tick.png";
No newline at end of file
45 $alt_image = "Disabled";
No newline at end of file
46 break;
No newline at end of file
47 }
No newline at end of file
48 ?>
No newline at end of file
49 <img src="<?php echo $src_image; ?>" alt="<?php echo $alt_image; ?>" border="0" />
No newline at end of file
50 </td> No newline at end of file
37 </tr> No newline at end of file
51 </tr>
38 <?php No newline at end of file
52 <?php
39 } No newline at end of file
53 }
40 }else{ No newline at end of file
54 }else{
41 ?> No newline at end of file
55 ?>
42 <tr><td colspan="4" style="text-align: center">No Areas</td></tr> No newline at end of file
56 <tr><td colspan="4" style="text-align: center">No Areas</td></tr>
43 <?php No newline at end of file
57 <?php
44 } No newline at end of file
58 }
45 ?> No newline at end of file
59 ?>
46 </tbody> No newline at end of file
60 </tbody>
47 </table> No newline at end of file
61 </table>
General Comments 0
You need to be logged in to leave comments. Login now