##// 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
@@ -22,99 +22,33
22 22 } No newline at end of file
23 23 No newline at end of file
24 24 public function add(){
No newline at end of file
25 $type = $_GET['ty']; No newline at end of file
26 25
26 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 27 $data["content"] = "components".DS."com_areas".DS."views".DS."form.php";
28 No newline at end of file
37 $data["title"] = "Add Report:::::::::::::"; No newline at end of file
38 29 No newline at end of file
39 30 $this->view->show("template.php", $data); No newline at end of file
40 31 } No newline at end of file
41 32 No newline at end of file
42 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 34 $title = $_POST['txtTitle']; No newline at end of file
46 35 $desc = $_POST['description']; No newline at end of file
47 36
37 No newline at end of file
48 $url = explode(DS, trim(SYS_ROOT));
No newline at end of file
38 No newline at end of file
49 array_pop($url);
No newline at end of file
39 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
41 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 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 43 $data_sql['date_create'] = date("Y-m-d H:i:s"); No newline at end of file
93 44 $data_sql['state'] = 1; No newline at end of file
94 45
46 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
48 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 49 No newline at end of file
116 50 header("location: ".$url);
51 No newline at end of file
117 exit (0); No newline at end of file
118 52 } No newline at end of file
119 53 No newline at end of file
120 54 public function setTitle($type){ No newline at end of file
@@ -33,7 +33,21
33 33 <td style="text-align: center"><input type="checkbox" name="chkReport" value="" class="lstChkReport" /></td> No newline at end of file
34 34 <td style="text-align: center"><?php echo $obj->name; ?></td> No newline at end of file
35 35 <td style="text-align: center"><?php echo "0" ?></td>
36 No newline at end of file
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 51 </tr> No newline at end of file
38 52 <?php No newline at end of file
39 53 } No newline at end of file
General Comments 0
You need to be logged in to leave comments. Login now