| 1 | <?php | 
|---|
| 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 2012 | 
|---|
| 6 | // Fecha última modificación: Noviembre-2012 | 
|---|
| 7 | // Nombre del fichero: CrearImagenBas.php | 
|---|
| 8 | // Descripción: | 
|---|
| 9 | //              Implementación del comando "CrearImagenBas.php" | 
|---|
| 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/crearsoftincremental_".$idioma.".php"); | 
|---|
| 19 | include_once("../idiomas/php/".$idioma."/comandos/opcionesacciones_".$idioma.".php"); | 
|---|
| 20 | include_once("../includes/pintaTablaConfiguraciones.php"); | 
|---|
| 21 |  | 
|---|
| 22 | //________________________________________________________________________________________________________ | 
|---|
| 23 | // | 
|---|
| 24 | include_once("./includes/capturaacciones.php"); | 
|---|
| 25 | //________________________________________________________________________________________________________ | 
|---|
| 26 | // | 
|---|
| 27 | $cmd=CreaComando($cadenaconexion); | 
|---|
| 28 | if (!$cmd) | 
|---|
| 29 | Header('Location: '.$pagerror.'?herror=2'); // Error de conexión con servidor B.D. | 
|---|
| 30 | //________________________________________________________________________________________________________ | 
|---|
| 31 | // | 
|---|
| 32 | $resul=tomaPropiedades($cmd,$idambito); | 
|---|
| 33 | if (!$resul){ | 
|---|
| 34 | Header('Location: '.$pagerror.'?herror=3'); // Error de recuperación de datos. | 
|---|
| 35 | } | 
|---|
| 36 | //________________________________________________________________________________________________________ | 
|---|
| 37 | ?> | 
|---|
| 38 | <HTML> | 
|---|
| 39 | <HEAD> | 
|---|
| 40 | <TITLE>Administración web de aulas</TITLE> | 
|---|
| 41 | <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> | 
|---|
| 42 | <LINK rel="stylesheet" type="text/css" href="../estilos.css"> | 
|---|
| 43 | <SCRIPT language="javascript" src="./jscripts/CrearSoftIncremental.js"></SCRIPT> | 
|---|
| 44 | <SCRIPT language="javascript" src="../clases/jscripts/HttpLib.js"></SCRIPT> | 
|---|
| 45 | <?php echo '<SCRIPT language="javascript" src="../idiomas/javascripts/'.$idioma.'/comandos/crearsoftincremental_'.$idioma.'.js"></SCRIPT>'?> | 
|---|
| 46 | <?php echo '<SCRIPT language="javascript" src="../idiomas/javascripts/'.$idioma.'/comandos/comunescomandos_'.$idioma.'.js"></SCRIPT>'?> | 
|---|
| 47 | <SCRIPT language="javascript" src="./jscripts/comunescomandos.js"></SCRIPT> | 
|---|
| 48 | </HEAD> | 
|---|
| 49 | <BODY> | 
|---|
| 50 | <!------------------------------------------------------------------------------------------ | 
|---|
| 51 | Cabecera | 
|---|
| 52 | -------------------------------------------------------------------------------------------> | 
|---|
| 53 | <P align=center class=cabeceras><?php echo $TbMsg[0] ?></P> | 
|---|
| 54 | <P align=center> | 
|---|
| 55 | <SPAN class=subcabeceras><?php echo $TbMsg[1] ?></SPAN> | 
|---|
| 56 | <BR> | 
|---|
| 57 | <TABLE  align=center border=0 cellPadding=1 cellSpacing=1 class=tabla_datos> | 
|---|
| 58 | <TR> | 
|---|
| 59 | <TH align=center> <?php echo $TbMsg[2] ?> </TH> | 
|---|
| 60 | <?php echo '<TD>'.$nombreordenador.'</TD>';?> | 
|---|
| 61 | <TD colspan=2 valign=top align=left rowspan=3><IMG border=2 style="border-color:#63676b" src="../images/fotoordenador.gif"></TD> | 
|---|
| 62 | </TR> | 
|---|
| 63 | <TR> | 
|---|
| 64 | <TH align=center> <?php echo $TbMsg[3] ?> </TH> | 
|---|
| 65 | <?php echo '<TD>'.$ip.'</TD>';?> | 
|---|
| 66 | </TR> | 
|---|
| 67 | <TR> | 
|---|
| 68 | <TH align=center> <?php echo $TbMsg[4] ?> </TH> | 
|---|
| 69 | <?php echo '<TD>'.$mac.'</TD>';?> | 
|---|
| 70 | </TR> | 
|---|
| 71 | </TABLE> | 
|---|
| 72 | <!------------------------------------------------------------------------------------------ | 
|---|
| 73 | Subcabecera | 
|---|
| 74 | -------------------------------------------------------------------------------------------> | 
|---|
| 75 | <P align=center><SPAN class=subcabeceras><?php echo $TbMsg[6] ?></SPAN></p> | 
|---|
| 76 | <FORM  align=center name="fdatos"> | 
|---|
| 77 | <TABLE  width=90% align=center border=0 cellPadding=1 cellSpacing=1 class=tabla_datos> | 
|---|
| 78 | <TR> | 
|---|
| 79 | <TH align=center>  </TH> | 
|---|
| 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["INCREMENTAL_IMAGE_REPOSITORY"]?> </TH> | 
|---|
| 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> | 
|---|
| 87 | </TR> | 
|---|
| 88 | <!------------------------------------------------------------------------------------------ | 
|---|
| 89 | Detalle | 
|---|
| 90 | -------------------------------------------------------------------------------------------> | 
|---|
| 91 | <?php | 
|---|
| 92 | $tbPar=tablaConfiguracionesSincronizacion1($idambito); | 
|---|
| 93 | ?> | 
|---|
| 94 | </TABLE> | 
|---|
| 95 | <input type=hidden id="cadPar" value="<?php echo $tbPar ?>"> | 
|---|
| 96 | <br> | 
|---|
| 97 | <?php | 
|---|
| 98 | opcionesAdicionales(); | 
|---|
| 99 | ?> | 
|---|
| 100 | </FORM> | 
|---|
| 101 | <?php | 
|---|
| 102 | //--------------------------------------------------------------------------------------------- | 
|---|
| 103 | // Pie | 
|---|
| 104 | //---------------------------------------------------------------------------------------------- | 
|---|
| 105 | include_once("./includes/formularioacciones.php"); | 
|---|
| 106 | include_once("./includes/opcionesacciones.php"); | 
|---|
| 107 | ?> | 
|---|
| 108 | </BODY> | 
|---|
| 109 | </HTML> | 
|---|
| 110 | <?php | 
|---|
| 111 | //********************************************************************************************* | 
|---|
| 112 | //      FUNCIONES | 
|---|
| 113 | //********************************************************************************************* | 
|---|
| 114 |  | 
|---|
| 115 | /*---------------------------------------------------------------------------------------------- | 
|---|
| 116 | Recupera los datos de un ordenador | 
|---|
| 117 | Parámetros: | 
|---|
| 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 | } | 
|---|
| 144 |  | 
|---|
| 145 | /*---------------------------------------------------------------------------------------------- | 
|---|
| 146 | Dibuja una tabla con las opciones generales | 
|---|
| 147 | ----------------------------------------------------------------------------------------------*/ | 
|---|
| 148 | function opcionesAdicionales() | 
|---|
| 149 | { | 
|---|
| 150 | global $TbMsg; | 
|---|
| 151 |  | 
|---|
| 152 | $tablaHtml='<table width="90%" style="display:none" align=center border=0 cellPadding=0 cellSpacing=0 class="tabla_accesos">'; | 
|---|
| 153 | $tablaHtml.='<tr><th colspan=8 align=center><b> '.$TbMsg[11].' </b></th></tr>'; | 
|---|
| 154 | $tablaHtml.='<tr id="trOpc"> | 
|---|
| 155 | <td align=right>'.$TbMsg[13].'</td> | 
|---|
| 156 | <td ><input  type=checkbox name="bpi"></td>'; // Borrar imagen del servidor  o borrar partición previamente | 
|---|
| 157 | $tablaHtml.=' | 
|---|
| 158 | <td  align=right>'.$TbMsg[14].'</td> | 
|---|
| 159 | <td><input type=checkbox name="cpc"></td>'; // Copiar además la imagen a la caché | 
|---|
| 160 | $tablaHtml.=' | 
|---|
| 161 | <td  align=right>'.$TbMsg[15].'</td> | 
|---|
| 162 | <td><input type=checkbox name="bpc"></td>'; // Borrar imagen de la caché previamente antes de copiarla | 
|---|
| 163 | $tablaHtml.=' | 
|---|
| 164 | <td  align=right>'.$TbMsg[16].'</td> | 
|---|
| 165 | <td><input type=checkbox name="nba"></td>'; // No borrar archivos en destino | 
|---|
| 166 | $tablaHtml.='</tr>'; | 
|---|
| 167 | $tablaHtml.='   </table>'; | 
|---|
| 168 | echo $tablaHtml; | 
|---|
| 169 | } | 
|---|
| 170 | /*---------------------------------------------------------------------------------------------- | 
|---|
| 171 | Crea desplegable de imagenes | 
|---|
| 172 | ----------------------------------------------------------------------------------------------*/ | 
|---|
| 173 | function HTMLSELECT_imagenes($idimagen) | 
|---|
| 174 | { | 
|---|
| 175 | global $cmd; | 
|---|
| 176 | global $idcentro; | 
|---|
| 177 | global $IMAGENES_INCREMENTALES; | 
|---|
| 178 |  | 
|---|
| 179 | $SelectHtml=""; | 
|---|
| 180 | $cmd->texto="SELECT imagenes.idimagen as idimageninc,imagenes.descripcion,imagenes.nombreca as nombreincca, | 
|---|
| 181 | imagesbas.nombreca,imagesbas.idimagen,imagesbas.ruta, | 
|---|
| 182 | repositorios.ip,repositorios.nombrerepositorio | 
|---|
| 183 | FROM  imagenes | 
|---|
| 184 | INNER JOIN imagenes as imagesbas on imagesbas.idimagen = imagenes.imagenid | 
|---|
| 185 | INNER JOIN repositorios on imagesbas.idrepositorio = repositorios.idrepositorio | 
|---|
| 186 | WHERE imagenes.tipo=".$IMAGENES_INCREMENTALES." | 
|---|
| 187 | AND imagesbas.idcentro=".$idcentro; | 
|---|
| 188 | //echo $cmd->texto; | 
|---|
| 189 | $rs=new Recordset; | 
|---|
| 190 | $rs->Comando=&$cmd; | 
|---|
| 191 | if (!$rs->Abrir()) return(""); | 
|---|
| 192 | $rs->Primero(); | 
|---|
| 193 | $SelectHtml.= '<SELECT class="estilodesple" style="width:95%">'; | 
|---|
| 194 | $SelectHtml.= '    <OPTION value="0"></OPTION>'; | 
|---|
| 195 | while (!$rs->EOF){ | 
|---|
| 196 | $SelectHtml.='<OPTION | 
|---|
| 197 | value="'.$rs->campos["idimagen"].";".$rs->campos["nombreca"].";".$rs->campos["ip"].";".$rs->campos["idimageninc"].";".$rs->campos["nombreincca"].";".$rs->campos["ruta"].'"'; | 
|---|
| 198 | if($idimagen==$rs->campos["idimagen"]) $SelectHtml.=" selected "; | 
|---|
| 199 |  | 
|---|
| 200 | $SelectHtml.='>'; | 
|---|
| 201 | $SelectHtml.= $rs->campos["descripcion"].' - '. $rs->campos['nombrerepositorio'].'</OPTION>'; | 
|---|
| 202 | $rs->Siguiente(); | 
|---|
| 203 | } | 
|---|
| 204 | $rs->Cerrar(); | 
|---|
| 205 | $SelectHtml.= '</SELECT>'; | 
|---|
| 206 | return($SelectHtml); | 
|---|
| 207 | } | 
|---|
| 208 |  | 
|---|