/var/www/vhosts/sivana.com.br/httpdocs/etapas-curriculo-formacao.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
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
<?
session_start
();
if (!isset(
$_SESSION['cur_cpf'])|| !isset($_SESSION['editcpf'])) {
echo 
"<script>window.location='banco-de-talentos.php?registro=desconhecido'</script>";
exit();    
}
 include_once(
"init.php");
 include(
"valida.jsp");
 include_once(
"functions.php");
?>
<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="iso-8859-1">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <meta name="description" content="">
        <meta name="author" content="">
        <link rel="icon" href="../../favicon.ico">

        <title>Sivana</title>
        <base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER HTTP_SERVER) . DIR_WS_CATALOG?>" />
        <!-- Bootstrap core CSS -->
        <link href="dist/css/bootstrap.min.css" rel="stylesheet">

        <!-- Custom styles for this template -->
        <link href="css/sivana.css" rel="stylesheet">
        <!-- Owl Carousel Assets -->
        <link href="owl-carousel/owl.carousel.css" rel="stylesheet">
        <link href="owl-carousel/owl.theme.css" rel="stylesheet">
        <!-- Just for debugging purposes. Don't actually copy these 2 lines! -->
        <!--[if lt IE 9]><script src="../../assets/js/ie8-responsive-file-warning.js"></script><![endif]-->
        <script src="assets/js/ie-emulation-modes-warning.js"></script>
        <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
        
        
        <script language= "javascript">
        <!--
        function aviso(id){
        if(confirm ('Deseja realmente excluir? '))
        {
        location.href="etapas-curriculo-formacao.php?excluir=ok&id_cont="+id;
        }
        else
        {
        return false;
        }
        }
        //-->
        </script>
        
        
        <script language="javascript" type="text/javascript" src="arquivo_ajax.js"></script>
        <script src="assets/js/ie10-viewport-bug-workaround.js"></script>
        <!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
        <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
        <!--[if lt IE 9]>
          <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
          <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
        <![endif]-->
       
        
        <?
            
function excluir () {
            
$id_cont $_GET['id_cont'];
            
$query_excluir mysql_query("delete from formacao where idformacao='$id_cont'") or die ("Erro ao selecionar");
            }
            
            if (
$_GET['excluir']=='ok'){
            
excluir();
            }
        
?>
    </head>

    <body>
        
        <? include ("topo-curriculo.php")?>
        <!-- Static navbar -->
        
        <div class="conteudo">
            <div class="container">
               <div class="vintespaco"></div>         
                
                    <div class="col-md-12">
                        <div class="principal">

                            <h1>Cadastrar Formação Acadêmica</h1>
                            <p>    
                                Preencha os campos abaixo para indicar sua formação acadêmica e clique em "Inserir", você pode inserir vários cursos. Para editar ou excluir um curso utilize a tabela abaixo que lista os cursos cadastrados.
Para passar para próxima etapa clique em "Avançar" ou selecione a aba desejada.
                            </p>
                            <div class="clearfix"></div>
                          <div class="row">
                            <div class="col-md-12">
                            
                            
                            <?php 
