<?php
include 'header.php';
include 'erpc_gp_setores_toolbar.php';
include_once 'connect.php';

if(isset($_GET['id'])){
    $id = base64_decode($_GET['id']);
    $consulta = "select * from erpc_gp_setores where id = $id";
    $result = mysqli_query($conexao, $consulta);
    if(mysqli_num_rows($result)>0){
        $result = mysqli_fetch_array($result);
        $ds_setor = $result['ds_setor'];
    }
}

?>

<!-- Nav tabs -->
<ul class="nav nav-tabs" role="tablist">
  
  	
 
  </li>
  <!--
  <li role="presentation"><a href="#form2" aria-controls="form2" role="tab" data-toggle="tab">Form #2</a></li>
  <li role="presentation"><a href="#form3" aria-controls="form3" role="tab" data-toggle="tab">Form #3</a></li>
  <li role="presentation"><a href="#form4" aria-controls="form4" role="tab" data-toggle="tab">Form #4</a></li>
  -->
</ul>

<form id=validate_custom method=POST action="erpc_gp_setores_ws.php">

<!-- Tab panes -->
  <div class="tab-content">
    <div role="tabpanel" class="tab-pane fade in active" id="form1">
	  
      <div class="block">
      	<div class=header>
      		<h2>Editar Setor:</h2>
    	</div>
        <div class="content controls">
          <div class="form-row">
            <div class="col-md-2">
              <label>ID</label>
            </div>
            <div class="col-md-6">
              <input readonly type="text" name="id" class="form-control" value="<?= sgcws_attr($id); ?>" />
            </div>
          </div>
          <div class="form-row">
            <div class="col-md-2">
              <label for="funcoes[ds_funcao]">Setor</label>
            </div>
            <div class="col-md-6">
              <input type="text" name="ds_setor" class="form-control nouppercase" value="<?= sgcws_attr($ds_setor); ?>" />
            </div>
          </div>
 
        </div> <!-- controls -->
        
        <div class=footer>
          <div class="side pull-right">
            <div class=btn-group>
    		        <button class="btn btn-default" type="button" onClick="window.history.go(-1)" value="Voltar">Voltar</button>
                <button class="btn btn-success" type="submit" value="editar" onClick="$('#validate_custom').validationEngine('hide');" name="editar">Editar</button>
    		    </div>
          </div>
        </div>
        
      </div> <!-- block -->
    </div> <!-- tab-pane -->
 </div> <!-- tab-content -->
</form>

  <?php
include 'footer.php';
?>
