parroquia 1.1.13 → 1.1.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. checksums.yaml +4 -4
  2. data/lib/parroquia/catecismo/actualizar_alumno.rb +181 -0
  3. data/lib/parroquia/catecismo/alumno.rb +179 -0
  4. data/lib/parroquia/catecismo/catecismo.rb +119 -0
  5. data/lib/parroquia/catecismo/consulta.rb +177 -0
  6. data/lib/parroquia/catecismo/resultado.rb +230 -0
  7. data/lib/parroquia/main.rb +82 -91
  8. data/lib/parroquia/sacramentos/actualizar_bautismo.rb +313 -0
  9. data/lib/parroquia/sacramentos/actualizar_certificado_prebautismal.rb +184 -0
  10. data/lib/parroquia/sacramentos/actualizar_comunion.rb +239 -0
  11. data/lib/parroquia/sacramentos/actualizar_confirmacion.rb +239 -0
  12. data/lib/parroquia/sacramentos/actualizar_matrimonio.rb +298 -0
  13. data/lib/parroquia/sacramentos/actualizar_misa.rb +170 -0
  14. data/lib/parroquia/sacramentos/actualizar_permiso_prebautismal.rb +200 -0
  15. data/lib/parroquia/sacramentos/actualizar_permiso_prematrimonial.rb +205 -0
  16. data/lib/parroquia/sacramentos/actualizar_supletoria.rb +313 -0
  17. data/lib/parroquia/sacramentos/bautizo.rb +310 -0
  18. data/lib/parroquia/sacramentos/certificado_prebautismal.rb +195 -0
  19. data/lib/parroquia/sacramentos/comunion.rb +234 -0
  20. data/lib/parroquia/sacramentos/confirmacion.rb +239 -0
  21. data/lib/parroquia/sacramentos/consultas.rb +162 -0
  22. data/lib/parroquia/sacramentos/matrimonio.rb +297 -0
  23. data/lib/parroquia/sacramentos/misa.rb +171 -0
  24. data/lib/parroquia/sacramentos/permiso_bautismo.rb +207 -0
  25. data/lib/parroquia/sacramentos/permiso_prematrimonial.rb +219 -0
  26. data/lib/parroquia/sacramentos/resultados.rb +931 -0
  27. data/lib/parroquia/sacramentos/sacramentos.rb +182 -0
  28. data/lib/parroquia/sacramentos/supletoria.rb +309 -0
  29. metadata +30 -11
  30. data/lib/parroquia/actualizar_bautismo.rb +0 -245
  31. data/lib/parroquia/actualizar_confirmacion.rb +0 -194
  32. data/lib/parroquia/actualizar_matrimonio.rb +0 -235
  33. data/lib/parroquia/bautizo.rb +0 -239
  34. data/lib/parroquia/confirmacion.rb +0 -191
  35. data/lib/parroquia/consultas.rb +0 -144
  36. data/lib/parroquia/matrimonio.rb +0 -232
  37. data/lib/parroquia/resultados.rb +0 -414
