[0ccb7c7] | 1 | <?php |
---|
[3ec149c] | 2 | // ************************************************************************************************************************************************* |
---|
| 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: RestaurarImagenOrdenador.php |
---|
| 8 | // Descripción : |
---|
| 9 | // Implementación del comando "RestaurarImagen" (Ordenadores) |
---|
[0285a39] | 10 | // version 1.1: cliente con varios repositorios |
---|
| 11 | // HTMLSELECT_imagenes: Imagenes de todos los repositorios de la UO - Cambia parametro idordenadores por idambito |
---|
| 12 | // autor: Irina Gomez, Universidad de Sevilla |
---|
| 13 | // fecha 2015-06-17 |
---|
[3ec149c] | 14 | // ************************************************************************************************************************************************* |
---|
| 15 | include_once("../includes/ctrlacc.php"); |
---|
| 16 | include_once("../clases/AdoPhp.php"); |
---|
| 17 | include_once("../includes/constantes.php"); |
---|
| 18 | include_once("../includes/comunes.php"); |
---|
| 19 | include_once("../includes/CreaComando.php"); |
---|
| 20 | include_once("../includes/HTMLSELECT.php"); |
---|
| 21 | include_once("../includes/HTMLCTESELECT.php"); |
---|
| 22 | include_once("../includes/TomaDato.php"); |
---|
| 23 | include_once("../includes/RecopilaIpesMacs.php"); |
---|
[ef938d2] | 24 | include_once("../includes/opcionesprotocolos.php"); |
---|
[3ec149c] | 25 | include_once("../idiomas/php/".$idioma."/comandos/restaurarimagen_".$idioma.".php"); |
---|
[86d5b32] | 26 | include_once("../idiomas/php/".$idioma."/comandos/opcionesacciones_".$idioma.".php"); |
---|
[b2651a6] | 27 | include_once("../includes/ConfiguracionesParticiones.php"); |
---|
| 28 | |
---|
[3ec149c] | 29 | //________________________________________________________________________________________________________ |
---|
| 30 | include_once("./includes/capturaacciones.php"); |
---|
| 31 | //________________________________________________________________________________________________________ |
---|
| 32 | $cmd=CreaComando($cadenaconexion); |
---|
| 33 | if (!$cmd) |
---|
| 34 | Header('Location: '.$pagerror.'?herror=2'); // Error de conexión con servidor B.D. |
---|
| 35 | //________________________________________________________________________________________________________ |
---|
| 36 | // |
---|
| 37 | // Captura parámetros |
---|
| 38 | //________________________________________________________________________________________________________ |
---|
| 39 | |
---|
| 40 | $ambito=0; |
---|
| 41 | $idambito=0; |
---|
| 42 | |
---|
| 43 | // Agrupamiento por defecto |
---|
| 44 | $fk_sysFi=0; |
---|
| 45 | $fk_tamano=0; |
---|
| 46 | $fk_nombreSO=0; |
---|
| 47 | |
---|
| 48 | if (isset($_GET["idambito"])) $idambito=$_GET["idambito"]; |
---|
| 49 | if (isset($_GET["ambito"])) $ambito=$_GET["ambito"]; |
---|
| 50 | |
---|
| 51 | if (isset($_POST["idambito"])) $idambito=$_POST["idambito"]; |
---|
| 52 | if (isset($_POST["ambito"])) $ambito=$_POST["ambito"]; |
---|
| 53 | |
---|
| 54 | if (isset($_POST["fk_sysFi"])) $fk_sysFi=$_POST["fk_sysFi"]; |
---|
| 55 | if (isset($_POST["fk_tamano"])) $fk_tamano=$_POST["fk_tamano"]; |
---|
| 56 | if (isset($_POST["fk_nombreSO"])) $fk_nombreSO=$_POST["fk_nombreSO"]; |
---|
| 57 | |
---|
| 58 | //________________________________________________________________________________________________________ |
---|
| 59 | ?> |
---|
| 60 | <HTML> |
---|
| 61 | <TITLE>Administración web de aulas</TITLE> |
---|
| 62 | <HEAD> |
---|
| 63 | <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> |
---|
| 64 | <LINK rel="stylesheet" type="text/css" href="../estilos.css"> |
---|
| 65 | <STYLE TYPE="text/css"></STYLE> |
---|
| 66 | <SCRIPT language="javascript" src="./jscripts/RestaurarImagen.js"></SCRIPT> |
---|
| 67 | <SCRIPT language="javascript" src="../clases/jscripts/HttpLib.js"></SCRIPT> |
---|
| 68 | <SCRIPT language="javascript" src="./jscripts/comunescomandos.js"></SCRIPT> |
---|
| 69 | <SCRIPT language="javascript" src="../jscripts/constantes.js"></SCRIPT> |
---|
[aac24d7] | 70 | <?php echo '<SCRIPT language="javascript" src="../idiomas/javascripts/'.$idioma.'/comandos/comunescomandos_'.$idioma.'.js"></SCRIPT>'?> |
---|
| 71 | <?php echo '<SCRIPT language="javascript" src="../idiomas/javascripts/'.$idioma.'/comandos/restaurarimagen_'.$idioma.'.js"></SCRIPT>'?> |
---|
[3ec149c] | 72 | </HEAD> |
---|
| 73 | <BODY> |
---|
[aac24d7] | 74 | <?php |
---|
[69650cb] | 75 | echo '<p align=center><span class=cabeceras>'.$TbMsg[5].' </span><br>'; |
---|
| 76 | //________________________________________________________________________________________________________ |
---|
| 77 | |
---|
[ef3ffe2] | 78 | include_once("./includes/FiltradoAmbito.php"); |
---|
[69650cb] | 79 | //________________________________________________________________________________________________________ |
---|
| 80 | |
---|
[3ec149c] | 81 | echo '<P align=center><SPAN align=center class=subcabeceras>'.$TbMsg[19].'</SPAN></P>'; |
---|
| 82 | if($ambito!=$AMBITO_ORDENADORES){ |
---|
| 83 | $cadenaid=""; |
---|
| 84 | $cadenaip=""; |
---|
| 85 | $cadenamac=""; |
---|
| 86 | RecopilaIpesMacs($cmd,$ambito,$idambito); |
---|
| 87 | ?> |
---|
| 88 | <FORM action="RestaurarImagen.php" name="fdatos" method="POST"> |
---|
| 89 | <INPUT type="hidden" name="idambito" value="<? echo $idambito?>"> |
---|
| 90 | <INPUT type="hidden" name="ambito" value="<? echo $ambito?>"> |
---|
| 91 | <INPUT type="hidden" name="cadenaid" value="<? echo $cadenaid?>"> |
---|
| 92 | <TABLE class="tabla_busquedas" align=center border=0 cellPadding=0 cellSpacing=0> |
---|
| 93 | <TR> |
---|
| 94 | <TH height=15 align="center" colspan=14><? echo $TbMsg[18]?></TH> |
---|
| 95 | </TR> |
---|
| 96 | <TR> |
---|
| 97 | <TD align=right><? echo $TbMsg[30]?></TD> |
---|
| 98 | <TD align=center><INPUT type="checkbox" value="<? echo $msk_sysFi?>" name="fk_sysFi" <? if($fk_sysFi==$msk_sysFi) echo " checked "?>></TD> |
---|
| 99 | <TD width="20" align=center> </TD> |
---|
| 100 | |
---|
| 101 | <TD align=right><? echo $TbMsg[32]?></TD> |
---|
| 102 | <TD align=center><INPUT type="checkbox" value="<? echo $msk_tamano?>" name="fk_tamano" <? if($fk_tamano==$msk_tamano) echo " checked "?>></TD> |
---|
| 103 | <TD width="20" align=center> </TD> |
---|
| 104 | |
---|
| 105 | <TD align=right><? echo $TbMsg[31]?></TD> |
---|
| 106 | <TD align=center><INPUT type="checkbox" value="<? echo $msk_nombreSO?>" name="fk_nombreSO" <? if($fk_nombreSO==$msk_nombreSO) echo " checked "?>></TD> |
---|
| 107 | <TD width="20" align=center> </TD> |
---|
| 108 | </TR> |
---|
| 109 | <TR> |
---|
| 110 | <TD height=2 style="BORDER-TOP:#999999 1px solid;" align="center" colspan=14> </TD> |
---|
| 111 | </TR> |
---|
| 112 | <TR> |
---|
| 113 | <TD height=20 align="center" colspan=14> |
---|
| 114 | <A href=#> |
---|
[2307886] | 115 | <IMG border=0 src="../images/boton_confirmar_<? echo $idioma ?>.gif" onclick="document.fdatos.submit()"></A></TD> |
---|
[3ec149c] | 116 | </TR> |
---|
| 117 | </TABLE> |
---|
| 118 | </FORM> |
---|
[aac24d7] | 119 | <?php |
---|
[3ec149c] | 120 | } |
---|
[0285a39] | 121 | |
---|
| 122 | |
---|
[3ec149c] | 123 | $sws=$fk_sysFi | $fk_tamano | $fk_nombreSO; |
---|
[b2651a6] | 124 | pintaConfiguraciones($cmd,$idambito,$ambito,9,$sws,false,"pintaParticionesRestaurarImagen"); |
---|
[3ec149c] | 125 | //________________________________________________________________________________________________________ |
---|
| 126 | include_once("./includes/formularioacciones.php"); |
---|
| 127 | //________________________________________________________________________________________________________ |
---|
| 128 | //________________________________________________________________________________________________________ |
---|
| 129 | include_once("./includes/opcionesacciones.php"); |
---|
| 130 | //________________________________________________________________________________________________________ |
---|
| 131 | ?> |
---|
[ef3ffe2] | 132 | <SCRIPT language="javascript"> |
---|
| 133 | Sondeo(); |
---|
| 134 | </SCRIPT> |
---|
[3ec149c] | 135 | </BODY> |
---|
| 136 | </HTML> |
---|
[aac24d7] | 137 | <?php |
---|
[581c733] | 138 | |
---|
[3ec149c] | 139 | /*________________________________________________________________________________________________________ |
---|
| 140 | Crea la etiqueta html <SELECT> de los perfiles softwares |
---|
[aeb4951] | 141 | // Version 0.1: En consulta SQL se quita imagenes.numpar>0. las imágenes recien creadas tienen numpar=0. |
---|
| 142 | // US ETSII - Irina Gomez - 2014-11-11 |
---|
[3ec149c] | 143 | ________________________________________________________________________________________________________*/ |
---|
[0285a39] | 144 | function HTMLSELECT_imagenes($cmd,$idimagen,$numpar,$codpar,$icp,$sw,$idambito,$ambito) |
---|
[3ec149c] | 145 | { |
---|
[62d43c3] | 146 | global $IMAGENES_MONOLITICAS; |
---|
| 147 | |
---|
[3ec149c] | 148 | $SelectHtml=""; |
---|
[0285a39] | 149 | $cmd->texto="SELECT *,repositorios.ip as iprepositorio, repositorios.nombrerepositorio as nombrerepo FROM imagenes |
---|
[3ec149c] | 150 | INNER JOIN repositorios ON repositorios.idrepositorio=imagenes.idrepositorio"; |
---|
| 151 | if($sw) // Imágenes con el mismo tipo de partición |
---|
| 152 | $cmd->texto.= " WHERE imagenes.codpar=".$codpar; |
---|
| 153 | else |
---|
| 154 | $cmd->texto.= " WHERE imagenes.codpar<>".$codpar; |
---|
| 155 | |
---|
[aeb4951] | 156 | $cmd->texto.=" AND imagenes.codpar>0 AND imagenes.idrepositorio>0 "; // La imagene debe existir y |
---|
| 157 | $cmd->texto.=" AND imagenes.tipo=".$IMAGENES_MONOLITICAS; |
---|
[ad1f809] | 158 | |
---|
[0285a39] | 159 | // 1.1 Imagenes de todos los repositorios de la UO. |
---|
| 160 | switch ($ambito) { |
---|
| 161 | case 16: |
---|
| 162 | // ambito ordenador |
---|
| 163 | $selectrepo='select repositorios.idrepositorio from repositorios INNER JOIN aulas INNER JOIN ordenadores where repositorios.idcentro=aulas.idcentro AND aulas.idaula=ordenadores.idaula AND idordenador='.$idambito; |
---|
| 164 | break; |
---|
| 165 | case 8: |
---|
| 166 | // ambito grupo ordenadores |
---|
| 167 | $selectrepo='select idrepositorio from repositorios INNER JOIN aulas INNER JOIN gruposordenadores where repositorios.idcentro=aulas.idcentro AND aulas.idaula=gruposordenadores.idaula AND idgrupo='.$idambito; |
---|
| 168 | break; |
---|
| 169 | case 4: |
---|
| 170 | // ambito aulas |
---|
| 171 | $selectrepo='select idrepositorio from repositorios INNER JOIN aulas where repositorios.idcentro=aulas.idcentro AND idaula='.$idambito; |
---|
| 172 | break; |
---|
| 173 | } |
---|
| 174 | $cmd->texto.=" AND repositorios.idrepositorio IN (".$selectrepo.")"; |
---|
[ad1f809] | 175 | |
---|
[3ec149c] | 176 | $rs=new Recordset; |
---|
| 177 | $rs->Comando=&$cmd; |
---|
| 178 | if($sw) $des=1; else $des=0; |
---|
| 179 | $SelectHtml.= '<SELECT class="formulariodatos" id="despleimagen_'.$icp.'_'.$des.'" style="WIDTH:220">'; |
---|
| 180 | $SelectHtml.= ' <OPTION value="0"></OPTION>'; |
---|
| 181 | |
---|
| 182 | if ($rs->Abrir()){ |
---|
| 183 | $rs->Primero(); |
---|
| 184 | while (!$rs->EOF){ |
---|
| 185 | $SelectHtml.='<OPTION value="'.$rs->campos["idimagen"]."_".$rs->campos["nombreca"]."_".$rs->campos["iprepositorio"]."_".$rs->campos["idperfilsoft"].'"'; |
---|
| 186 | if($idimagen==$rs->campos["idimagen"]) $SelectHtml.=" selected "; |
---|
| 187 | $SelectHtml.='>'; |
---|
[0285a39] | 188 | $SelectHtml.= $rs->campos["descripcion"].' ('.$rs->campos["nombrerepo"].') </OPTION>'; |
---|
| 189 | |
---|
[3ec149c] | 190 | $rs->Siguiente(); |
---|
| 191 | } |
---|
| 192 | $rs->Cerrar(); |
---|
| 193 | } |
---|
| 194 | $SelectHtml.= '</SELECT>'; |
---|
| 195 | return($SelectHtml); |
---|
| 196 | } |
---|
| 197 | /*________________________________________________________________________________________________________ |
---|
| 198 | Crea la etiqueta html <SELECT> de los repositorios |
---|
| 199 | ________________________________________________________________________________________________________*/ |
---|
| 200 | function HTMLSELECT_repositorios($cmd,$idcentro,$idrepositorio,$particion){ |
---|
| 201 | $SelectHtml=""; |
---|
| 202 | $rs=new Recordset; |
---|
| 203 | |
---|
| 204 | $cmd->texto="SELECT nombrerepositorio,ip FROM repositorios"; |
---|
| 205 | $rs->Comando=&$cmd; |
---|
| 206 | |
---|
| 207 | if (!$rs->Abrir()) return($SelectHtml); // Error al abrir recordset |
---|
| 208 | $SelectHtml.= '<SELECT class="formulariodatos" id="desplerepositorios_'.$particion.'" style="WIDTH: 200">'; |
---|
| 209 | $rs->Primero(); |
---|
| 210 | while (!$rs->EOF){ |
---|
| 211 | $SelectHtml.='<OPTION value="'.$rs->campos["ip"].'"'; |
---|
| 212 | if($rs->campos["idrepositorio"]==$idrepositorio) $SelectHtml.=" selected "; |
---|
| 213 | $SelectHtml.='>'; |
---|
| 214 | $SelectHtml.= $rs->campos["nombrerepositorio"]; |
---|
| 215 | $SelectHtml.='</OPTION>'; |
---|
| 216 | $rs->Siguiente(); |
---|
| 217 | } |
---|
| 218 | $SelectHtml.= '</SELECT>'; |
---|
| 219 | $rs->Cerrar(); |
---|
| 220 | return($SelectHtml); |
---|
| 221 | } |
---|
[ad1f809] | 222 | |
---|
| 223 | |
---|
[547d88b2] | 224 | |
---|
[3ec149c] | 225 | ?> |
---|
[ef3ffe2] | 226 | |
---|