1 | <? |
---|
2 | // ************************************************************************************************************************************************* |
---|
3 | // Aplicación WEB: ogAdmWebCon |
---|
4 | // Autor: José Manuel Alonso (E.T.S.I.I.) Universidad de Sevilla |
---|
5 | // Fecha Creación: Año 2009-2010 |
---|
6 | // Fecha Última modificación: Agosto-2010 |
---|
7 | // Nombre del fichero: CrearImagen.php |
---|
8 | // Descripción : |
---|
9 | // Implementación del comando "CrearImagen.php" |
---|
10 | // ************************************************************************************************************************************************* |
---|
11 | include_once("../includes/ctrlacc.php"); |
---|
12 | include_once("../clases/AdoPhp.php"); |
---|
13 | include_once("../includes/constantes.php"); |
---|
14 | include_once("../includes/comunes.php"); |
---|
15 | include_once("../includes/CreaComando.php"); |
---|
16 | include_once("../includes/HTMLSELECT.php"); |
---|
17 | include_once("../includes/TomaDato.php"); |
---|
18 | include_once("../idiomas/php/".$idioma."/comandos/crearimagen_".$idioma.".php"); |
---|
19 | include_once("../idiomas/php/".$idioma."/comandos/opcionesacciones_".$idioma.".php"); |
---|
20 | include_once("../includes/pintaTablaConfiguraciones.php"); |
---|
21 | |
---|
22 | //________________________________________________________________________________________________________ |
---|
23 | include_once("./includes/capturaacciones.php"); |
---|
24 | //________________________________________________________________________________________________________ |
---|
25 | $cmd=CreaComando($cadenaconexion); |
---|
26 | if (!$cmd) |
---|
27 | Header('Location: '.$pagerror.'?herror=2'); // Error de conexión con servidor B.D. |
---|
28 | //________________________________________________________________________________________________________ |
---|
29 | $resul=tomaPropiedades($cmd,$idambito); |
---|
30 | if (!$resul){ |
---|
31 | Header('Location: '.$pagerror.'?herror=3'); // Error de recuperación de datos. |
---|
32 | } |
---|
33 | //________________________________________________________________________________________________________ |
---|
34 | ?> |
---|
35 | <HTML> |
---|
36 | <TITLE>Administración web de aulas</TITLE> |
---|
37 | <HEAD> |
---|
38 | <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> |
---|
39 | <LINK rel="stylesheet" type="text/css" href="../estilos.css"> |
---|
40 | <SCRIPT language="javascript" src="./jscripts/CrearImagen.js"></SCRIPT> |
---|
41 | <SCRIPT language="javascript" src="../clases/jscripts/HttpLib.js"></SCRIPT> |
---|
42 | <? echo '<SCRIPT language="javascript" src="../idiomas/javascripts/'.$idioma.'/comandos/crearimagen_'.$idioma.'.js"></SCRIPT>'?> |
---|
43 | <? echo '<SCRIPT language="javascript" src="../idiomas/javascripts/'.$idioma.'/comandos/comunescomandos_'.$idioma.'.js"></SCRIPT>'?> |
---|
44 | <SCRIPT language="javascript" src="./jscripts/comunescomandos.js"></SCRIPT> |
---|
45 | </HEAD> |
---|
46 | <BODY> |
---|
47 | <? |
---|
48 | $urlimg='../images/iconos/ordenador.gif'; |
---|
49 | $textambito=$TbMsg[15]; |
---|
50 | |
---|
51 | echo '<p align=center><span class=cabeceras>'.$TbMsg[0].' </span><br>'; |
---|
52 | echo '<IMG src="'.$urlimg.'"> <span align=center class=subcabeceras> |
---|
53 | <U>'.$TbMsg[14].': '.$textambito.','.$nombreambito.'</U></span> </span></p>'; |
---|
54 | ?> |
---|
55 | <P align=center><SPAN align=center class=subcabeceras><? echo $TbMsg[6] ?></SPAN></P> |
---|
56 | |
---|
57 | <FORM align=center name="fdatos"> |
---|
58 | <TABLE id='tabla_conf' align=center border=0 cellPadding=1 cellSpacing=1 class=tabla_datos> |
---|
59 | <TR> |
---|
60 | <TH align=center> </TH> |
---|
61 | <TH align=center> <?php echo $TbMsg["PARTITION"] ?> </TH> |
---|
62 | <TH align=center> <?php echo $TbMsg["PARTITION_TYPE"] ?> </TH> |
---|
63 | <TH align=center> <?php echo $TbMsg["SO_NAME"] ?> </TH> |
---|
64 | <TH align=center> <?php echo $TbMsg["IMAGE_TO_CREATE"] ?> </TD> |
---|
65 | <TH align=center> <?php echo $TbMsg["DESTINATION_REPOSITORY"] ?> </TD> |
---|
66 | </TR> |
---|
67 | |
---|
68 | <? |
---|
69 | echo tablaConfiguracionesCrearImagen($cmd,$idambito,$idrepositorio); |
---|
70 | ?> |
---|
71 | </TABLE> |
---|
72 | </FORM> |
---|
73 | |
---|
74 | <? |
---|
75 | //________________________________________________________________________________________________________ |
---|
76 | include_once("./includes/formularioacciones.php"); |
---|
77 | //________________________________________________________________________________________________________ |
---|
78 | //________________________________________________________________________________________________________ |
---|
79 | include_once("./includes/opcionesacciones.php"); |
---|
80 | //________________________________________________________________________________________________________ |
---|
81 | ?> |
---|
82 | </BODY> |
---|
83 | </HTML> |
---|
84 | <? |
---|
85 | /************************************************************************************************************************************************** |
---|
86 | Recupera los datos de un ordenador |
---|
87 | Parametros: |
---|
88 | - cmd: Una comando ya operativo (con conexiónabierta) |
---|
89 | - ido: El identificador del ordenador |
---|
90 | ________________________________________________________________________________________________________*/ |
---|
91 | function tomaPropiedades($cmd,$ido){ |
---|
92 | global $nombreordenador; |
---|
93 | global $ip; |
---|
94 | global $mac; |
---|
95 | global $idperfilhard; |
---|
96 | global $idrepositorio; |
---|
97 | $rs=new Recordset; |
---|
98 | $cmd->texto="SELECT nombreordenador,ip,mac,idperfilhard,idrepositorio FROM ordenadores WHERE idordenador='".$ido."'"; |
---|
99 | $rs->Comando=&$cmd; |
---|
100 | if (!$rs->Abrir()) return(false); // Error al abrir recordset |
---|
101 | $rs->Primero(); |
---|
102 | if (!$rs->EOF){ |
---|
103 | $nombreordenador=$rs->campos["nombreordenador"]; |
---|
104 | $ip=$rs->campos["ip"]; |
---|
105 | $mac=$rs->campos["mac"]; |
---|
106 | $idperfilhard=$rs->campos["idperfilhard"]; |
---|
107 | $idrepositorio=$rs->campos["idrepositorio"]; |
---|
108 | $rs->Cerrar(); |
---|
109 | return(true); |
---|
110 | } |
---|
111 | else |
---|
112 | return(false); |
---|
113 | } |
---|
114 | /*________________________________________________________________________________________________________ |
---|
115 | Crea la etiqueta html <SELECT> de los perfiles softwares |
---|
116 | UHU - 2013/05/17 - Ahora las imagenes pueden ser en cualquier disco |
---|
117 | ________________________________________________________________________________________________________*/ |
---|
118 | function HTMLSELECT_imagenes($cmd,$idrepositorio,$idperfilsoft,$disk,$particion,$masterip) |
---|
119 | { |
---|
120 | $SelectHtml=""; |
---|
121 | $cmd->texto="SELECT imagenes.idimagen,imagenes.descripcion,imagenes.nombreca,imagenes.idperfilsoft, repositorios.nombrerepositorio |
---|
122 | FROM imagenes INNER JOIN repositorios on imagenes.idrepositorio = repositorios.idrepositorio |
---|
123 | WHERE imagenes.idrepositorio=".$idrepositorio ." OR repositorios.ip='" .$masterip ."'"; |
---|
124 | //echo $cmd->texto; |
---|
125 | $rs=new Recordset; |
---|
126 | $rs->Comando=&$cmd; |
---|
127 | $SelectHtml.= '<SELECT class="formulariodatos" id="despleimagen_'.$disk."_".$particion.'" style="WIDTH: 300">'; |
---|
128 | $SelectHtml.= ' <OPTION value="0"></OPTION>'; |
---|
129 | if ($rs->Abrir()){ |
---|
130 | $rs->Primero(); |
---|
131 | while (!$rs->EOF){ |
---|
132 | $SelectHtml.='<OPTION value="'.$rs->campos["idimagen"]."_".$rs->campos["nombreca"]."_".$rs->campos["nombreca"].'"'; |
---|
133 | if($idperfilsoft==$rs->campos["idperfilsoft"]) $SelectHtml.=" selected "; |
---|
134 | $SelectHtml.='>'; |
---|
135 | $SelectHtml.= $rs->campos["descripcion"]. ' -- '. $rs->campos['nombrerepositorio'] . '</OPTION>'; |
---|
136 | $rs->Siguiente(); |
---|
137 | } |
---|
138 | $rs->Cerrar(); |
---|
139 | } |
---|
140 | $SelectHtml.= '</SELECT>'; |
---|
141 | return($SelectHtml); |
---|
142 | } |
---|
143 | |
---|
144 | function HTMLSELECT_imagenesORIGINAL($cmd,$idrepositorio,$idperfilsoft,$particion,$masterip) |
---|
145 | { |
---|
146 | $SelectHtml=""; |
---|
147 | $cmd->texto="SELECT imagenes.idimagen,imagenes.descripcion,imagenes.nombreca,imagenes.idperfilsoft |
---|
148 | FROM imagenes INNER JOIN repositorios on imagenes.idrepositorio = repositorios.idrepositorio |
---|
149 | WHERE imagenes.idrepositorio=".$idrepositorio ." OR repositorios.ip='" .$masterip ."'"; |
---|
150 | //echo $cmd->texto; |
---|
151 | $rs=new Recordset; |
---|
152 | $rs->Comando=&$cmd; |
---|
153 | $SelectHtml.= '<SELECT class="formulariodatos" id="despleimagen_'.$particion.'" style="WIDTH: 300">'; |
---|
154 | $SelectHtml.= ' <OPTION value="0"></OPTION>'; |
---|
155 | if ($rs->Abrir()){ |
---|
156 | $rs->Primero(); |
---|
157 | while (!$rs->EOF){ |
---|
158 | $SelectHtml.='<OPTION value="'.$rs->campos["idimagen"]."_".$rs->campos["nombreca"]."_".$rs->campos["nombreca"].'"'; |
---|
159 | if($idperfilsoft==$rs->campos["idperfilsoft"]) $SelectHtml.=" selected "; |
---|
160 | $SelectHtml.='>'; |
---|
161 | $SelectHtml.= $rs->campos["descripcion"].'</OPTION>'; |
---|
162 | $rs->Siguiente(); |
---|
163 | } |
---|
164 | $rs->Cerrar(); |
---|
165 | } |
---|
166 | $SelectHtml.= '</SELECT>'; |
---|
167 | return($SelectHtml); |
---|
168 | } |
---|
169 | |
---|
170 | |
---|
171 | /*________________________________________________________________________________________________________ |
---|
172 | Crea la etiqueta html <SELECT> de los repositorios |
---|
173 | UHU - 2013/05/17 - Ahora las imagenes pueden ser en cualquier disco |
---|
174 | ________________________________________________________________________________________________________*/ |
---|
175 | function HTMLSELECT_repositorios($cmd,$idcentro,$idrepositorio,$disk,$particion,$masterip){ |
---|
176 | $SelectHtml=""; |
---|
177 | $rs=new Recordset; |
---|
178 | $cmd->texto='SELECT idrepositorio, nombrerepositorio, ip FROM repositorios WHERE idrepositorio="'.$idrepositorio .'" OR ip="'.$masterip.'"'; |
---|
179 | $rs->Comando=&$cmd; |
---|
180 | |
---|
181 | if (!$rs->Abrir()) return($SelectHtml); // Error al abrir recordset |
---|
182 | $SelectHtml.= '<SELECT class="formulariodatos" id="desplerepositorios_'.$disk."_".$particion.'" style="WIDTH: 250">'; |
---|
183 | $rs->Primero(); |
---|
184 | while (!$rs->EOF){ |
---|
185 | $SelectHtml.='<OPTION value="'.$rs->campos["ip"].'"'; |
---|
186 | if($rs->campos["idrepositorio"]==$idrepositorio) $SelectHtml.=" selected "; |
---|
187 | $SelectHtml.='>'; |
---|
188 | $SelectHtml.= $rs->campos["nombrerepositorio"]; |
---|
189 | $SelectHtml.='</OPTION>'; |
---|
190 | $rs->Siguiente(); |
---|
191 | } |
---|
192 | $SelectHtml.= '</SELECT>'; |
---|
193 | $rs->Cerrar(); |
---|
194 | return($SelectHtml); |
---|
195 | } |
---|
196 | |
---|
197 | ?> |
---|