[3ec149c] | 1 | // ********************************************************************************************************// Libreria de scripts de Javascript
|
---|
[3806a31] | 2 | // Autor: Jos� Manuel Alonso (E.T.S.I.I.) Universidad de Sevilla
|
---|
| 3 | // Fecha Creaci�n: 2009-2010
|
---|
| 4 | // Fecha �ltima modificaci�n: Noviembre-2005
|
---|
[3ec149c] | 5 | // Nombre del fichero:M_Iconos
|
---|
[3806a31] | 6 | // Descripci�n :
|
---|
[3ec149c] | 7 | // Este fichero implementa las funciones javascript del fichero M_Iconos.php
|
---|
| 8 | // ********************************************************************************************************
|
---|
| 9 | // Opciones
|
---|
[3806a31] | 10 | var Insertar=1;
|
---|
| 11 | var Eliminar=2;
|
---|
| 12 | var Modificar=3;
|
---|
| 13 | var Consultar=4;
|
---|
[3ec149c] | 14 |
|
---|
| 15 | // Acciones
|
---|
[3806a31] | 16 | var Sin_accion=0;
|
---|
| 17 | var Insertar_registro=1;
|
---|
| 18 | var Borrar_registro=2;
|
---|
| 19 | var Modificar_registro=3;
|
---|
| 20 | var Leer_registro=4;
|
---|
[3ec149c] | 21 |
|
---|
| 22 | var CurrentFecha=null;
|
---|
| 23 | //-------------------------------------------------------------------------------------------------------------
|
---|
| 24 | function menu(){
|
---|
[3806a31] | 25 | w=window.parent;
|
---|
[3ec149c] | 26 | w.location.href="../menu.php"
|
---|
| 27 | }
|
---|
| 28 | //-------------------------------------------------------------------------------------------------------------
|
---|
| 29 | function Editar(){
|
---|
[3806a31] | 30 | document.fdatos.opcion.value=Modificar;
|
---|
| 31 | document.fdatos.accion.value=Leer_registro;
|
---|
[3ec149c] | 32 | document.fdatos.submit()
|
---|
| 33 | }
|
---|
| 34 | //-------------------------------------------------------------------------------------------------------------
|
---|
| 35 | function Agregar() {
|
---|
[3806a31] | 36 | document.fdatos.opcion.value=Insertar;
|
---|
| 37 | document.fdatos.accion.value=Sin_accion;
|
---|
[3ec149c] | 38 | document.fdatos.submit()
|
---|
| 39 | }
|
---|
| 40 | //-------------------------------------------------------------------------------------------------------------
|
---|
| 41 | function Borrar(){
|
---|
[3806a31] | 42 | document.fdatos.opcion.value=Eliminar;
|
---|
| 43 | document.fdatos.accion.value=Leer_registro;
|
---|
[3ec149c] | 44 | document.fdatos.submit()
|
---|
| 45 | }
|
---|
| 46 | //-------------------------------------------------------------------------------------------------------------
|
---|
| 47 | function Cancelar() {
|
---|
[3806a31] | 48 | document.fdatos.opcion.value=Insertar;
|
---|
| 49 | document.fdatos.accion.value=Sin_accion;
|
---|
| 50 | document.fdatos.idicono.value=0;
|
---|
[3ec149c] | 51 | document.fdatos.submit()
|
---|
| 52 | }
|
---|
| 53 | //-------------------------------------------------------------------------------------------------------------
|
---|
| 54 | function Confirmar() {
|
---|
[3806a31] | 55 | var sw;
|
---|
| 56 | sw=parseInt(document.fdatos.opcion.value);
|
---|
[3ec149c] | 57 | switch (sw) {
|
---|
| 58 | case Insertar :
|
---|
| 59 | if (comprobar_datos()){
|
---|
[3806a31] | 60 | document.fdatos.accion.value=Insertar_registro;
|
---|
[3ec149c] | 61 | document.fdatos.submit()
|
---|
| 62 | }
|
---|
[3806a31] | 63 | break;
|
---|
[3ec149c] | 64 | case Eliminar :
|
---|
[3806a31] | 65 | document.fdatos.accion.value=Borrar_registro;
|
---|
| 66 | document.fdatos.submit();
|
---|
| 67 | break;
|
---|
[3ec149c] | 68 | case Modificar :
|
---|
| 69 | if (comprobar_datos()){
|
---|
[3806a31] | 70 | document.fdatos.accion.value=Modificar_registro;
|
---|
[3ec149c] | 71 | document.fdatos.submit()
|
---|
| 72 | }
|
---|
| 73 | break
|
---|
| 74 | }
|
---|
| 75 | }
|
---|
| 76 | //----------------------------------------------------------------------------------------------
|
---|
| 77 | function comprobar_datos(){
|
---|
[3806a31] | 78 |
|
---|
| 79 | if (document.fdatos.descripcion.value==""){
|
---|
| 80 | alert(TbMsg["DESCRIP"]);
|
---|
| 81 | document.forms.fdatos.descripcion.focus();
|
---|
| 82 | return(false)
|
---|
[3ec149c] | 83 | }
|
---|
| 84 | return(true)
|
---|
| 85 | }
|
---|