parroquia 1.1.19 → 1.1.21

Sign up to get free protection for your applications and to get access to all the features.
@@ -132,10 +132,22 @@ class ActualizarSupletoria < FXMainWindow
132
132
  @input_madrina = FXTextField.new(self, 10, opts: LAYOUT_EXPLICIT, width: 150, height: 20, x: 510,
133
133
  y: 360)
134
134
  @input_madrina.text = registro[6]
135
- @lbl_certifica = FXLabel.new(self, 'Certifica: ', opts: LAYOUT_EXPLICIT, width: 150, height: 20, x: 10,
135
+ @lbl_testigo_uno = FXLabel.new(self, 'Testigo 1): ', opts: LAYOUT_EXPLICIT, width: 150, height: 20,
136
+ x: 10, y: 390)
137
+ @lbl_testigo_uno.backColor = FXRGB(3, 187, 133)
138
+ @input_testigo_uno = FXTextField.new(self, 10, opts: LAYOUT_EXPLICIT, width: 150, height: 20, x: 170,
139
+ y: 390)
140
+ @input_testigo_uno.text = registro[7]
141
+ @lbl_testigo_dos = FXLabel.new(self, 'Testigo 2): ', opts: LAYOUT_EXPLICIT, width: 150, height: 20,
142
+ x: 340, y: 390)
143
+ @lbl_testigo_dos.backColor = FXRGB(3, 187, 133)
144
+ @input_testigo_dos = FXTextField.new(self, 10, opts: LAYOUT_EXPLICIT, width: 150, height: 20, x: 510,
145
+ y: 390)
146
+ @input_testigo_dos.text = registro[8]
147
+ @lbl_certifica = FXLabel.new(self, 'Certifica: ', opts: LAYOUT_EXPLICIT, width: 150, height: 20, x: 680,
136
148
  y: 390)
137
149
  @lbl_certifica.backColor = FXRGB(3, 187, 133)
138
- @input_certifica = FXTextField.new(self, 10, opts: LAYOUT_EXPLICIT, width: 150, height: 20, x: 170,
150
+ @input_certifica = FXTextField.new(self, 10, opts: LAYOUT_EXPLICIT, width: 150, height: 20, x: 850,
139
151
  y: 390)
140
152
  @input_certifica.text = registro[4]
141
153
 
@@ -201,33 +213,35 @@ class ActualizarSupletoria < FXMainWindow
201
213
 
202
214
  # connect buttons
203
215
  @btnupdate.connect(SEL_COMMAND) do
204
- tomo = @input_tomo.text
205
- page = @input_page.text
206
- number = @input_number.text
207
- fecha = @input_fecha.text
208
- sacramento = @input_sacramento.text
209
- parroquia = @input_parroquia.text
210
- sector = @input_sector.text
211
- parroco = @input_parroco.text
212
- ministro = @input_ministro.text
213
- name = @input_name.text
214
- apellidos = @input_apellidos.text
215
- lugar_nacimiento = @input_lugar_nacimiento.text
216
- fecha_nacimiento = @input_fecha_nacimiento.text
216
+ tomo = @input_tomo.text.empty? ? nil : @input_tomo.text
217
+ page = @input_page.text.empty? ? nil : @input_page.text
218
+ number = @input_number.text.empty? ? nil : @input_number.text
219
+ fecha = @input_fecha.text.empty? ? nil : @input_fecha.text
220
+ sacramento = @input_sacramento.text.empty? ? nil : @input_sacramento.text
221
+ parroquia = @input_parroquia.text.empty? ? nil : @input_parroquia.text
222
+ sector = @input_sector.text.empty? ? nil : @input_sector.text
223
+ parroco = @input_parroco.text.empty? ? nil : @input_parroco.text
224
+ ministro = @input_ministro.text.empty? ? nil : @input_ministro.text
225
+ name = @input_name.text.empty? ? nil : @input_name.text
226
+ apellidos = @input_apellidos.text.empty? ? nil : @input_apellidos.text
227
+ lugar_nacimiento = @input_lugar_nacimiento.text.empty? ? nil : @input_lugar_nacimiento.text
228
+ fecha_nacimiento = @input_fecha_nacimiento.text.empty? ? nil : @input_fecha_nacimiento.text
217
229
  cedula = @input_cedula.text.empty? ? nil : @input_cedula.text
218
230
  padrino = @input_padrino.text.empty? ? nil : @input_padrino.text
219
231
  madrina = @input_madrina.text.empty? ? nil : @input_madrina.text
220
232
  padre = @input_padre.text.empty? ? nil : @input_padre.text
221
233
  madre = @input_madre.text.empty? ? nil : @input_madre.text
222
- certifica = @input_certifica.text
223
- provincia_rc = @input_provincia_rc.text
224
- canton_rc = @input_canton_rc.text
225
- parroquia_rc = @input_parroquia_rc.text
226
- anio_rc = @input_anio_rc.text
227
- tomo_rc = @input_tomo_rc.text
228
- pag_rc = @input_pag_rc.text
229
- acta_rc = @input_acta_rc.text
230
- date_rc = @input_date_rc.text
234
+ testigo_uno = @input_testigo_uno.text.empty? ? nil : @input_testigo_uno.text
235
+ testigo_dos = @input_testigo_dos.text.empty? ? nil : @input_testigo_dos.text
236
+ certifica = @input_certifica.text.empty? ? nil : @input_certifica.text
237
+ provincia_rc = @input_provincia_rc.text.empty? ? nil : @input_provincia_rc.text
238
+ canton_rc = @input_canton_rc.text.empty? ? nil : @input_canton_rc.text
239
+ parroquia_rc = @input_parroquia_rc.text. empty? ? nil : @input_parroquia_rc.text
240
+ anio_rc = @input_anio_rc.text.empty? ? nil : @input_anio_rc.text
241
+ tomo_rc = @input_tomo_rc.text.empty? ? nil : @input_tomo_rc.text
242
+ pag_rc = @input_pag_rc.text.empty? ? nil : @input_pag_rc.text
243
+ acta_rc = @input_acta_rc.text.empty? ? nil : @input_acta_rc.text
244
+ date_rc = @input_date_rc.text.empty? ? nil : @input_date_rc.text
231
245
 
232
246
  # tables
233
247
  # tabla libros (id, tomo, pagina, numero)
@@ -240,8 +254,8 @@ class ActualizarSupletoria < FXMainWindow
240
254
  $conn.exec('UPDATE libros SET tomo = $1, pagina = $2, numero = $3 WHERE id = $4',
241
255
  [tomo, page, number, registro[14]])
242
256
  $conn.exec(
243
- 'UPDATE sacramentos SET fecha = $1, sacramento = $2, celebrante = $3, certifica = $4, padrino = $5, madrina = $6, padre = $7, madre = $8 WHERE id = $9', [
244
- fecha, sacramento, ministro, certifica, padrino, madrina, padre, madre, registro[0]
257
+ 'UPDATE sacramentos SET fecha = $1, sacramento = $2, celebrante = $3, testigo_novio = $4, testigo_novia = $5, certifica = $6, padrino = $7, madrina = $8, padre = $9, madre = $10 WHERE id = $11', [
258
+ fecha, sacramento, ministro, testigo_uno, testigo_dos, certifica, padrino, madrina, padre, madre, registro[0]
245
259
  ]
246
260
  )
247
261
  $conn.exec(
@@ -177,33 +177,33 @@ class Bautizo < FXMainWindow
177
177
 
178
178
  # connect buttons
179
179
  @btnsave.connect(SEL_COMMAND) do
180
- tomo = @input_tomo.text
181
- page = @input_page.text
182
- number = @input_number.text
183
- fecha = @input_fecha.text
180
+ tomo = @input_tomo.text.empty? ? nil : @input_tomo.text
181
+ page = @input_page.text.empty? ? nil : @input_page.text
182
+ number = @input_number.text.empty? ? nil : @input_number.text
183
+ fecha = @input_fecha.text.empty? ? nil : @input_fecha.text
184
184
  sacramento = @input_sacramento.text
185
- parroquia = @input_parroquia.text
186
- sector = @input_sector.text
187
- parroco = @input_parroco.text
188
- ministro = @input_ministro.text
189
- name = @input_name.text
190
- apellidos = @input_apellidos.text
191
- lugar_nacimiento = @input_lugar_nacimiento.text
192
- fecha_nacimiento = @input_fecha_nacimiento.text
185
+ parroquia = @input_parroquia.text.empty? ? nil : @input_parroquia.text
186
+ sector = @input_sector.text.empty? ? nil : @input_sector.text
187
+ parroco = @input_parroco.text.empty? ? nil : @input_parroco.text
188
+ ministro = @input_ministro.text.empty? ? nil : @input_ministro.text
189
+ name = @input_name.text.empty? ? nil : @input_name.text
190
+ apellidos = @input_apellidos.text.empty? ? nil : @input_apellidos.text
191
+ lugar_nacimiento = @input_lugar_nacimiento.text.empty? ? nil : @input_lugar_nacimiento.text
192
+ fecha_nacimiento = @input_fecha_nacimiento.text.empty? ? nil : @input_fecha_nacimiento.text
193
193
  cedula = @input_cedula.text.empty? ? nil : @input_cedula.text
194
194
  padrino = @input_padrino.text.empty? ? nil : @input_padrino.text
195
195
  madrina = @input_madrina.text.empty? ? nil : @input_madrina.text
196
196
  padre = @input_padre.text.empty? ? nil : @input_padre.text
197
197
  madre = @input_madre.text.empty? ? nil : @input_madre.text
198
- certifica = @input_certifica.text
199
- provincia_rc = @input_provincia_rc.text
200
- canton_rc = @input_canton_rc.text
201
- parroquia_rc = @input_parroquia_rc.text
202
- anio_rc = @input_anio_rc.text
203
- tomo_rc = @input_tomo_rc.text
204
- pag_rc = @input_pag_rc.text
205
- acta_rc = @input_acta_rc.text
206
- date_rc = @input_date_rc.text
198
+ certifica = @input_certifica.text.empty? ? nil : @input_certifica.text
199
+ provincia_rc = @input_provincia_rc.text.empty? ? nil : @input_provincia_rc.text
200
+ canton_rc = @input_canton_rc.text.empty? ? nil : @input_canton_rc.text
201
+ parroquia_rc = @input_parroquia_rc.text.empty? ? nil : @input_parroquia_rc.text
202
+ anio_rc = @input_anio_rc.text.empty? ? nil : @input_anio_rc.text
203
+ tomo_rc = @input_tomo_rc.text.empty? ? nil : @input_tomo_rc.text
204
+ pag_rc = @input_pag_rc.text.empty? ? nil : @input_pag_rc.text
205
+ acta_rc = @input_acta_rc.text.empty? ? nil : @input_acta_rc.text
206
+ date_rc = @input_date_rc.text.empty? ? nil : @input_date_rc.text
207
207
 
208
208
  # tables
209
209
  # tabla libros (id, tomo, pagina, numero)
@@ -90,17 +90,17 @@ class PreBautismal < FXMainWindow
90
90
 
91
91
  # connect buttons
92
92
  @btnsave.connect(SEL_COMMAND) do
93
- fecha = @input_fecha.text
93
+ fecha = @input_fecha.text.empty? ? nil : @input_fecha.text
94
94
  sacramento = @input_sacramento.text
95
- parroquia = @input_parroquia.text
96
- sector = @input_sector.text
97
- parroco = @input_parroco.text
98
- name = @input_name.text
99
- apellidos = @input_apellidos.text
95
+ parroquia = @input_parroquia.text.empty? ? nil : @input_parroquia.text
96
+ sector = @input_sector.text.empty? ? nil : @input_sector.text
97
+ parroco = @input_parroco.text.empty? ? nil : @input_parroco.text
98
+ name = @input_name.text.empty? ? nil : @input_name.text
99
+ apellidos = @input_apellidos.text.empty? ? nil : @input_apellidos.text
100
100
  cedula = @input_cedula.text.empty? ? nil : @input_cedula.text
101
101
  padrino = @input_padrino.text.empty? ? nil : @input_padrino.text
102
102
  madrina = @input_madrina.text.empty? ? nil : @input_madrina.text
103
- certifica = @input_certifica.text
103
+ certifica = @input_certifica.text.empty? ? nil : @input_certifica.text
104
104
 
105
105
  # tables
106
106
  # tabla libros (id, tomo, pagina, numero)
@@ -143,16 +143,15 @@ class PreBautismal < FXMainWindow
143
143
 
144
144
  def clear_input_fields
145
145
  @input_fecha.text = ''
146
+ @input_sacramento.text = ''
147
+ @input_parroquia.text = ''
148
+ @input_sector.text = ''
146
149
  @input_parroco.text = ''
147
150
  @input_name.text = ''
148
151
  @input_apellidos.text = ''
149
- @input_lugar_nacimiento.text = ''
150
- @input_fecha_nacimiento.text = ''
151
152
  @input_cedula.text = ''
152
153
  @input_padrino.text = ''
153
154
  @input_madrina.text = ''
154
- @input_padre.text = ''
155
- @input_madre.text = ''
156
155
  @input_certifica.text = ''
157
156
  end
158
157
  end
@@ -0,0 +1,293 @@
1
+ require 'fox16'
2
+ include Fox
3
+
4
+ class LicenciaMatrimonio < FXMainWindow
5
+ def initialize(app)
6
+ super(app, 'Parroquia San Judas Tadeo', width: 1050, height: 530)
7
+ self.backColor = FXRGB(3, 187, 133)
8
+ # Title
9
+ @lbltitle = FXLabel.new(self, 'Bienvenido a la Parroquia San Judas Tadeo',
10
+ opts: LAYOUT_EXPLICIT | JUSTIFY_CENTER_X, width: 1050, height: 20, x: 0, y: 20)
11
+ @lbltitle.font = FXFont.new(app, 'Geneva', 16, FONTWEIGHT_BOLD)
12
+ @lbltitle.backColor = FXRGB(3, 187, 133)
13
+ # Subtitle
14
+ @lblsubtitle = FXLabel.new(self, 'ARQUIDIOSESIS DE QUITO - SERVICIO PARROQUIAL DE SAN JUDAS TADEO',
15
+ opts: LAYOUT_EXPLICIT | JUSTIFY_CENTER_X, width: 1050, height: 20, x: 0, y: 40)
16
+ @lblsubtitle.font = FXFont.new(app, 'Geneva', 10, FONTWEIGHT_BOLD)
17
+ @lblsubtitle.backColor = FXRGB(3, 187, 133)
18
+ # Date
19
+ @date = Time.now.strftime('%d/%m/%Y')
20
+ @lbldate = FXLabel.new(self, "Fecha: #{cambiar_formato_fecha(@date)}", opts: LAYOUT_EXPLICIT | JUSTIFY_RIGHT,
21
+ width: 1050, height: 20, x: 0, y: 60, padRight: 20)
22
+ @lbldate.font = FXFont.new(app, 'Geneva', 12, FONTWEIGHT_BOLD)
23
+ @lbldate.backColor = FXRGB(3, 187, 133)
24
+ # section libros
25
+ @lbl_tomo = FXLabel.new(self, 'Tomo', opts: LAYOUT_EXPLICIT, width: 50, height: 20, x: 50, y: 100)
26
+ @lbl_tomo.backColor = FXRGB(3, 187, 133)
27
+ @input_tomo = FXTextField.new(self, 10, opts: LAYOUT_EXPLICIT, width: 50, height: 20, x: 110, y: 100)
28
+ @lbl_page = FXLabel.new(self, 'Pagina', opts: LAYOUT_EXPLICIT, width: 50, height: 20, x: 170, y: 100)
29
+ @lbl_page.backColor = FXRGB(3, 187, 133)
30
+ @input_page = FXTextField.new(self, 10, opts: LAYOUT_EXPLICIT, width: 50, height: 20, x: 230, y: 100)
31
+ @lbl_number = FXLabel.new(self, 'Numero', opts: LAYOUT_EXPLICIT, width: 50, height: 20, x: 290,
32
+ y: 100)
33
+ @lbl_number.backColor = FXRGB(3, 187, 133)
34
+ @input_number = FXTextField.new(self, 10, opts: LAYOUT_EXPLICIT, width: 50, height: 20, x: 350,
35
+ y: 100)
36
+
37
+ # section datos
38
+ @lbl_fecha = FXLabel.new(self, 'Fecha de matrimonio (AAAA/MM/DD): ', opts: LAYOUT_EXPLICIT, width: 250,
39
+ height: 20, x: 10, y: 150)
40
+ @lbl_fecha.backColor = FXRGB(3, 187, 133)
41
+ @input_fecha = FXTextField.new(self, 10, opts: LAYOUT_EXPLICIT, width: 150, height: 20, x: 340,
42
+ y: 150)
43
+ @lbl_sacramento = FXLabel.new(self, 'Sacramento: ', opts: LAYOUT_EXPLICIT, width: 150, height: 20,
44
+ x: 680, y: 150)
45
+ @lbl_sacramento.backColor = FXRGB(3, 187, 133)
46
+ @input_sacramento = FXTextField.new(self, 10, opts: LAYOUT_EXPLICIT, width: 150, height: 20, x: 850,
47
+ y: 150)
48
+ @input_sacramento.text = 'Licencia de Matrimonio'
49
+ @input_sacramento.disable
50
+ @lbl_parroquia = FXLabel.new(self, 'Iglesia parroquial: ', opts: LAYOUT_EXPLICIT, width: 150, height: 20,
51
+ x: 10, y: 180)
52
+ @lbl_parroquia.backColor = FXRGB(3, 187, 133)
53
+ @input_parroquia = FXTextField.new(self, 10, opts: LAYOUT_EXPLICIT, width: 150, height: 20, x: 170,
54
+ y: 180)
55
+ @lbl_sector = FXLabel.new(self, 'Sector: ', opts: LAYOUT_EXPLICIT, width: 150, height: 20, x: 340,
56
+ y: 180)
57
+ @lbl_sector.backColor = FXRGB(3, 187, 133)
58
+ @input_sector = FXTextField.new(self, 10, opts: LAYOUT_EXPLICIT, width: 150, height: 20, x: 510,
59
+ y: 180)
60
+ @lbl_parroco = FXLabel.new(self, 'Parroco: ', opts: LAYOUT_EXPLICIT, width: 150, height: 20, x: 680,
61
+ y: 180)
62
+ @lbl_parroco.backColor = FXRGB(3, 187, 133)
63
+ @input_parroco = FXTextField.new(self, 10, opts: LAYOUT_EXPLICIT, width: 150, height: 20, x: 850,
64
+ y: 180)
65
+ @lbl_celebrante = FXLabel.new(self, 'Celebrante: ', opts: LAYOUT_EXPLICIT, width: 150, height: 20,
66
+ x: 10, y: 210)
67
+ @lbl_celebrante.backColor = FXRGB(3, 187, 133)
68
+ @input_celebrante = FXTextField.new(self, 10, opts: LAYOUT_EXPLICIT, width: 150, height: 20, x: 170,
69
+ y: 210)
70
+ @lbl_name_novio = FXLabel.new(self, 'Nombres del novio: ', opts: LAYOUT_EXPLICIT, width: 150, height: 20,
71
+ x: 10, y: 240)
72
+ @lbl_name_novio.backColor = FXRGB(3, 187, 133)
73
+ @input_name_novio = FXTextField.new(self, 10, opts: LAYOUT_EXPLICIT, width: 150, height: 20, x: 170,
74
+ y: 240)
75
+ @lbl_apellido_novio = FXLabel.new(self, 'Apellidos del novio: ', opts: LAYOUT_EXPLICIT, width: 150,
76
+ height: 20, x: 340, y: 240)
77
+ @lbl_apellido_novio.backColor = FXRGB(3, 187, 133)
78
+ @input_apellido_novio = FXTextField.new(self, 10, opts: LAYOUT_EXPLICIT, width: 150, height: 20, x: 510,
79
+ y: 240)
80
+ @lbl_cedula_novio = FXLabel.new(self, 'Cédula del novio: ', opts: LAYOUT_EXPLICIT, width: 150, height: 20,
81
+ x: 680, y: 240)
82
+ @lbl_cedula_novio.backColor = FXRGB(3, 187, 133)
83
+ @input_cedula_novio = FXTextField.new(self, 10, opts: LAYOUT_EXPLICIT, width: 150, height: 20, x: 850,
84
+ y: 240)
85
+ @lbl_name_novia = FXLabel.new(self, 'Nombres de la novia: ', opts: LAYOUT_EXPLICIT, width: 150,
86
+ height: 20, x: 10, y: 270)
87
+ @lbl_name_novia.backColor = FXRGB(3, 187, 133)
88
+ @input_name_novia = FXTextField.new(self, 10, opts: LAYOUT_EXPLICIT, width: 150, height: 20, x: 170,
89
+ y: 270)
90
+ @lbl_apellido_novia = FXLabel.new(self, 'Apellidos de la novia: ', opts: LAYOUT_EXPLICIT, width: 150,
91
+ height: 20, x: 340, y: 270)
92
+ @lbl_apellido_novia.backColor = FXRGB(3, 187, 133)
93
+ @input_apellido_novia = FXTextField.new(self, 10, opts: LAYOUT_EXPLICIT, width: 150, height: 20, x: 510,
94
+ y: 270)
95
+ @lbl_cedula_novia = FXLabel.new(self, 'Cédula de la novia: ', opts: LAYOUT_EXPLICIT, width: 150,
96
+ height: 20, x: 680, y: 270)
97
+ @lbl_cedula_novia.backColor = FXRGB(3, 187, 133)
98
+ @input_cedula_novia = FXTextField.new(self, 10, opts: LAYOUT_EXPLICIT, width: 150, height: 20, x: 850,
99
+ y: 270)
100
+ @lbl_testigo_novio = FXLabel.new(self, 'Testigo del novio: ', opts: LAYOUT_EXPLICIT, width: 150,
101
+ height: 20, x: 10, y: 300)
102
+ @lbl_testigo_novio.backColor = FXRGB(3, 187, 133)
103
+ @input_nombres_testigo_novio = FXTextField.new(self, 10, opts: LAYOUT_EXPLICIT, width: 150, height: 20,
104
+ x: 170, y: 300)
105
+ @lbl_testigo_novia = FXLabel.new(self, 'Testigo novia: ', opts: LAYOUT_EXPLICIT, width: 150, height: 20,
106
+ x: 340, y: 300)
107
+ @lbl_testigo_novia.backColor = FXRGB(3, 187, 133)
108
+ @input_nombres_testigo_novia = FXTextField.new(self, 10, opts: LAYOUT_EXPLICIT, width: 150, height: 20,
109
+ x: 510, y: 300)
110
+ @lbl_certifica = FXLabel.new(self, 'Certifica: ', opts: LAYOUT_EXPLICIT, width: 150, height: 20,
111
+ x: 680, y: 300)
112
+ @lbl_certifica.backColor = FXRGB(3, 187, 133)
113
+ @input_certifica = FXTextField.new(self, 10, opts: LAYOUT_EXPLICIT, width: 150, height: 20, x: 850,
114
+ y: 300)
115
+
116
+ # section registro civil
117
+ @lbl_reg_civ = FXLabel.new(self,
118
+ '------------------------------------ REGISTRO CIVIL ------------------------------------', opts: LAYOUT_EXPLICIT | JUSTIFY_CENTER_X, width: 1050, height: 20, x: 10, y: 330)
119
+ @lbl_reg_civ.backColor = FXRGB(3, 187, 133)
120
+ @lbl_provincia_rc = FXLabel.new(self, 'Provincia: ', opts: LAYOUT_EXPLICIT, width: 150, height: 20,
121
+ x: 10, y: 360)
122
+ @lbl_provincia_rc.backColor = FXRGB(3, 187, 133)
123
+ @input_provincia_rc = FXTextField.new(self, 10, opts: LAYOUT_EXPLICIT, width: 150, height: 20, x: 170,
124
+ y: 360)
125
+ @lbl_canton_rc = FXLabel.new(self, 'Cantón: ', opts: LAYOUT_EXPLICIT, width: 150, height: 20, x: 340,
126
+ y: 360)
127
+ @lbl_canton_rc.backColor = FXRGB(3, 187, 133)
128
+ @input_canton_rc = FXTextField.new(self, 10, opts: LAYOUT_EXPLICIT, width: 150, height: 20, x: 510,
129
+ y: 360)
130
+ @lbl_parroquia_rc = FXLabel.new(self, 'Parroquia: ', opts: LAYOUT_EXPLICIT, width: 150, height: 20,
131
+ x: 680, y: 360)
132
+ @lbl_parroquia_rc.backColor = FXRGB(3, 187, 133)
133
+ @input_parroquia_rc = FXTextField.new(self, 10, opts: LAYOUT_EXPLICIT, width: 150, height: 20, x: 850,
134
+ y: 360)
135
+ @lbl_anio_rc = FXLabel.new(self, 'Año: ', opts: LAYOUT_EXPLICIT, width: 50, height: 20, x: 50,
136
+ y: 390)
137
+ @lbl_anio_rc.backColor = FXRGB(3, 187, 133)
138
+ @input_anio_rc = FXTextField.new(self, 10, opts: LAYOUT_EXPLICIT, width: 50, height: 20, x: 110,
139
+ y: 390)
140
+ @lbl_tomo_rc = FXLabel.new(self, 'Tomo: ', opts: LAYOUT_EXPLICIT, width: 50, height: 20, x: 170,
141
+ y: 390)
142
+ @lbl_tomo_rc.backColor = FXRGB(3, 187, 133)
143
+ @input_tomo_rc = FXTextField.new(self, 10, opts: LAYOUT_EXPLICIT, width: 50, height: 20, x: 230,
144
+ y: 390)
145
+ @lbl_pag_rc = FXLabel.new(self, 'Página: ', opts: LAYOUT_EXPLICIT, width: 50, height: 20, x: 290,
146
+ y: 390)
147
+ @lbl_pag_rc.backColor = FXRGB(3, 187, 133)
148
+ @input_pag_rc = FXTextField.new(self, 10, opts: LAYOUT_EXPLICIT, width: 50, height: 20, x: 350,
149
+ y: 390)
150
+ @lbl_acta_rc = FXLabel.new(self, 'Acta: ', opts: LAYOUT_EXPLICIT, width: 50, height: 20, x: 410,
151
+ y: 390)
152
+ @lbl_acta_rc.backColor = FXRGB(3, 187, 133)
153
+ @input_acta_rc = FXTextField.new(self, 10, opts: LAYOUT_EXPLICIT, width: 50, height: 20, x: 470,
154
+ y: 390)
155
+ @lbl_date_rc = FXLabel.new(self, 'Fecha (AAAA/MM/DD): ', opts: LAYOUT_EXPLICIT, width: 150, height: 20,
156
+ x: 10, y: 420)
157
+ @lbl_date_rc.backColor = FXRGB(3, 187, 133)
158
+ @input_date_rc = FXTextField.new(self, 10, opts: LAYOUT_EXPLICIT, width: 150, height: 20, x: 170,
159
+ y: 420)
160
+
161
+
162
+ # create buttons
163
+ @btnsave = FXButton.new(self, 'Guardar', opts: LAYOUT_EXPLICIT | BUTTON_NORMAL, width: 100, height: 30,
164
+ x: 790, y: 480)
165
+ @btncancel = FXButton.new(self, 'Cancelar', opts: LAYOUT_EXPLICIT | BUTTON_NORMAL, width: 100, height: 30,
166
+ x: 900, y: 480)
167
+
168
+ # connect buttons
169
+ @btnsave.connect(SEL_COMMAND) do
170
+ tomo = @input_tomo.text
171
+ page = @input_page.text
172
+ number = @input_number.text
173
+ fecha = @input_fecha.text
174
+ sacramento = @input_sacramento.text
175
+ parroquia = @input_parroquia.text
176
+ sector = @input_sector.text
177
+ parroco = @input_parroco.text
178
+ celebrante = @input_celebrante.text
179
+ name_novio = @input_name_novio.text
180
+ apellido_novio = @input_apellido_novio.text
181
+ cedula_novio = @input_cedula_novio.text.empty? ? nil : @input_cedula_novio.text
182
+ nombres_novia = @input_name_novia.text.empty? ? nil : @input_name_novia.text
183
+ apellidos_novia = @input_apellido_novia.text.empty? ? nil : @input_apellido_novia.text
184
+ cedula_novia = @input_cedula_novia.text.empty? ? nil : @input_cedula_novia.text
185
+ testigo_novio = @input_nombres_testigo_novio.text.empty? ? nil : @input_nombres_testigo_novio.text
186
+ testigo_novia = @input_nombres_testigo_novia.text.empty? ? nil : @input_nombres_testigo_novia.text
187
+ certifica = @input_certifica.text
188
+ provincia_rc = @input_provincia_rc.text
189
+ canton_rc = @input_canton_rc.text
190
+ parroquia_rc = @input_parroquia_rc.text
191
+ anio_rc = @input_anio_rc.text
192
+ tomo_rc = @input_tomo_rc.text
193
+ pagina_rc = @input_pag_rc.text
194
+ acta_rc = @input_acta_rc.text
195
+ fecha_rc = @input_date_rc.text
196
+
197
+ # tables
198
+ # tabla libros (id, tomo, pagina, numero)
199
+ # tabla creyentes (id, nombres, apellidos, lugar_nacimiento, fecha_nacimiento, cedula)
200
+ # tabla parroquias (id, nombre, sector, parroco)
201
+ # 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)
202
+ # tabla registros_civiles (id, provincia_rc, canton_rc, parroquia_rc, anio_rc, tomo_rc, pagina_rc, acta_rc, fecha_rc)
203
+ $conn.transaction do
204
+ $conn.exec('INSERT INTO libros (tomo, pagina, numero) VALUES ($1, $2, $3)', [tomo, page, number])
205
+ $conn.exec('INSERT INTO creyentes (nombres, apellidos, cedula) VALUES ($1, $2, $3)',
206
+ [name_novio, apellido_novio, cedula_novio])
207
+ $conn.exec('INSERT INTO parroquias (parroquia, sector, parroco) VALUES ($1, $2, $3)',
208
+ [parroquia, sector, parroco])
209
+ $conn.exec(
210
+ '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)', [
211
+ provincia_rc, canton_rc, parroquia_rc, anio_rc, tomo_rc, pagina_rc, acta_rc, fecha_rc
212
+ ]
213
+ )
214
+ # Insertar en la tabla misas
215
+ @registro_misas = $conn.exec('INSERT INTO misas (intencion, fecha, hora) VALUES ($1, $2, $3)', [nil, nil, nil])
216
+ $conn.exec(
217
+ 'INSERT INTO sacramentos (sacramento, fecha, celebrante, certifica, testigo_novio, testigo_novia, nombres_novia, apellidos_novia, cedula_novia) VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9)', [
218
+ sacramento, fecha, celebrante, certifica, testigo_novio, testigo_novia, nombres_novia, apellidos_novia, cedula_novia
219
+ ]
220
+ )
221
+ $conn.exec('COMMIT')
222
+ FXMessageBox.information(self, MBOX_OK, 'Información', 'Datos guardados correctamente')
223
+ clear_input_fields
224
+ end
225
+ end
226
+
227
+ @btncancel.connect(SEL_COMMAND) do
228
+ clear_input_fields
229
+ end
230
+
231
+ def clear_input_fields
232
+ @input_tomo.text = ''
233
+ @input_page.text = ''
234
+ @input_number.text = ''
235
+ @input_fecha.text = ''
236
+ @input_parroco.text = ''
237
+ @input_celebrante.text = ''
238
+ @input_name_novio.text = ''
239
+ @input_apellido_novio.text = ''
240
+ @input_cedula_novio.text = ''
241
+ @input_name_novia.text = ''
242
+ @input_apellido_novia.text = ''
243
+ @input_cedula_novia.text = ''
244
+ @input_nombres_testigo_novio.text = ''
245
+ @input_nombres_testigo_novia.text = ''
246
+ @input_certifica.text = ''
247
+ @input_provincia_rc.text = ''
248
+ @input_canton_rc.text = ''
249
+ @input_parroquia_rc.text = ''
250
+ @input_anio_rc.text = ''
251
+ @input_tomo_rc.text = ''
252
+ @input_pag_rc.text = ''
253
+ @input_acta_rc.text = ''
254
+ @input_date_rc.text = ''
255
+ end
256
+ end
257
+
258
+ # Nombre del mes
259
+ def nombre_mes(mes)
260
+ meses = {
261
+ '01' => 'enero',
262
+ '02' => 'febrero',
263
+ '03' => 'marzo',
264
+ '04' => 'abril',
265
+ '05' => 'mayo',
266
+ '06' => 'junio',
267
+ '07' => 'julio',
268
+ '08' => 'agosto',
269
+ '09' => 'septiembre',
270
+ '10' => 'octubre',
271
+ '11' => 'noviembre',
272
+ '12' => 'diciembre'
273
+ }
274
+ meses[mes]
275
+ end
276
+
277
+ # Cambiar el formato de la fecha de YYYY-MM-DD a DD de nombre_mes de YYYY
278
+ def cambiar_formato_fecha(fecha)
279
+ # split "-" or "/"
280
+ fecha = fecha.split(%r{-|/})
281
+ # si el formato de fecha es YYYY-MM-DD o YYYY/MM/DD, sino si es DD-MM-YYYY o DD/MM/YYYY
282
+ if fecha[0].length == 4
283
+ "#{fecha[2]} de #{nombre_mes(fecha[1])} de #{fecha[0]}"
284
+ else
285
+ "#{fecha[0]} de #{nombre_mes(fecha[1])} de #{fecha[2]}"
286
+ end
287
+ end
288
+
289
+ def create
290
+ super
291
+ show(PLACEMENT_SCREEN)
292
+ end
293
+ end
@@ -100,19 +100,19 @@ class PermisoBautizo < FXMainWindow
100
100
 
101
101
  # connect buttons
102
102
  @btnsave.connect(SEL_COMMAND) do
103
- fecha = @input_fecha.text
103
+ fecha = @input_fecha.text.empty? ? nil : @input_fecha.text
104
104
  sacramento = @input_sacramento.text
105
- parroquia = @input_parroquia.text
106
- sector = @input_sector.text
107
- parroco = @input_parroco.text
108
- name = @input_name.text
109
- apellidos = @input_apellidos.text
105
+ parroquia = @input_parroquia.text.empty? ? nil : @input_parroquia.text
106
+ sector = @input_sector.text.empty? ? nil : @input_sector.text
107
+ parroco = @input_parroco.text.empty? ? nil : @input_parroco.text
108
+ name = @input_name.text.empty? ? nil : @input_name.text
109
+ apellidos = @input_apellidos.text.empty? ? nil : @input_apellidos.text
110
110
  cedula = @input_cedula.text.empty? ? nil : @input_cedula.text
111
111
  padrino = @input_padrino.text.empty? ? nil : @input_padrino.text
112
112
  madrina = @input_madrina.text.empty? ? nil : @input_madrina.text
113
113
  padre = @input_padre.text.empty? ? nil : @input_padre.text
114
114
  madre = @input_madre.text.empty? ? nil : @input_madre.text
115
- certifica = @input_certifica.text
115
+ certifica = @input_certifica.text.empty? ? nil : @input_certifica.text
116
116
 
117
117
  # tables
118
118
  # tabla libros (id, tomo, pagina, numero)
@@ -155,11 +155,12 @@ class PermisoBautizo < FXMainWindow
155
155
 
156
156
  def clear_input_fields
157
157
  @input_fecha.text = ''
158
+ @input_sacramento.text = ''
159
+ @input_parroquia.text = ''
160
+ @input_sector.text = ''
158
161
  @input_parroco.text = ''
159
162
  @input_name.text = ''
160
163
  @input_apellidos.text = ''
161
- @input_lugar_nacimiento.text = ''
162
- @input_fecha_nacimiento.text = ''
163
164
  @input_cedula.text = ''
164
165
  @input_padrino.text = ''
165
166
  @input_madrina.text = ''
@@ -105,20 +105,20 @@ class PermisoMatrimonio < FXMainWindow
105
105
 
106
106
  # connect buttons
107
107
  @btnsave.connect(SEL_COMMAND) do
108
- fecha = @input_fecha.text
108
+ fecha = @input_fecha.text.empty? ? nil : @input_fecha.text
109
109
  sacramento = @input_sacramento.text
110
- parroquia = @input_parroquia.text
111
- sector = @input_sector.text
112
- parroco = @input_parroco.text
113
- name_novio = @input_name_novio.text
114
- apellido_novio = @input_apellido_novio.text
110
+ parroquia = @input_parroquia.text.empty? ? nil : @input_parroquia.text
111
+ sector = @input_sector.text.empty? ? nil : @input_sector.text
112
+ parroco = @input_parroco.text.empty? ? nil : @input_parroco.text
113
+ name_novio = @input_name_novio.text.empty? ? nil : @input_name_novio.text
114
+ apellido_novio = @input_apellido_novio.text.empty? ? nil : @input_apellido_novio.text
115
115
  cedula_novio = @input_cedula_novio.text.empty? ? nil : @input_cedula_novio.text
116
116
  nombres_novia = @input_name_novia.text.empty? ? nil : @input_name_novia.text
117
117
  apellidos_novia = @input_apellido_novia.text.empty? ? nil : @input_apellido_novia.text
118
118
  cedula_novia = @input_cedula_novia.text.empty? ? nil : @input_cedula_novia.text
119
119
  testigo_novio = @input_nombres_testigo_novio.text.empty? ? nil : @input_nombres_testigo_novio.text
120
120
  testigo_novia = @input_nombres_testigo_novia.text.empty? ? nil : @input_nombres_testigo_novia.text
121
- certifica = @input_certifica.text
121
+ certifica = @input_certifica.text.empty? ? nil : @input_certifica.text
122
122
 
123
123
  # tables
124
124
  # tabla libros (id, tomo, pagina, numero)
@@ -140,8 +140,8 @@ class PermisoMatrimonio < FXMainWindow
140
140
  # Insertar en la tabla misas
141
141
  @registro_misas = $conn.exec('INSERT INTO misas (intencion, fecha, hora) VALUES ($1, $2, $3)', [nil, nil, nil])
142
142
  $conn.exec(
143
- 'INSERT INTO sacramentos (sacramento, fecha, celebrante, certifica, testigo_novio, testigo_novia, nombres_novia, apellidos_novia, cedula_novia) VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9)', [
144
- sacramento, fecha, celebrante, certifica, testigo_novio, testigo_novia, nombres_novia, apellidos_novia, cedula_novia
143
+ 'INSERT INTO sacramentos (sacramento, fecha, certifica, testigo_novio, testigo_novia, nombres_novia, apellidos_novia, cedula_novia) VALUES ($1, $2, $3, $4, $5, $6, $7, $8)', [
144
+ sacramento, fecha, certifica, testigo_novio, testigo_novia, nombres_novia, apellidos_novia, cedula_novia
145
145
  ]
146
146
  )
147
147
  $conn.exec('COMMIT')
@@ -155,12 +155,11 @@ class PermisoMatrimonio < FXMainWindow
155
155
  end
156
156
 
157
157
  def clear_input_fields
158
- @input_tomo.text = ''
159
- @input_page.text = ''
160
- @input_number.text = ''
161
158
  @input_fecha.text = ''
159
+ @input_sacramento.text = ''
160
+ @input_parroquia.text = ''
161
+ @input_sector.text = ''
162
162
  @input_parroco.text = ''
163
- @input_celebrante.text = ''
164
163
  @input_name_novio.text = ''
165
164
  @input_apellido_novio.text = ''
166
165
  @input_cedula_novio.text = ''
@@ -170,14 +169,6 @@ class PermisoMatrimonio < FXMainWindow
170
169
  @input_nombres_testigo_novio.text = ''
171
170
  @input_nombres_testigo_novia.text = ''
172
171
  @input_certifica.text = ''
173
- @input_provincia_rc.text = ''
174
- @input_canton_rc.text = ''
175
- @input_parroquia_rc.text = ''
176
- @input_anio_rc.text = ''
177
- @input_tomo_rc.text = ''
178
- @input_pag_rc.text = ''
179
- @input_acta_rc.text = ''
180
- @input_date_rc.text = ''
181
172
  end
182
173
  end
183
174