if ($_POST['ac_form']=='editar'){ 
$idcurriculo $_POST['idcurriculo'];
$idformacao $_POST['idformacao'];

        
$selecionar mysql_query("select formacao.*, grau_inst.grau from formacao left outer join grau_inst on (formacao.grau_inst_idgrau_inst=grau_inst.idgrau_inst) where idformacao='$idformacao' and curriculo_idcurriculo='$idcurriculo'") or die("erro ao selecionar");
        
$cont mysql_num_rows($selecionar);
        
        if (
$cont 0){
        
$l_formf=mysql_fetch_assoc($selecionar);
    
$dtn explode("-"$l_formf['data_inicio']);
    
$data_inicio $dtn[2] . '/' $dtn[1] . '/' $dtn[0];

    
$dtn explode("-"$l_formf['data_termino']);
    
$data_termino $dtn[2] . '/' $dtn[1] . '/' $dtn[0];
        }else{
           echo 
"<b><br><br><font color=#FF0000 size=3 face=Verdana><center>Erro ao buscar informações.</center></font></b><br>";?>
           <div align=center><form action="etapas_curriculo.php?p=2" method="post">
             <input type="submit" name="button2" id="button2" value="Voltar" />
           </form></div>
           <?php
           
exit();
           }
           
?>
                                <div class="block">
                                    <h1><i><img src="images/icon-calendario.png" class="nocem" /></i>Editar Formação Acadêmica</h1>
                                    <div class="news">
                                        <form id="cad_form" name="cad_form" method="post" action="central.php" onsubmit="return formformacao()">
                                        <div class="row">
                                            <div class="col-md-6">
                                            <label>Tipos de Formação *</label>
                                              <select name="grau" id="grau" onchange="javascript:mudar(this.value);" class="form-control" required>
                                              <?
                                        $grau_id 
$l_formf['grau_inst_idgrau_inst'?>
                                              <option value="<?=$l_formf['grau_inst_idgrau_inst'?>">
                                                <?=$l_formf['grau'?>
                                                </option><?php
                                           $sql 
"SELECT * FROM grau_inst where idgrau_inst <> '$grau_id'";
                                           
$resultado mysql_query($sql) or die ("Problema na Consulta");
                                            while(
$l_forminha mysql_fetch_array($resultado))
                                               {
                                        
?>
                                              <option value="<?=$l_forminha['idgrau_inst'?>">
                                                <?=$l_forminha['grau'?>
                                                </option>
                                              <?
                                               
}
                                        
?>
                                            </select>

                                            <input type="hidden" name="alterarformacao" id="alterarformacao" value="<?= $l_formf["idformacao"];?>">
                                            <input type="hidden" name="idcurriculo" id="idcurriculo" value="<?= $l_formf["curriculo_idcurriculo"];?>">
                                            </div>
                                            <div class="col-md-6">
                                            <label>Curso *</label>
                                               <div id="mostraCombo">
                                                <?php if ($l_formf['grau_inst_idgrau_inst']=='2'){?>
                                                <select name="curso" id="curso" class="form-control" required>
                                                  <?php
                                            $curso 
$l_formf['curso'];
                                            
$sql "SELECT * FROM graduacao";
                                            
$resultado mysql_query($sql) or die ("Erro na consulta do banco");
                                            while(
$l_forminha mysql_fetch_array($resultado))
                                            {
                                            
?>
                                                  <option value="<?=$l_forminha['curso'?><?php if ($l_forminha['curso']==$curso){echo 'selected="selected"'; }?>>
                                                    <?=$l_forminha['curso'?>
                                                    </option>
                                                  <?
                                            
}
                                            
                                            
?>
                                                </select>
                                                <?php } else { ?>
                                                <input name="curso" type="text" class="form-control" id="curso"  value="<?=$l_formf['curso'];?>" size="50" />
                                                <?php ?>
                                              </div>
                                              
                                            </div>
                                            
                                            <div class="col-md-6">
                                                <label>Situação *</label>
                                                <select name="situacao" id="situacao" class="form-control" required>
                                                 <option value="">Selecione</option>
                                                  <option value="Concluído" <?php if ($l_formf['situacao']=='concluido'){ echo 'selected="selected"' ;}?>>Concluído</option>
                                                  <option value="Cursando" <?php if ($l_formf['situacao']=='cursando'){ echo 'selected="selected"' ;}?>>Cursando</option>
                                                  <option value="Interrompido" <?php if ($l_formf['situacao']=='interrompido'){ echo 'selected="selected"' ;}?>>Interrompido</option>
                                                </select>
                                            </div>
                                            
                                            <div class="col-md-6">
                                                <label>Instituição *</label>
                                                <input type="text" class="form-control" name="instituicao" id="instituicao" value="<?php echo $l_formf['instituicao']; ?>" required>
                                            </div>
                                            
                                             <div class="col-md-3">
                                                <label>Data de Inicio </label>
                                                <input type="text" class="form-control data" name="data_inicio" id="data_inicio" value="<?php echo $data_inicio?>" >
                                            </div>
                                            
                                            <div class="col-md-3">
                                                <label>Data Término </label>
                                                <input type="text" class="form-control data" name="data_termino" id="data_termino" value="<?php echo $data_termino?>" >
                                            </div>
                                            
                                           
                                            
                                            <div class="col-md-6">
                                            
                                            <label>Cidade:*</label>
                                           <input name="cidade" type="text" class="form-control" id="cidade" size="25" value="<?php echo $l_formf['cidade']; ?>" required/>
                                            <div id="cod_cidade">
                                                
                                            </div>
                                            
                                            </div>
                                            
                                        </div><!-- ../ Row --> 
                                        <input type="submit" class="btn btn-lg btn-primary  " value="Alterar">  <a href="etapas-curriculo-formacao.php" class="nobg btn btn-lg pull-right"><input type="button" class="btn botao" value="Cancelar"></a>
                                        
                                        </form>
                                    </div>
                                </div>
  <?php
} else { ?>
                                <div class="block">
                                    <h1><i><img src="images/icon-calendario.png" class="nocem" /></i>Cadastrar Formação Acadêmica</h1>
                                    <div class="news">
                                        <form id="cad_form" name="cad_form" method="post" action="central.php" onsubmit="return formformacao()">
                                        <div class="row">
                                            <div class="col-md-6">
                                            <label>Tipos de Formação *</label>
                                              <select name="grau" id="grau" onchange="javascript:mudar(this.value);" class="form-control" required>
                                              <option value="">Selecione</option>
                                              <?
                                               $sql 
"SELECT * FROM grau_inst";
                                               
$resultado mysql_query($sql) or die ("Problema na Consulta");
                                               while(
$l_forminha mysql_fetch_array($resultado))
                                                   {
                                             
?>
                                              <option value="<?=$l_forminha['idgrau_inst'?>">
                                                <?=$l_forminha['grau'?>
                                                </option>
                                              <?
                                               
}
                                              
?>
                                            </select>
                                            <input type="hidden" name="cpf3" id="cpf3" value="<?=$_SESSION["cur_cpf"];?>">
                                            </div>
                                            <div class="col-md-6">
                                            <label>Curso </label>
                                              
                                              <input type="text" class="form-control" name="curso" id="curso" >
                                            </div>
                                            <div class="col-md-6">
                                                <label>Situação *</label>
                                                <select name="situacao" id="situacao" class="form-control" required>
                                                  <option value="">Selecionar</option>
                                                  <option value="Concluído">Concluído</option>
                                                  <option value="Cursando">Cursando</option>
                                                  <option value="Interrompido">Interrompido</option>
                                                </select>
                                            </div>
                                            
                                            <div class="col-md-6">
                                                <label>Instituição *</label>
                                                <input type="text" class="form-control" name="instituicao" id="instituicao" required>
                                            </div>
                                            
                                             <div class="col-md-3">
                                                <label>Data de Inicio</label>
                                                <input type="text" class="form-control data" name="data_inicio" id="data_inicio" >
                                            </div>
                                            
                                            <div class="col-md-3">
                                                <label>Data Término </label>
                                                <input type="text" class="form-control data" name="data_termino" id="data_termino" >
                                            </div>
                                            
                                           <div class="col-md-3">
                                              <label>UF:</label>
                                            
                                            <select class="form-control" name="cod_estados" id="cod_estados" required>
                                                <option value="">Selecione um estado</option>
                                                <?php
                                                    $sql 
"SELECT cod_estados, sigla
                                                            FROM estados
                                                            ORDER BY sigla"
;
                                                    
$res mysql_query$sql );
                                                    while ( 
$row mysql_fetch_assoc$res ) ) {
                                                        echo 
'<option value="'.$row['cod_estados'].'">'.$row['sigla'].'</option>';
                                                    }
                                                
?>
                                            </select>
                                            </div>
                                            
                                            <div class="col-md-3">
                                            
                                            <label>Cidade:*</label>
                                           <select name="tt" id="tt" class="form-control">
                                                <option value="">-- Escolha um estado --</option>
                                            </select>
                                            <div id="cod_cidade">
                                                
                                            </div>
                                            
                                            </div>
                                            
                                        </div><!-- ../ Row --> 
                                        <input type="submit" class="btn btn-lg btn-primary " value="Inserir Formação">  <br><br><br><br><br><br>
                                        
                                        
                                        <a href="etapas-curriculo-cursos.php" class="pull-right nobg"><input type="button" class="btn botao pull-right" value="Avançar Etapa"></a>
                                        
                                        </form>
                                    </div>
                                </div>
                                <? ?>
                                <div class="clearfix"></div>
                                
                                    <?
                                        $cpf 
sonumeros($_SESSION["cur_cpf"]);
                                        
$selecionar_form mysql_query("select idcurriculo, grau_inst from curriculo where cpf='$cpf'") or die("erro ao selecionar");
                                        
$cont_form mysql_num_rows($selecionar_form);
                                         
                                         if (
$cont_form 0){
                                         
$l_form=mysql_fetch_assoc($selecionar_form);
                                         
$idcurriculo$l_form['idcurriculo'];
                                         
$grau_inst$l_form['grau_inst'];
                                        }else{
                                            exit();
                                        }
                                    
?>
                                    
<?php

$idcurriculo 
$l_form['idcurriculo'];
$sql_form mysql_query("select formacao.*, grau_inst.grau from formacao left outer join grau_inst on (formacao.grau_inst_idgrau_inst=grau_inst.idgrau_inst) where curriculo_idcurriculo='$idcurriculo'") or die("erro ao selecionar");
$cont_form mysql_num_rows($sql_form);
if (
$cont_form 0){?>
<div class="block">
<h1><i><img src="images/icon-calendario.png" class="nocem" /></i>Cursos Cadastrados</h1>
<div class="news">
  <table width="100%" border="0" align="center" cellpadding="0" cellspacing="1" class="borda">
  
  <tr class="t_tit">
    <td width="6%">#</td>
    <td width="46%">Cursos</td>
    <td width="24%">Forma&ccedil;&atilde;o</td>
    <td width="11%">Situacao</td>
    <td width="13%">A&ccedil;&atilde;o</td>
    </tr>
  <?php 
    
for ($i 0$i $cont_form$i++)    {
        
$dados_form mysql_fetch_assoc($sql_form); 
        
$style "trbranco";
        if (
$i != 0) {
         
$style "trcinza";
    }
        
$contador$i+1;
    
?>
  <tr  class="<?php echo $style ?>">
    <td align="center" class="colun" ><?php echo $contador?></td>
    <td class="colun"><?php echo $dados_form['curso']; ?></td>
    <td align="left" class="colun"><?php echo $dados_form['grau']; ?></td>
    <td align="left" class="colun"><?php echo $dados_form['situacao']; ?></td>
        <td align="center" class="colun">
            <table width="100%" border="0" cellspacing="0" cellpadding="0">
                <tr valign="middle">
                  <td>
                  <div style="height:5px;"></div>
                  <form id="form1" name="form1" method="post" action="etapas-curriculo-formacao.php">
                    <input type="submit" name="imageField" id="imageField" class="btn botao" value="Editar" />
                    <input name="idformacao" id="idformacao" type="hidden" value="<?php echo $dados_form['idformacao']?>" />
                    <input name="idcurriculo" id="idcurriculo" type="hidden" value="<?php echo $dados_form['curriculo_idcurriculo']?>" />
                    <input name="ac_form" type="hidden" value="editar" />
                    <input type="button" name="imageField" id="imageField" class="btn botao" onclick="aviso('<?php echo $dados_form['idformacao']?>');" value="Excluir" />
                   
                  </form>
                 </td>
                </tr>
            </table>
        </td>
    </tr>
  <?php } while ($dados_form mysql_fetch_assoc($sql_form)); 
?>
</table>
</div>
</div>
<?php  ?> 
                                    
                                
                            </div>
                          </div>  
                           <div class="clearfix"></div>
                        </div>
                    </div><!-- col 8  -->     
                    
                    
              
                <div class="vintespaco"></div>
                
            </div> <!-- /container -->
            <? include ("rodape.php"?>
        </div><!-- Conteudo do site-->


        <!-- Bootstrap core JavaScript
        ================================================== -->
        <!-- Placed at the end of the document so the pages load faster -->
        
        <script src="dist/js/bootstrap.min.js"></script>
        <script src="owl-carousel/owl.carousel.js"></script>
        <script src='ajax-cidades.js' type='text/javascript'></script>
        <script src="js/mascara.js"></script>
    </body>
</html>