<commit_before>
<html>
    <head>
        <title>Kairos</title>
        <?php
        include "../include/include_css.php";
        include "../menu_principal/menu_lateral.php";
        include "../header/header.php";
        include '../include/include_classes.php';
        ?>         
        <meta charset="UTF-8">
        <script type="text/javascript" src="../../js/validadores.js"></script>
       
    </head>
    
    
    <body >
        
            <?php
            
              $id = (int) $_GET[md5('idDept')];
              $departamento = new departamento(); 
            if (isset($_POST['atualizar'])):

                
            $nome_dept = $_POST['nome_dept'];
            $cnpj = $_POST['cnpj'];
            $lider = $_POST['lider'];
            $gerente = $_POST['gerente'];
            $endereco = $_POST['endereco'];
          
         
            $departamento->setNome($nome_dept);
            $departamento->setCnpj($cnpj);
           
            $departamento->setLider($lider);
            $departamento->setGerente($gerente);
            $departamento->setIdEnderecoFK($endereco);
            $departamento->setId($id);

                if ($departamento->update($id)) {
                    echo "<script>alert('Departamento Atualizado!')</script>";
                }

            endif;
            ?>  

        <!-- Wrapper da pagina -->
        <div id="page-wrapper" style="overflow-x: hidden; padding-left: 250px; height:100%; padding-top: 30px;">
            <!-- Primeira linha do wrapper -->
            <div class="row" >
                <div class="col-lg-12">
                    <h1 class="page-header">Editar Departamento</h1>
                </div>
            </div>
           
            <div class="row">
                
                <div class="col-lg-8">
                    <div class="panel panel-default">
                        <!-- Conteudo dentro de wrapper -->
                        <div class="panel-body">
                            <div id="chart">
                                <?php $resultado = $departamento->find($id);  ?> 
                                <form method="post" action="">
                                    <div class="input-prepend">
                                        
                                        <div class="row">
                                                <div class="form-group col-lg-4">
                                                  <label for="nome_dept">Nome Departamento</label>
                                                  <input type="text" class="form-control" id="nome_dept" value="<?php echo $resultado->nome; ?>" name="nome_dept" onkeypress="javascript: mascara(this, soLetras);" placeholder="Nome Departamento" required>

                                                </div>

                                                
                                                <div class="form-group col-lg-8">
                                                  <label for="endereco">Endere&ccedil;o</label>
                                                    <select  class="form-control" name="endereco" id="enderecoEdit">
                                                      <option value="<?php $endereco = new endereco; $end = $resultado->idEnderecoFK; $ender = $endereco->find($end); echo $resultado->idEnderecoFK; ?>" selected><?php echo $ender->endereco." Nº: ".$ender->numero; ?></option>  
                                                        <?php foreach ($endereco->whereSelectedEnd($end) as $key => $value): ?>
                                                        <option value="<?php echo $value->id; ?>">
                                                        <?php echo $value->endereco."Nº: ".$value->numero; ?></option> 
                                                        <?php endforeach; ?>
                                                    </select>
                                                </div> 
     

                                                <div class="form-group col-lg-4">
                                                  <label for="cnpj">CNPJ</label>
                                                  <input type="text" class="form-control" name="cnpj"  value="<?php echo $resultado->cnpj; ?>" id="cnpjEdit" placeholder="CNPJ" readonly>
                                                </div>     <commit_msg>Correção no combo de endereço.<commit_after>
<html>
    <head>
        <title>Kairos</title>
        <?php
        include "../include/include_css.php";
        include "../menu_principal/menu_lateral.php";
        include "../header/header.php";
        include '../include/include_classes.php';
        ?>         
        <meta charset="UTF-8">
        <script type="text/javascript" src="../../js/validadores.js"></script>
       
    </head>
    
    
    <body >
        
            <?php
            
              $id = (int) $_GET[md5('idDept')];
              $departamento = new departamento(); 
            if (isset($_POST['atualizar'])):

                
            $nome_dept = $_POST['nome_dept'];
            $cnpj = $_POST['cnpj'];
            $lider = $_POST['lider'];
            $gerente = $_POST['gerente'];
            $endereco = $_POST['endereco'];
          
         
            $departamento->setNome($nome_dept);
            $departamento->setCnpj($cnpj);
           
            $departamento->setLider($lider);
            $departamento->setGerente($gerente);
            $departamento->setIdEnderecoFK($endereco);
            $departamento->setId($id);

                if ($departamento->update($id)) {
                    echo "<script>alert('Departamento Atualizado!')</script>";
                }

            endif;
            ?>  

        <!-- Wrapper da pagina -->
        <div id="page-wrapper" style="overflow-x: hidden; padding-left: 250px; height:100%; padding-top: 30px;">
            <!-- Primeira linha do wrapper -->
            <div class="row" >
                <div class="col-lg-12">
                    <h1 class="page-header">Editar Departamento</h1>
                </div>
            </div>
           
            <div class="row">
                
                <div class="col-lg-8">
                    <div class="panel panel-default">
                        <!-- Conteudo dentro de wrapper -->
                        <div class="panel-body">
                            <div id="chart">
                                <?php $resultado = $departamento->find($id);  ?> 
                                <form method="post" action="">
                                    <div class="input-prepend">
                                        
                                        <div class="row">
                                                <div class="form-group col-lg-4">
                                                  <label for="nome_dept">Nome Departamento</label>
                                                  <input type="text" class="form-control" id="nome_dept" value="<?php echo $resultado->nome; ?>" name="nome_dept" onkeypress="javascript: mascara(this, soLetras);" placeholder="Nome Departamento" required>

                                                </div>

                                                
                                                <div class="form-group col-lg-8">
                                                  <label for="endereco">Endere&ccedil;o</label>
                                                    <select  class="form-control" name="endereco" id="enderecoEdit">
                                                      <option value="<?php $endereco = new endereco; $end = $resultado->idEnderecoFK; $ender = $endereco->find($end); echo $resultado->idEnderecoFK; ?>" selected><?php echo $ender->endereco." Nº: ".$ender->numero; ?></option>  
                                                        <?php foreach ($endereco->whereSelectedEnd($end) as $key => $value): ?>
                                                        <option value="<?php echo $value->id; ?>">
                                                        <?php echo $value->endereco." Nº: ".$value->numero; ?></option> 
                                                        <?php endforeach; ?>
                                                    </select>
                                                </div> 
     

                                                <div class="form-group col-lg-4">
                                                  <label for="cnpj">CNPJ</label>
                                                  <input type="text" class="form-control" name="cnpj"  value="<?php echo $resultado->cnpj; ?>" id="cnpjEdit" placeholder="CNPJ" readonly>
                                                </div>     
{'fraction_non_alphanumeric': 0.13338604020781566, 'fraction_numerical': 0.0040659588886379034, 'mean_word_length': 1.01204271756419, 'pattern_counts': {'":': 0, '<': 123, '<?xml version=': 0, '>': 163, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 86, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1876546', 'n_tokens_mistral': 2134, 'n_tokens_neox': 2060, 'n_words': 371}