[4329e85] | 1 | <?php |
---|
| 2 | // ******************************************************************************************************** |
---|
[3ec149c] | 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: propiedades_imagenes.php |
---|
| 8 | // Descripción : |
---|
| 9 | // Presenta el formulario de captura de datos de una imagen para insertar,modificar y eliminar |
---|
[4329e85] | 10 | // ******************************************************************************************************* |
---|
[3ec149c] | 11 | include_once("../includes/ctrlacc.php"); |
---|
| 12 | include_once("../clases/AdoPhp.php"); |
---|
[5105e58] | 13 | include_once("../includes/constantes.php"); |
---|
| 14 | include_once("../includes/opciones.php"); |
---|
[de16f79] | 15 | include_once("../includes/CreaComando.php"); |
---|
| 16 | include_once("../includes/HTMLSELECT.php"); |
---|
[4329e85] | 17 | include_once("../includes/TomaDato.php"); |
---|
[683eccc] | 18 | include_once("../includes/comunes.php"); |
---|
| 19 | include_once("../includes/restfunctions.php"); |
---|
[3ec149c] | 20 | include_once("../idiomas/php/".$idioma."/propiedades_imagenes_".$idioma.".php"); |
---|
[21372e8] | 21 | include_once("../idiomas/php/".$idioma."/avisos_".$idioma.".php"); |
---|
[3ec149c] | 22 | //________________________________________________________________________________________________________ |
---|
[4329e85] | 23 | |
---|
[5105e58] | 24 | if (isset($_POST["opcion"])) {$opcion=$_POST["opcion"];}else{$opcion=0;} // Recoge parametros |
---|
[3ec149c] | 25 | $opciones=array($TbMsg[0],$TbMsg[1],$TbMsg[2],$TbMsg[3]); |
---|
| 26 | //________________________________________________________________________________________________________ |
---|
[4329e85] | 27 | |
---|
[fff35b2] | 28 | // Valores iniciales para variables. |
---|
| 29 | $idimagen=0; |
---|
[3ec149c] | 30 | $nombreca=""; |
---|
[4329e85] | 31 | $ruta=""; |
---|
[3ec149c] | 32 | $descripcion=""; |
---|
[388cc5d] | 33 | $modelo=""; |
---|
| 34 | $numdisk=0; |
---|
[fff35b2] | 35 | $numpar=0; |
---|
[d43c0eb] | 36 | $codpar=0; |
---|
[b0d5fb32] | 37 | $tipopar=""; |
---|
[3ec149c] | 38 | $idperfilsoft=0; |
---|
[fff35b2] | 39 | $perfilsoft=""; |
---|
[3ec149c] | 40 | $comentarios=""; |
---|
[2196ce9] | 41 | $inremotepc=""; |
---|
[21372e8] | 42 | $scheduler=""; |
---|
[3ec149c] | 43 | $grupoid=0; |
---|
[4329e85] | 44 | $litamb=""; |
---|
| 45 | $tipoimg=0; |
---|
[fff35b2] | 46 | $idrepositorio=0; |
---|
[683eccc] | 47 | $repoip=""; |
---|
| 48 | $repokey=""; |
---|
[b0d5fb32] | 49 | $sistoperativo=""; |
---|
[388cc5d] | 50 | $fechacreacion=""; |
---|
[25e581e] | 51 | $revision=0; |
---|
[fff35b2] | 52 | $imagenid=0; |
---|
[a7e6f1b] | 53 | $validnombreca=""; |
---|
| 54 | $validdescripcion=""; |
---|
[5105e58] | 55 | if (isset($_POST["validnombreca"])) {$opcion=$_POST["validnombreca"];}else{$validnombreca="";} // Recoge parametros |
---|
[f65c8b8] | 56 | if (isset($_POST["datospost"])) {$datospost=$_POST["datospost"];}else{$datospost=0;} // Recoge parametros |
---|
[3ec149c] | 57 | if (isset($_GET["opcion"])) $opcion=$_GET["opcion"]; // Recoge parametros |
---|
| 58 | if (isset($_GET["idimagen"])) $idimagen=$_GET["idimagen"]; |
---|
| 59 | if (isset($_GET["grupoid"])) $grupoid=$_GET["grupoid"]; |
---|
| 60 | if (isset($_GET["identificador"])) $idimagen=$_GET["identificador"]; |
---|
[4329e85] | 61 | if (isset($_GET["litamb"])) $litamb=$_GET["litamb"]; |
---|
| 62 | if (isset($_GET["tipoimg"])) $tipoimg=$_GET["tipoimg"]; |
---|
[3ec149c] | 63 | //________________________________________________________________________________________________________ |
---|
[5105e58] | 64 | //________________________________________________________________________________________________________ |
---|
[3ec149c] | 65 | $cmd=CreaComando($cadenaconexion); // Crea objeto comando |
---|
| 66 | if (!$cmd) |
---|
[21372e8] | 67 | header('Location: '.$pagerror.'?herror=2'); // Error de conexión con servidor B.D. |
---|
| 68 | if ($opcion!=$op_alta) |
---|
[3ec149c] | 69 | $resul=TomaPropiedades($cmd,$idimagen); |
---|
[21372e8] | 70 | else |
---|
| 71 | $resul=TomaConfiguracion($cmd); |
---|
| 72 | if (!$resul) |
---|
| 73 | header('Location: '.$pagerror.'?herror=3'); // Error de recuperación de datos. |
---|
[5105e58] | 74 | |
---|
[a7e6f1b] | 75 | if ($opcion == 1 && $datospost == 1) { |
---|
[f65c8b8] | 76 | if (isset($_POST["opcion"])) $opcion=$_POST["opcion"];// Recoge parametros |
---|
[a7e6f1b] | 77 | if (isset($_POST["idrepositorio"])) $idrepositorio=$_POST["idrepositorio"]; |
---|
[5105e58] | 78 | if (isset($_POST["idimagen"])) $idimagen=$_POST["idimagen"]; |
---|
[a7e6f1b] | 79 | if (isset($_POST["nombreca"])) { |
---|
| 80 | $nombreca=$_POST["nombreca"]; |
---|
| 81 | ValidaNombre($cmd,$nombreca,$idrepositorio); |
---|
| 82 | } |
---|
| 83 | if ($validnombreca != 1) {$validnombreca=0;} |
---|
[5105e58] | 84 | if (isset($_POST["ruta"])) $ruta=$_POST["ruta"]; |
---|
[2810a69] | 85 | if (isset($_POST["descripcion"])) {$descripcion=$_POST["descripcion"];} |
---|
[5105e58] | 86 | if (isset($_POST["grupoid"])) $grupoid=$_POST["grupoid"]; |
---|
| 87 | if (isset($_POST["idperfilsoft"])) $idperfilsoft=$_POST["idperfilsoft"]; |
---|
| 88 | if (isset($_POST["comentarios"])) $comentarios=$_POST["comentarios"]; |
---|
[2196ce9] | 89 | if (isset($_POST["inremotepc"])) $inremotepc=$_POST["inremotepc"]; |
---|
[5105e58] | 90 | if (isset($_POST["identificador"])) $idimagen=$_POST["identificador"]; |
---|
[5a8c831] | 91 | if (isset($_POST["modelo"])) $numpar=$_POST["modelo"]; |
---|
| 92 | if (isset($_POST["numdisk"])) $numpar=$_POST["numdisk"]; |
---|
[5105e58] | 93 | if (isset($_POST["numpar"])) $numpar=$_POST["numpar"]; |
---|
| 94 | if (isset($_POST["codpar"])) $codpar=$_POST["codpar"]; |
---|
| 95 | if (isset($_POST["idrepositorio"])) $idrepositorio=$_POST["idrepositorio"]; |
---|
| 96 | if (isset($_POST["imagenid"])) $imagenid=$_POST["imagenid"]; |
---|
| 97 | if (isset($_POST["tipoimg"])) $tipoimg=$_POST["tipoimg"]; |
---|
[388cc5d] | 98 | if (isset($_POST["fechacreacion"])) $fechacreacion=$_POST["fechacreacion"]; |
---|
[5105e58] | 99 | if (isset($_POST["litamb"])) $litamb=$_POST["litamb"]; |
---|
| 100 | } |
---|
[683eccc] | 101 | // Solicitar datos del fichero de imagen a la API REST de su repositorio. |
---|
| 102 | if ($opcion!=$op_alta and isset($repokey)) { |
---|
| 103 | $repo[0]['url'] = "https://$repoip/opengnsys/rest/repository/image/$nombreca"; |
---|
| 104 | $repo[0]['header'] = array('Authorization: '.$repokey); |
---|
| 105 | $result = multiRequest($repo); |
---|
| 106 | if ($result[0]['code'] === 200) { |
---|
| 107 | $result = json_decode($result[0]['data']); |
---|
| 108 | $imgpath = (@$result->type==="dir" ? @$result->name : @$result->name.".".@$result->type); |
---|
| 109 | $imgsize = humanSize(@$result->size); |
---|
[3180500] | 110 | $imgdatasize = humanSize(@$result->datasize); |
---|
[683eccc] | 111 | $imgbackup = @$result->backedup; |
---|
| 112 | $imgbksize = isset($result->backupsize) ? humanSize($result->backupsize) : 0; |
---|
| 113 | $imglock = @$result->locked; |
---|
| 114 | } else { |
---|
[7fb33671] | 115 | $imgpath = $imgsize = $imgbackup = $imglock = ""; |
---|
[683eccc] | 116 | } |
---|
| 117 | } |
---|
| 118 | |
---|
[3ec149c] | 119 | //________________________________________________________________________________________________________ |
---|
| 120 | ?> |
---|
| 121 | <HTML> |
---|
| 122 | <HEAD> |
---|
[b0d5fb32] | 123 | <TITLE>Administración web de aulas</TITLE> |
---|
[3ec149c] | 124 | <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> |
---|
| 125 | <LINK rel="stylesheet" type="text/css" href="../estilos.css"> |
---|
[3b3043b] | 126 | <SCRIPT language="javascript" src="../jscripts/validators.js"></SCRIPT> |
---|
[4329e85] | 127 | <SCRIPT language="javascript" src="../jscripts/constantes.js"></SCRIPT> |
---|
[3ec149c] | 128 | <SCRIPT language="javascript" src="../jscripts/propiedades_imagenes.js"></SCRIPT> |
---|
| 129 | <SCRIPT language="javascript" src="../jscripts/opciones.js"></SCRIPT> |
---|
[043e67d] | 130 | <?php echo '<SCRIPT language="javascript" src="../idiomas/javascripts/'.$idioma.'/propiedades_imagenes_'.$idioma.'.js"></SCRIPT>'?> |
---|
[3ec149c] | 131 | </HEAD> |
---|
| 132 | <BODY> |
---|
[4329e85] | 133 | <DIV align=center> |
---|
[a7e6f1b] | 134 | <?php if ( $opcion == 1 && $datospost == 1 && $validnombreca == 0 && $validdescripcion == 0 || $opcion != 1) { ?> |
---|
[5105e58] | 135 | <FORM name="fdatos" action="../gestores/gestor_imagenes.php" method="post"> |
---|
| 136 | <?php }else{ ?> |
---|
| 137 | <FORM name="fdatos" action="./propiedades_imagenes.php" method="post"> |
---|
| 138 | <?php } ?> |
---|
| 139 | |
---|
[043e67d] | 140 | <INPUT type="hidden" name="opcion" value="<?php echo $opcion?>"> |
---|
| 141 | <INPUT type="hidden" name="idimagen" value="<?php echo $idimagen?>"> |
---|
| 142 | <INPUT type="hidden" name="grupoid" value="<?php echo $grupoid?>"> |
---|
| 143 | <INPUT type="hidden" name="tipoimg" value="<?php echo $tipoimg?>"> |
---|
| 144 | <INPUT type="hidden" name="litamb" value="<?php echo $litamb?>"> |
---|
[5105e58] | 145 | <INPUT type="hidden" name="datospost" value="1"> |
---|
[5a8c831] | 146 | <?php |
---|
[4329e85] | 147 | switch($tipoimg){ |
---|
| 148 | case $IMAGENES_MONOLITICAS: |
---|
| 149 | $lit=$TbMsg[4]; |
---|
| 150 | break; |
---|
| 151 | case |
---|
| 152 | $IMAGENES_BASICAS: |
---|
| 153 | $lit=$TbMsg[12]; |
---|
| 154 | break; |
---|
| 155 | case $IMAGENES_INCREMENTALES: |
---|
| 156 | $lit=$TbMsg[13]; |
---|
| 157 | } |
---|
| 158 | |
---|
| 159 | ?> |
---|
[043e67d] | 160 | <P align=center class=cabeceras><?php echo $lit?><BR> |
---|
[b0d5fb32] | 161 | <SPAN class=subcabeceras><?php echo $opciones[$opcion]?></SPAN> |
---|
[4329e85] | 162 | </P> |
---|
| 163 | |
---|
[3ec149c] | 164 | <TABLE align=center border=0 cellPadding=1 cellSpacing=1 class=tabla_datos> |
---|
[b0d5fb32] | 165 | <!-- -------------------------------------------------------------------------------- --> |
---|
[4329e85] | 166 | <TR> |
---|
[b0d5fb32] | 167 | <TH align=center> <?php echo $TbMsg[11]?> </TH> |
---|
[a7e6f1b] | 168 | <?php if ($opcion==$op_eliminacion || !empty($idperfilsoft) || $opcion == 2) |
---|
[b0d5fb32] | 169 | echo '<TD style="width:150px">'.$nombreca.' |
---|
[4329e85] | 170 | <INPUT type="hidden" name="nombreca" value="'.$nombreca.'"></TD>'; |
---|
[3ec149c] | 171 | else |
---|
[b0d5fb32] | 172 | echo '<TD><INPUT class="formulariodatos" name=nombreca style="width:150px" type=text value="'.$nombreca.'">'; |
---|
| 173 | if ($validnombreca == 1){echo '<div style="color: red; font-weight: bold;"> '.$TbMsg[18].'</div>';} |
---|
| 174 | echo '</TD>';?> |
---|
[3ec149c] | 175 | </TR> |
---|
[b0d5fb32] | 176 | <!-- -------------------------------------------------------------------------------- --> |
---|
[4329e85] | 177 | <TR> |
---|
[b0d5fb32] | 178 | <TH align=center> <?php echo $TbMsg[5]?> </TH> |
---|
[a7e6f1b] | 179 | <?php if ($opcion==$op_eliminacion) { |
---|
[b0d5fb32] | 180 | echo '<TD style="width:300px">'.$descripcion.' |
---|
[a7e6f1b] | 181 | <INPUT type="hidden" name="descripcion" value="'.$descripcion.'"></TD>'; |
---|
| 182 | } else { |
---|
[b0d5fb32] | 183 | echo '<TD><INPUT class="formulariodatos" name=descripcion style="width:350px" type=text value="'.$descripcion.'">'; |
---|
| 184 | if ($validnombreca == 0 && $validdescripcion == 1){echo '<div style="color: red; font-weight: bold;"> '.$TbMsg[22].'</div>';} |
---|
[a7e6f1b] | 185 | echo '</TD>'; |
---|
| 186 | } ?> |
---|
[3ec149c] | 187 | </TR> |
---|
[b0d5fb32] | 188 | <!-- -------------------------------------------------------------------------------- --> |
---|
[a7e6f1b] | 189 | <?php if($tipoimg==$IMAGENES_INCREMENTALES){?> |
---|
[3ec149c] | 190 | <TR> |
---|
[b0d5fb32] | 191 | <TH align=center> <?php echo $TbMsg[14]?> </TH> |
---|
[a7e6f1b] | 192 | <?php if ($opcion==$op_eliminacion || !empty($idperfilsoft)) |
---|
[4329e85] | 193 | echo '<TD>'.TomaDato($cmd,$idcentro,'imagenes',$imagenid,'imagenid','descripcion').' |
---|
| 194 | <INPUT type="hidden" name="imagenid" value="'.$imagenid.'"></TD>'; |
---|
[3ec149c] | 195 | else |
---|
[4329e85] | 196 | echo '<TD>'.HTMLSELECT($cmd,$idcentro,'imagenes',$imagenid,'idimagen','descripcion',300,"",""," |
---|
| 197 | tipo=".$IMAGENES_BASICAS,"imagenid").'</TD>'; |
---|
[3ec149c] | 198 | ?> |
---|
| 199 | </TR> |
---|
[a7e6f1b] | 200 | <?php } ?> |
---|
[5a8c831] | 201 | <?php if($tipoimg!=$IMAGENES_INCREMENTALES){?> |
---|
[b0d5fb32] | 202 | <!-- -------------------------------------------------------------------------------- --> |
---|
[3ec149c] | 203 | <TR> |
---|
[b0d5fb32] | 204 | <TH align=center> <?php echo $TbMsg[10]?> </TH> |
---|
[a7e6f1b] | 205 | <?php if ($opcion==$op_eliminacion || !empty($idperfilsoft)) |
---|
[4329e85] | 206 | echo '<TD>'.$nombrerepositorio.' |
---|
| 207 | <INPUT type="hidden" name="idrepositorio" value="'.$idrepositorio.'"></TD>'; |
---|
[3ec149c] | 208 | else |
---|
| 209 | echo '<TD>'.HTMLSELECT($cmd,$idcentro,'repositorios',$idrepositorio,'idrepositorio','nombrerepositorio',300).'</TD>'; |
---|
| 210 | ?> |
---|
[4329e85] | 211 | </TR> |
---|
[b0d5fb32] | 212 | <!-- -------------------------------------------------------------------------------- --> |
---|
[043e67d] | 213 | <?php if($tipoimg==$IMAGENES_BASICAS){?> |
---|
[4329e85] | 214 | <TR> |
---|
[b0d5fb32] | 215 | <TH align=center> <?php echo $TbMsg[16]?> </TH> |
---|
[a7e6f1b] | 216 | <?php if ($opcion==$op_eliminacion || !empty($idperfilsoft)) |
---|
[4329e85] | 217 | echo '<TD>'.$ruta.' |
---|
| 218 | <INPUT type="hidden" name="ruta" value="'.$ruta.'"></TD>'; |
---|
| 219 | else |
---|
[b0d5fb32] | 220 | echo '<TD><INPUT class="formulariodatos" name=ruta style="width:350px" type=text value="'.$ruta.'"></TH>';?> |
---|
[4329e85] | 221 | </TR> |
---|
[043e67d] | 222 | <?php }?> |
---|
[b0d5fb32] | 223 | <!-- -------------------------------------------------------------------------------- --> |
---|
[4329e85] | 224 | <TR> |
---|
[b0d5fb32] | 225 | <TH align=center> <?php echo $TbMsg[7]?> </TH> |
---|
[a7e6f1b] | 226 | <?php if ($opcion==$op_eliminacion) |
---|
[3ec149c] | 227 | echo '<TD>'.$comentarios.'</TD>'; |
---|
| 228 | else |
---|
[4329e85] | 229 | echo '<TD><TEXTAREA class="formulariodatos" name=comentarios rows=3 cols=55>'.$comentarios.'</TEXTAREA></TH>'; |
---|
[3ec149c] | 230 | ?> |
---|
[4329e85] | 231 | </TR> |
---|
[2196ce9] | 232 | <!-- Acceso remoto --> |
---|
| 233 | <tr> |
---|
| 234 | <th align="center"> <?php echo $TbMsg['PROP_REMOTEACCESS']?> </th> |
---|
| 235 | <?php if ($opcion==$op_eliminacion) { |
---|
| 236 | echo '<td><input name="inremotepc" type="checkbox" disabled readonly'; |
---|
| 237 | if ($inremotepc) echo ' checked '; |
---|
| 238 | echo '></td>'; |
---|
| 239 | } else { |
---|
| 240 | echo '<td><input name="inremotepc" type="checkbox" value="1"'; |
---|
| 241 | if ($inremotepc) echo ' checked '; |
---|
[21372e8] | 242 | if ($scheduler) |
---|
| 243 | echo '> <em>('.$TbMsg['COMM_REMOTEACCESS'].')<em></td>'; |
---|
| 244 | else |
---|
| 245 | echo 'disabled> <em>'.$TbMsg['WARN_SCHEDULER'].'<em></td>'; |
---|
[2196ce9] | 246 | } |
---|
| 247 | ?> |
---|
| 248 | </tr> |
---|
[fa3eca0] | 249 | |
---|
[2154cbb] | 250 | <?php if ($opcion!=$op_alta) { ?> |
---|
[5a8c831] | 251 | <!-- Equipo modelo (aula) --> |
---|
| 252 | <tr> |
---|
| 253 | <th align=center> <?php echo $TbMsg[19]?> </th> |
---|
| 254 | <td> <?php echo $modelo ?> |
---|
| 255 | <input type="hidden" name="modelo" value="<?php echo $modelo ?>"> |
---|
| 256 | </tr> |
---|
[fa3eca0] | 257 | <!-- Disco, partición y tipo de partición --> |
---|
[5a8c831] | 258 | <tr> |
---|
| 259 | <th align="center"> <?php echo $TbMsg[8]?> </th> |
---|
[fa3eca0] | 260 | <td> <?php if (! empty($modelo)) echo "$numdisk, $numpar (".dechex($codpar)."-$tipopar)" ?> |
---|
| 261 | <input type="hidden" name="numdisk" value="<?php echo $numdisk ?>"> |
---|
| 262 | <input type="hidden" name="numpar" value="<?php echo $numpar ?>"></td> |
---|
[5a8c831] | 263 | </tr> |
---|
| 264 | <!-- Fecha de creación --> |
---|
| 265 | <tr> |
---|
| 266 | <th align="center"> <?php echo $TbMsg[20]?> </th> |
---|
[476d1a0f] | 267 | <td> <?php if (! empty ($modelo)) echo "$fechacreacion ".($revision>0 ? "(r$revision)" : "") ?> |
---|
[fa3eca0] | 268 | <input type="hidden" name="fechacreacion" value="<?php echo $fechacreacion ?>"></td> |
---|
[5a8c831] | 269 | </tr> |
---|
[2154cbb] | 270 | <!-- Perfil de software --> |
---|
[4329e85] | 271 | <TR> |
---|
[b0d5fb32] | 272 | <TH align=center> <?php echo $TbMsg[6]?> </TH> |
---|
[a7e6f1b] | 273 | <?php |
---|
[de5fe13] | 274 | if (isset($modelo)) { |
---|
[2154cbb] | 275 | echo '<TD> '.$perfilsoft.' |
---|
| 276 | <INPUT type="hidden" name="idperfilsoft" value="'.$idperfilsoft.'"></TD>'; |
---|
[de5fe13] | 277 | } else { |
---|
| 278 | echo '<TD>'.HTMLSELECT($cmd,$idcentro,'perfilessoft',$idperfilsoft,'idperfilsoft','descripcion',300).'</TD>'; |
---|
| 279 | } |
---|
[4329e85] | 280 | ?> |
---|
| 281 | </TR> |
---|
[2154cbb] | 282 | <!-- Sistema Operativo --> |
---|
| 283 | <tr> |
---|
[0234026] | 284 | <th align="center"> <?php echo $TbMsg['PROP_OS']?> </th> |
---|
[2154cbb] | 285 | <td> <?php echo $sistoperativo?> </td> |
---|
| 286 | </tr> |
---|
[3180500] | 287 | <!-- Tamaño de los datos --> |
---|
| 288 | <tr> |
---|
| 289 | <th align="center"> <?php echo $TbMsg['DATA_SIZE']?> </th> |
---|
| 290 | <td> <?php echo $imgdatasize?> </td> |
---|
| 291 | </tr> |
---|
[683eccc] | 292 | <?php |
---|
| 293 | // Datos de imagen en el repositorio |
---|
| 294 | if (isset($imgpath)) { |
---|
| 295 | print <<< EOT |
---|
| 296 | <tr> |
---|
| 297 | <th colspan="2" align="center">Datos del repositorio</th> |
---|
| 298 | </tr> |
---|
| 299 | <tr> |
---|
| 300 | <th align="center">Camino</th> |
---|
| 301 | <td> /$imgpath </td> |
---|
| 302 | </tr> |
---|
| 303 | <tr> |
---|
| 304 | <th align="center">Tamaño</th> |
---|
| 305 | <td> $imgsize </td> |
---|
| 306 | </tr> |
---|
| 307 | EOT; |
---|
| 308 | if ($imgbackup) { |
---|
| 309 | print <<< EOT |
---|
| 310 | <tr> |
---|
| 311 | <th align="center">Copia de seguridad</th> |
---|
| 312 | <td> $imgbksize </td> |
---|
| 313 | </tr> |
---|
| 314 | EOT; |
---|
| 315 | } |
---|
| 316 | if ($imglock) { |
---|
| 317 | print <<< EOT |
---|
| 318 | <tr> |
---|
| 319 | <th align="center">Bloqueada</th> |
---|
| 320 | <td> Atención: la imagen está bloqueda por operación de uso exclusivo </td> |
---|
| 321 | </tr> |
---|
| 322 | EOT; |
---|
| 323 | } |
---|
| 324 | } |
---|
| 325 | ?> |
---|
[2154cbb] | 326 | <?php } // fin if != op_alta |
---|
[0e4be6d] | 327 | // Mensaje aviso ruta de origen |
---|
| 328 | if ($opcion==$op_alta && $tipoimg==$IMAGENES_BASICAS) { |
---|
| 329 | echo '<tr><th colspan="14">'.$TbMsg["WARN_SOURCE_PATH"].'</th></tr>'; |
---|
| 330 | } |
---|
[2154cbb] | 331 | }?> |
---|
[b0d5fb32] | 332 | <!-- -------------------------------------------------------------------------------- --> |
---|
[3ec149c] | 333 | </TABLE> |
---|
| 334 | </FORM> |
---|
[4329e85] | 335 | |
---|
[a7e6f1b] | 336 | <?php |
---|
[4329e85] | 337 | if (!empty($idperfilsoft)){ // Nota a pie de página indicando que cuando la imagen tiene perfilsoft no pueden modificarse ciertos campos |
---|
| 338 | echo ' |
---|
| 339 | <DIV id="Layer_nota" align=center > |
---|
[b0d5fb32] | 340 | <SPAN class=notas><em>'.$TbMsg[15].'</em></SPAN> |
---|
[4329e85] | 341 | </DIV><br>'; |
---|
| 342 | } |
---|
[3ec149c] | 343 | //________________________________________________________________________________________________________ |
---|
[4329e85] | 344 | |
---|
[5105e58] | 345 | |
---|
[53c03ca] | 346 | if ($validnombreca=="0"){ |
---|
[5105e58] | 347 | echo '<script type="text/javascript">'; |
---|
| 348 | echo 'confirmar('.$opcion.')'; |
---|
| 349 | echo '</script>'; |
---|
[a7e6f1b] | 350 | } |
---|
[5105e58] | 351 | if ($validnombreca=="1"){ |
---|
| 352 | echo '<script type="text/javascript">'; |
---|
| 353 | echo 'alert('.$TbMsg[17].')'; |
---|
| 354 | echo '</script>'; |
---|
[a7e6f1b] | 355 | } |
---|
[5105e58] | 356 | |
---|
[3ec149c] | 357 | include_once("../includes/opcionesbotonesop.php"); |
---|
| 358 | //________________________________________________________________________________________________________ |
---|
[4329e85] | 359 | |
---|
[3ec149c] | 360 | ?> |
---|
| 361 | </BODY> |
---|
| 362 | </HTML> |
---|
[043e67d] | 363 | <?php |
---|
[3ec149c] | 364 | //________________________________________________________________________________________________________ |
---|
[4329e85] | 365 | |
---|
[3ec149c] | 366 | // Recupera los datos de una imagen |
---|
| 367 | // Parametros: |
---|
| 368 | // - cmd: Una comando ya operativo (con conexión abierta) |
---|
| 369 | // - id: El identificador de la imagen |
---|
| 370 | //________________________________________________________________________________________________________ |
---|
[4329e85] | 371 | |
---|
[3ec149c] | 372 | function TomaPropiedades($cmd,$idmagen){ |
---|
| 373 | global $nombreca; |
---|
[4329e85] | 374 | global $ruta; |
---|
[3ec149c] | 375 | global $descripcion; |
---|
| 376 | global $comentarios; |
---|
[2196ce9] | 377 | global $inremotepc; |
---|
[21372e8] | 378 | global $scheduler; |
---|
[3ec149c] | 379 | global $idperfilsoft; |
---|
[5a8c831] | 380 | global $modelo; |
---|
| 381 | global $numdisk; |
---|
[3ec149c] | 382 | global $numpar; |
---|
| 383 | global $codpar; |
---|
| 384 | global $tipopar; |
---|
| 385 | global $nombrerepositorio; |
---|
| 386 | global $idrepositorio; |
---|
[683eccc] | 387 | global $repoip; |
---|
| 388 | global $repokey; |
---|
[5a8c831] | 389 | global $perfilsoft; |
---|
[2154cbb] | 390 | global $sistoperativo; |
---|
[5a8c831] | 391 | global $imagenid; |
---|
| 392 | global $fechacreacion; |
---|
[25e581e] | 393 | global $revision; |
---|
[3ec149c] | 394 | |
---|
| 395 | $rs=new Recordset; |
---|
[2154cbb] | 396 | $cmd->texto="SELECT imagenes.*, tipospar.tipopar, repositorios.nombrerepositorio, |
---|
[683eccc] | 397 | repositorios.ip, repositorios.apikey, |
---|
[2154cbb] | 398 | perfilessoft.descripcion AS perfilsoft, nombreso AS sistoperativo, |
---|
[21372e8] | 399 | CONCAT (ordenadores.nombreordenador,' (',aulas.nombreaula,')') AS modelo, |
---|
| 400 | IF(@@GLOBAL.event_scheduler='ON',1,0) AS scheduler |
---|
[5a8c831] | 401 | FROM imagenes |
---|
| 402 | LEFT OUTER JOIN tipospar ON tipospar.codpar=imagenes.codpar |
---|
| 403 | LEFT OUTER JOIN repositorios ON repositorios.idrepositorio=imagenes.idrepositorio |
---|
| 404 | LEFT OUTER JOIN perfilessoft ON perfilessoft.idperfilsoft=imagenes.idperfilsoft |
---|
| 405 | LEFT OUTER JOIN ordenadores ON ordenadores.idordenador=imagenes.idordenador |
---|
[d9175d6] | 406 | LEFT OUTER JOIN aulas ON ordenadores.idaula=aulas.idaula |
---|
[2154cbb] | 407 | LEFT OUTER JOIN nombresos ON perfilessoft.idnombreso=nombresos.idnombreso |
---|
[5a8c831] | 408 | WHERE imagenes.idimagen=".$idmagen; |
---|
[3ec149c] | 409 | $rs->Comando=&$cmd; |
---|
| 410 | if (!$rs->Abrir()) return(0); // Error al abrir recordset |
---|
| 411 | $rs->Primero(); |
---|
| 412 | if (!$rs->EOF){ |
---|
| 413 | $nombreca=$rs->campos["nombreca"]; |
---|
[4329e85] | 414 | $ruta=$rs->campos["ruta"]; |
---|
[3ec149c] | 415 | $descripcion=$rs->campos["descripcion"]; |
---|
| 416 | $idperfilsoft=$rs->campos["idperfilsoft"]; |
---|
| 417 | $comentarios=$rs->campos["comentarios"]; |
---|
[2196ce9] | 418 | $inremotepc=$rs->campos["inremotepc"]; |
---|
[21372e8] | 419 | $scheduler=$rs->campos["scheduler"]; |
---|
[5a8c831] | 420 | $modelo=$rs->campos["modelo"]; |
---|
| 421 | $numdisk=$rs->campos["numdisk"]; |
---|
[3ec149c] | 422 | $numpar=$rs->campos["numpar"]; |
---|
| 423 | $tipopar=$rs->campos["tipopar"]; |
---|
| 424 | $codpar=$rs->campos["codpar"]; |
---|
| 425 | $idrepositorio=$rs->campos["idrepositorio"]; |
---|
| 426 | $nombrerepositorio=$rs->campos["nombrerepositorio"]; |
---|
[683eccc] | 427 | $repoip=$rs->campos["ip"]; |
---|
| 428 | $repokey=$rs->campos["apikey"]; |
---|
[3ec149c] | 429 | $perfilsoft=$rs->campos["perfilsoft"]; |
---|
[2154cbb] | 430 | $sistoperativo=$rs->campos["sistoperativo"]; |
---|
[4329e85] | 431 | $imagenid=$rs->campos["imagenid"]; |
---|
[5a8c831] | 432 | $fechacreacion=$rs->campos["fechacreacion"]; |
---|
[25e581e] | 433 | $revision=$rs->campos["revision"]; |
---|
[3ec149c] | 434 | $rs->Cerrar(); |
---|
| 435 | return(true); |
---|
| 436 | } |
---|
[21372e8] | 437 | return(false); |
---|
| 438 | } |
---|
| 439 | |
---|
| 440 | //________________________________________________________________________________________________________ |
---|
| 441 | // Recupera los algunos datos de configuración de la base de datos |
---|
| 442 | // Parametros: |
---|
| 443 | // - cmd: comando ya operativo (con conexión abierta) |
---|
| 444 | //________________________________________________________________________________________________________ |
---|
| 445 | function TomaConfiguracion($cmd) { |
---|
| 446 | global $scheduler; |
---|
| 447 | |
---|
| 448 | $rs=new Recordset; |
---|
| 449 | $cmd->texto="SELECT IF(@@GLOBAL.event_scheduler='ON',1,0) AS scheduler"; |
---|
| 450 | $rs->Comando=&$cmd; |
---|
| 451 | if (!$rs->Abrir()) return(0); // Error al abrir recordset |
---|
| 452 | if (!$rs->EOF){ |
---|
| 453 | $scheduler=$rs->campos["scheduler"]; |
---|
| 454 | $rs->Cerrar(); |
---|
[3ec149c] | 455 | return(true); |
---|
[21372e8] | 456 | } |
---|
| 457 | return(false); |
---|
[3ec149c] | 458 | } |
---|
[5105e58] | 459 | |
---|
| 460 | //________________________________________________________________________________________________________ |
---|
| 461 | |
---|
| 462 | // Comprueba Nombre de la imagen |
---|
| 463 | // Parametros: |
---|
| 464 | // - cmd: Una comando ya operativo (con conexión abierta) |
---|
[a7e6f1b] | 465 | // - nombreca: Nombre de la imagen |
---|
| 466 | // - descripcion: Descripcion de la imagen |
---|
[5105e58] | 467 | //________________________________________________________________________________________________________ |
---|
| 468 | |
---|
[a7e6f1b] | 469 | function ValidaNombre($cmd,$nombreca,$idrepositorio){ |
---|
[5105e58] | 470 | global $nombreca; |
---|
| 471 | global $validnombreca; |
---|
[a7e6f1b] | 472 | global $idrepositorio; |
---|
| 473 | |
---|
| 474 | $rs=new Recordset; |
---|
| 475 | $cmd->texto="SELECT * from imagenes WHERE nombreca='$nombreca'"; |
---|
| 476 | $rs->Comando=&$cmd; |
---|
| 477 | if (!$rs->Abrir()) return(0); // Error al abrir recordset |
---|
| 478 | $rs->Primero(); |
---|
| 479 | if (!$rs->EOF){ |
---|
| 480 | $nombrecabase=$rs->campos["nombreca"]; |
---|
| 481 | $idrepositoriobase=$rs->campos["idrepositorio"]; |
---|
| 482 | if ( $nombrecabase == $nombreca && $idrepositoriobase == $idrepositorio) |
---|
| 483 | {$validnombreca="1";}else{$validnombreca="0";} |
---|
| 484 | } |
---|
| 485 | $rs->Cerrar(); |
---|
| 486 | } |
---|
| 487 | |
---|
| 488 | //________________________________________________________________________________________________________ |
---|
| 489 | |
---|
| 490 | // Comprueba Descripcion del nombre canónico |
---|
| 491 | // Parametros: |
---|
| 492 | // - cmd: Una comando ya operativo (con conexión abierta) |
---|
| 493 | // - nombreca: Nombre de la imagen |
---|
| 494 | // - descripcion: Descripcion de la imagen |
---|
| 495 | //________________________________________________________________________________________________________ |
---|
| 496 | |
---|
| 497 | function ValidaDescripcion($cmd,$nombreca,$descripcion){ |
---|
| 498 | global $nombreca; |
---|
| 499 | global $validnombreca; |
---|
| 500 | global $descripcion; |
---|
| 501 | global $validdescripcion; |
---|
[5105e58] | 502 | |
---|
| 503 | $rs=new Recordset; |
---|
| 504 | $cmd->texto="SELECT * from imagenes WHERE nombreca='$nombreca'"; |
---|
| 505 | $rs->Comando=&$cmd; |
---|
| 506 | if (!$rs->Abrir()) return(0); // Error al abrir recordset |
---|
| 507 | $rs->Primero(); |
---|
| 508 | if (!$rs->EOF){ |
---|
| 509 | $nombrecabase=$rs->campos["nombreca"]; |
---|
[a7e6f1b] | 510 | $descripcionbase=$rs->campos["descripcion"]; |
---|
| 511 | if ( $nombrecabase == $nombreca && "$descripcionbase" == "$descripcion" ) |
---|
| 512 | {$validdescripcion="1";}else{$validdescripcion="0";} |
---|
[21372e8] | 513 | } |
---|
| 514 | $rs->Cerrar(); |
---|
[5105e58] | 515 | } |
---|