-
Notifications
You must be signed in to change notification settings - Fork 0
/
cad-associados.php
300 lines (296 loc) · 12.3 KB
/
cad-associados.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
<html>
<head>
<?php
//require_once("cabecalho.php");
include("head.php");
?>
</head>
<?php
include("bd.php");
$result = $_POST['idAssoc'];
?>
<body style="overflow-x:hidden;">
<?php
if($result){
$acao = 'u';
}else{
$acao = 'i';
}
$associados = resultBuscaAssociado($conn, $result);
foreach($associados as $associado) :
?>
<iframe id="ifm-aux" name="ifm-aux" style="display:none;"></iframe>
<div>
<center><h2>Cadastro de Novo Associado</h2>
<br>
<br>
<form name="frm-cad-assoc" id="frm-cad-assoc" action="save-cad-associado.php" method="POST">
<input type="hidden" id="idAssoc" name="idAssoc" value="<?=$associado->getIdAssociado();?>">
<input type="hidden" id="acao" name="acao" value="<?=$acao?>">
<table class="table-responsive text-10">
<tbody>
<tr>
<th nowrap>Cód. Associado</th>
<td><input class="formulario input-sm text-center" type="text" id="codAssociado" name="codAssociado" value="<?=$associado->getCodAssociado();?>"></td>
<th nowrap>Data de Início GYO</th>
<td>
<form class="form-horizontal" method="post">
<input class="formulario input-sm text-center" id="dtIniGYO" name="dtIniGYO" placeholder="MM/DD/YYYY" value="<?=dateToBR($associado->getDataInicioGYO());?>" type="text"/>
</form>
</td>
<th nowrap>Tipo Mensalidade</th>
<td>
<select class="formulario input-sm" id="mensalidade" name="mensalidade">
<?php
$tipoMensalidade = buscaTipoMensalidade($conn,'');
foreach($tipoMensalidade as $tm) :
$assocTM = $associado->getIdTipoMensalidade() == $tm->getIdTipoMensalidade();
$selecaoTM = $assocTM ? "selected='selected'" : "";
?>
<option value="<?=$tm->getIdTipoMensalidade();?>" <?=$selecaoTM?> >
<?=$tm->getTipoMensalidade();?>
</option>
<?php
endforeach
?>
</select>
</td>
</tr>
<tr>
<th nowrap>Data de Nasc.</th>
<td>
<input type="datetimelocal" id="dtnasc" name="dtnasc" class="formulario input-sm text-center" value="<?=dateTimeToBR($associado->getDataNascimento());?>" />
<script type="text/javascript">
$('#dtnasc').datetimepicker({
format: "dd/mm/yyyy HH:ii:ss",
language: "pt-BR",
autoclose: true
});
</script>
</td>
<th>Local Nasc.</th>
<td>
<select class="formulario input-sm" id="idLocalNascimento" name="idLocalNascimento">
<?php
$cidades = buscaCidade($conn,'');
foreach($cidades as $cidade) :
$cid = $associado->getLocalNascimento() == $cidade->getIdCidade();
$selecaoCid = $cid ? "selected='selected'" : "";
?>
<option value="<?=$cidade->getIdCidade();?>" <?=$selecaoCid?>>
<?=$cidade->getCidade();?>
</option>
<?php
endforeach
?>
</select>
</td>
<th nowrap> </th>
<td> </td>
</tr>
<tr>
<td colspan="6"><hr></td>
</tr>
<tr>
<th rowspan="2" style="vertical-align: middle;">Primeiro Nome</th>
<td><input class="formulario input-sm" type="text" id="nomePrimeiro" name="nomePrimeiro" value="<?=$associado->getPrimeiroNome();?>"></td>
<th rowspan="2" style="vertical-align: middle;">Nome do Meio</th>
<td><input class="formulario input-sm" type="text" id="nomeSegundo" name="nomeSegundo" value="<?=$associado->getSegundoNome();?>"></td>
<th rowspan="2" style="vertical-align: middle;">Sobrenome</th>
<td><input class="formulario input-sm" type="text" id="sobreNome" name="sobreNome" value="<?=$associado->getSobrenome();?>"></td>
</tr>
<tr>
<td><input class="formulario input-sm" type="text" id="nomePrimeiroJap" name="nomePrimeiroJap" value="<?=$associado->getNomeJapones();?>">
<td><input class="formulario input-sm" type="text" id="nomeSegundoJap" name="nomeSegundoJap" value="<?=$associado->getSegundoNomeJapones();?>"></td>
<td><input class="formulario input-sm" type="text" id="sobrenomeJap" name="sobrenomeJap" value="<?=$associado->getSobrenomeJapones();?>"></td>
<td colspan="2"> </td>
</tr>
<tr>
<th>Local Associação</th>
<td><?=$associado->getLocalAssociacao();?></td>
<th>Estado Civil</th>
<td>
<select class="formulario input-sm" id="estadocivil" name="estadocivil">
<?php
$estadoCivil = buscaEstadoCivil($conn,'');
foreach($estadoCivil as $ec) :
$assocec = $associado->getIdEstadoCivil() == $ec->getIdEstadoCivil();
$selecao = $assocec ? "selected='selected'" : "";
?>
<option value="<?=$ec->getIdEstadoCivil();?>" <?=$selecao?> >
<?=$ec->getEstadoCivil();?>
</option>
<?php
endforeach
?>
</select>
<th>Sexo</th>
<td>
<select class="formulario input-sm" id="sexo" name="sexo">
<option value="M" selected="selected">MASCULINO</option>
<option value="F">FEMININO</option>
</select>
</td>
</tr>
<tr>
<td colspan="6"><hr></td>
</tr>
<tr>
<th colspan="6"><h4>Informações Pessoais</h4></th>
</tr>
<tr>
<th>Tel. Residencial</th>
<td>
<input class="formulario input-sm" size="2" type="text" id="dddTelResid" name="dddTelResid" value="<?=$associado->getDDDTelefoneResid();?>" maxlength="2" size="2">
<input class="formulario input-sm" size="9" type="text" id="telefoneResid" name="telefoneResid" value="<?=$associado->getTelefoneResid();?>" maxlength="9" size="10">
</td>
<th>Tel. Celular</th>
<td>
<input class="formulario input-sm" size="2" type="text" id="dddTelCel" name="dddTelCel" value="<?=$associado->getDDDTelefoneCel();?>" maxlength="2" size="2">
<input class="formulario input-sm" size="9" type="text" id="telefonecel" name="telefoneCel" value="<?=$associado->getTelefoneCel();?>" maxlength="9" size="10">
</td>
<th>E-mail</th>
<td><input class="formulario input-sm" type="email" id="email" name="email" value="<?=$associado->getEmailAssociado();?>"></td>
</tr>
<tr><td> </td></tr>
<tr>
<th>CEP</TH>
<td>
<input class="formulario input-sm" type="text" id="cepResid" name="cepResid" value="<?=$associado->getCepResid();?>" maxlength="9">
<input type="button" class="btn btn-sm" id="btnResid" name="btnResid" value="Buscar CEP">
</td>
</tr>
<tr>
<th>Rua</th>
<td><input class="formulario input-sm" type="text" id="ruaResid" name="ruaResid" value="<?=$associado->getEnderecoResid();?>" size="34"></td>
<th>Número</th>
<td><input class="formulario input-sm" size="6" type="text" id="numeroResid" name="numeroResid" value="<?=$associado->getNumeroResid();?>"></td>
<th>Complemento</th>
<td><input class="formulario input-sm" type="text" id="complementoResid" name="complementoResid" value="<?=$associado->getComplementoResid();?>"></td>
</tr>
<tr>
<th>Bairro</th>
<td><input class="formulario input-sm" type="text" id="bairroResid" name="bairroResid" value="<?=$associado->getBairroResid();?>"></td>
<th>Cidade</th>
<td><input class="formulario input-sm" size="10" type="text" id="cidadeResid" name="cidadeResid" value="<?=$associado->getCidadeResid();?>"></td>
<th>Estado</th>
<td><input class="formulario input-sm" type="text" id="ufResid" name="ufResid" maxlength="2" value="<?=$associado->getEstadoResid();?>"></td>
</tr>
<tr>
<td colspan="6"><hr></td>
</tr>
<tr>
<th colspan="6"><h4>Informações Comerciais</h4></th>
</tr>
<tr>
<th>Profissão</th>
<td>
<select class="formulario input-sm" id="profissao" name="profissao">
<?php
$profissao = buscaProfissao($conn,'');
foreach($profissao as $tipo) :
$verifica = $associado->getIdProfissao() == $tipo->getIdProfissao();
$select = $verifica ? "selected='selected'" : "";
?>
<option value="<?=$tipo->getIdProfissao();?>" <?=$select?> ><?=$tipo->getProfissao();?></option>
<?php
endforeach
?>
</select>
</td>
</tr>
<tr>
<th>Tel. Comercial</th>
<td>
<input class="formulario input-sm" size="2" type="text" id="dddTelCom" name="dddTelCom" value="<?=$associado->getDDDTelefoneCom();?>" maxlength="2" size="2">
<input class="formulario input-sm" size="9" type="text" id="telefoneCom" name="telefoneCom" value="<?=$associado->getTelefoneCom();?>" maxlength="9" size="10">
<strong>Ramal</strong>
<input class="formulario input-sm" size="4" type="text" id="ramalTelefoneCom" name="ramalTelefoneCom" value="<?=$associado->getRamalTelefoneCom();?>">
</td>
<th>Tel. Comercial</th>
<td colspan="2" nowrap>
<input class="formulario input-sm" size="2" type="text" id="dddTelefoneCom2" name="dddTelefoneCom2" value="<?=$associado->getDDDTelefoneCom2();?>" maxlength="2" size="2">
<input class="formulario input-sm" size="9" type="text" id="telefoneCom2" name="telefoneCom2" value="<?=$associado->getTelefoneCom2();?>" maxlength="9" size="10">
<strong>Ramal</strong>
<input class="formulario input-sm" size="4" type="text" id="ramalTelefoneCom2" name="ramalTelefoneCom2" value="<?=$associado->getRamalTelefoneCom2();?>">
</td>
</tr>
<tr><td> </td></tr>
<tr>
<th>CEP</TH>
<td>
<input class="formulario input-sm" type="text" id="cepCom" name="cepCom" value="<?=$associado->getCepCom();?>" maxlength="9">
<input type="button" class="btn btn-sm" id="btnCom" name="btnCom" value="Buscar CEP">
</td>
</tr>
<tr>
<th>Rua</th>
<td><input class="formulario input-sm" type="text" id="ruaCom" name="ruaCom" size="34" value="<?=$associado->getEnderecoCom();?>"></td>
<th>Número</th>
<td><input class="formulario input-sm" size="6" type="text" id="numeroCom" name="numeroCom" value="<?=$associado->getNumeroCom();?>"></td>
<th>Complemento</th>
<td><input class="formulario input-sm" type="text" id="complementoCom" name="complementoCom" value="<?=$associado->getComplementoCom();?>"></td>
</tr>
<tr>
<th>Bairro</th>
<td><input class="formulario input-sm" type="text" id="bairroCom" name="bairroCom" value="<?=$associado->getBairroCom();?>"></td>
<th>Cidade</th>
<td><input class="formulario input-sm" size="10" type="text" id="cidadeCom" name="cidadeCom" value="<?=$associado->getCidadeCom();?>"></td>
<th>Estado</th>
<td><input class="formulario input-sm" type="text" id="ufCom" name="ufCom" maxlength="2" value="<?=$associado->getEstadoCom();?>"></td>
</tr>
<tr>
<td colspan="6"><hr></td>
</tr>
<tr>
<th>Apresentador</th>
<td><input class="formulario input-sm" type="text" id="apresentador" name="apresentador" value="<?=$associado->getApresentador();?>"></td>
<th>Padrinho</th>
<td><input class="formulario input-sm" type="text" id="padrinho" name="padrinho" value="<?=$associado->getApadrinhamento();?>"></td>
<th>Resp. Presente GYO</th>
<td><input class="formulario input-sm" type="text" id="presenteGYO" name="presenteGYO" value="<?=$associado->getPresenteGYO();?>"></td>
</tr>
<tr>
<td colspan="6"><hr></td>
</tr>
<tr>
<th style="vertical-align: middle;" colspan ="3">Observaçðes</th>
<th style="vertical-align: middle;" colspan ="3">Motivo Entrada</th>
</tr>
<tr>
<td colspan="3">
<textarea class="form-control" cols="30" id="obs" name="obs"><?=$associado->getObsAssociado();?></textarea>
</td>
<td colspan="3">
<textarea cols="40" class="form-control" id="motivoEntrada" name="motivoEntrada"><?=$associado->getMotivoEntrada();?></textarea>
</td>
</tr>
<tr>
<td colspan="6"> </td>
</tr>
<tr>
<td colspan="2"> </td>
<td><input type="button" class="btn btn-danger" id="btn-volta" name="btn-volta" value="Voltar" onclick="javascript: history.back();"></td>
<td class="text-center">
<button form="frm-cad-assoc" class="btn btn-primary" type="submit" target="ifm-aux">Salvar</button>
</td>
<td colspan="2"> </td>
</tr>
</tbody>
</table>
</form>
<?php
endforeach
?>
</div>
<?php
include("modal-associados.php");
include("library\scripts.php");
include("rodape.php");
?>
</body>
</html>