parroquia 1.1.33 → 1.1.34
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: aba00676e481ee645498f4da88ee612048feec4e6868c3279fd673a1ef4dafde
|
4
|
+
data.tar.gz: b7bce5ab50238cc08291d65c6000e42b8251d6093cb8ea7b5a33bb3b6d910619
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d1493514a47e1c7743c12e2e54b8321b4a0e81c9f447f634f2ff30f852d429a52181d93d270526f423f19860c0fe49019feace778c54e28cbb023314041a41c7
|
7
|
+
data.tar.gz: 0b2ef39088c6b476edc9a33121e370e9f165350150e3292f7da5a10182ce0bc8b3a9ddbcb62eab9053a1b3c00836a772ead826b13fd5712cfb67e5a59fbdfc97
|
@@ -7,7 +7,7 @@ include Fox
|
|
7
7
|
class ActualizarAlumno < FXMainWindow
|
8
8
|
def initialize(app, registro)
|
9
9
|
@registro = registro
|
10
|
-
super(app, 'Parroquia San Judas Tadeo', width: 1050, height:
|
10
|
+
super(app, 'Parroquia San Judas Tadeo', width: 1050, height: 330)
|
11
11
|
self.backColor = FXRGB(3, 187, 133)
|
12
12
|
# Title
|
13
13
|
@lbltitle = FXLabel.new(self, 'Bienvenido a la Parroquia San Judas Tadeo',
|
@@ -27,71 +27,78 @@ class ActualizarAlumno < FXMainWindow
|
|
27
27
|
@lbldate.backColor = FXRGB(3, 187, 133)
|
28
28
|
|
29
29
|
# section datos
|
30
|
-
@lbl_anio_lectivo = FXLabel.new(self, 'Año lectivo', opts: LAYOUT_EXPLICIT, width:
|
30
|
+
@lbl_anio_lectivo = FXLabel.new(self, 'Año lectivo', opts: LAYOUT_EXPLICIT, width: 150,
|
31
31
|
height: 20, x: 10, y: 150)
|
32
32
|
@lbl_anio_lectivo.backColor = FXRGB(3, 187, 133)
|
33
|
-
@input_anio_lectivo = FXTextField.new(self, 10, opts: LAYOUT_EXPLICIT, width: 150, height: 20, x:
|
33
|
+
@input_anio_lectivo = FXTextField.new(self, 10, opts: LAYOUT_EXPLICIT, width: 150, height: 20, x: 170,
|
34
34
|
y: 150)
|
35
35
|
@input_anio_lectivo.text = @registro[12]
|
36
36
|
@lbl_nivel = FXLabel.new(self, 'Nivel: ', opts: LAYOUT_EXPLICIT, width: 150, height: 20,
|
37
|
-
x:
|
37
|
+
x: 330, y: 150)
|
38
38
|
@lbl_nivel.backColor = FXRGB(3, 187, 133)
|
39
|
-
@input_nivel = FXTextField.new(self, 10, opts: LAYOUT_EXPLICIT, width: 150, height: 20, x:
|
39
|
+
@input_nivel = FXTextField.new(self, 10, opts: LAYOUT_EXPLICIT, width: 150, height: 20, x: 490,
|
40
40
|
y: 150)
|
41
41
|
@input_nivel.text = @registro[10]
|
42
|
-
@lbl_sector = FXLabel.new(self, 'Sector: ', opts: LAYOUT_EXPLICIT, width: 150, height: 20, x:
|
43
|
-
y:
|
42
|
+
@lbl_sector = FXLabel.new(self, 'Sector: ', opts: LAYOUT_EXPLICIT, width: 150, height: 20, x: 650,
|
43
|
+
y: 150)
|
44
44
|
@lbl_sector.backColor = FXRGB(3, 187, 133)
|
45
|
-
@input_sector = FXTextField.new(self, 10, opts: LAYOUT_EXPLICIT, width: 150, height: 20, x:
|
46
|
-
y:
|
45
|
+
@input_sector = FXTextField.new(self, 10, opts: LAYOUT_EXPLICIT, width: 150, height: 20, x: 810,
|
46
|
+
y: 150)
|
47
47
|
@input_sector.text = @registro[11]
|
48
48
|
@lbl_name = FXLabel.new(self, 'Nombres: ', opts: LAYOUT_EXPLICIT, width: 150, height: 20, x: 10,
|
49
|
-
y:
|
49
|
+
y: 180)
|
50
50
|
@lbl_name.backColor = FXRGB(3, 187, 133)
|
51
51
|
@input_name = FXTextField.new(self, 10, opts: LAYOUT_EXPLICIT, width: 150, height: 20, x: 170,
|
52
|
-
y:
|
52
|
+
y: 180)
|
53
53
|
@input_name.text = @registro[1]
|
54
|
-
@lbl_apellidos = FXLabel.new(self, 'Apellidos: ', opts: LAYOUT_EXPLICIT, width: 150, height: 20, x:
|
55
|
-
y:
|
54
|
+
@lbl_apellidos = FXLabel.new(self, 'Apellidos: ', opts: LAYOUT_EXPLICIT, width: 150, height: 20, x: 330,
|
55
|
+
y: 180)
|
56
56
|
@lbl_apellidos.backColor = FXRGB(3, 187, 133)
|
57
|
-
@input_apellidos = FXTextField.new(self, 10, opts: LAYOUT_EXPLICIT, width: 150, height: 20, x:
|
58
|
-
y:
|
57
|
+
@input_apellidos = FXTextField.new(self, 10, opts: LAYOUT_EXPLICIT, width: 150, height: 20, x: 490,
|
58
|
+
y: 180)
|
59
59
|
@input_apellidos.text = @registro[2]
|
60
60
|
@lbl_lugar_nacimiento = FXLabel.new(self, 'Lugar de nacimiento: ', opts: LAYOUT_EXPLICIT, width: 150,
|
61
|
-
height: 20, x: 10, y:
|
61
|
+
height: 20, x: 10, y: 210)
|
62
62
|
@lbl_lugar_nacimiento.backColor = FXRGB(3, 187, 133)
|
63
63
|
@input_lugar_nacimiento = FXTextField.new(self, 10, opts: LAYOUT_EXPLICIT, width: 150, height: 20,
|
64
|
-
x: 170, y:
|
64
|
+
x: 170, y: 210)
|
65
65
|
@input_lugar_nacimiento.text = @registro[3]
|
66
66
|
@lbl_fecha_nacimiento = FXLabel.new(self, 'Fecha de nacimiento (AAAA/MM/DD): ', opts: LAYOUT_EXPLICIT,
|
67
|
-
width: 250, height: 20, x: 340, y:
|
67
|
+
width: 250, height: 20, x: 340, y: 210)
|
68
68
|
@lbl_fecha_nacimiento.backColor = FXRGB(3, 187, 133)
|
69
69
|
@input_fecha_nacimiento = FXTextField.new(self, 10, opts: LAYOUT_EXPLICIT, width: 150, height: 20,
|
70
|
-
x: 590, y:
|
70
|
+
x: 590, y: 210)
|
71
71
|
@input_fecha_nacimiento.text = @registro[4]
|
72
72
|
@lbl_cedula = FXLabel.new(self, 'Cédula: ', opts: LAYOUT_EXPLICIT, width: 80, height: 20, x: 750,
|
73
|
-
y:
|
73
|
+
y: 210)
|
74
74
|
@lbl_cedula.backColor = FXRGB(3, 187, 133)
|
75
75
|
@input_cedula = FXTextField.new(self, 10, opts: LAYOUT_EXPLICIT, width: 150, height: 20, x: 850,
|
76
|
-
y:
|
76
|
+
y: 210)
|
77
77
|
@input_cedula.text = @registro[5]
|
78
78
|
@lbl_nombres_catequista = FXLabel.new(self, 'Nombres Catequista: ', opts: LAYOUT_EXPLICIT, width: 150, height: 20, x: 10,
|
79
|
-
y:
|
79
|
+
y: 240)
|
80
80
|
@lbl_nombres_catequista.backColor = FXRGB(3, 187, 133)
|
81
81
|
@input_nombres_catequista = FXTextField.new(self, 10, opts: LAYOUT_EXPLICIT, width: 150, height: 20, x: 170,
|
82
|
-
y:
|
82
|
+
y: 240)
|
83
83
|
@input_nombres_catequista.text = @registro[7]
|
84
|
-
@lbl_apellidos_catequista = FXLabel.new(self, 'Apellidos catequista: ', opts: LAYOUT_EXPLICIT, width: 150, height: 20, x:
|
85
|
-
y:
|
84
|
+
@lbl_apellidos_catequista = FXLabel.new(self, 'Apellidos catequista: ', opts: LAYOUT_EXPLICIT, width: 150, height: 20, x: 340,
|
85
|
+
y: 240)
|
86
86
|
@lbl_apellidos_catequista.backColor = FXRGB(3, 187, 133)
|
87
|
-
@input_apellidos_catequista = FXTextField.new(self, 10, opts: LAYOUT_EXPLICIT, width: 150, height: 20, x:
|
88
|
-
y:
|
87
|
+
@input_apellidos_catequista = FXTextField.new(self, 10, opts: LAYOUT_EXPLICIT, width: 150, height: 20, x: 510,
|
88
|
+
y: 240)
|
89
89
|
@input_apellidos_catequista.text = @registro[8]
|
90
|
+
@lbl_parroco = FXLabel.new(self, 'Párroco: ', opts: LAYOUT_EXPLICIT, width: 150, height: 20, x: 680,
|
91
|
+
y: 240)
|
92
|
+
@lbl_parroco.backColor = FXRGB(3, 187, 133)
|
93
|
+
@input_parroco = FXTextField.new(self, 10, opts: LAYOUT_EXPLICIT, width: 150, height: 20, x: 840,
|
94
|
+
y: 240)
|
95
|
+
@input_parroco.text = @registro[13]
|
96
|
+
|
90
97
|
# create buttons
|
91
98
|
@btnupdate = FXButton.new(self, 'Actualizar', opts: LAYOUT_EXPLICIT | BUTTON_NORMAL, width: 100, height: 30,
|
92
|
-
x: 790, y:
|
99
|
+
x: 790, y: 280)
|
93
100
|
@btncancel = FXButton.new(self, 'Cancelar', opts: LAYOUT_EXPLICIT | BUTTON_NORMAL, width: 100, height: 30,
|
94
|
-
x: 900, y:
|
101
|
+
x: 900, y: 280)
|
95
102
|
|
96
103
|
# connect buttons
|
97
104
|
@btnupdate.connect(SEL_COMMAND) do
|
@@ -105,6 +112,7 @@ class ActualizarAlumno < FXMainWindow
|
|
105
112
|
cedula = @input_cedula.text.empty? ? nil : @input_cedula.text
|
106
113
|
nombres_catequista = @input_nombres_catequista.text.empty? ? nil : @input_nombres_catequista.text
|
107
114
|
apellidos_catequista = @input_apellidos_catequista.text.empty? ? nil : @input_apellidos_catequista.text
|
115
|
+
parroco = @input_parroco.text.empty? ? nil : @input_parroco.text
|
108
116
|
|
109
117
|
# tables
|
110
118
|
# tabla catequistas (id, nombres, apellidos, fecha de nacimiento, lugar de nacimiento, cedula)
|
@@ -118,8 +126,8 @@ class ActualizarAlumno < FXMainWindow
|
|
118
126
|
|
119
127
|
# Actualizar la tabla niveles
|
120
128
|
$conn.exec(
|
121
|
-
'UPDATE niveles SET anio_lectivo = $1, nivel = $2, sector = $3 WHERE id = $
|
122
|
-
anio_lectivo, nivel, sector, registro[9]
|
129
|
+
'UPDATE niveles SET anio_lectivo = $1, nivel = $2, sector = $3, parroco = $4 WHERE id = $5', [
|
130
|
+
anio_lectivo, nivel, sector, parroco, registro[9]
|
123
131
|
]
|
124
132
|
)
|
125
133
|
|
@@ -77,6 +77,12 @@ class Alumno < FXMainWindow
|
|
77
77
|
@lbl_apellidos_catequista.backColor = FXRGB(3, 187, 133)
|
78
78
|
@input_apellidos_catequista = FXTextField.new(self, 10, opts: LAYOUT_EXPLICIT, width: 150, height: 20,
|
79
79
|
x: 510, y: 240)
|
80
|
+
@lbl_parroco = FXLabel.new(self, 'Párroco: ', opts: LAYOUT_EXPLICIT, width: 150, height: 20, x: 680,
|
81
|
+
y: 240)
|
82
|
+
@lbl_parroco.backColor = FXRGB(3, 187, 133)
|
83
|
+
@input_parroco = FXTextField.new(self, 10, opts: LAYOUT_EXPLICIT, width: 150, height: 20, x: 840,
|
84
|
+
y: 240)
|
85
|
+
|
80
86
|
# create buttons
|
81
87
|
@btnsave = FXButton.new(self, 'Guardar', opts: LAYOUT_EXPLICIT | BUTTON_NORMAL, width: 100, height: 30,
|
82
88
|
x: 790, y: 270)
|
@@ -95,7 +101,7 @@ class Alumno < FXMainWindow
|
|
95
101
|
cedula = @input_cedula.text.empty? ? nil : @input_cedula.text
|
96
102
|
nombres_catequista = @input_nombre_catequista.text.empty? ? nil : @input_nombre_catequista.text
|
97
103
|
apellidos_catequista = @input_apellidos_catequista.text.empty? ? nil : @input_apellidos_catequista.text
|
98
|
-
|
104
|
+
parroco = @input_parroco.text.empty? ? nil : @input_parroco.text
|
99
105
|
|
100
106
|
# tables
|
101
107
|
# tabla catequistas (id, nombres, apellidos, fecha de nacimiento, lugar de nacimiento, cedula)
|
@@ -106,17 +112,14 @@ class Alumno < FXMainWindow
|
|
106
112
|
@registro_catequistas = $conn.exec('INSERT INTO catequistas (nombres, apellidos) VALUES ($1, $2)',
|
107
113
|
[nombres_catequista, apellidos_catequista])
|
108
114
|
# Insertar en la tabla niveles
|
109
|
-
@registro_parroquias = $conn.exec('INSERT INTO niveles (anio_lectivo, nivel, sector) VALUES ($1, $2, $3)',
|
110
|
-
[anio_lectivo, nivel, sector])
|
115
|
+
@registro_parroquias = $conn.exec('INSERT INTO niveles (anio_lectivo, nivel, sector, parroco) VALUES ($1, $2, $3, $4)',
|
116
|
+
[anio_lectivo, nivel, sector, parroco])
|
111
117
|
# Insertar en la tabla alumnos
|
112
118
|
@registro_creyentes = $conn.exec(
|
113
119
|
'INSERT INTO alumnos (nombres, apellidos, lugar_nacimiento, fecha_nacimiento, cedula) VALUES ($1, $2, $3, $4, $5)', [
|
114
120
|
name, apellidos, lugar_nacimiento, fecha_nacimiento, cedula
|
115
121
|
]
|
116
122
|
)
|
117
|
-
puts @registro_creyentes
|
118
|
-
puts @registro_parroquias
|
119
|
-
puts @registro_catequistas
|
120
123
|
|
121
124
|
# Confirmar la transacción
|
122
125
|
$conn.exec('COMMIT')
|
@@ -18,7 +18,7 @@ class ResultadosConsulta < FXMainWindow
|
|
18
18
|
@tabla.visibleRows = 10
|
19
19
|
@tabla.visibleColumns = 10
|
20
20
|
# El tamaño de la tabla depende del número de columnas nombrada en poner nombre a las columnas y las filas al numero de registros encontrados
|
21
|
-
@tabla.setTableSize(@result_data.length,
|
21
|
+
@tabla.setTableSize(@result_data.length, 14)
|
22
22
|
|
23
23
|
|
24
24
|
# Llena la tabla con los datos de resultados
|
@@ -39,9 +39,10 @@ class ResultadosConsulta < FXMainWindow
|
|
39
39
|
@tabla.setColumnText(7, 'Nivel')
|
40
40
|
@tabla.setColumnText(8, 'Sector')
|
41
41
|
@tabla.setColumnText(9, 'Año lectivo')
|
42
|
-
@tabla.setColumnText(10, '
|
43
|
-
@tabla.setColumnText(11, '
|
44
|
-
@tabla.setColumnText(12, '
|
42
|
+
@tabla.setColumnText(10, 'Párroco')
|
43
|
+
@tabla.setColumnText(11, 'ID Catequistas')
|
44
|
+
@tabla.setColumnText(12, 'Nombres')
|
45
|
+
@tabla.setColumnText(13, 'Apellidos')
|
45
46
|
|
46
47
|
|
47
48
|
# Al hacer clic en una fila, se selecciona la fila completa para imprimir los datos
|
@@ -126,6 +127,14 @@ class ResultadosConsulta < FXMainWindow
|
|
126
127
|
listar_pdf
|
127
128
|
end
|
128
129
|
|
130
|
+
def registros_seleccionados
|
131
|
+
registros = []
|
132
|
+
(0...@tabla.numRows).each do |i|
|
133
|
+
registros << @result_data[i] if @tabla.isRowSelected(i)
|
134
|
+
end
|
135
|
+
registros
|
136
|
+
end
|
137
|
+
|
129
138
|
def listar_pdf
|
130
139
|
selected_columns = seleccionar_columna
|
131
140
|
registros_seleccionados = registros_seleccionados() # Obtén los registros seleccionados
|
@@ -186,6 +195,56 @@ class ResultadosConsulta < FXMainWindow
|
|
186
195
|
end
|
187
196
|
end
|
188
197
|
|
198
|
+
def imprimir_pdf
|
199
|
+
if registros_seleccionados.empty?
|
200
|
+
FXMessageBox.warning(self, MBOX_OK, 'Advertencia', 'Debe seleccionar al menos un registro')
|
201
|
+
else
|
202
|
+
# Genera el archivo PDF
|
203
|
+
Prawn::Document.generate(@archivo_pdf, margin: [100, 100, 100, 100]) do |pdf|
|
204
|
+
pdf.font 'Helvetica'
|
205
|
+
pdf.font_size 12
|
206
|
+
# Definir tres casos en los que se puede imprimir el certificado y los distintos formatos para bautismo, confirmación y matrimonio
|
207
|
+
# Bautismo
|
208
|
+
# Encabezado
|
209
|
+
pdf.image File.join(File.dirname(__FILE__), '../assets/images/arquidiocesisquito.png'), height: 80,
|
210
|
+
position: :absolute, at: [-60, 680]
|
211
|
+
pdf.text_box 'Arquidiócesis de Quito', align: :center, size: 16, style: :bold, at: [10, 670],
|
212
|
+
width: pdf.bounds.width
|
213
|
+
pdf.text_box 'Parroquia Eclesiástica "San Judas Tadeo"', align: :center, size: 14, style: :bold,
|
214
|
+
at: [10, 650], width: pdf.bounds.width
|
215
|
+
pdf.text_box "Jaime Roldós Aguilera, calle Oe13A y N82\nEl Condado, Quito - Ecuador\nTeléfono: 02496446",
|
216
|
+
align: :center, size: 10, at: [10, 630], width: pdf.bounds.width
|
217
|
+
pdf.image File.join(File.dirname(__FILE__), '../assets/images/sanjudastadeo.png'), height: 80,
|
218
|
+
position: :absolute, at: [430, 680]
|
219
|
+
# Título del certificado en color rojo
|
220
|
+
pdf.move_down 20
|
221
|
+
pdf.text 'CERTIFICADO', align: :center, size: 20, style: :bold, color: 'FF0000'
|
222
|
+
pdf.move_down 20
|
223
|
+
registros_seleccionados.each do |registro|
|
224
|
+
# Añadir márgenes izquierdo y derecho
|
225
|
+
# Fecha actual alineada a la derecha
|
226
|
+
pdf.text "Quito, #{cambiar_formato_fecha(Time.now.strftime('%d/%m/%Y'))}", align: :right
|
227
|
+
pdf.move_down 20
|
228
|
+
# Cuerpo
|
229
|
+
pdf.text "A quien interese por la presente CERTIFICO, que #{registro[1]} #{registro[2]}, participó en esta parroquia en el nivel de #{registro[7]} durante el periodo lectivo #{registro[9]}.", align: :justify
|
230
|
+
pdf.move_down 20
|
231
|
+
# Despedida
|
232
|
+
pdf.text 'Es todo cuanto puedo certificar en honor a la verdad', align: :justify
|
233
|
+
pdf.move_down 40
|
234
|
+
# Firma del párroco
|
235
|
+
pdf.text '_______________________________', align: :center
|
236
|
+
# Nombre del párroco
|
237
|
+
pdf.text (registro[10]).to_s, align: :center
|
238
|
+
# Parroco
|
239
|
+
pdf.text 'Párroco', align: :center
|
240
|
+
end
|
241
|
+
end
|
242
|
+
# Abre el archivo PDF con el visor de PDF predeterminado del sistema
|
243
|
+
system("xdg-open '#{@archivo_pdf}'")
|
244
|
+
# Mensaje de confirmación
|
245
|
+
FXMessageBox.information(self, MBOX_OK, 'Información', 'El archivo PDF se ha generado correctamente')
|
246
|
+
end
|
247
|
+
end
|
189
248
|
|
190
249
|
@btnedit.connect(SEL_COMMAND) do
|
191
250
|
# Editar registros seleccionados y actualizar la basee de datos
|