@@ -0,0 +1,182 @@
1
+ require 'pg'
2
+ require 'fox16'
3
+ include Fox
4
+
5
+ class Sacramentos < FXMainWindow
6
+ def initialize(app)
7
+ super(app, 'Parroquia San Judas Tadeo', width: 800, height: 500)
8
+ @app = app
9
+ self.backColor = FXRGB(3, 187, 133)
10
+
11
+ # Font
12
+ @font = FXFont.new(app, 'Geneva', 12, FONTWEIGHT_BOLD)
13
+
14
+ # Inserar imagen del logo
15
+ @image = File.join(File.dirname(__FILE__), '../assets/images/Logo-SJT.png')
16
+ @image = File.open(@image, 'rb')
17
+ @image = FXPNGIcon.new(app, @image.read)
18
+ @logo = FXImageFrame.new(self, @image, opts: LAYOUT_EXPLICIT | LAYOUT_CENTER_X | LAYOUT_CENTER_Y, width: 400,
19
+ height: 250, x: 10, y: 100)
20
+ # Color de fondo de image frame es el mismo que el de la ventana
21
+ @logo.backColor = FXRGB(3, 187, 133)
22
+ # Escalar imagen
23
+ @image.scale(400, 250)
24
+
25
+ # Title
26
+ @lbltitle = FXLabel.new(self, 'Bienvenido a la Parroquia San Judas Tadeo',
27
+ opts: LAYOUT_EXPLICIT | JUSTIFY_CENTER_X, width: 700, height: 20, x: 0, y: 20)
28
+ @lbltitle.font = FXFont.new(app, 'Geneva', 16, FONTWEIGHT_BOLD)
29
+ @lbltitle.backColor = FXRGB(3, 187, 133)
30
+ # Subtitle
31
+ @lblsubtitle = FXLabel.new(self, 'ARQUIDIOSESIS DE QUITO - SERVICIO PARROQUIAL DE SAN JUDAS TADEO',
32
+ opts: LAYOUT_EXPLICIT | JUSTIFY_CENTER_X, width: 700, height: 20, x: 0, y: 40)
33
+ @lblsubtitle.font = FXFont.new(app, 'Geneva', 10, FONTWEIGHT_BOLD)
34
+ @lblsubtitle.backColor = FXRGB(3, 187, 133)
35
+ # Date
36
+ @date = Time.now.strftime('%d/%m/%Y')
37
+ @lbldate = FXLabel.new(self, "Fecha: #{cambiar_formato_fecha(@date)}", opts: LAYOUT_EXPLICIT | JUSTIFY_RIGHT,
38
+ width: 700, height: 20, x: 0, y: 60, padRight: 20)
39
+ @lbldate.font = FXFont.new(app, 'Geneva', 12, FONTWEIGHT_BOLD)
40
+ @lbldate.backColor = FXRGB(3, 187, 133)
41
+
42
+ # section lista
43
+ @btnbautizo = FXButton.new(self, 'Ingresar Bautismo', opts: LAYOUT_EXPLICIT | BUTTON_NORMAL, width: 150,
44
+ height: 30, x: 460, y: 150)
45
+ @btncomunion = FXButton.new(self, 'Ingresar Comunión', opts: LAYOUT_EXPLICIT | BUTTON_NORMAL, width: 150,
46
+ height: 30, x: 460, y: 190)
47
+ @btnconfirmacion = FXButton.new(self, 'Ingresar Confirmación', opts: LAYOUT_EXPLICIT | BUTTON_NORMAL,
48
+ width: 150, height: 30, x: 460, y: 230)
49
+ @btnmatrimonio = FXButton.new(self, 'Ingresar Matrimonio', opts: LAYOUT_EXPLICIT | BUTTON_NORMAL, width: 150,
50
+ height: 30, x: 460, y: 270)
51
+ @btnconsulta = FXButton.new(self, 'Consultar', opts: LAYOUT_EXPLICIT | BUTTON_NORMAL, width: 150, height: 30,
52
+ x: 460, y: 310)
53
+ @btnsupletoria = FXButton.new(self, 'Partida Supletoria', opts: LAYOUT_EXPLICIT | BUTTON_NORMAL, width: 150,
54
+ height: 30, x: 620, y: 150)
55
+ @btnprebautismal = FXButton.new(self, 'Certificado Prebautismal', opts: LAYOUT_EXPLICIT | BUTTON_NORMAL,
56
+ width: 150, height: 30, x: 620, y: 190)
57
+ @btnpermisobautizo = FXButton.new(self, 'Permiso de Bautismo', opts: LAYOUT_EXPLICIT | BUTTON_NORMAL,
58
+ width: 150, height: 30, x: 620, y: 230)
59
+ @btnprematrimonial = FXButton.new(self, 'Permiso Prematrimonial', opts: LAYOUT_EXPLICIT | BUTTON_NORMAL,
60
+ width: 150, height: 30, x: 620, y: 270)
61
+ @btnmisa = FXButton.new(self, 'Misa', opts: LAYOUT_EXPLICIT | BUTTON_NORMAL, width: 150, height: 30,
62
+ x: 620, y: 310)
63
+ # Footer
64
+ @lblfooter = FXLabel.new(self, 'WebMinds Studio - 2023', opts: LAYOUT_EXPLICIT | JUSTIFY_CENTER_X, width: 700,
65
+ height: 20, x: 0, y: 400)
66
+ @lblfooter.font = FXFont.new(app, 'Geneva', 10)
67
+ @lblfooter.backColor = FXRGB(3, 187, 133)
68
+ @lblauthor = FXLabel.new(self, 'Desarrollado por Ing. Francisco J. Borja L.',
69
+ opts: LAYOUT_EXPLICIT | JUSTIFY_CENTER_X, width: 700, height: 20, x: 0, y: 420)
70
+ @lblauthor.font = FXFont.new(app, 'Geneva', 10)
71
+ @lblauthor.backColor = FXRGB(3, 187, 133)
72
+ @lblweb = FXLabel.new(self, 'www.webmindsstudio.com', opts: LAYOUT_EXPLICIT | JUSTIFY_CENTER_X, width: 700,
73
+ height: 20, x: 0, y: 440)
74
+ @lblweb.font = FXFont.new(app, 'Geneva', 10)
75
+ @lblweb.backColor = FXRGB(3, 187, 133)
76
+ @lbllicence = FXLabel.new(self, 'MIT License', opts: LAYOUT_EXPLICIT | JUSTIFY_CENTER_X, width: 700,
77
+ height: 20, x: 0, y: 460)
78
+ @lbllicence.font = FXFont.new(app, 'Geneva', 10)
79
+ @lbllicence.backColor = FXRGB(3, 187, 133)
80
+ # section buttons executions
81
+ @btnbautizo.connect(SEL_COMMAND) do
82
+ require_relative 'bautizo'
83
+ vtnbautizo = Bautizo.new(@app)
84
+ vtnbautizo.create
85
+ vtnbautizo.show(PLACEMENT_SCREEN)
86
+ end
87
+ @btncomunion.connect(SEL_COMMAND) do
88
+ require_relative 'comunion'
89
+ vtncomunion = Comunion.new(@app)
90
+ vtncomunion.create
91
+ vtncomunion.show(PLACEMENT_SCREEN)
92
+ end
93
+ @btnconfirmacion.connect(SEL_COMMAND) do
94
+ require_relative 'confirmacion'
95
+ vtnconfirmacion = Confirmacion.new(@app)
96
+ vtnconfirmacion.create
97
+ vtnconfirmacion.show(PLACEMENT_SCREEN)
98
+ end
99
+ @btnmatrimonio.connect(SEL_COMMAND) do
100
+ require_relative 'matrimonio'
101
+ vtnmatrimonio = Matrimonio.new(@app)
102
+ vtnmatrimonio.create
103
+ vtnmatrimonio.show(PLACEMENT_SCREEN)
104
+ end
105
+ @btnconsulta.connect(SEL_COMMAND) do
106
+ require_relative 'consultas'
107
+ vtnconsulta = Consulta.new(@app)
108
+ vtnconsulta.create
109
+ vtnconsulta.show(PLACEMENT_SCREEN)
110
+ end
111
+ @btnsupletoria.connect(SEL_COMMAND) do
112
+ require_relative 'supletoria'
113
+ vtnsupletoria = Supletoria.new(@app)
114
+ vtnsupletoria.create
115
+ vtnsupletoria.show(PLACEMENT_SCREEN)
116
+ end
117
+ @btnprebautismal.connect(SEL_COMMAND) do
118
+ require_relative 'certificado_prebautismal'
119
+ vtnprebautismal = PreBautismal.new(@app)
120
+ vtnprebautismal.create
121
+ vtnprebautismal.show(PLACEMENT_SCREEN)
122
+ end
123
+ @btnpermisobautizo.connect(SEL_COMMAND) do
124
+ require_relative 'permiso_bautismo'
125
+ vtnpermisobautizo = PermisoBautizo.new(@app)
126
+ vtnpermisobautizo.create
127
+ vtnpermisobautizo.show(PLACEMENT_SCREEN)
128
+ end
129
+ @btnprematrimonial.connect(SEL_COMMAND) do
130
+ require_relative 'permiso_prematrimonial'
131
+ vtnprematrimonial = PermisoMatrimonio.new(@app)
132
+ vtnprematrimonial.create
133
+ vtnprematrimonial.show(PLACEMENT_SCREEN)
134
+ end
135
+ @btnmisa.connect(SEL_COMMAND) do
136
+ require_relative 'misa'
137
+ vtnmisa = Misa.new(@app)
138
+ vtnmisa.create
139
+ vtnmisa.show(PLACEMENT_SCREEN)
140
+ end
141
+ end
142
+
143
+ # Nombre del mes
144
+ def nombre_mes(mes)
145
+ meses = {
146
+ '01' => 'enero',
147
+ '02' => 'febrero',
148
+ '03' => 'marzo',
149
+ '04' => 'abril',
150
+ '05' => 'mayo',
151
+ '06' => 'junio',
152
+ '07' => 'julio',
153
+ '08' => 'agosto',
154
+ '09' => 'septiembre',
155
+ '10' => 'octubre',
156
+ '11' => 'noviembre',
157
+ '12' => 'diciembre'
158
+ }
159
+ meses[mes]
160
+ end
161
+
162
+ # Cambiar el formato de la fecha de YYYY-MM-DD a DD de nombre_mes de YYYY
163
+ def cambiar_formato_fecha(fecha)
164
+ # split "-" or "/"
165
+ fecha = fecha.split(%r{-|/})
166
+ # si el formato de fecha es YYYY-MM-DD o YYYY/MM/DD, sino si es DD-MM-YYYY o DD/MM/YYYY
167
+ if fecha[0].length == 4
168
+ "#{fecha[2]} de #{nombre_mes(fecha[1])} de #{fecha[0]}"
169
+ else
170
+ "#{fecha[0]} de #{nombre_mes(fecha[1])} de #{fecha[2]}"
171
+ end
172
+ end
173
+
174
+ def create
175
+ super
176
+ show(PLACEMENT_SCREEN)
177
+ end
178
+ end
179
+
180
+ $conn = PG.connect(host: 'localhost', port: '5432', dbname: 'sacramentos', user: 'postgres', password: 'postgres')
181
+ # Comprobar conexión con la base de datos
182
+ exit if $conn.status != PG::CONNECTION_OK
@@ -0,0 +1,309 @@
1
+ require 'fox16'
2
+ include Fox
3
+
4
+ class Supletoria < FXMainWindow
5
+ def initialize(app)
6
+ super(app, 'Parroquia San Judas Tadeo', width: 1050, height: 600)
7
+ self.backColor = FXRGB(3, 187, 133)
8
+ # create label
9
+ # Title
10
+ @lbltitle = FXLabel.new(self, 'Bienvenido a la Parroquia San Judas Tadeo',
11
+ opts: LAYOUT_EXPLICIT | JUSTIFY_CENTER_X, width: 1050, height: 20, x: 0, y: 20)
12
+ @lbltitle.font = FXFont.new(app, 'Geneva', 16, FONTWEIGHT_BOLD)
13
+ @lbltitle.backColor = FXRGB(3, 187, 133)
14
+ # Subtitle
15
+ @lblsubtitle = FXLabel.new(self, 'ARQUIDIOSESIS DE QUITO - SERVICIO PARROQUIAL DE SAN JUDAS TADEO',
16
+ opts: LAYOUT_EXPLICIT | JUSTIFY_CENTER_X, width: 1050, height: 20, x: 0, y: 40)
17
+ @lblsubtitle.font = FXFont.new(app, 'Geneva', 10, FONTWEIGHT_BOLD)
18
+ @lblsubtitle.backColor = FXRGB(3, 187, 133)
19
+ # Date
20
+ @date = Time.now.strftime('%d/%m/%Y')
21
+ @lbldate = FXLabel.new(self, "Fecha: #{cambiar_formato_fecha(@date)}", opts: LAYOUT_EXPLICIT | JUSTIFY_RIGHT,
22
+ width: 1050, height: 20, x: 0, y: 60, padRight: 20)
23
+ @lbldate.font = FXFont.new(app, 'Geneva', 12, FONTWEIGHT_BOLD)
24
+ @lbldate.backColor = FXRGB(3, 187, 133)
25
+ # section libros
26
+ @lbl_tomo = FXLabel.new(self, 'Tomo', opts: LAYOUT_EXPLICIT, width: 50, height: 20, x: 50, y: 100)
27
+ @lbl_tomo.backColor = FXRGB(3, 187, 133)
28
+ @input_tomo = FXTextField.new(self, 10, opts: LAYOUT_EXPLICIT, width: 50, height: 20, x: 110, y: 100)
29
+ @lbl_page = FXLabel.new(self, 'Pagina', opts: LAYOUT_EXPLICIT, width: 50, height: 20, x: 170, y: 100)
30
+ @lbl_page.backColor = FXRGB(3, 187, 133)
31
+ @input_page = FXTextField.new(self, 10, opts: LAYOUT_EXPLICIT, width: 50, height: 20, x: 230, y: 100)
32
+ @lbl_number = FXLabel.new(self, 'Numero', opts: LAYOUT_EXPLICIT, width: 50, height: 20, x: 290,
33
+ y: 100)
34
+ @lbl_number.backColor = FXRGB(3, 187, 133)
35
+ @input_number = FXTextField.new(self, 10, opts: LAYOUT_EXPLICIT, width: 50, height: 20, x: 350,
36
+ y: 100)
37
+
38
+ # section datos
39
+ @lbl_fecha = FXLabel.new(self, 'Fecha de bautismo (AAAA/MM/DD): ', opts: LAYOUT_EXPLICIT, width: 250,
40
+ height: 20, x: 10, y: 150)
41
+ @lbl_fecha.backColor = FXRGB(3, 187, 133)
42
+ @input_fecha = FXTextField.new(self, 10, opts: LAYOUT_EXPLICIT, width: 150, height: 20, x: 340,
43
+ y: 150)
44
+ @lbl_sacramento = FXLabel.new(self, 'Sacramento: ', opts: LAYOUT_EXPLICIT, width: 150, height: 20,
45
+ x: 680, y: 150)
46
+ @lbl_sacramento.backColor = FXRGB(3, 187, 133)
47
+ @input_sacramento = FXTextField.new(self, 10, opts: LAYOUT_EXPLICIT, width: 150, height: 20, x: 850,
48
+ y: 150)
49
+ @input_sacramento.text = 'Partida Supletoria del Bautismo'
50
+ @input_sacramento.disable
51
+ @lbl_parroquia = FXLabel.new(self, 'Iglesia parroquial: ', opts: LAYOUT_EXPLICIT, width: 150, height: 20,
52
+ x: 10, y: 180)
53
+ @lbl_parroquia.backColor = FXRGB(3, 187, 133)
54
+ @input_parroquia = FXTextField.new(self, 10, opts: LAYOUT_EXPLICIT, width: 150, height: 20, x: 170,
55
+ y: 180)
56
+ @input_parroquia.text = 'San Judas Tadeo'
57
+ @input_parroquia.disable
58
+ @lbl_sector = FXLabel.new(self, 'Sector: ', opts: LAYOUT_EXPLICIT, width: 150, height: 20, x: 340,
59
+ y: 180)
60
+ @lbl_sector.backColor = FXRGB(3, 187, 133)
61
+ @input_sector = FXTextField.new(self, 10, opts: LAYOUT_EXPLICIT, width: 150, height: 20, x: 510,
62
+ y: 180)
63
+ @input_sector.text = 'Jaime Roldós'
64
+ @lbl_parroco = FXLabel.new(self, 'Parroco: ', opts: LAYOUT_EXPLICIT, width: 150, height: 20, x: 680,
65
+ y: 180)
66
+ @lbl_parroco.backColor = FXRGB(3, 187, 133)
67
+ @input_parroco = FXTextField.new(self, 10, opts: LAYOUT_EXPLICIT, width: 150, height: 20, x: 850,
68
+ y: 180)
69
+ @lbl_ministro = FXLabel.new(self, 'Ministro: ', opts: LAYOUT_EXPLICIT, width: 150, height: 20, x: 10,
70
+ y: 210)
71
+ @lbl_ministro.backColor = FXRGB(3, 187, 133)
72
+ @input_ministro = FXTextField.new(self, 10, opts: LAYOUT_EXPLICIT, width: 150, height: 20, x: 170,
73
+ y: 210)
74
+ @lbl_name = FXLabel.new(self, 'Nombres: ', opts: LAYOUT_EXPLICIT, width: 150, height: 20, x: 10,
75
+ y: 240)
76
+ @lbl_name.backColor = FXRGB(3, 187, 133)
77
+ @input_name = FXTextField.new(self, 10, opts: LAYOUT_EXPLICIT, width: 150, height: 20, x: 170,
78
+ y: 240)
79
+ @lbl_apellidos = FXLabel.new(self, 'Apellidos: ', opts: LAYOUT_EXPLICIT, width: 150, height: 20,
80
+ x: 340, y: 240)
81
+ @lbl_apellidos.backColor = FXRGB(3, 187, 133)
82
+ @input_apellidos = FXTextField.new(self, 10, opts: LAYOUT_EXPLICIT, width: 150, height: 20, x: 510,
83
+ y: 240)
84
+ @lbl_cedula = FXLabel.new(self, 'Cédula: ', opts: LAYOUT_EXPLICIT, width: 150, height: 20, x: 10,
85
+ y: 270)
86
+ @lbl_cedula.backColor = FXRGB(3, 187, 133)
87
+ @input_cedula = FXTextField.new(self, 10, opts: LAYOUT_EXPLICIT, width: 150, height: 20, x: 170,
88
+ y: 270)
89
+ @lbl_lugar_nacimiento = FXLabel.new(self, 'Lugar de nacimiento: ', opts: LAYOUT_EXPLICIT, width: 150,
90
+ height: 20, x: 10, y: 300)
91
+ @lbl_lugar_nacimiento.backColor = FXRGB(3, 187, 133)
92
+ @input_lugar_nacimiento = FXTextField.new(self, 10, opts: LAYOUT_EXPLICIT, width: 150, height: 20,
93
+ x: 170, y: 300)
94
+ @lbl_fecha_nacimiento = FXLabel.new(self, 'Fecha de nacimiento (AAAA/MM/DD): ', opts: LAYOUT_EXPLICIT,
95
+ width: 250, height: 20, x: 340, y: 300)
96
+ @lbl_fecha_nacimiento.backColor = FXRGB(3, 187, 133)
97
+ @input_fecha_nacimiento = FXTextField.new(self, 10, opts: LAYOUT_EXPLICIT, width: 150, height: 20,
98
+ x: 590, y: 300)
99
+ @lbl_padre = FXLabel.new(self, 'Padre: ', opts: LAYOUT_EXPLICIT, width: 150, height: 20, x: 10,
100
+ y: 330)
101
+ @lbl_padre.backColor = FXRGB(3, 187, 133)
102
+ @input_padre = FXTextField.new(self, 10, opts: LAYOUT_EXPLICIT, width: 150, height: 20, x: 170,
103
+ y: 330)
104
+ @lbl_madre = FXLabel.new(self, 'Madre: ', opts: LAYOUT_EXPLICIT, width: 150, height: 20, x: 340,
105
+ y: 330)
106
+ @lbl_madre.backColor = FXRGB(3, 187, 133)
107
+ @input_madre = FXTextField.new(self, 10, opts: LAYOUT_EXPLICIT, width: 150, height: 20, x: 510,
108
+ y: 330)
109
+ @lbl_padrino = FXLabel.new(self, 'Padrino: ', opts: LAYOUT_EXPLICIT, width: 150, height: 20, x: 10,
110
+ y: 360)
111
+ @lbl_padrino.backColor = FXRGB(3, 187, 133)
112
+ @input_padrino = FXTextField.new(self, 10, opts: LAYOUT_EXPLICIT, width: 150, height: 20, x: 170,
113
+ y: 360)
114
+ @lbl_madrina = FXLabel.new(self, 'Madrina: ', opts: LAYOUT_EXPLICIT, width: 150, height: 20, x: 340,
115
+ y: 360)
116
+ @lbl_madrina.backColor = FXRGB(3, 187, 133)
117
+ @input_madrina = FXTextField.new(self, 10, opts: LAYOUT_EXPLICIT, width: 150, height: 20, x: 510,
118
+ y: 360)
119
+ @lbl_certifica = FXLabel.new(self, 'Certifica: ', opts: LAYOUT_EXPLICIT, width: 150, height: 20, x: 10,
120
+ y: 390)
121
+ @lbl_certifica.backColor = FXRGB(3, 187, 133)
122
+ @input_certifica = FXTextField.new(self, 10, opts: LAYOUT_EXPLICIT, width: 150, height: 20, x: 170,
123
+ y: 390)
124
+
125
+ # section registro civil
126
+ @lbl_reg_civ = FXLabel.new(self,
127
+ '------------------------------------ REGISTRO CIVIL ------------------------------------', opts: LAYOUT_EXPLICIT | JUSTIFY_CENTER_X, width: 1050, height: 20, x: 10, y: 420)
128
+ @lbl_reg_civ.backColor = FXRGB(3, 187, 133)
129
+ @lbl_provincia_rc = FXLabel.new(self, 'Provincia: ', opts: LAYOUT_EXPLICIT, width: 150, height: 20,
130
+ x: 10, y: 450)
131
+ @lbl_provincia_rc.backColor = FXRGB(3, 187, 133)
132
+ @input_provincia_rc = FXTextField.new(self, 10, opts: LAYOUT_EXPLICIT, width: 150, height: 20, x: 170,
133
+ y: 450)
134
+ @lbl_canton_rc = FXLabel.new(self, 'Cantón: ', opts: LAYOUT_EXPLICIT, width: 150, height: 20, x: 340,
135
+ y: 450)
136
+ @lbl_canton_rc.backColor = FXRGB(3, 187, 133)
137
+ @input_canton_rc = FXTextField.new(self, 10, opts: LAYOUT_EXPLICIT, width: 150, height: 20, x: 510,
138
+ y: 450)
139
+ @lbl_parroquia_rc = FXLabel.new(self, 'Parroquia: ', opts: LAYOUT_EXPLICIT, width: 150, height: 20,
140
+ x: 680, y: 450)
141
+ @lbl_parroquia_rc.backColor = FXRGB(3, 187, 133)
142
+ @input_parroquia_rc = FXTextField.new(self, 10, opts: LAYOUT_EXPLICIT, width: 150, height: 20, x: 850,
143
+ y: 450)
144
+ @lbl_anio_rc = FXLabel.new(self, 'Año: ', opts: LAYOUT_EXPLICIT, width: 50, height: 20, x: 50,
145
+ y: 480)
146
+ @lbl_anio_rc.backColor = FXRGB(3, 187, 133)
147
+ @input_anio_rc = FXTextField.new(self, 10, opts: LAYOUT_EXPLICIT, width: 50, height: 20, x: 110,
148
+ y: 480)
149
+ @lbl_tomo_rc = FXLabel.new(self, 'Tomo: ', opts: LAYOUT_EXPLICIT, width: 50, height: 20, x: 170,
150
+ y: 480)
151
+ @lbl_tomo_rc.backColor = FXRGB(3, 187, 133)
152
+ @input_tomo_rc = FXTextField.new(self, 10, opts: LAYOUT_EXPLICIT, width: 50, height: 20, x: 230,
153
+ y: 480)
154
+ @lbl_pag_rc = FXLabel.new(self, 'Página: ', opts: LAYOUT_EXPLICIT, width: 50, height: 20, x: 290,
155
+ y: 480)
156
+ @lbl_pag_rc.backColor = FXRGB(3, 187, 133)
157
+ @input_pag_rc = FXTextField.new(self, 10, opts: LAYOUT_EXPLICIT, width: 50, height: 20, x: 350,
158
+ y: 480)
159
+ @lbl_acta_rc = FXLabel.new(self, 'Acta: ', opts: LAYOUT_EXPLICIT, width: 50, height: 20, x: 410,
160
+ y: 480)
161
+ @lbl_acta_rc.backColor = FXRGB(3, 187, 133)
162
+ @input_acta_rc = FXTextField.new(self, 10, opts: LAYOUT_EXPLICIT, width: 50, height: 20, x: 470,
163
+ y: 480)
164
+ @lbl_date_rc = FXLabel.new(self, 'Fecha (AAAA/MM/DD): ', opts: LAYOUT_EXPLICIT, width: 150, height: 20,
165
+ x: 10, y: 510)
166
+ @lbl_date_rc.backColor = FXRGB(3, 187, 133)
167
+ @input_date_rc = FXTextField.new(self, 10, opts: LAYOUT_EXPLICIT, width: 150, height: 20, x: 170,
168
+ y: 510)
169
+
170
+
171
+ # create buttons
172
+ @btnsave = FXButton.new(self, 'Guardar', opts: LAYOUT_EXPLICIT | BUTTON_NORMAL, width: 100, height: 30,
173
+ x: 790, y: 540)
174
+ @btncancel = FXButton.new(self, 'Cancelar', opts: LAYOUT_EXPLICIT | BUTTON_NORMAL, width: 100, height: 30,
175
+ x: 900, y: 540)
176
+
177
+ # connect buttons
178
+ @btnsave.connect(SEL_COMMAND) do
179
+ tomo = @input_tomo.text
180
+ page = @input_page.text
181
+ number = @input_number.text
182
+ fecha = @input_fecha.text
183
+ sacramento = @input_sacramento.text
184
+ parroquia = @input_parroquia.text
185
+ sector = @input_sector.text
186
+ parroco = @input_parroco.text
187
+ ministro = @input_ministro.text
188
+ name = @input_name.text
189
+ apellidos = @input_apellidos.text
190
+ lugar_nacimiento = @input_lugar_nacimiento.text
191
+ fecha_nacimiento = @input_fecha_nacimiento.text
192
+ cedula = @input_cedula.text.empty? ? nil : @input_cedula.text
193
+ padrino = @input_padrino.text.empty? ? nil : @input_padrino.text
194
+ madrina = @input_madrina.text.empty? ? nil : @input_madrina.text
195
+ padre = @input_padre.text.empty? ? nil : @input_padre.text
196
+ madre = @input_madre.text.empty? ? nil : @input_madre.text
197
+ certifica = @input_certifica.text
198
+ provincia_rc = @input_provincia_rc.text
199
+ canton_rc = @input_canton_rc.text
200
+ parroquia_rc = @input_parroquia_rc.text
201
+ anio_rc = @input_anio_rc.text
202
+ tomo_rc = @input_tomo_rc.text
203
+ pag_rc = @input_pag_rc.text
204
+ acta_rc = @input_acta_rc.text
205
+ date_rc = @input_date_rc.text
206
+
207
+ # tables
208
+ # tabla libros (id, tomo, pagina, numero)
209
+ # tabla creyentes (id, nombres, apellidos, lugar_nacimiento, fecha_nacimiento, cedula)
210
+ # tabla parroquias (id, nombre, sector, parroco)
211
+ # tabla sacramentos (id, nombre, fecha, celebrante, certifica, padrino, madrina, testigo_novio, testigo_novia, padre, madre, nombres_novia, apellidos_novia, cedula_novia, fk_creyentes, fk_parroquias, fk_registros_civiles, fk_libros)
212
+ # tabla registros_civiles (id, provincia_rc, canton_rc, parroquia_rc, anio_rc, tomo_rc, pagina_rc, acta_rc, fecha_rc)
213
+ # Iniciar una transacción
214
+ $conn.transaction do
215
+ $conn.exec('INSERT INTO libros (tomo, pagina, numero) VALUES ($1, $2, $3)', [tomo, page, number])
216
+ $conn.exec(
217
+ 'INSERT INTO creyentes (nombres, apellidos, lugar_nacimiento, fecha_nacimiento, cedula) VALUES ($1, $2, $3, $4, $5)', [
218
+ name, apellidos, lugar_nacimiento, fecha_nacimiento, cedula
219
+ ]
220
+ )
221
+ $conn.exec('INSERT INTO parroquias (parroquia, sector, parroco) VALUES ($1, $2, $3)',
222
+ [parroquia, sector, parroco])
223
+ $conn.exec(
224
+ 'INSERT INTO registros_civiles (provincia_rc, canton_rc, parroquia_rc, anio_rc, tomo_rc, pagina_rc, acta_rc, fecha_rc) VALUES ($1, $2, $3, $4, $5, $6, $7, $8)', [
225
+ provincia_rc, canton_rc, parroquia_rc, anio_rc, tomo_rc, pag_rc, acta_rc, date_rc
226
+ ]
227
+ )
228
+ # Insertar en la tabla misas
229
+ @registro_misas = $conn.exec('INSERT INTO misas (intencion, fecha, hora) VALUES ($1, $2, $3)', [nil, nil, nil])
230
+ $conn.exec(
231
+ 'INSERT INTO sacramentos (sacramento, fecha, celebrante, certifica, padrino, madrina, padre, madre) VALUES ($1, $2, $3, $4, $5, $6, $7, $8)', [
232
+ sacramento, fecha, ministro, certifica, padrino, madrina, padre, madre
233
+ ]
234
+ )
235
+ # Confirmar la transacción
236
+ $conn.exec('COMMIT')
237
+ FXMessageBox.information(self, MBOX_OK, 'Información', 'Datos guardados correctamente')
238
+ clear_input_fields
239
+ end
240
+ end
241
+
242
+ @btncancel.connect(SEL_COMMAND) do
243
+ clear_input_fields
244
+ end
245
+
246
+ def clear_input_fields
247
+ @input_tomo.text = ''
248
+ @input_page.text = ''
249
+ @input_number.text = ''
250
+ @input_fecha.text = ''
251
+ @input_parroco.text = ''
252
+ @input_ministro.text = ''
253
+ @input_name.text = ''
254
+ @input_apellidos.text = ''
255
+ @input_lugar_nacimiento.text = ''
256
+ @input_fecha_nacimiento.text = ''
257
+ @input_cedula.text = ''
258
+ @input_padrino.text = ''
259
+ @input_madrina.text = ''
260
+ @input_padre.text = ''
261
+ @input_madre.text = ''
262
+ @input_certifica.text = ''
263
+ @input_provincia_rc.text = ''
264
+ @input_canton_rc.text = ''
265
+ @input_parroquia_rc.text = ''
266
+ @input_anio_rc.text = ''
267
+ @input_tomo_rc.text = ''
268
+ @input_pag_rc.text = ''
269
+ @input_acta_rc.text = ''
270
+ @input_date_rc.text = ''
271
+ end
272
+ end
273
+
274
+ # Nombre del mes
275
+ def nombre_mes(mes)
276
+ meses = {
277
+ '01' => 'enero',
278
+ '02' => 'febrero',
279
+ '03' => 'marzo',
280
+ '04' => 'abril',
281
+ '05' => 'mayo',
282
+ '06' => 'junio',
283
+ '07' => 'julio',
284
+ '08' => 'agosto',
285
+ '09' => 'septiembre',
286
+ '10' => 'octubre',
287
+ '11' => 'noviembre',
288
+ '12' => 'diciembre'
289
+ }
290
+ meses[mes]
291
+ end
292
+
293
+ # Cambiar el formato de la fecha de YYYY-MM-DD a DD de nombre_mes de YYYY
294
+ def cambiar_formato_fecha(fecha)
295
+ # split "-" or "/"
296
+ fecha = fecha.split(%r{-|/})
297
+ # si el formato de fecha es YYYY-MM-DD o YYYY/MM/DD, sino si es DD-MM-YYYY o DD/MM/YYYY
298
+ if fecha[0].length == 4
299
+ "#{fecha[2]} de #{nombre_mes(fecha[1])} de #{fecha[0]}"
300
+ else
301
+ "#{fecha[0]} de #{nombre_mes(fecha[1])} de #{fecha[2]}"
302
+ end
303
+ end
304
+
305
+ def create
306
+ super
307
+ show(PLACEMENT_SCREEN)
308
+ end
309
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: parroquia
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.13
4
+ version: 1.1.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - Francisco Javier Borja Lobato
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-10-20 00:00:00.000000000 Z
11
+ date: 2023-11-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fxruby
@@ -78,24 +78,43 @@ extensions: []
78
78
  extra_rdoc_files: []
