source: admin/WebConsole/varios/perfilcomponente_hard.php

qndtest
Last change on this file was 6694784, checked in by Ramón M. Gómez <ramongomez@…>, 5 years ago

#834: Fixing more code cleanup: CSS units, HTML tags; Javascript comparisons, and PHP variables.

  • Property mode set to 100644
File size: 4.9 KB
Line 
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 2009-2010
6// Fecha Última modificación: Agosto-2010
7// Nombre del fichero: perfilcomponente_hard.php
8// Descripción :
9//              Administra los componentes hardware incluidos en un perfil harware
10// *************************************************************************************************************************************************
11include_once("../includes/ctrlacc.php");
12include_once("../clases/AdoPhp.php");
13include_once("../includes/CreaComando.php");
14include_once("../idiomas/php/".$idioma."/perfilcomponente_hard_".$idioma.".php");
15//________________________________________________________________________________________________________
16$idperfilhard=0; 
17$descripcionperfil=""; 
18if (isset($_GET["idperfilhard"])) $idperfilhard=$_GET["idperfilhard"]; // Recoge parametros
19if (isset($_GET["descripcionperfil"])) $descripcionperfil=$_GET["descripcionperfil"]; // Recoge parametros
20
21$cmd=CreaComando($cadenaconexion);
22if (!$cmd)
23        Header('Location: '.$pagerror.'?herror=2'); // Error de conexióncon servidor B.D.
24//________________________________________________________________________________________________________
25?>
26<HTML>
27<HEAD>
28<TITLE>Administración web de aulas</TITLE>
29<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
30<LINK rel="stylesheet" type="text/css" href="../estilos.css">
31<SCRIPT language="javascript" src="../jscripts/perfilcomponente_hard.js"></SCRIPT>
32<SCRIPT language="javascript" src="../jscripts/opciones.js"></SCRIPT>
33<SCRIPT language="javascript" src="../clases/jscripts/HttpLib.js"></SCRIPT>
34<?php echo '<SCRIPT language="javascript" src="../idiomas/javascripts/'.$idioma.'/perfilcomponente_hard_'.$idioma.'.js"></SCRIPT>'?>
35</HEAD>
36<BODY>
37<FORM name="fdatos"> 
38        <INPUT type=hidden value="<?php echo $idcentro?>" id=idcentro>   
39        <INPUT type=hidden value="<?php echo $idperfilhard?>" id=idperfilhard>   
40        <P align=center class=cabeceras><?php echo $TbMsg[0]?><BR>
41        <SPAN align=center class=subcabeceras><?php echo $TbMsg[1]?></SPAN>&nbsp;<IMG src="../images/iconos/confihard.gif"></P>
42        <BR>
43        <DIV align=center id="Layer_componentes">
44                <SPAN align=center class=presentaciones><B><U><?php echo $TbMsg[2]?></U>:&nbsp;<?php echo $descripcionperfil?></B></SPAN></P>
45                <TABLE width="100%" class="tabla_listados" cellspacing=1 cellpadding=0 >
46                         <TR>
47                                <TH>&nbsp</TH>
48                                <TH>T</TH>
49                                <TH><?php echo $TbMsg[3]?></TH>
50                        </TR>
51                <?php
52                        $rs=new Recordset; 
53                        $cmd->texto='SELECT hardwares.idhardware, hardwares.descripcion,'.
54                                    '       tipohardwares.descripcion AS hdescripcion, tipohardwares.urlimg'.
55                                    '  FROM hardwares'.
56                                    ' INNER JOIN perfileshard_hardwares ON hardwares.idhardware=perfileshard_hardwares.idhardware'.
57                                    ' INNER JOIN tipohardwares ON hardwares.idtipohardware=tipohardwares.idtipohardware'.
58                                    ' WHERE perfileshard_hardwares.idperfilhard='.$idperfilhard.
59                                    ' ORDER BY tipohardwares.idtipohardware, hardwares.descripcion';
60                        $rs->Comando=&$cmd; 
61
62                        if ($rs->Abrir()){ 
63                                $rs->Primero();
64                                $A_W=" WHERE ";
65                                $strex="";
66                                while (!$rs->EOF){
67                                                 echo '<TR>';
68                                                 echo '<TD align=center width="10%" ><INPUT type=checkbox onclick="gestion_componente('.$rs->campos["idhardware"].',this)" checked ></INPUT></TD>';
69                                                 echo '<TD align=center width="10%" ><IMG alt="'. $rs->campos["hdescripcion"].'"src="'.$rs->campos["urlimg"].'"></TD>';
70                                                 echo '<TD  width="80%" >&nbsp;'.$rs->campos["descripcion"].'</TD>';
71                                                 echo '</TR>';
72                                                 $strex.= $A_W."hardwares.idhardware<>".$rs->campos["idhardware"];
73                                                $A_W=" AND ";
74                                                $rs->Siguiente();
75                                }
76                        }
77                        $rs->Cerrar();
78                        $cmd->texto='SELECT hardwares.idhardware, hardwares.descripcion,'.
79                                    '       tipohardwares.descripcion AS hdescripcion, tipohardwares.urlimg,'.
80                                    '  FROM hardwares'.
81                                    ' INNER JOIN tipohardwares ON hardwares.idtipohardware=tipohardwares.idtipohardware '.
82                                    $strex.' AND hardwares.idcentro='.$idcentro.
83                                    ' ORDER BY tipohardwares.idtipohardware, hardwares.descripcion';
84                        $rs->Comando=&$cmd; 
85                        if ($rs->Abrir()){
86                                $rs->Primero();
87                                while (!$rs->EOF){
88                                                 echo '<TR>';
89                                                 echo '<TD align=center width="10%" ><INPUT type=checkbox onclick="gestion_componente('.$rs->campos["idhardware"].',this)"  ></INPUT></TD>';
90                                                 echo '<TD align=center width="10%" ><IMG alt="'. $rs->campos["hdescripcion"].'"src="'.$rs->campos["urlimg"].'"></TD>';
91
92                                                 echo '<TD width="80%" >&nbsp;'.$rs->campos["descripcion"].'</TD>';
93                                                 echo '</TR>';
94                                                $rs->Siguiente();
95                                }
96                        }
97                        $rs->Cerrar();
98                ?>
99                </TABLE>
100        </DIV>         
101        <DIV id="Layer_nota" align=center >
102                <BR>
103                <SPAN align=center class=notas><I><?php echo $TbMsg[4]?></I></SPAN>
104        </DIV>
105</FORM>
106</BODY>
107</HTML>
Note: See TracBrowser for help on using the repository browser.