home
/
u529748449
/
domains
/
borabilhete.com
/
public_html
/
admin
➕ New
📤 Upload
✎ Editing:
cadastrar_setor.php
← Back
<?php include 'conexao.php'; ?> <!DOCTYPE html> <html> <head> <title>Cadastrar Setor</title> </head> <body> <h2>Cadastro de Setor para Evento</h2> <form method="POST"> Evento: <select name="id_evento" required> <option value="">Selecione...</option> <?php $result = $conn->query("SELECT id, nome FROM eventos"); while ($row = $result->fetch_assoc()) { echo "<option value='{$row['id']}'>{$row['nome']}</option>"; } ?> </select><br> Nome do Setor: <input type="text" name="nome_setor" required><br> Preço: <input type="number" step="0.01" name="preco" required><br> Quantidade Total: <input type="number" name="quantidade_total" required><br> <button type="submit">Cadastrar</button> </form> <?php if ($_SERVER["REQUEST_METHOD"] == "POST") { $id_evento = $_POST["id_evento"]; $nome_setor = $_POST["nome_setor"]; $preco = $_POST["preco"]; $quantidade = $_POST["quantidade_total"]; $sql = "INSERT INTO setores (id_evento, nome_setor, preco, quantidade_total) VALUES ('$id_evento', '$nome_setor', '$preco', '$quantidade')"; if ($conn->query($sql) === TRUE) { echo "Setor cadastrado com sucesso!"; } else { echo "Erro: " . $conn->error; } } ?> </body> </html>
💾 Save Changes
Cancel
📤 Upload File
×
Select File
Upload
Cancel
➕ Create New
×
Type
📄 File
📁 Folder
Name
Create
Cancel
✎ Rename Item
×
Current Name
New Name
Rename
Cancel
🔐 Change Permissions
×
Target File
Permission (e.g., 0755, 0644)
0755
0644
0777
Apply
Cancel