79
79
  files:
80
80
  - bin/parroquia
81
- - lib/parroquia/actualizar_bautismo.rb
82
- - lib/parroquia/actualizar_confirmacion.rb
83
- - lib/parroquia/actualizar_matrimonio.rb
84
81
  - lib/parroquia/assets/images/Logo-SJT.png
85
82
  - lib/parroquia/assets/images/San_Judas_Tadeo.png
86
83
  - lib/parroquia/assets/images/arquidiocesisquito.png
87
84
  - lib/parroquia/assets/images/sanjudastadeo.png
88
85
  - lib/parroquia/assets/images/schema.png
89
- - lib/parroquia/bautizo.rb
90
- - lib/parroquia/confirmacion.rb
91
- - lib/parroquia/consultas.rb
86
+ - lib/parroquia/catecismo/actualizar_alumno.rb
87
+ - lib/parroquia/catecismo/alumno.rb
88
+ - lib/parroquia/catecismo/catecismo.rb
89
+ - lib/parroquia/catecismo/consulta.rb
90
+ - lib/parroquia/catecismo/resultado.rb
92
91
  - lib/parroquia/main.rb
93
- - lib/parroquia/matrimonio.rb
94
- - lib/parroquia/resultados.rb
92
+ - lib/parroquia/sacramentos/actualizar_bautismo.rb
93
+ - lib/parroquia/sacramentos/actualizar_certificado_prebautismal.rb
94
+ - lib/parroquia/sacramentos/actualizar_comunion.rb
95
+ - lib/parroquia/sacramentos/actualizar_confirmacion.rb
96
+ - lib/parroquia/sacramentos/actualizar_matrimonio.rb
97
+ - lib/parroquia/sacramentos/actualizar_misa.rb
98
+ - lib/parroquia/sacramentos/actualizar_permiso_prebautismal.rb
99
+ - lib/parroquia/sacramentos/actualizar_permiso_prematrimonial.rb
100
+ - lib/parroquia/sacramentos/actualizar_supletoria.rb
101
+ - lib/parroquia/sacramentos/bautizo.rb
102
+ - lib/parroquia/sacramentos/certificado_prebautismal.rb
103
+ - lib/parroquia/sacramentos/comunion.rb
104
+ - lib/parroquia/sacramentos/confirmacion.rb
105
+ - lib/parroquia/sacramentos/consultas.rb
106
+ - lib/parroquia/sacramentos/matrimonio.rb
107
+ - lib/parroquia/sacramentos/misa.rb
108
+ - lib/parroquia/sacramentos/permiso_bautismo.rb
109
+ - lib/parroquia/sacramentos/permiso_prematrimonial.rb
110
+ - lib/parroquia/sacramentos/resultados.rb
111
+ - lib/parroquia/sacramentos/sacramentos.rb
112
+ - lib/parroquia/sacramentos/supletoria.rb
95
113
  homepage: https://github.com/franclobo/Parroquia-San-Judas-Tadeo
96
114
  licenses:
97
115
  - MIT
98
- metadata: {}
116
+ metadata:
117
+ rubygems_mfa_required: 'true'
99
118
  post_install_message:
100
119
  rdoc_options: []
101
120
  require_paths: