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