[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; |
---|
[3ec149c] | 37 | $idperfilsoft=0; |
---|
[fff35b2] | 38 | $perfilsoft=""; |
---|
[3ec149c] | 39 | $comentarios=""; |
---|
[2196ce9] | 40 | $inremotepc=""; |
---|
[21372e8] | 41 | $scheduler=""; |
---|
[3ec149c] | 42 | $grupoid=0; |
---|
[4329e85] | 43 | $litamb=""; |
---|
| 44 | $tipoimg=0; |
---|
[fff35b2] | 45 | $idrepositorio=0; |
---|
[683eccc] | 46 | $repoip=""; |
---|
| 47 | $repokey=""; |
---|
[388cc5d] | 48 | $fechacreacion=""; |
---|
[25e581e] | 49 | $revision=0; |
---|
[fff35b2] | 50 | $imagenid=0; |
---|
[a7e6f1b] | 51 | $validnombreca=""; |
---|
| 52 | $validdescripcion=""; |
---|
[5105e58] | 53 | if (isset($_POST["validnombreca"])) {$opcion=$_POST["validnombreca"];}else{$validnombreca="";} // Recoge parametros |
---|
[f65c8b8] | 54 | if (isset($_POST["datospost"])) {$datospost=$_POST["datospost"];}else{$datospost=0;} // Recoge parametros |
---|
[3ec149c] | 55 | if (isset($_GET["opcion"])) $opcion=$_GET["opcion"]; // Recoge parametros |
---|
| 56 | if (isset($_GET["idimagen"])) $idimagen=$_GET["idimagen"]; |
---|
| 57 | if (isset($_GET["grupoid"])) $grupoid=$_GET["grupoid"]; |
---|
| 58 | if (isset($_GET["identificador"])) $idimagen=$_GET["identificador"]; |
---|
[4329e85] | 59 | if (isset($_GET["litamb"])) $litamb=$_GET["litamb"]; |
---|
| 60 | if (isset($_GET["tipoimg"])) $tipoimg=$_GET["tipoimg"]; |
---|
[3ec149c] | 61 | //________________________________________________________________________________________________________ |
---|
[5105e58] | 62 | //________________________________________________________________________________________________________ |
---|
[3ec149c] | 63 | $cmd=CreaComando($cadenaconexion); // Crea objeto comando |
---|
| 64 | if (!$cmd) |
---|
[21372e8] | 65 | header('Location: '.$pagerror.'?herror=2'); // Error de conexión con servidor B.D. |
---|
| 66 | if ($opcion!=$op_alta) |
---|
[3ec149c] | 67 | $resul=TomaPropiedades($cmd,$idimagen); |
---|
[21372e8] | 68 | else |
---|
| 69 | $resul=TomaConfiguracion($cmd); |
---|
| 70 | if (!$resul) |
---|
| 71 | header('Location: '.$pagerror.'?herror=3'); // Error de recuperación de datos. |
---|
[5105e58] | 72 | |
---|
[a7e6f1b] | 73 | if ($opcion == 1 && $datospost == 1) { |
---|
[f65c8b8] | 74 | if (isset($_POST["opcion"])) $opcion=$_POST["opcion"];// Recoge parametros |
---|
[a7e6f1b] | 75 | if (isset($_POST["idrepositorio"])) $idrepositorio=$_POST["idrepositorio"]; |
---|
[5105e58] | 76 | if (isset($_POST["idimagen"])) $idimagen=$_POST["idimagen"]; |
---|
[a7e6f1b] | 77 | if (isset($_POST["nombreca"])) { |
---|
| 78 | $nombreca=$_POST["nombreca"]; |
---|
| 79 | ValidaNombre($cmd,$nombreca,$idrepositorio); |
---|
| 80 | } |
---|
| 81 | if ($validnombreca != 1) {$validnombreca=0;} |
---|
[5105e58] | 82 | if (isset($_POST["ruta"])) $ruta=$_POST["ruta"]; |
---|
[a7e6f1b] | 83 | if (isset($_POST["descripcion"])) { |
---|
| 84 | $descripcion=$_POST["descripcion"]; |
---|
| 85 | ValidaDescripcion($cmd,$nombreca,$descripcion); |
---|
| 86 | } |
---|
| 87 | if ($validdescripcion != 1) {$validdescripcion=0;} |
---|
[5105e58] | 88 | if (isset($_POST["grupoid"])) $grupoid=$_POST["grupoid"]; |
---|
| 89 | if (isset($_POST["idperfilsoft"])) $idperfilsoft=$_POST["idperfilsoft"]; |
---|
| 90 | if (isset($_POST["comentarios"])) $comentarios=$_POST["comentarios"]; |
---|
[2196ce9] | 91 | if (isset($_POST["inremotepc"])) $inremotepc=$_POST["inremotepc"]; |
---|
[5105e58] | 92 | if (isset($_POST["identificador"])) $idimagen=$_POST["identificador"]; |
---|
[5a8c831] | 93 | if (isset($_POST["modelo"])) $numpar=$_POST["modelo"]; |
---|
| 94 | if (isset($_POST["numdisk"])) $numpar=$_POST["numdisk"]; |
---|
[5105e58] | 95 | if (isset($_POST["numpar"])) $numpar=$_POST["numpar"]; |
---|
| 96 | if (isset($_POST["codpar"])) $codpar=$_POST["codpar"]; |
---|
| 97 | if (isset($_POST["idrepositorio"])) $idrepositorio=$_POST["idrepositorio"]; |
---|
| 98 | if (isset($_POST["imagenid"])) $imagenid=$_POST["imagenid"]; |
---|
| 99 | if (isset($_POST["tipoimg"])) $tipoimg=$_POST["tipoimg"]; |
---|
[388cc5d] | 100 | if (isset($_POST["fechacreacion"])) $fechacreacion=$_POST["fechacreacion"]; |
---|
[5105e58] | 101 | if (isset($_POST["litamb"])) $litamb=$_POST["litamb"]; |
---|
| 102 | } |
---|
[683eccc] | 103 | // Solicitar datos del fichero de imagen a la API REST de su repositorio. |
---|
| 104 | if ($opcion!=$op_alta and isset($repokey)) { |
---|
| 105 | $repo[0]['url'] = "https://$repoip/opengnsys/rest/repository/image/$nombreca"; |
---|
| 106 | $repo[0]['header'] = array('Authorization: '.$repokey); |
---|
| 107 | $result = multiRequest($repo); |
---|
| 108 | if ($result[0]['code'] === 200) { |
---|
| 109 | $result = json_decode($result[0]['data']); |
---|
| 110 | $imgpath = (@$result->type==="dir" ? @$result->name : @$result->name.".".@$result->type); |
---|
| 111 | $imgsize = humanSize(@$result->size); |
---|
| 112 | $imgbackup = @$result->backedup; |
---|
| 113 | $imgbksize = isset($result->backupsize) ? humanSize($result->backupsize) : 0; |
---|
| 114 | $imglock = @$result->locked; |
---|
| 115 | } else { |
---|
| 116 | $imgpath = ""; |
---|
| 117 | } |
---|
| 118 | } |
---|
| 119 | |
---|
[3ec149c] | 120 | //________________________________________________________________________________________________________ |
---|
| 121 | ?> |
---|
| 122 | <HTML> |
---|
| 123 | <TITLE>Administración web de aulas</TITLE> |
---|
| 124 | <HEAD> |
---|
| 125 | <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> |
---|
| 126 | <LINK rel="stylesheet" type="text/css" href="../estilos.css"> |
---|
[3b3043b] | 127 | <SCRIPT language="javascript" src="../jscripts/validators.js"></SCRIPT> |
---|
[4329e85] | 128 | <SCRIPT language="javascript" src="../jscripts/constantes.js"></SCRIPT> |
---|
[3ec149c] | 129 | <SCRIPT language="javascript" src="../jscripts/propiedades_imagenes.js"></SCRIPT> |
---|
| 130 | <SCRIPT language="javascript" src="../jscripts/opciones.js"></SCRIPT> |
---|
[043e67d] | 131 | <?php echo '<SCRIPT language="javascript" src="../idiomas/javascripts/'.$idioma.'/propiedades_imagenes_'.$idioma.'.js"></SCRIPT>'?> |
---|
[3ec149c] | 132 | </HEAD> |
---|
| 133 | <BODY> |
---|
[4329e85] | 134 | <DIV align=center> |
---|
[a7e6f1b] | 135 | <?php if ( $opcion == 1 && $datospost == 1 && $validnombreca == 0 && $validdescripcion == 0 || $opcion != 1) { ?> |
---|
[5105e58] | 136 | <FORM name="fdatos" action="../gestores/gestor_imagenes.php" method="post"> |
---|
| 137 | <?php }else{ ?> |
---|
| 138 | <FORM name="fdatos" action="./propiedades_imagenes.php" method="post"> |
---|
| 139 | <?php } ?> |
---|
| 140 | |
---|
[043e67d] | 141 | <INPUT type="hidden" name="opcion" value="<?php echo $opcion?>"> |
---|
| 142 | <INPUT type="hidden" name="idimagen" value="<?php echo $idimagen?>"> |
---|
| 143 | <INPUT type="hidden" name="grupoid" value="<?php echo $grupoid?>"> |
---|
| 144 | <INPUT type="hidden" name="tipoimg" value="<?php echo $tipoimg?>"> |
---|
| 145 | <INPUT type="hidden" name="litamb" value="<?php echo $litamb?>"> |
---|
[5105e58] | 146 | <INPUT type="hidden" name="datospost" value="1"> |
---|
[5a8c831] | 147 | <?php |
---|
[4329e85] | 148 | switch($tipoimg){ |
---|
| 149 | case $IMAGENES_MONOLITICAS: |
---|
| 150 | $lit=$TbMsg[4]; |
---|
| 151 | break; |
---|
| 152 | case |
---|
| 153 | $IMAGENES_BASICAS: |
---|
| 154 | $lit=$TbMsg[12]; |
---|
| 155 | break; |
---|
| 156 | case $IMAGENES_INCREMENTALES: |
---|
| 157 | $lit=$TbMsg[13]; |
---|
| 158 | } |
---|
| 159 | |
---|
| 160 | ?> |
---|
[043e67d] | 161 | <P align=center class=cabeceras><?php echo $lit?><BR> |
---|
| 162 | <SPAN align=center class=subcabeceras><?php echo $opciones[$opcion]?></SPAN> |
---|
[4329e85] | 163 | </P> |
---|
| 164 | |
---|
[3ec149c] | 165 | <TABLE align=center border=0 cellPadding=1 cellSpacing=1 class=tabla_datos> |
---|
[4329e85] | 166 | <!--------------------------------------------------------------------------------------> |
---|
| 167 | <TR> |
---|
[043e67d] | 168 | <TH align=center> <?php echo $TbMsg[11]?> </TD> |
---|
[a7e6f1b] | 169 | <?php if ($opcion==$op_eliminacion || !empty($idperfilsoft) || $opcion == 2) |
---|
[5105e58] | 170 | echo '<TD style="width:150">'.$nombreca.' |
---|
[4329e85] | 171 | <INPUT type="hidden" name="nombreca" value="'.$nombreca.'"></TD>'; |
---|
[3ec149c] | 172 | else |
---|
[5105e58] | 173 | echo '<TD><INPUT class="formulariodatos" name=nombreca style="width:150" type=text value="'.$nombreca.'"></TH>';if ($validnombreca == 1){echo '<font color=red><strong> '.$TbMsg[18].'</strong>';}?> |
---|
[3ec149c] | 174 | </TR> |
---|
[4329e85] | 175 | <!--------------------------------------------------------------------------------------> |
---|
| 176 | <TR> |
---|
[043e67d] | 177 | <TH align=center> <?php echo $TbMsg[5]?> </TD> |
---|
[a7e6f1b] | 178 | <?php if ($opcion==$op_eliminacion) { |
---|
| 179 | echo '<TD style="width:300">'.$descripcion.' |
---|
| 180 | <INPUT type="hidden" name="descripcion" value="'.$descripcion.'"></TD>'; |
---|
| 181 | } else { |
---|
| 182 | echo '<TD><INPUT class="formulariodatos" name=descripcion style="width:350" type=text value="'.$descripcion.'">'; |
---|
| 183 | if ($validnombreca == 0 && $validdescripcion == 1){echo '<font color=red><strong> '.$TbMsg[22].'</strong>';} |
---|
| 184 | echo '</TD>'; |
---|
| 185 | } ?> |
---|
[3ec149c] | 186 | </TR> |
---|
[4329e85] | 187 | <!--------------------------------------------------------------------------------------> |
---|
[a7e6f1b] | 188 | <?php if($tipoimg==$IMAGENES_INCREMENTALES){?> |
---|
[3ec149c] | 189 | <TR> |
---|
[043e67d] | 190 | <TH align=center> <?php echo $TbMsg[14]?> </TD> |
---|
[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){?> |
---|
[4329e85] | 201 | <!--------------------------------------------------------------------------------------> |
---|
[3ec149c] | 202 | <TR> |
---|
[043e67d] | 203 | <TH align=center> <?php echo $TbMsg[10]?> </TD> |
---|
[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> |
---|
| 211 | <!--------------------------------------------------------------------------------------> |
---|
[043e67d] | 212 | <?php if($tipoimg==$IMAGENES_BASICAS){?> |
---|
[4329e85] | 213 | <TR> |
---|
[043e67d] | 214 | <TH align=center> <?php echo $TbMsg[16]?> </TD> |
---|
[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 |
---|
| 219 | echo '<TD><INPUT class="formulariodatos" name=ruta style="width:350" type=text value="'.$ruta.'"></TH>';?> |
---|
| 220 | </TR> |
---|
[043e67d] | 221 | <?php }?> |
---|
[4329e85] | 222 | <!--------------------------------------------------------------------------------------> |
---|
| 223 | <TR> |
---|
[043e67d] | 224 | <TH align=center> <?php echo $TbMsg[7]?> </TD> |
---|
[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> |
---|
[043e67d] | 271 | <TH align=center> <?php echo $TbMsg[6]?> </TD> |
---|
[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 | }?> |
---|
[4329e85] | 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 > |
---|
| 334 | <SPAN align=center class=notas><I>'.$TbMsg[15].'</I></SPAN> |
---|
| 335 | </DIV><br>'; |
---|
| 336 | } |
---|
[3ec149c] | 337 | //________________________________________________________________________________________________________ |
---|
[4329e85] | 338 | |
---|
[5105e58] | 339 | |
---|
[a7e6f1b] | 340 | if ($validnombreca=="0" && $validdescripcion=="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 | } |
---|
| 350 | if ($validnombreca=="0" && $validdescripcion=="1"){ |
---|
| 351 | echo '<script type="text/javascript">'; |
---|
| 352 | echo 'alert('.$TbMsg[21].')'; |
---|
| 353 | echo '</script>'; |
---|
| 354 | } |
---|
[5105e58] | 355 | |
---|
[3ec149c] | 356 | include_once("../includes/opcionesbotonesop.php"); |
---|
| 357 | //________________________________________________________________________________________________________ |
---|
[4329e85] | 358 | |
---|
[3ec149c] | 359 | ?> |
---|
| 360 | </BODY> |
---|
| 361 | </HTML> |
---|
[043e67d] | 362 | <?php |
---|
[3ec149c] | 363 | //________________________________________________________________________________________________________ |
---|
[4329e85] | 364 | |
---|
[3ec149c] | 365 | // Recupera los datos de una imagen |
---|
| 366 | // Parametros: |
---|
| 367 | // - cmd: Una comando ya operativo (con conexión abierta) |
---|
| 368 | // - id: El identificador de la imagen |
---|
| 369 | //________________________________________________________________________________________________________ |
---|
[4329e85] | 370 | |
---|
[3ec149c] | 371 | function TomaPropiedades($cmd,$idmagen){ |
---|
| 372 | global $nombreca; |
---|
[4329e85] | 373 | global $ruta; |
---|
[3ec149c] | 374 | global $descripcion; |
---|
| 375 | global $comentarios; |
---|
[2196ce9] | 376 | global $inremotepc; |
---|
[21372e8] | 377 | global $scheduler; |
---|
[3ec149c] | 378 | global $idperfilsoft; |
---|
[5a8c831] | 379 | global $modelo; |
---|
| 380 | global $numdisk; |
---|
[3ec149c] | 381 | global $numpar; |
---|
| 382 | global $codpar; |
---|
| 383 | global $tipopar; |
---|
| 384 | global $nombrerepositorio; |
---|
| 385 | global $idrepositorio; |
---|
[683eccc] | 386 | global $repoip; |
---|
| 387 | global $repokey; |
---|
[5a8c831] | 388 | global $perfilsoft; |
---|
[2154cbb] | 389 | global $sistoperativo; |
---|
[5a8c831] | 390 | global $imagenid; |
---|
| 391 | global $fechacreacion; |
---|
[25e581e] | 392 | global $revision; |
---|
[3ec149c] | 393 | |
---|
| 394 | $rs=new Recordset; |
---|
[2154cbb] | 395 | $cmd->texto="SELECT imagenes.*, tipospar.tipopar, repositorios.nombrerepositorio, |
---|
[683eccc] | 396 | repositorios.ip, repositorios.apikey, |
---|
[2154cbb] | 397 | perfilessoft.descripcion AS perfilsoft, nombreso AS sistoperativo, |
---|
[21372e8] | 398 | CONCAT (ordenadores.nombreordenador,' (',aulas.nombreaula,')') AS modelo, |
---|
| 399 | IF(@@GLOBAL.event_scheduler='ON',1,0) AS scheduler |
---|
[5a8c831] | 400 | FROM imagenes |
---|
| 401 | LEFT OUTER JOIN tipospar ON tipospar.codpar=imagenes.codpar |
---|
| 402 | LEFT OUTER JOIN repositorios ON repositorios.idrepositorio=imagenes.idrepositorio |
---|
| 403 | LEFT OUTER JOIN perfilessoft ON perfilessoft.idperfilsoft=imagenes.idperfilsoft |
---|
| 404 | LEFT OUTER JOIN ordenadores ON ordenadores.idordenador=imagenes.idordenador |
---|
[d9175d6] | 405 | LEFT OUTER JOIN aulas ON ordenadores.idaula=aulas.idaula |
---|
[2154cbb] | 406 | LEFT OUTER JOIN nombresos ON perfilessoft.idnombreso=nombresos.idnombreso |
---|
[5a8c831] | 407 | WHERE imagenes.idimagen=".$idmagen; |
---|
[3ec149c] | 408 | $rs->Comando=&$cmd; |
---|
| 409 | if (!$rs->Abrir()) return(0); // Error al abrir recordset |
---|
| 410 | $rs->Primero(); |
---|
| 411 | if (!$rs->EOF){ |
---|
| 412 | $nombreca=$rs->campos["nombreca"]; |
---|
[4329e85] | 413 | $ruta=$rs->campos["ruta"]; |
---|
[3ec149c] | 414 | $descripcion=$rs->campos["descripcion"]; |
---|
| 415 | $idperfilsoft=$rs->campos["idperfilsoft"]; |
---|
| 416 | $comentarios=$rs->campos["comentarios"]; |
---|
[2196ce9] | 417 | $inremotepc=$rs->campos["inremotepc"]; |
---|
[21372e8] | 418 | $scheduler=$rs->campos["scheduler"]; |
---|
[5a8c831] | 419 | $modelo=$rs->campos["modelo"]; |
---|
| 420 | $numdisk=$rs->campos["numdisk"]; |
---|
[3ec149c] | 421 | $numpar=$rs->campos["numpar"]; |
---|
| 422 | $tipopar=$rs->campos["tipopar"]; |
---|
| 423 | $codpar=$rs->campos["codpar"]; |
---|
| 424 | $idrepositorio=$rs->campos["idrepositorio"]; |
---|
| 425 | $nombrerepositorio=$rs->campos["nombrerepositorio"]; |
---|
[683eccc] | 426 | $repoip=$rs->campos["ip"]; |
---|
| 427 | $repokey=$rs->campos["apikey"]; |
---|
[3ec149c] | 428 | $perfilsoft=$rs->campos["perfilsoft"]; |
---|
[2154cbb] | 429 | $sistoperativo=$rs->campos["sistoperativo"]; |
---|
[4329e85] | 430 | $imagenid=$rs->campos["imagenid"]; |
---|
[5a8c831] | 431 | $fechacreacion=$rs->campos["fechacreacion"]; |
---|
[25e581e] | 432 | $revision=$rs->campos["revision"]; |
---|
[3ec149c] | 433 | $rs->Cerrar(); |
---|
| 434 | return(true); |
---|
| 435 | } |
---|
[21372e8] | 436 | return(false); |
---|
| 437 | } |
---|
| 438 | |
---|
| 439 | //________________________________________________________________________________________________________ |
---|
| 440 | // Recupera los algunos datos de configuración de la base de datos |
---|
| 441 | // Parametros: |
---|
| 442 | // - cmd: comando ya operativo (con conexión abierta) |
---|
| 443 | //________________________________________________________________________________________________________ |
---|
| 444 | function TomaConfiguracion($cmd) { |
---|
| 445 | global $scheduler; |
---|
| 446 | |
---|
| 447 | $rs=new Recordset; |
---|
| 448 | $cmd->texto="SELECT IF(@@GLOBAL.event_scheduler='ON',1,0) AS scheduler"; |
---|
| 449 | $rs->Comando=&$cmd; |
---|
| 450 | if (!$rs->Abrir()) return(0); // Error al abrir recordset |
---|
| 451 | if (!$rs->EOF){ |
---|
| 452 | $scheduler=$rs->campos["scheduler"]; |
---|
| 453 | $rs->Cerrar(); |
---|
[3ec149c] | 454 | return(true); |
---|
[21372e8] | 455 | } |
---|
| 456 | return(false); |
---|
[3ec149c] | 457 | } |
---|
[5105e58] | 458 | |
---|
| 459 | //________________________________________________________________________________________________________ |
---|
| 460 | |
---|
| 461 | // Comprueba Nombre de la imagen |
---|
| 462 | // Parametros: |
---|
| 463 | // - cmd: Una comando ya operativo (con conexión abierta) |
---|
[a7e6f1b] | 464 | // - nombreca: Nombre de la imagen |
---|
| 465 | // - descripcion: Descripcion de la imagen |
---|
[5105e58] | 466 | //________________________________________________________________________________________________________ |
---|
| 467 | |
---|
[a7e6f1b] | 468 | function ValidaNombre($cmd,$nombreca,$idrepositorio){ |
---|
[5105e58] | 469 | global $nombreca; |
---|
| 470 | global $validnombreca; |
---|
[a7e6f1b] | 471 | global $idrepositorio; |
---|
| 472 | |
---|
| 473 | $rs=new Recordset; |
---|
| 474 | $cmd->texto="SELECT * from imagenes WHERE nombreca='$nombreca'"; |
---|
| 475 | $rs->Comando=&$cmd; |
---|
| 476 | if (!$rs->Abrir()) return(0); // Error al abrir recordset |
---|
| 477 | $rs->Primero(); |
---|
| 478 | if (!$rs->EOF){ |
---|
| 479 | $nombrecabase=$rs->campos["nombreca"]; |
---|
| 480 | $idrepositoriobase=$rs->campos["idrepositorio"]; |
---|
| 481 | if ( $nombrecabase == $nombreca && $idrepositoriobase == $idrepositorio) |
---|
| 482 | {$validnombreca="1";}else{$validnombreca="0";} |
---|
| 483 | } |
---|
| 484 | $rs->Cerrar(); |
---|
| 485 | } |
---|
| 486 | |
---|
| 487 | //________________________________________________________________________________________________________ |
---|
| 488 | |
---|
| 489 | // Comprueba Descripcion del nombre canónico |
---|
| 490 | // Parametros: |
---|
| 491 | // - cmd: Una comando ya operativo (con conexión abierta) |
---|
| 492 | // - nombreca: Nombre de la imagen |
---|
| 493 | // - descripcion: Descripcion de la imagen |
---|
| 494 | //________________________________________________________________________________________________________ |
---|
| 495 | |
---|
| 496 | function ValidaDescripcion($cmd,$nombreca,$descripcion){ |
---|
| 497 | global $nombreca; |
---|
| 498 | global $validnombreca; |
---|
| 499 | global $descripcion; |
---|
| 500 | global $validdescripcion; |
---|
[5105e58] | 501 | |
---|
| 502 | $rs=new Recordset; |
---|
| 503 | $cmd->texto="SELECT * from imagenes WHERE nombreca='$nombreca'"; |
---|
| 504 | $rs->Comando=&$cmd; |
---|
| 505 | if (!$rs->Abrir()) return(0); // Error al abrir recordset |
---|
| 506 | $rs->Primero(); |
---|
| 507 | if (!$rs->EOF){ |
---|
| 508 | $nombrecabase=$rs->campos["nombreca"]; |
---|
[a7e6f1b] | 509 | $descripcionbase=$rs->campos["descripcion"]; |
---|
| 510 | if ( $nombrecabase == $nombreca && "$descripcionbase" == "$descripcion" ) |
---|
| 511 | {$validdescripcion="1";}else{$validdescripcion="0";} |
---|
[21372e8] | 512 | } |
---|
| 513 | $rs->Cerrar(); |
---|
[5105e58] | 514 | } |
---|
[3ec149c] | 515 | ?> |
---|