File "edit.php"
Full path: /home2/camaradearamari/public_html/cmd/edit.php
File size: 8.27 KiB (8470 bytes)
MIME-type: text/x-php
Charset: utf-8
<?php include('src/View/Layout/main.php');
$n_p = $_GET['parlamentar']; // Assumindo que o valor do protocolo é obtido por meio de uma variável GET
$query = "SELECT * FROM parlamentares WHERE nome_parlamentar = '$n_p'";
$result = mysqli_query($conn, $query);
while ($row = mysqli_fetch_assoc($result)) {
$url_img = $row['url_img'];
$nome = $row['nome_completo'];
$nome_parlamentar = $row['nome_parlamentar'];
$ocupacao = $row['ocupacao'];
$naturalizada = $row['naturalidade'];
$partido = $row['partido'];
$naturalidade = $row['naturalidade'];
$data_nascimento = $row['data_nascimento'];
$telefone = $row['telefone'];
$email = $row['email'];
$parlamentar_id = $row['id'];
}
?>
<main class="content">
<button onclick="goBack()" class="btn btn-dark mb-3">Voltar <i data-feather="corner-up-left"
class="ms-2"></i></button>
<br>
<h1 class="h3 mb-3">EDITAR DADOS DO PARLAMENTAR<i class="align-middle ms-2" data-feather="users"></i></h1>
<div class="row mt-4">
<div class="col-12">
<div class="card w-100">
<div class="card-header">
<div class="card-body">
<div class="d-flex justify-content-center">
<img src="../uploads/parlamentares/<?php echo $url_img; ?>" width="200" class="img-fluid" alt="">
</div>
<form action="src/Models/editParlamentarseguro.php" method="POST" enctype="multipart/form-data">
<div class="text-uppercase mt-3">
<input type="hidden" name="parlamentar_id" value="<?php echo $parlamentar_id;?>"
<h6 class="fw-bold text-primary">Nome completo:</h6>
<div class="input-group">
<input type="text" name="nome" class="form-control" value="<?php echo $nome;?>" aria-label="Sizing example input"
aria-describedby="inputGroup-sizing-default">
</div>
</div>
<div class="text-uppercase mt-3">
<h6 class="fw-bold text-primary">Nome do parlamentar:</h6>
<div class="input-group">
<input type="text" name="nome_par" class="form-control" value="<?php echo $nome_parlamentar;?>" aria-label="Sizing example input"
aria-describedby="inputGroup-sizing-default">
</div>
</div>
<div class="text-uppercase mt-3">
<h6 class="fw-bold text-primary">Ocupação:</h6>
<div class="input-group">
<input type="text" name="ocupacao" class="form-control" value="<?php echo $ocupacao;?>" aria-label="Sizing example input"
aria-describedby="inputGroup-sizing-default">
</div>
</div>
<div class="text-uppercase mt-3">
<h6 class="fw-bold text-primary">Naturalidade:</h6>
<div class="input-group">
<input type="text" value="<?php echo $naturalidade;?>" name="naturalidade" class="form-control" aria-label="Sizing example input"
aria-describedby="inputGroup-sizing-default">
</div>
</div>
<div class="text-uppercase mt-3">
<h6 class="fw-bold text-primary">Partido:</h6>
<div class="input-group">
<input type="text" class="form-control" name="partido" value="<?php echo $partido;?>" aria-label="Sizing example input"
aria-describedby="inputGroup-sizing-default">
</div>
</div>
<div class="text-uppercase mt-3">
<h6 class="fw-bold text-primary">imagem:</h6>
<div class="input-group">
<input type="file" class="form-control" name="foto" id="inputGroupFile02">
</div>
</div>
<div class="text-uppercase mt-3">
<h6 class="fw-bold text-primary">Data de nascimento:</h6>
<div class="input-group">
<input type="text" class="form-control" value="<?php echo $data_nascimento;?>" name="dat_nasc" aria-label="Sizing example input"
aria-describedby="inputGroup-sizing-default">
</div>
</div>
<div class="text-uppercase mt-3">
<h6 class="fw-bold text-primary">Telefone:</h6>
<div class="input-group">
<input type="number" class="form-control" value="<?php echo $telefone;?>" name="tel" aria-label="Sizing example input"
aria-describedby="inputGroup-sizing-default">
</div>
</div>
<div class="text-uppercase mt-3">
<h6 class="fw-bold text-primary">E-mail:</h6>
<div class="input-group">
<input type="email" class="form-control" value="<?php echo $email;?>" name="email" aria-label="Sizing example input"
aria-describedby="inputGroup-sizing-default">
</div>
</div>
<div class="mt-4">
<button type="submit" class="btn btn-success">
<i class="me-2" data-feather="check-circle"></i>ATUALIZAR
</button>
<button type="button" class="btn btn-danger float-end" data-bs-toggle="modal"
data-bs-target="#modal-confirmacao">
<i class="me-2" data-feather="trash-2"></i>CANCELAR
</button>
</div>
</form>
</div>
</div>
<div class="modal fade" id="modal-confirmacao" tabindex="-1" data-bs-backdrop="static" aria-labelledby="modal-confirmacao-label"
aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="modal-confirmacao-label">Confirmação de Cancelamento
</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal"
aria-label="Close"></button>
</div>
<div class="modal-body">
<p>Deseja realmente <strong class="text-danger">CANCELAR?</strong></p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-primary" data-bs-dismiss="modal">Continuar
edição</button>
<button id="btn-confirmar-exclusao" type="button" class="btn btn-danger"
onclick="goBack()">CANCELAR</button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</main>
</body>