-
Notifications
You must be signed in to change notification settings - Fork 1
/
editar_ponto.php
115 lines (97 loc) · 4.04 KB
/
editar_ponto.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
<?php
session_start();
// Se o usuário não estiver logado e tentar acessar a página diretamente pela url
// o mesmo será redirecionado para a tela de login
if(!isset($_SESSION['matricula']) || empty($_SESSION['matricula']))
{
unset($_SESSION['matricula']);
header('Location: index.php');
}
$matricula = $_SESSION['matricula'];
$id = $_GET['id'];
?>
<!DOCTYPE html>
<html lang="pt-BR">
<head>
<meta charset="utf-8">
<title>Editar Ponto</title>
<link rel="stylesheet" href="css/bootstrap.css">
<style>
#tamanhoContainer{
width: 700px;
}
.element::-webkit-input-placeholder {
color: black;
font-weight: bold;
}
</style>
</head>
<body>
<div class="container" id="tamanhoContainer" style="margin-top: 40px">
<h1><strong>Editar Ponto</strong></h1>
<form action="atualizar_ponto.php" method="post" style="margin-top: 20px">
<input type="number" name="id" value="<?php echo $id; ?>" style="display: none;">
<?php
include "conexao.php";
$sql = "SELECT * FROM `registro` WHERE iduser = $id";
$buscar = mysqli_query($conn, $sql);
while ($array = mysqli_fetch_array($buscar)){
$iduser = $array['iduser'];
$inicio_expediente = $array['inicio_expediente'];
$inicio_almoco = $array['inicio_almoco'];
$fim_almoco = $array['fim_almoco'];
$fim_expediente = $array['fim_expediente'];
$descricao = trim($array['descricao']);
?>
<div class="form-group">
<label for="entrada"><strong>Entrada</strong></label>
<div class="input-group mb-3">
<div class="input-group-append">
<input type="datetime-local" name="entradaExp" value="<?= str_replace(" ", "T", $inicio_expediente); ?>" disabled>
</div>
</div>
</div>
<div class="form-group">
<label for="saidaAlmoco"><strong>Entrada Almoço</strong></label>
<div class="input-group mb-3">
<div class="input-group-append">
<input type="datetime-local" name="entradaAlm" value="<?= str_replace(" ", "T", $inicio_almoco); ?>" disabled>
</div>
</div>
</div>
<div class="form-group">
<label for="saidaAlmoco"><strong>Saída Almoço</strong></label>
<div class="input-group mb-3">
<div class="input-group-append">
<input type="datetime-local" name="saidaAlm" value="<?= str_replace(" ", "T", $fim_almoco); ?>" disabled>
</div>
</div>
</div>
<div class="form-group">
<label for="saidaExp"><strong>Saída</strong></label>
<div class="input-group mb-3">
<div class="input-group-append">
<input type="datetime-local" name="saidaExp" value="<?= str_replace(" ", "T", $fim_expediente); ?>" disabled>
</div>
</div>
</div>
<div class="form-group">
<label for="descricao"><strong>Descrição</strong></label>
<div class="input-group mb-3">
<div class="input-group-append">
<textarea class="element" name="descricao" rows="5" cols="33" minlength="20"
maxlength="100" disabled><?php echo htmlspecialchars($descricao, ENT_QUOTES, 'UTF-8') ?>
</textarea>
</div>
</div>
</div>
<!--<button type="submit" class="btn btn-success">Atualizar</button>-->
<a class="btn btn-primary" href="listar_pontos.php"
role="button"><i class="fas fa-thumbs-up"></i>Voltar
</a>
<?php } ?>
</form>
</div>
<script type="text/javascript" src="js/bootstrap.js"></script>
</body>
</html>