This repository was archived by the owner on Jul 12, 2019. It is now read-only.
forked from utramig42/JobSmart-WEB
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathusuarios.php
More file actions
136 lines (107 loc) · 4.84 KB
/
usuarios.php
File metadata and controls
136 lines (107 loc) · 4.84 KB
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
//Configuração
include_once 'includes/config.php';
include_once 'includes/headers/header-init.php';
// CSS
include_once 'includes/headers/header-styles.php';
// Default Navbar
include_once 'includes/navbar/navbar-main.php';
$fileName = ucfirst(str_replace(".php", '', basename(__FILE__)));
// Require Files Users
require_once 'core/dao/Connection.php';
require_once 'core/dao/UsuarioModel.php';
?>
<title>Job'Smart - <?php echo $fileName ?></title>
<!-- Table Style CSS -->
<link rel="stylesheet" href="css/tables.css">
<div id="wrapper">
<!-- Sidebar -->
<?php
include_once 'includes/navbar/navbar-sidebar.php';
?>
<div id="content-wrapper">
<div class="container-fluid">
<!-- Breadcrumbs-->
<ol class="breadcrumb">
<li class="breadcrumb-item">
<a href="index.php">Painel de controle</a>
</li>
<li class="breadcrumb-item active text-capitalize">
<?php
// Placing Header
echo $fileName;
?>
</li>
</ol>
<?php if (isset($_SESSION['mensagem'])) echo $_SESSION['mensagem'];
unset($_SESSION['mensagem']) ?>
<!-- Data Tables -->
<div class="card mb-3">
<div class="card-header">
<i class="fas fa-table mt-2"></i>
<span>Lista de funcionários</span>
<div class="d-md-inline-block float-right">
<!-- Register Button -->
<button type="button" class="btn btn-primary float-right" onclick="window.location.href='cadastroUsuarios.php'">
<i class="fas fa-plus text-white icon" aria-hidden="true"></i>
<span>Cadastrar</span>
</button>
<!-- Navbar Search -->
<form class="d-none d-md-inline-block form-inline float-right ml-auto mr-0 mr-md-5 my-2 my-md-0" id="search-table">
<div class="input-group">
<input type="text" class="form-control" placeholder="Pesquisar por..." aria-label="Search" aria-describedby="basic-addon2">
<div class="input-group-append">
<button class="btn btn-primary" type="button">
<i class="fas fa-search"></i>
</button>
</div>
</div>
</form>
</div>
</div>
<div class="card-body">
<div class="table-responsive">
<table class="table table-bordered" id="dataTable" width="100%" cellspacing="0">
<thead>
<tr>
<th>Nome Completo</th>
<th>CPF</th>
<th>Telefone</th>
<th>Cargo</th>
<th>Salário</th>
<th>Ações</th>
</tr>
</thead>
<tfoot>
<?php
$maxItens = 10; // Número de itens por pagina.
$page = (isset($_GET['pagina']) ? intval($_GET['pagina']) : 0); // Pagina Atual.
$pagesSql = $page * $maxItens; // Para pegar o dado de 10 em 10.
$userModel = new UsuarioModel();
$userModel->listUsersTables($pagesSql, $maxItens);
$userModel->listUsersModals($pagesSql, $maxItens);
$table = 'funcionario';
?>
</tfoot>
</table>
</div>
<?php include_once 'core/dll/Pagination.php' ?>
</div>
<div class="card-footer small text-muted">Última atualização - <?php echo date('d/m/Y H:i:s') ?></div>
</div>
</div>
<!-- /.container-fluid -->
</div>
<!-- /.content-wrapper -->
</div>
<!-- /#wrapper -->
<?php
include_once 'includes/footers/footer-init.php';
include_once 'includes/footers/footer-modal.php';
include_once 'includes/footers/footer-scripts.php';
include_once 'includes/footers/footer-final.php';
?>
<script src="js/controller/TableController.js"></script>
<script>
window.table = new TableController(document.querySelector('#search-table'), document.querySelector('table tfoot'));
</script>