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
|
<?php if (($_SESSION['asso']=='asso_siv')) { ?>
<?php include_once("../_private/conectar.php"); include ("../valida.jsp");
function gravar() { foreach ($_POST as $campo => $valor ){ $$campo = strip_tags(trim($valor)); } $data = date('Y-m-d'); $autor =$_SESSION['id_asso']; /* $dt=explode(":", $horai); $horai=$dt[2] .':' . $dt[2].':00'; $dt=explode("/", $horaf); $horaf=$dt[2] .':' . $dt[2].':00'; */
$query = mysql_query("update vagas set empresa='$empresa', telefone='$fone', email='$email', endereco='$end', funcao='$funcao', idade='$idade', escolaridade='$grau', experiencia='$exp', sexo='$sexo', horai='$horai', horaf='$horaf', feriados='$feriados', qtde='$qtde' where idvagas='$id' and autor='$autor'") or die ("erro ao selecionar a tabela".mysql_error());
if ($query) { echo "<script> alert('Vaga alterada com sucesso!') </script>"; print "<script>window.location='listar_vagas.php'</script>"; } }
if ($_POST['editar']=='salvar') { gravar(); }
$autor =$_SESSION['id_asso']; $id = $_GET['id'];
$selecionar = "SELECT * FROM vagas where autor='$autor' and idvagas='$id'"; $sql = mysql_query($selecionar) or die("erro ao selecionar"); $total = mysql_num_rows($sql);?> <table width="684" border="0" cellspacing="0" cellpadding="0"> <?php if ($total > 0){ $dados = mysql_fetch_assoc($sql); ?> <tr> <td> <table width="684" border="0" cellspacing="0" cellpadding="0"> <tr> <td class="titulo2"><div align="center">EDITAR VAGA</div></td> </tr> <tr> <td> </td> </tr> <tr> <td><form id="f_vagas" name="f_vagas" method="post" action="?p=12" onsubmit="return Formvagas()"> <table width="684" border="0" cellspacing="2" cellpadding="0"> <tr> <td height="30" colspan="2" class="titulo2B">INFORMAÇÕES DA EMPRESA <input name="id" type="hidden" id="id" value="<?=$dados['idvagas'];?>" /></td> </tr> <tr> <td width="132" height="25" align="right" class="texto_escuro">Empresa:</td> <td width="552" height="25" class="texto_escuro"><label> <input name="empresa" type="text" id="empresa" size="50" value="<?=$dados['empresa'];?>"/> <input name="editar" type="hidden" id="editar" value="salvar" /> </label></td> </tr> <tr> <td height="25" align="right" class="texto_escuro">Telefone:</td> <td height="25" class="texto_escuro"><label> <input type="text" name="fone" id="fone" value="<?=$dados['telefone'];?>" onKeyUp="return txtBoxFormat(this, '(99) 9999-9999', event);" maxlength="14"/> </label></td> </tr> <tr> <td height="25" align="right" class="texto_escuro">E-mail:</td> <td height="25" class="texto_escuro"><label> <input name="email" type="text" id="email" size="50" value="<?=$dados['email'];?>"/> </label></td> </tr> <tr> <td height="25" align="right" class="texto_escuro">Endereço:</td> <td height="25"><label> <textarea name="end" id="end" cols="50" rows="3"><?=$dados['endereco'];?></textarea> </label></td> </tr> <tr> <td height="30" colspan="2" class="titulo2B">DESCRIÇÃO VAGA</td> </tr> <tr> <td height="25" align="right" class="texto_escuro">Função:</td> <td height="25" class="texto_escuro"><label> <input name="funcao" type="text" id="funcao" size="50" value="<?=$dados['funcao'];?>"/> </label></td> </tr> <tr> <td height="25" align="right" class="texto_escuro"><font color="#FF0000">*</font> Qtde de Vagas:</td> <td height="25" class="texto_escuro"><label> <input name="qtde" type="text" id="qtde" size="10" value="<?=$dados['qtde'];?>" onkeypress='return SomenteNumero(event)'/> </label></td> </tr> <tr> <td height="25" align="right" class="texto_escuro">Idade:</td> <td height="25" class="texto_escuro"><label> <select name="idade" id="idade"> <option value="0" <?php if ($dados['idade'] == '0'){ echo 'selected="selected" '; }?>>Não mostrar</option> <option value="18" <?php if ($dados['idade'] == '18'){ echo 'selected="selected" '; }?>>Maior de 18 anos</option> </select> </label></td> </tr> <tr> <td height="25" align="right" class="texto_escuro">Escolaridade:</td> <td height="25" class="texto_escuro"><span class="texto_escuro"> <select name="grau" id="grau"> <option value="0" selected="selected" <?php if ($dados['escolaridade'] == '0'){ echo 'selected="selected" ';} ?>>Não mostrar</option> <option value="1" <?php if ($dados['escolaridade'] == '1'){ echo 'selected="selected" ';} ?>>Ensino Médio</option> <option value="2" <?php if ($dados['escolaridade'] == '2'){ echo 'selected="selected" '; }?>>Ensino Superior</option> </select> </span></td> </tr> <tr> <td height="25" align="right" class="texto_escuro">Experiência:</td> <td height="25" class="texto_escuro"><table width="200"> <tr> <td width="63"><label> <input type="radio" name="exp" value="s" id="exp_0" <?php if ($dados['experiencia'] == 's'){ echo 'checked="checked"'; }?>/> Sim</label></td> <td width="125"><input type="radio" name="exp" value="n" id="exp_1" <?php if ($dados['experiencia'] == 'n'){ echo 'checked="checked"';} ?>/> Não necessária</td> </tr> </table> </td> </tr> <tr> <td height="25" align="right" class="texto_escuro"> Sexo:</td> <td height="25" class="texto_escuro"><label> <select name="sexo" id="sexo"> <option value="a" <?php if ($dados['sexo'] == 'a'){ echo 'selected="selected" '; }?>>Ambos</option> <option value="f" <?php if ($dados['sexo'] == 'f'){ echo 'selected="selected" '; }?>>Feminino</option> <option value="m" <?php if ($dados['sexo'] == 'm'){ echo 'selected="selected" ';} ?>>Masculino</option> </select> </label></td> </tr> <tr> <td height="30" colspan="2" class="titulo2B">INFORMAÇÕES TURNO:</td> </tr> <tr> <td height="25" colspan="2" class="texto_escuro">Horário das <label> <input name="horai" type="text" id="horai" size="8" value="<?=$dados['horai'];?>"/> </label> às hs <label> <input name="horaf" type="text" id="horaf" size="8" value="<?=$dados['horaf'];?>"/> </label></td> </tr> <tr> <td height="5" colspan="2" class="texto_escuro"> </td> </tr> <tr> <td height="25" colspan="2" class="texto_escuro">Com Disponibilidade de Horário nos Domingos e Feriados? </td> </tr> <tr> <td height="25" colspan="2" class="texto_escuro"><table width="200"> <tr> <td width="63"><label> <input type="radio" name="feriados" value="s" id="exp_2" <?php if ($dados['feriados'] == 's'){ echo 'checked="checked"'; }?>/> Sim</label></td> <td width="125"><input type="radio" name="feriados" value="n" id="exp_3" <?php if ($dados['feriados'] == 'n'){ echo 'checked="checked"';} ?>/> Não necessário</td> </tr> </table></td> </tr> <tr> <td> </td> <td> </td> </tr> <tr> <td> </td> <td><label> <input type="submit" name="Submit" id="Submit" value="Alterar Vaga" /> <input type="button" value="Cancelar" onclick="javascript:window.location='listar_vagas.php'" /> </label></td> </tr> </table> </form> </td> </tr> <tr> <td></td> </tr> </table></td> </tr> <?php }else{?> <tr><td class="texto_escuro">Nenhum registro encontrado!</td></tr> <?php } ?> </table> <?php } else { print("<script language='javascript'>window.location ='index.php?login=no'</script>"); } ?>
|