[4329e85] | 1 | <?php |
---|
| 2 | // ************************************************************************************************************************************************* |
---|
[b2651a6] | 3 | // Aplicaci�n WEB: ogAdmWebCon |
---|
| 4 | // Autor: Jos� Manuel Alonso (E.T.S.I.I.) Universidad de Sevilla |
---|
| 5 | // Fecha Creaci�n: A�o 2012 |
---|
| 6 | // Fecha �ltima modificaci�n: Noviembre-2012 |
---|
[4329e85] | 7 | // Nombre del fichero: CrearImagenBas.php |
---|
[b2651a6] | 8 | // Descripci�n : |
---|
| 9 | // Implementaci�n del comando "CrearImagenBas.php" |
---|
[4329e85] | 10 | // ************************************************************************************************************************************************* |
---|
| 11 | include_once("../includes/ctrlacc.php"); |
---|
| 12 | include_once("../clases/AdoPhp.php"); |
---|
| 13 | include_once("../includes/constantes.php"); |
---|
| 14 | include_once("../includes/comunes.php"); |
---|
| 15 | include_once("../includes/CreaComando.php"); |
---|
| 16 | include_once("../includes/HTMLSELECT.php"); |
---|
| 17 | include_once("../includes/HTMLCTESELECT.php"); |
---|
| 18 | include_once("../idiomas/php/".$idioma."/comandos/crearimagenbasica_".$idioma.".php"); |
---|
| 19 | include_once("../idiomas/php/".$idioma."/comandos/opcionesacciones_".$idioma.".php"); |
---|
[b2651a6] | 20 | include_once("../includes/pintaTablaConfiguraciones.php"); |
---|
[4329e85] | 21 | //________________________________________________________________________________________________________ |
---|
| 22 | // |
---|
| 23 | include_once("./includes/capturaacciones.php"); |
---|
| 24 | //________________________________________________________________________________________________________ |
---|
| 25 | // |
---|
| 26 | $cmd=CreaComando($cadenaconexion); |
---|
| 27 | if (!$cmd) |
---|
[b2651a6] | 28 | Header('Location: '.$pagerror.'?herror=2'); // Error de conexi�n con servidor B.D. |
---|
[4329e85] | 29 | //________________________________________________________________________________________________________ |
---|
| 30 | // |
---|
| 31 | $resul=tomaPropiedades($cmd,$idambito); |
---|
| 32 | if (!$resul){ |
---|
[b2651a6] | 33 | Header('Location: '.$pagerror.'?herror=3'); // Error de recuperaci�n de datos. |
---|
[4329e85] | 34 | } |
---|
| 35 | //________________________________________________________________________________________________________ |
---|
| 36 | ?> |
---|
| 37 | <HTML> |
---|
[b2651a6] | 38 | <TITLE>Administraci�n web de aulas</TITLE> |
---|
[4329e85] | 39 | <HEAD> |
---|
| 40 | <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> |
---|
| 41 | <LINK rel="stylesheet" type="text/css" href="../estilos.css"> |
---|
| 42 | <SCRIPT language="javascript" src="./jscripts/CrearImagenBasica.js"></SCRIPT> |
---|
| 43 | <SCRIPT language="javascript" src="../clases/jscripts/HttpLib.js"></SCRIPT> |
---|
| 44 | <?php echo '<SCRIPT language="javascript" src="../idiomas/javascripts/'.$idioma.'/comandos/crearimagenbasica_'.$idioma.'.js"></SCRIPT>'?> |
---|
| 45 | <?php echo '<SCRIPT language="javascript" src="../idiomas/javascripts/'.$idioma.'/comandos/comunescomandos_'.$idioma.'.js"></SCRIPT>'?> |
---|
| 46 | <SCRIPT language="javascript" src="./jscripts/comunescomandos.js"></SCRIPT> |
---|
| 47 | </HEAD> |
---|
| 48 | <BODY> |
---|
| 49 | <!------------------------------------------------------------------------------------------ |
---|
| 50 | Cabecera |
---|
| 51 | -------------------------------------------------------------------------------------------> |
---|
[043e67d] | 52 | <P align=center class=cabeceras><?php echo $TbMsg[0] ?><P> |
---|
[4329e85] | 53 | <P align=center> |
---|
[043e67d] | 54 | <SPAN align=center class=subcabeceras><?php echo $TbMsg[1] ?></SPAN> |
---|
[4329e85] | 55 | </BR> |
---|
| 56 | <TABLE align=center border=0 cellPadding=1 cellSpacing=1 class=tabla_datos> |
---|
| 57 | <TR> |
---|
[043e67d] | 58 | <TH align=center> <?php echo $TbMsg[2] ?> </TD> |
---|
| 59 | <?php echo '<TD>'.$nombreordenador.'</TD>';?> |
---|
[4329e85] | 60 | <TD colspan=2 valign=top align=left rowspan=3><IMG border=2 style="border-color:#63676b" src="../images/fotoordenador.gif"></TD> |
---|
| 61 | </TR> |
---|
| 62 | <TR> |
---|
[043e67d] | 63 | <TH align=center> <?php echo $TbMsg[3] ?> </TD> |
---|
| 64 | <?php echo '<TD>'.$ip.'</TD>';?> |
---|
[4329e85] | 65 | </TR> |
---|
| 66 | <TR> |
---|
[043e67d] | 67 | <TH align=center> <?php echo $TbMsg[4] ?> </TD> |
---|
| 68 | <?php echo '<TD>'.$mac.'</TD>';?> |
---|
[4329e85] | 69 | </TR> |
---|
| 70 | </TABLE> |
---|
| 71 | </P> |
---|
| 72 | <!------------------------------------------------------------------------------------------ |
---|
| 73 | Subcabecera |
---|
| 74 | -------------------------------------------------------------------------------------------> |
---|
[043e67d] | 75 | <P align=center><SPAN align=center class=subcabeceras><?php echo $TbMsg[6] ?></SPAN></p> |
---|
[4329e85] | 76 | <FORM align=center name="fdatos"> |
---|
[b2651a6] | 77 | <TABLE width=90% align=center border=0 cellPadding=1 cellSpacing=1 class=tabla_datos> |
---|
[4329e85] | 78 | <TR> |
---|
| 79 | <TH align=center> </TH> |
---|
[b2651a6] | 80 | <TH align=center> <?php echo $TbMsg["PARTITION"] ?> </TH> |
---|
| 81 | <TH align=center> <?php echo $TbMsg["SO_NAME"] ?> </TH> |
---|
| 82 | <TH align=center> <?php echo $TbMsg["IMAGE_REPOSITORY"]?> </TH> |
---|
[a8c0a4a7] | 83 | <TH align=center> <?php echo $TbMsg["SYNC_METHOD"]?> </TH> |
---|
| 84 | <TH align=center> <dfn title='<?php echo $TbMsg["TITLE_W"]?>'> W </dfn> </TH> |
---|
| 85 | <TH align=center> <dfn title='<?php echo $TbMsg["TITLE_E"]?>'> E </dfn> </TH> |
---|
| 86 | <TH align=center> <dfn title='<?php echo $TbMsg["TITLE_C"]?>'> C </dfn> </TH> |
---|
[4329e85] | 87 | </TR> |
---|
| 88 | <!------------------------------------------------------------------------------------------ |
---|
| 89 | Detalle |
---|
| 90 | -------------------------------------------------------------------------------------------> |
---|
[043e67d] | 91 | <?php |
---|
[b2651a6] | 92 | $tbPar=tablaConfiguracionesSincronizacion1($idambito); |
---|
[4329e85] | 93 | ?> |
---|
[b2651a6] | 94 | </TABLE> |
---|
[043e67d] | 95 | <input type=hidden id="cadPar" value="<?php echo $tbPar ?>"> |
---|
[4329e85] | 96 | <br> |
---|
[043e67d] | 97 | <?php |
---|
[4329e85] | 98 | opcionesAdicionales(); |
---|
| 99 | ?> |
---|
| 100 | </FORM> |
---|
[043e67d] | 101 | <?php |
---|
[4329e85] | 102 | //--------------------------------------------------------------------------------------------- |
---|
| 103 | // Pie |
---|
| 104 | //---------------------------------------------------------------------------------------------- |
---|
| 105 | include_once("./includes/formularioacciones.php"); |
---|
| 106 | include_once("./includes/opcionesacciones.php"); |
---|
| 107 | ?> |
---|
| 108 | </BODY> |
---|
| 109 | </HTML> |
---|
[043e67d] | 110 | <?php |
---|
[4329e85] | 111 | //********************************************************************************************* |
---|
| 112 | // FUNCIONES |
---|
| 113 | //********************************************************************************************* |
---|
| 114 | |
---|
| 115 | /*---------------------------------------------------------------------------------------------- |
---|
| 116 | Recupera los datos de un ordenador |
---|
| 117 | Parametros: |
---|
| 118 | - ido: El identificador del ordenador |
---|
| 119 | ----------------------------------------------------------------------------------------------*/ |
---|
| 120 | function tomaPropiedades($cmd,$ido) |
---|
| 121 | { |
---|
| 122 | global $nombreordenador; |
---|
| 123 | global $ip; |
---|
| 124 | global $mac; |
---|
| 125 | global $cmd; |
---|
| 126 | |
---|
| 127 | $rs=new Recordset; |
---|
| 128 | $cmd->texto="SELECT nombreordenador,ip,mac,idperfilhard,idrepositorio |
---|
| 129 | FROM ordenadores |
---|
| 130 | WHERE idordenador='".$ido."'"; |
---|
| 131 | $rs->Comando=&$cmd; |
---|
| 132 | if (!$rs->Abrir()) return(false); // Error al abrir recordset |
---|
| 133 | $rs->Primero(); |
---|
| 134 | if (!$rs->EOF){ |
---|
| 135 | $nombreordenador=$rs->campos["nombreordenador"]; |
---|
| 136 | $ip=$rs->campos["ip"]; |
---|
| 137 | $mac=$rs->campos["mac"];global $idcentro; |
---|
| 138 | $rs->Cerrar(); |
---|
| 139 | return(true); |
---|
| 140 | } |
---|
| 141 | else |
---|
| 142 | return(false); |
---|
| 143 | } |
---|
[b2651a6] | 144 | |
---|
[4329e85] | 145 | /*---------------------------------------------------------------------------------------------- |
---|
| 146 | Dibuja una tabla con las opciones generales |
---|
| 147 | ----------------------------------------------------------------------------------------------*/ |
---|
| 148 | function opcionesAdicionales() |
---|
| 149 | { |
---|
| 150 | global $TbMsg; |
---|
[ee89d87] | 151 | global $funcion; |
---|
| 152 | |
---|
[b2651a6] | 153 | $tablaHtml='<table width="90%" '; |
---|
[ee89d87] | 154 | |
---|
| 155 | //if($funcion!="CrearImagenBasica") |
---|
| 156 | $tablaHtml.='style="display:none"'; |
---|
| 157 | |
---|
| 158 | $tablaHtml.=' center border=0 cellPadding=0 cellSpacing=0 class="tabla_accesos">'; |
---|
[4329e85] | 159 | $tablaHtml.='<tr><th colspan=8 align=center><b> '.$TbMsg[12].' </b></th></tr>'; |
---|
| 160 | $tablaHtml.='<tr id="trOpc"> |
---|
| 161 | <td align=right>'.$TbMsg[13].'</td> |
---|
| 162 | <td><input type=checkbox name="bpi"></td>'; // Borrar imagen previamente del servidor |
---|
| 163 | $tablaHtml.=' |
---|
| 164 | <td align=right>'.$TbMsg[14].'</td> |
---|
[b2651a6] | 165 | <td><input type=checkbox name="cpc"></td>'; // Copiar adem�s la imagen a la cach� |
---|
[4329e85] | 166 | $tablaHtml.=' |
---|
| 167 | <td align=right>'.$TbMsg[15].'</td> |
---|
[b2651a6] | 168 | <td><input type=checkbox name="bpc"></td>'; // Borrar imagen de la cach� previamente antes de copiarla |
---|
[4329e85] | 169 | $tablaHtml.=' |
---|
| 170 | <td align=right>'.$TbMsg[16].'</td> |
---|
| 171 | <td><input type=checkbox name="nba"></td>'; // No borrar archivos en destino |
---|
| 172 | $tablaHtml.='</tr>'; |
---|
| 173 | $tablaHtml.=' </table>'; |
---|
| 174 | echo $tablaHtml; |
---|
| 175 | } |
---|
| 176 | /*---------------------------------------------------------------------------------------------- |
---|
| 177 | Crea desplegable de imagenes |
---|
| 178 | ----------------------------------------------------------------------------------------------*/ |
---|
| 179 | function HTMLSELECT_imagenes($idimagen) |
---|
| 180 | { |
---|
| 181 | global $cmd; |
---|
| 182 | global $IMAGENES_BASICAS; |
---|
| 183 | global $idcentro; |
---|
| 184 | |
---|
| 185 | $SelectHtml=""; |
---|
| 186 | $cmd->texto="SELECT imagenes.idimagen,imagenes.descripcion,imagenes.nombreca,imagenes.ruta, |
---|
| 187 | repositorios.ip,repositorios.nombrerepositorio |
---|
| 188 | FROM imagenes |
---|
| 189 | INNER JOIN repositorios on imagenes.idrepositorio = repositorios.idrepositorio |
---|
| 190 | WHERE tipo=".$IMAGENES_BASICAS." |
---|
| 191 | AND imagenes.idcentro=".$idcentro; |
---|
| 192 | |
---|
| 193 | //echo $cmd->texto; |
---|
| 194 | $rs=new Recordset; |
---|
| 195 | $rs->Comando=&$cmd; |
---|
| 196 | if (!$rs->Abrir()) return(""); |
---|
| 197 | $rs->Primero(); |
---|
| 198 | $SelectHtml.= '<SELECT class="estilodesple" style="width:95%">'; |
---|
| 199 | $SelectHtml.= ' <OPTION value="0"></OPTION>'; |
---|
| 200 | while (!$rs->EOF){ |
---|
| 201 | $SelectHtml.='<OPTION value="'.$rs->campos["idimagen"].";".$rs->campos["nombreca"].";".$rs->campos["ip"].";".$rs->campos["ruta"].'"'; |
---|
| 202 | if($idimagen==$rs->campos["idimagen"]) $SelectHtml.=" selected "; |
---|
| 203 | |
---|
| 204 | $SelectHtml.='>'; |
---|
| 205 | $SelectHtml.= $rs->campos["descripcion"].' - '. $rs->campos['nombrerepositorio'].'</OPTION>'; |
---|
| 206 | $rs->Siguiente(); |
---|
| 207 | } |
---|
| 208 | $rs->Cerrar(); |
---|
| 209 | $SelectHtml.= '</SELECT>'; |
---|
| 210 | return($SelectHtml); |
---|
| 211 | } |
---|
| 212 | ?> |
---|
| 213 | |
---|