-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnovo_painel.php
134 lines (104 loc) · 5.05 KB
/
novo_painel.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
126
127
128
129
130
131
132
133
134
<?php
session_start();
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="../bootstrap/css/bootstrap.min.css">
<!-- Ícone e Estilo CSS -->
<link rel="stylesheet" type="text/css" href="../css/userinterface.css">
<link rel="icon" href="../img/logo.ico">
<!--Normalize HTML-->
<link rel="stylesheet" type="text/css" href="../css/normalize.css">
<title>Codex & Projectu</title>
</head>
<body>
<!--- inicio menu --->
<header>
<nav class="navbar navbar-expand-md">
<div class="container">
<a href="../home.php" class="navbar-brand"><img src="../img/logo.png" width="50px"></a>
<button class="navbar-toggler" data-toggle="collapse" data-target="#menu"><i class="fas fa-bars text-white"></i></button>
<div class="collapse navbar-collapse" id="menu">
<ul class="navbar-nav ml-auto">
<li class="nav-item"><a href="../home.php" class="nav-link">Home</a></li>
<li class="nav-item"><a href="../sobre.php" class="nav-link">Sobre nós</a></li>
<li class="nav-item"><a href="../projetos.php" class="nav-link">Projetos</a></li>
<?php
if (!isset($_SESSION['logado'])) {
echo '<li class="nav-item"><a href="../cadastro.php" class="nav-link">Inscrever-se</a></li>';
}
?>
<li class="nav-item">
<?php
if (!isset($_SESSION['logado'])) {
echo '<a href="../entrar.php" class="btn btn-outline-light">Entrar</a>';
} else if ($_SESSION['logado'] == "true") {
echo "<a href='../user/userinterface.php'>FOTO AQUI</a>";
}
?>
</li>
</ul>
</div>
</div>
</nav>
</header>
<!--- final menu --->
<!-- Início Conteúdo -->
<div class="container">
<div class="row">
<div class='col-sm-12'>
<div id="box" class='mt-4' style='height: 20rem;width:100%;overflow-y: scroll;overflow-x: hidden;position: relative;'>
<h2>Novo Painel</h2>
<hr>
<?php
// inclusões
include_once("create_all.php");
include_once("configdb.php");
// conexão
$conn = iniciaDB("codexp49_projetos");
if (!isset($_POST['criar']) == FALSE) {
// campos e variáveis
$id_proj = $_GET['cod'];
$nome_do_painel = $_POST['nome'];
// inserir painel
$insert_panel = "INSERT INTO paineis (nome, proj) VALUES (:nome, :proj);";
$stmt = $conn -> prepare($insert_panel);
$stmt -> bindValue(":nome", $nome_do_painel);
$stmt -> bindValue(":proj", $id_proj);
$run = $stmt -> execute();
if ($run) {
echo "<script>alert('Seu painel foi criado com sucesso!');</script>";
echo "<script>window.location.href='../user/meus_proj.php'</script>";
} else {
echo "<script>alert('Ocorreu um erro ao criar o seu painel!');</script>";
}
}
?>
<form method= "POST">
<label for='nome'>Nome do seu painel</label><br>
<input class='rounded' style='border: 1px solid white;padding:8px;' type='text' name='nome' id='nome' placeholder='Ex: Change Log' required><br><br>
<input class='btn btn-light' type='submit' name='criar' value='Criar painel'>
</form>
<hr>
<a href='../user/meus_proj.php'><button class='btn btn-success mr-3'>Voltar</button></a>
</div>
</div>
</div>
</div>
<!-- Final Conteúdo -->
<!---rodapé --->
<footer id="rodape" class='p-0' style='margin-top: 22%;'>
<img src="../img/logo.png" width="40px">Todos os direitos reservados © LilCode Team 2021<br>
<ul><li style='display: inline;'><a href='../other/politica.php' style='color:white;'>POLÍTICA</a></li> | <li style='display: inline;'><a href='../other/termos-uso.php' style='color:white;'>TERMOS DE USO</a></li></ul>
</footer>
<!-- Boostrap Script Links -->
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.15.3/css/all.css" integrity="sha384-SZXxX4whJ79/gErwcOYf+zWLeJdY/qpuqC4cAa9rOGUstPomtqpuNWT9wdPEn2fk" crossorigin="anonymous">
<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js" integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj" crossorigin="anonymous"></script>
<script src="../bootstrap/js/bootstrap.bundle.min.js"></script>
</body>
</html>
?>