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