93 lines
3.0 KiB
PHP
93 lines
3.0 KiB
PHP
<?php
|
|
|
|
ob_start();
|
|
session_start();
|
|
|
|
// Verificar se o usuário está logado
|
|
if (!isset($_SESSION['user_id'])) {
|
|
header("Location: login.php");
|
|
exit();
|
|
}
|
|
?>
|
|
<!DOCTYPE html>
|
|
<html lang="pt-BR">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<title>Sistema de Ferramentas</title>
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
<link rel="stylesheet" href="style.css">
|
|
<script src="script.js"></script>
|
|
<link rel="stylesheet" href="https://code.jquery.com/ui/1.13.2/themes/base/jquery-ui.css">
|
|
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
|
|
<script src="https://code.jquery.com/ui/1.13.2/jquery-ui.min.js"></script>
|
|
</head>
|
|
<body>
|
|
<?php
|
|
|
|
include 'menu.php';
|
|
include 'top_menu.php';
|
|
|
|
?>
|
|
<div class="content">
|
|
<?php
|
|
if (isset($_GET['page'])) {
|
|
$page = $_GET['page'];
|
|
if ($page == 'upload') {
|
|
include 'prova/upload_prova.php';
|
|
} elseif ($page == 'status') {
|
|
include 'prova/status.php';
|
|
} elseif ($page == 'list_files') {
|
|
include 'prova/list_files.php';
|
|
} elseif ($page == 'register_client') {
|
|
include 'clientes/register_client.php';
|
|
} elseif ($page == 'list_clients') {
|
|
include 'clientes/list_clients.php';
|
|
} elseif ($page == 'client_details' && isset($_GET['id'])) {
|
|
include 'clientes/client_details.php';
|
|
} elseif ($page == 'edit_client' && isset($_GET['id'])) {
|
|
include 'clientes/edit_client.php';
|
|
} elseif ($page == 'delete_client' && isset($_GET['id'])) {
|
|
include 'clientes/delete_client.php';
|
|
} elseif ($page == 'edit_note' && isset($_POST['id'])) {
|
|
include 'clientes/edit_note.php';
|
|
} elseif ($page == 'delete_note' && isset($_POST['id'])) {
|
|
include 'clientes/delete_note.php';
|
|
} else {
|
|
echo "<h2>Bem-vindo ao Sistema de Ferramentas</h2>";
|
|
}
|
|
} else {
|
|
echo "<h2>Bem-vindo ao Sistema de Ferramentas</h2>";
|
|
}
|
|
?>
|
|
</div>
|
|
<script>
|
|
$(document).ready(function(){
|
|
$("#search").autocomplete({
|
|
source: "clientes/autocomplete.php",
|
|
minLength: 2,
|
|
select: function(event, ui) {
|
|
if (ui.item.id) {
|
|
window.location.href = 'index.php?page=client_details&id=' + ui.item.id;
|
|
}
|
|
}
|
|
});
|
|
|
|
$("#search-button").click(function(){
|
|
var query = $("#search").val().trim();
|
|
if(query !== ""){
|
|
window.location.href = 'index.php?page=list_clients&search=' + encodeURIComponent(query);
|
|
} else {
|
|
window.location.href = 'index.php?page=list_clients';
|
|
}
|
|
});
|
|
|
|
$("#search").keypress(function(e){
|
|
if(e.which == 13){
|
|
$("#search-button").click();
|
|
}
|
|
});
|
|
});
|
|
</script>
|
|
</body>
|
|
</html>
|