-
Notifications
You must be signed in to change notification settings - Fork 0
/
pedir.php
136 lines (105 loc) · 5.28 KB
/
pedir.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
135
136
<?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['pedir']) == FALSE) {
// campos e variáveis
$id_proj = $_GET['proj'];
$descricao = $_POST['descricao'];
// inserir pedido
$insert_pedi = "INSERT INTO pedidos (descricao, criador, proj) VALUES (:descricao, :criador, :proj);";
$stmt = $conn -> prepare($insert_pedi);
$stmt -> bindValue(":descricao", $descricao);
$stmt -> bindValue(":criador", $_SESSION['id']);
$stmt -> bindValue(":proj", $id_proj);
$run = $stmt -> execute();
if ($run) {
echo "<script>alert('Seu pedido foi registrado!');</script>";
echo "<script>window.location.href='projeto.php?cod=$id_proj'</script>";
} else {
echo "<script>alert('Ocorreu um erro ao pedir para participar!');</script>";
}
}
?>
<form method= "POST">
<label for='desc'>Descreva seu pedido</label><br>
<textarea class='rounded col-sm-6' style='border: 1px solid white;padding:8px;' type='text' name='descricao' id='desc' required></textarea><br><br>
<input class='btn btn-light' type='submit' name='pedir' value='Pedir'><br><br>
<b>* Não passe informações pessoais (bancárias, por exemplo)</b>
</form>
<hr>
<a href='projeto.php?cod=<?php echo $id_proj?>'><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>