[043e67d] | 1 | <?php |
---|
[3ec149c] | 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 | <HEAD> |
---|
[b0d5fb32] | 43 | <TITLE>Administración web de aulas</TITLE> |
---|
[3ec149c] | 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> |
---|
[043e67d] | 48 | <?php echo '<SCRIPT language="javascript" src="../idiomas/javascripts/'.$idioma.'/propiedades_perfilsoftwares_'.$idioma.'.js"></SCRIPT>'?> |
---|
[3ec149c] | 49 | </HEAD> |
---|
| 50 | <BODY> |
---|
| 51 | <DIV align=center> |
---|
| 52 | <FORM name="fdatos" action="../gestores/gestor_perfilsoftwares.php" method="post"> |
---|
[043e67d] | 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> |
---|
[b0d5fb32] | 58 | <SPAN class=subcabeceras><?php echo $opciones[$opcion]?></SPAN></P> |
---|
[3ec149c] | 59 | <TABLE align=center border=0 cellPadding=1 cellSpacing=1 class=tabla_datos> |
---|
| 60 | <!-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> |
---|
| 61 | <TR> |
---|
[043e67d] | 62 | <TH align=center> <?php echo $TbMsg[5]?> </TH> |
---|
| 63 | <?php if ($opcion==$op_eliminacion) |
---|
[b0d5fb32] | 64 | echo '<TD style="width:215px">'.$descripcion.'</TD>'; |
---|
[3ec149c] | 65 | else |
---|
[b0d5fb32] | 66 | echo '<TD><INPUT class="formulariodatos" name=descripcion style="width:215px" type=text value="'.$descripcion.'"></TD>';?> |
---|
| 67 | <TD align=left rowspan=2><IMG border=3 style="border-color:#63676b" src="../images/aula.jpg"><br><div align="center"> Images: <?php echo $imagenes?></div></TD> |
---|
[3ec149c] | 68 | </TR> |
---|
| 69 | <!-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> |
---|
| 70 | <TR> |
---|
[043e67d] | 71 | <TH align=center> <?php echo $TbMsg[6]?> </TH> |
---|
| 72 | <?php if ($opcion==$op_eliminacion) |
---|
[3ec149c] | 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> |
---|
[043e67d] | 82 | <?php |
---|
[3ec149c] | 83 | //________________________________________________________________________________________________________ |
---|
| 84 | include_once("../includes/opcionesbotonesop.php"); |
---|
| 85 | //________________________________________________________________________________________________________ |
---|
| 86 | ?> |
---|
| 87 | </BODY> |
---|
| 88 | </HTML> |
---|
[043e67d] | 89 | <?php |
---|
[3ec149c] | 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 | } |
---|
[b0d5fb32] | 126 | |
---|