-
Notifications
You must be signed in to change notification settings - Fork 0
/
listagemChavesPix.php
125 lines (112 loc) · 5.36 KB
/
listagemChavesPix.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
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="icon" href="./Logos/beebank.ico" type="image/x-icon">
<link rel="stylesheet" href="./css/style.css">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-rbsA2VBKQhggwzxH7pPCaAqO46MgnOM80zW1RWuH61DGLwZJEdK2Kadq2F9CUG65" crossorigin="anonymous">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/all.min.css" integrity="sha512-z3gLpd7yknf1YoNbCzqRKc4qyor8gaKU1qmn+CShxbuBusANI9QpRohGBreCFkKxLhei6S9CQXFEbbKuqLg0DA==" crossorigin="anonymous" referrerpolicy="no-referrer" />
<title>B&E Bank</title>
</head>
<body style="background-color: #161E23; color: aliceblue;">
<header>
<nav class="navbar navbar-expand-lg" style="background-color: #f9d552;">
<div class="container-fluid">
<a class="navbar-brand ms-3" href="./">
<img src="./Logos/1x/Artboard 3.png" alt="Logo" width="140" class="d-inline-block align-text-top">
</a>
<div class="d-flex justify-content-end me-4" id="navbarSupportedContent">
<ul class="navbar-nav me-auto mb-2 mb-lg-0 mr-2">
<i class="bi bi-house-door-fill"></i>
<li class="nav-item">
<a href="./moduloPix.php" style="color: #161E23;"><i class="m-2 me-3 align-middle fa-brands fa-pix fa-xl"></i></a>
</li>
<li class="nav-item">
<a href="./moduloConta.php" style="color: #161E23;"><i class="m-2 align-middle fa-solid fa-user fa-xl fa-xl"></i></a>
</li>
</ul>
</div>
</div>
</nav>
</header>
<main class="align-middle align-middle mt-5">
<div class="container">
<script>
function deletar(id, tipo_chave){
var resultado = confirm("Deseja remover a chave " + tipo_chave);
if(resultado == true){
var url = "processarRemocaoChavePix.php?id=" + id;
window.location.href = url;
}
}
</script>
<?php
$serverName = "localhost";
$database = "bee_bank";
$userName = "root";
$password = "";
$conn= mysqli_connect($serverName,$userName,
$password, $database);
if(!$conn){
die("Erro na conexão do DB "
. mysqli_connect_error());
}
$sql = "select id, tipo_chave, chave_pix from chaves_pix";
$tabela = mysqli_query($conn,$sql) or
die(mysqli_error($conn));
echo "<table id='tabelaExtrato' class='table table-dark table-hover' border=1>";
echo "<tr><th>Tipo</th><th>Chave</th><th></th></tr>";
echo "<tbody class='table-group-divider'>" ;
while($linha = mysqli_fetch_array($tabela)){
echo "<td>";
echo $linha["tipo_chave"] ;
echo "</td>";
echo "<td>";
echo $linha["chave_pix"] ;
echo "</td>";
echo "<td>";
echo "<input class='button-remover' type='button' value='Remover'
onclick='deletar(" . $linha['id'] . ", \"" . $linha['tipo_chave'] . "\")' />";
echo "</td>";
echo "</tr>";
}
echo "</table>";
mysqli_close($conn);
echo "<button class='button-cadastar-chave' data-bs-toggle='modal' data-bs-target='#chavesPixModal'><i class='fa-solid fa-plus'></i> Cadastrar nova chave</button>";
?>
</div>
<!-- Modal -->
<div class="modal fade" id="chavesPixModal" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true" style="color: #161E23">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Cadastrar chave PIX</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<form id="addChaveForm" action="processaAdicaoChavePix.php" method="post">
<div class="modal-body">
<div class="mb-3">
<div class="form-check form-check-inline">
<input class="form-check-input" type="radio" name="tipoChave" id="inlineRadio1" value="1" checked>
<label class="form-check-label" for="inlineRadio1">Telefone</label>
</div>
<div class="form-check form-check-inline">
<input class="form-check-input" type="radio" name="tipoChave" id="inlineRadio2" value="2">
<label class="form-check-label" for="inlineRadio1">CPF</label>
</div>
</div>
<div class="mb-3">
<label for="valorChave" class="form-label">Chave</label>
<input type="text" step="any" class="form-control" name="valorChave">
</div>
</div>
<div class="modal-footer">
<button type="button" id="button-cancel" class="btn button-cancel" data-bs-dismiss="modal">Cancelar</button>
<button type="submit" id="button-modal" class="btn button-modal">Cadastrar</button>
</div>
</form>
</div>
</div>
</div>
</main>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-kenU1KFdBIe4zVF0s0G1M5b4hcpxyD9F7jL+jjXkk+Q2h455rYXK/7HAuoJl+0I4" crossorigin="anonymous"></script>
</body>