1 | <? |
---|
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 2003-2004 |
---|
6 | // Fecha Última modificación: MArzo-2005 |
---|
7 | // Nombre del fichero: propiedades_imagenes.php |
---|
8 | // Descripción : |
---|
9 | // Presenta el formulario de captura de datos de una imagen 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("../includes/TomaDato.php"); |
---|
16 | include_once("../includes/HTMLSELECT.php"); |
---|
17 | include_once("../idiomas/php/".$idioma."/propiedades_imagenes_".$idioma.".php"); |
---|
18 | //________________________________________________________________________________________________________ |
---|
19 | $opcion=0; |
---|
20 | $opciones=array($TbMsg[0],$TbMsg[1],$TbMsg[2],$TbMsg[3]); |
---|
21 | //________________________________________________________________________________________________________ |
---|
22 | $idimagen=0; |
---|
23 | $descripcion=""; |
---|
24 | $idperfilsoft=0; |
---|
25 | $comentarios=""; |
---|
26 | $grupoid=0; |
---|
27 | |
---|
28 | if (isset($_GET["opcion"])) $opcion=$_GET["opcion"]; // Recoge parametros |
---|
29 | if (isset($_GET["idimagen"])) $idimagen=$_GET["idimagen"]; |
---|
30 | if (isset($_GET["grupoid"])) $grupoid=$_GET["grupoid"]; |
---|
31 | if (isset($_GET["identificador"])) $idimagen=$_GET["identificador"]; |
---|
32 | //________________________________________________________________________________________________________ |
---|
33 | $cmd=CreaComando($cadenaconexion); // Crea objeto comando |
---|
34 | if (!$cmd) |
---|
35 | Header('Location: '.$pagerror.'?herror=2'); // Error de conexión con servidor B.D. |
---|
36 | if ($opcion!=$op_alta){ |
---|
37 | $resul=TomaPropiedades($cmd,$idimagen); |
---|
38 | if (!$resul) |
---|
39 | Header('Location: '.$pagerror.'?herror=3'); // Error de recuperación de datos. |
---|
40 | } |
---|
41 | //________________________________________________________________________________________________________ |
---|
42 | ?> |
---|
43 | <HTML> |
---|
44 | <TITLE>Administración web de aulas</TITLE> |
---|
45 | <HEAD> |
---|
46 | <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> |
---|
47 | <LINK rel="stylesheet" type="text/css" href="../estilos.css"> |
---|
48 | <SCRIPT language="javascript" src="../jscripts/propiedades_imagenes.js"></SCRIPT> |
---|
49 | <SCRIPT language="javascript" src="../jscripts/opciones.js"></SCRIPT> |
---|
50 | <? echo '<SCRIPT language="javascript" src="../idiomas/javascripts/'.$idioma.'/propiedades_imagenes_'.$idioma.'.js"></SCRIPT>'?> |
---|
51 | </HEAD> |
---|
52 | <BODY> |
---|
53 | <DIV align=center> |
---|
54 | <FORM name="fdatos"> |
---|
55 | <INPUT type=hidden name=idimagen value=<?=$idimagen?>> |
---|
56 | <INPUT type=hidden name=grupoid value=<?=$grupoid?>> |
---|
57 | <P align=center class=cabeceras><?echo $TbMsg[4]?><BR> |
---|
58 | <SPAN align=center class=subcabeceras><? 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> <?echo $TbMsg[5]?> </TD> |
---|
63 | <?if ($opcion==$op_eliminacion) |
---|
64 | echo '<TD style="width:300">'.$descripcion.'</TD>'; |
---|
65 | else |
---|
66 | echo '<TD><INPUT class="formulariodatos" name=descripcion style="width:300" type=text value="'.$descripcion.'"></TD>';?> |
---|
67 | </TR> |
---|
68 | <!-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> |
---|
69 | <TR> |
---|
70 | <TH align=center> <?echo $TbMsg[6]?> </TD> |
---|
71 | <? |
---|
72 | if ($opcion==$op_eliminacion) |
---|
73 | echo '<TD>'.TomaDato($cmd,$idcentro,'perfilessoft',$idperfilsoft,'idperfilsoft','descripcion').'</TD>'; |
---|
74 | else |
---|
75 | echo '<TD>'.HTMLSELECT($cmd,$idcentro,'perfilessoft',$idperfilsoft,'idperfilsoft','descripcion',300).'</TD>'; |
---|
76 | ?> |
---|
77 | </TR> |
---|
78 | <!-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> |
---|
79 | <TR> |
---|
80 | <TH align=center> <?echo $TbMsg[7]?> </TD> |
---|
81 | <?if ($opcion==$op_eliminacion) |
---|
82 | echo '<TD>'.$comentarios.'</TD>'; |
---|
83 | else |
---|
84 | echo '<TD><TEXTAREA class="formulariodatos" name=comentarios rows=3 cols=55>'.$comentarios.'</TEXTAREA></TD>'; |
---|
85 | ?> |
---|
86 | </TR> |
---|
87 | <!-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> |
---|
88 | </TABLE> |
---|
89 | </FORM> |
---|
90 | <? |
---|
91 | //________________________________________________________________________________________________________ |
---|
92 | include_once("../includes/opcionesbotonesop.php"); |
---|
93 | //________________________________________________________________________________________________________ |
---|
94 | //________________________________________________________________________________________________________ |
---|
95 | include_once("../includes/iframecomun.php"); |
---|
96 | //________________________________________________________________________________________________________ |
---|
97 | ?> |
---|
98 | </BODY> |
---|
99 | </HTML> |
---|
100 | <? |
---|
101 | //________________________________________________________________________________________________________ |
---|
102 | // Recupera los datos de una imagen |
---|
103 | // Parametros: |
---|
104 | // - cmd: Una comando ya operativo (con conexión abierta) |
---|
105 | // - id: El identificador de la imagen |
---|
106 | //________________________________________________________________________________________________________ |
---|
107 | function TomaPropiedades($cmd,$id){ |
---|
108 | global $descripcion; |
---|
109 | global $comentarios; |
---|
110 | global $idperfilsoft; |
---|
111 | $rs=new Recordset; |
---|
112 | $cmd->texto="SELECT * FROM imagenes WHERE idimagen=".$id; |
---|
113 | $rs->Comando=&$cmd; |
---|
114 | if (!$rs->Abrir()) return(0); // Error al abrir recordset |
---|
115 | $rs->Primero(); |
---|
116 | if (!$rs->EOF){ |
---|
117 | $descripcion=$rs->campos["descripcion"]; |
---|
118 | $idperfilsoft=$rs->campos["idperfilsoft"]; |
---|
119 | $comentarios=$rs->campos["comentarios"]; |
---|
120 | $rs->Cerrar(); |
---|
121 | return(true); |
---|
122 | } |
---|
123 | else |
---|
124 | return(false); |
---|
125 | } |
---|
126 | ?> |
---|