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