This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Estilos gerais */ | |
body { | |
font-family: Arial, sans-serif; | |
} | |
.container { | |
max-width: 800px; | |
} | |
/* Centralizar botões no footer do modal */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Variável global para armazenar os contatos | |
let contacts = []; | |
let currentContactIndex = null; | |
// Função para renderizar os contatos na tabela | |
function renderContacts() { | |
const tableBody = document.getElementById('contactsTableBody'); | |
tableBody.innerHTML = ''; | |
contacts.forEach((contact, index) => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="pt-BR"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>Agenda de Contatos</title> | |
<!-- Bootstrap CSS --> | |
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet"> | |
<!-- Estilos personalizados --> | |
<link rel="stylesheet" href="style.css"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="pt-br"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>Erro - Agenda Telefônica</title> | |
<link rel="stylesheet" href="assets/css/style.css"> | |
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css"> | |
</head> | |
<body> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Incluir arquivo de conexão | |
require_once 'config/database.php'; | |
// Processar operação de exclusão após confirmação | |
if (isset($_GET["id"]) && !empty(trim($_GET["id"]))) { | |
// Obter parâmetro da URL | |
$id = trim($_GET["id"]); | |
// Preparar uma declaração de exclusão |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Incluir arquivo de conexão | |
require_once 'config/database.php'; | |
// Processar dados do formulário quando for enviado | |
if ($_SERVER["REQUEST_METHOD"] == "POST") { | |
// Validar ID | |
if (!isset($_POST["id"]) || empty(trim($_POST["id"]))) { | |
header("location: index.php"); | |
exit(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Incluir arquivo de conexão | |
require_once 'config/database.php'; | |
// Inicializar variáveis | |
$nome = $telefone = $email = ""; | |
$nome_err = $telefone_err = $email_err = ""; | |
// Verificar se o ID foi passado | |
if (isset($_GET["id"]) && !empty(trim($_GET["id"]))) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Incluir arquivo de conexão | |
require_once 'config/database.php'; | |
// Inicializar variáveis | |
$nome = $telefone = $email = ""; | |
$nome_err = $telefone_err = $email_err = ""; | |
// Processar dados do formulário quando for enviado | |
if ($_SERVER["REQUEST_METHOD"] == "POST") { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Incluir arquivo de conexão | |
require_once 'config/database.php'; | |
// Verificar se há mensagem de sucesso | |
$success_message = ''; | |
if (isset($_GET['success'])) { | |
switch ($_GET['success']) { | |
case 'create': | |
$success_message = 'Contato adicionado com sucesso!'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Estilos Gerais */ | |
* { | |
margin: 0; | |
padding: 0; | |
box-sizing: border-box; | |
} | |
body { | |
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; | |
line-height: 1.6; |
NewerOlder