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: propiedades_perfilsoftwares.php |
---|
8 | // Descripción : |
---|
9 | // Presenta el formulario de captura de datos de un pefil software para insertar,modificar y eliminar |
---|
10 | // ************************************************************************************************************************************************* |
---|
11 | include_once("../includes/ctrlacc.php"); |
---|
12 | include_once("../includes/opciones.php"); |
---|
13 | include_once("../includes/CreaComando.php"); |
---|
14 | include_once("../clases/AdoPhp.php"); |
---|
15 | include_once("../idiomas/php/".$idioma."/propiedades_perfilsoftwares_".$idioma.".php"); |
---|
16 | //________________________________________________________________________________________________________ |
---|
17 | $opcion=0; |
---|
18 | $opciones=array($TbMsg[0],$TbMsg[1],$TbMsg[2],$TbMsg[3]); |
---|
19 | //________________________________________________________________________________________________________ |
---|
20 | $idperfilsoft=0; |
---|
21 | $descripcion=""; |
---|
22 | $comentarios=""; |
---|
23 | $grupoid=0; |
---|
24 | $imagenes=0; // Número de imagenes que tienen este perfil |
---|
25 | |
---|
26 | if (isset($_GET["opcion"])) $opcion=$_GET["opcion"]; // Recoge parametros |
---|
27 | if (isset($_GET["idperfilsoft"])) $idperfilsoft=$_GET["idperfilsoft"]; |
---|
28 | if (isset($_GET["grupoid"])) $grupoid=$_GET["grupoid"]; |
---|
29 | if (isset($_GET["identificador"])) $idperfilsoft=$_GET["identificador"]; |
---|
30 | //________________________________________________________________________________________________________ |
---|
31 | $cmd=CreaComando($cadenaconexion); // Crea objeto comando |
---|
32 | if (!$cmd) |
---|
33 | Header('Location: '.$pagerror.'?herror=2'); // Error de conexión con servidor B.D. |
---|
34 | if ($opcion!=$op_alta){ |
---|
35 | $resul=TomaPropiedades($cmd,$idperfilsoft); |
---|
36 | if (!$resul) |
---|
37 | Header('Location: '.$pagerror.'?herror=3'); // Error de recuperación de datos. |
---|
38 | } |
---|
39 | //________________________________________________________________________________________________________ |
---|
40 | ?> |
---|
41 | <HTML> |
---|
42 | <TITLE>Administración web de aulas</TITLE> |
---|
43 | <HEAD> |
---|
44 | <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> |
---|
45 | <LINK rel="stylesheet" type="text/css" href="../estilos.css"> |
---|
46 | <SCRIPT language="javascript" src="../jscripts/propiedades_perfilsoftwares.js"></SCRIPT> |
---|
47 | <SCRIPT language="javascript" src="../jscripts/opciones.js"></SCRIPT> |
---|
48 | <?php echo '<SCRIPT language="javascript" src="../idiomas/javascripts/'.$idioma.'/propiedades_perfilsoftwares_'.$idioma.'.js"></SCRIPT>'?> |
---|
49 | </HEAD> |
---|
50 | <BODY> |
---|
51 | <DIV align=center> |
---|
52 | <FORM name="fdatos" action="../gestores/gestor_perfilsoftwares.php" method="post"> |
---|
53 | <INPUT type=hidden name=opcion value=<?php echo $opcion?>> |
---|
54 | <INPUT type=hidden name=idperfilsoft value=<?php echo $idperfilsoft?>> |
---|
55 | <INPUT type=hidden name=imagenes value=<?php echo $imagenes?>> |
---|
56 | <INPUT type=hidden name=grupoid value=<?php echo $grupoid?>> |
---|
57 | <P align=center class=cabeceras><?php echo $TbMsg[4]?><BR> |
---|
58 | <SPAN align=center class=subcabeceras><?php echo $opciones[$opcion]?></SPAN></P> |
---|
59 | <TABLE align=center border=0 cellPadding=1 cellSpacing=1 class=tabla_datos> |
---|
60 | <!-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> |
---|
61 | <TR> |
---|
62 | <TH align=center> <?php echo $TbMsg[5]?> </TH> |
---|
63 | <?php if ($opcion==$op_eliminacion) |
---|
64 | echo '<TD style="width:215">'.$descripcion.'</TD>'; |
---|
65 | else |
---|
66 | echo '<TD><INPUT class="formulariodatos" name=descripcion style="width:215" type=text value="'.$descripcion.'"></TD>';?> |
---|
67 | <TD align=left rowspan=2><IMG border=3 style="border-color:#63676b" src="../images/aula.jpg"><br><center> Images: <?php echo $imagenes?></center></TD> |
---|
68 | </TR> |
---|
69 | <!-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> |
---|
70 | <TR> |
---|
71 | <TH align=center> <?php echo $TbMsg[6]?> </TH> |
---|
72 | <?php if ($opcion==$op_eliminacion) |
---|
73 | echo '<TD>'.$comentarios.'</TD>'; |
---|
74 | else |
---|
75 | echo '<TD><TEXTAREA class="formulariodatos" name=comentarios rows=3 cols=40>'.$comentarios.'</TEXTAREA></TD>'; |
---|
76 | ?> |
---|
77 | </TR> |
---|
78 | <!-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> |
---|
79 | </TABLE> |
---|
80 | </FORM> |
---|
81 | </DIV> |
---|
82 | <?php |
---|
83 | //________________________________________________________________________________________________________ |
---|
84 | include_once("../includes/opcionesbotonesop.php"); |
---|
85 | //________________________________________________________________________________________________________ |
---|
86 | ?> |
---|
87 | </BODY> |
---|
88 | </HTML> |
---|
89 | <?php |
---|
90 | //________________________________________________________________________________________________________ |
---|
91 | // Recupera los datos de un perfil software |
---|
92 | // Parametros: |
---|
93 | // - cmd: Una comando ya operativo (con conexión abierta) |
---|
94 | // - id: El identificador del perfil software |
---|
95 | //________________________________________________________________________________________________________ |
---|
96 | function TomaPropiedades($cmd,$id){ |
---|
97 | global $descripcion; |
---|
98 | global $comentarios; |
---|
99 | |
---|
100 | global $imagenes; |
---|
101 | |
---|
102 | $rs=new Recordset; |
---|
103 | $cmd->texto="SELECT * FROM perfilessoft WHERE idperfilsoft=".$id; |
---|
104 | $rs->Comando=&$cmd; |
---|
105 | if (!$rs->Abrir()) return(0); // Error al abrir recordset |
---|
106 | $rs->Primero(); |
---|
107 | if (!$rs->EOF){ |
---|
108 | $descripcion=$rs->campos["descripcion"]; |
---|
109 | $comentarios=$rs->campos["comentarios"]; |
---|
110 | $rs->Cerrar(); |
---|
111 | $cmd->texto="SELECT count(*) as numimagenes |
---|
112 | FROM imagenes |
---|
113 | WHERE idperfilsoft=".$id." |
---|
114 | AND codpar>0"; |
---|
115 | $rs->Comando=&$cmd; |
---|
116 | if (!$rs->Abrir()) return(0); // Error al abrir recordset |
---|
117 | $rs->Primero(); |
---|
118 | if (!$rs->EOF) |
---|
119 | $imagenes=$rs->campos["numimagenes"]; |
---|
120 | $rs->Cerrar(); |
---|
121 | return(true); |
---|
122 | } |
---|
123 | else |
---|
124 | return(false); |
---|
125 | } |
---|
126 | ?> |
---|