$("#msg").html('<div class="alert alert-success" role="alert"> cadastrado com sucesso!</div>');
<?php
//ajaxdeleteselected.php
include"dbcon.php";
$selected = $_POST['selected'];
foreach ($selected as $value) {
$sql = "DELETE FROM tblemployees WHERE id='$value'";
if ($conn->query($sql) === TRUE) {
echo "Record deleted successfully $value <br/>";
} else {
echo "Error deleting record: " . $sql . "<br>" . $conn->error."'";
}
}
?> -- Banco de dados: `testing`
CREATE TABLE `tblemployees` (
`id` int(11) NOT NULL,
`fullname` varchar(50) DEFAULT NULL,
`emailadd` varchar(50) DEFAULT NULL,
`address` varchar(50) DEFAULT NULL,
`phone` varchar(50) DEFAULT NULL,
`created_at` datetime NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
INSERT INTO `tblemployees` (`id`, `fullname`, `emailadd`, `address`, `phone`, `created_at`) VALUES
(1, 'ALCEU JOSE', 'alceu@yakps.com.br', 'ONZE', '3931-4183', '2021-03-09 21:58:53'),
(2, 'BENE', NULL, 'SILVA', NULL, '2020-06-05 19:38:40'),
(3, 'CACILDA', NULL, 'BRAVA', NULL, '2020-06-05 20:07:05'),
(4, 'ALICE ', NULL, 'SILVA', NULL, '2020-06-05 20:07:39'),
(5, 'RANDOLFO', NULL, 'tadeu', NULL, '2021-01-29 07:58:59'),
(6, 'BEZERRA DA SILVA', 'alceu@uahoo.com.br', 'RUA NAO SEI, 45', '3931-4183', '2021-03-09 22:03:35');
ALTER TABLE `tblemployees`
ADD PRIMARY KEY (`id`);
ALTER TABLE `tblemployees`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;
start menu.reg
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FeatureManagement\Overrides\0\2093230218]
"EnabledState"=dword:00000002
"EnabledStateOptions"=dword:00000000 <?php
//dbcon.php
$conn = new mysqli('localhost','root','','testing');
if ($conn->connect_error) {
die('Error : ('. $conn->connect_errno .') '. $conn->connect_error);
}
?> index.php video https://www.youtube.com/watch?v=N3t4tDDLaFI set date brit set centu on use
SET DELE OFF
USE receber alias receber EXCLUSIVE
sele receber
pack
DELETE ALL FOR YEAR(pe_data)<=2021
USE morto alias morto EXCLUSIVE
sele morto
PACK
SET DELE OFF
DELETE ALL FOR YEAR(pe_data)<=2021
APPEND FROM receber FOR DELETED() <!DOCTYPE html>
<html lang="pt-br">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Language" content="pt-br"> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Data Table </title>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto|Varela+Round">
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
// Activate tooltip
$('[data-toggle="tooltip"]').tooltip();
// Select/Deselect checkboxes
var checkbox = $('table tbody input[type="checkbox"]');
$("#selectAll").click(function(){
if(this.checked){
checkbox.each(function(){
this.checked = true;
});
} else{
checkbox.each(function(){
this.checked = false;
});
}
});
checkbox.click(function(){
if(!this.checked){
$("#selectAll").prop("checked", false);
}
});
$('#cmdeleteselected').click (function(event) {
event.preventDefault();
var selected = new Array();
$("input:checkbox[name=options]:checked").each(function() {
selected.push($(this).val());
});
var selectedString = selected.join(",");
$.post("ajaxdeleteselected.php", {selected: selected },
function(data){
$('#deleteEmployeeModalselected').modal('hide');
$('.result').html(data);
});
});
});
</script>
</head>
<body>
<?php
include"dbcon.php";
if(isset($_POST["cmdaddnew"])){
$sql = "INSERT INTO tblemployees (fullname, emailadd, address, phone)
VALUES ('".$_POST["fullname"]."','".$_POST["emailadd"]."','".$_POST["address"]."','".$_POST["phone"]."')";
if ($conn->query($sql) === TRUE) {
echo "<script type= 'text/javascript'>alert('Adicionado com successfully');</script>";
} else {
echo "<script type= 'text/javascript'>alert('Error: " . $sql . "<br>" . $conn->error."');</script>";
}
}
$page = (isset($_GET['page']))?$_GET['page']:'';
$editemployee = (isset($_GET['editemployee']))?$_GET['editemployee']:'';
$deleteemployee = (isset($_GET['deleteemployee']))?$_GET['deleteemployee']:'';
if ($deleteemployee==''){
}else{
echo "<script type= 'text/javascript'>$(document).ready(function(){ $('#deleteEmployeeModal').modal() });</script>";
}
if(isset($_POST["cmdelete"])){
$sql = "DELETE FROM tblemployees WHERE id='$deleteemployee'";
if ($conn->query($sql) === TRUE) {
echo "<script type= 'text/javascript'>alert(' Deletado com success !! ');
window.location.replace('index.php');</script>";
} else {
echo "<script type= 'text/javascript'>alert('Error deleting record: " . $sql . "<br>" . $conn->error."');</script>";
}
}
if ($editemployee==''){
}else{
echo "<script type= 'text/javascript'>$(document).ready(function(){ $('#editEmployeeModal').modal() });</script>";
$results = mysqli_query($conn,"SELECT * FROM tblemployees Where id=$editemployee");
while($row = mysqli_fetch_array($results))
{
$editid = $row["id"];
$edit_fullname = $row["fullname"];
$edit_emailadd = $row["emailadd"];
$edit_address = $row["address"];
$edit_phone = $row["phone"];
}
}
if(isset($_POST["cmdedit"])){
$editname = $_POST["editname"];
$editemail = $_POST["editemail"];
$editaddress = $_POST["editaddress"];
$editphone = $_POST["editphone"];
$sql = "UPDATE tblemployees SET fullname='$editname', emailadd='$editemail', address='$editaddress', phone='$editphone' WHERE id='$editemployee'";
if (mysqli_query($conn, $sql)) {
echo "<script type= 'text/javascript'>alert('Alterado com successo!!! ');
window.location.replace('index.php');</script>";
} else {
echo "<script type= 'text/javascript'>alert('Error ao Gravar : " . $sql . "<br>" . $conn->error."');</script>";
}
}
if ($page==''){
$page = "1";
}else{
$page = $_GET['page'];
}
$cur_page = $page;
$page -= 1;
$per_page = 9; // ESTAVA 5
$previous_btn = true;
$next_btn = true;
$first_btn = true;
$last_btn = true;
$start = $page * $per_page;
//
//--------------- nome
$w_filtro = ''; // variavel auxilia no filto do select
$w_ordem = ''; // variavel auxilia no ordernar o select
if( !empty($_GET["pesq"]) ){
$pesq = $_GET["pesq"];
switch ( $_GET["ordem"] ) {
case 'name':
$w_filtro = $w_filtro . " and ( fullname LIKE '%".$pesq."%' or id = '".$pesq."' ) ";
break;
case 'ID':
$w_filtro = $w_filtro . " and ( fullname LIKE '%".$pesq."%' or id = '".$pesq."' ) ";
break;
}
}
if( !empty($w_filtro)) {
//
$w_len = strlen ( $w_filtro ) - 4;
//
$w_filtro = " where ".substr($w_filtro, -$w_len);
}
switch ( @$_GET["ordem"] ) {
case 'name':
$w_ordem = " order by fullname,id asc ";
break;
case 'ID':
$w_ordem = " ORDER BY ID asc ";
break;
}
if( empty($w_ordem) ){
$w_ordem = " ORDER BY fullname asc ";
}
$query_pag_data = "SELECT * from tblemployees ". $w_filtro.$w_ordem." LIMIT $start, $per_page";
$result_pag_data = mysqli_query($conn, $query_pag_data);
?>
<div class="container"><div class = "result"></div>
<p><h5 align="center">Cadastro <b>Funcionarios </h5></p>
<div class="table-wrapper">
<div class="table-title">
<div class="row">
<div class="col-sm-6">
</div>
<div class='container'>
<form name="pesquisa" action="index.php" method="get" id='form-contato' class="form-horizontal col-md-10">
<div class="panel panel-default">
<div class="panel-body">
<input type="text" size="40" name="pesq" placeholder="Digite o Nome ou ID">
<!-- <input type="submit" value="Busca" class="btn btn-xs btn-primary" /> -->
<button type="submit" name="buscar" id="buscar" title="buscar" class="btn btn-xs btn-info"> <span class="glyphicon glyphicon-search" ></span>Busca </button>
<label>Por:</label>
<select name = "ordem">
<option selected>name</option>
<option>ID</option>
</div>
</SELECT>
<!-- Link para página de cadastro -->
<a type="button" href="index.php" class="btn btn-warning" title="Sair"><span class="glyphicon glyphicon-home"></span></a>
<a title="List" href='lista1.php' class="btn btn-info "><span class="glyphicon glyphicon-print"></span></a>
<a Title="Novo" href="#addEmployeeModal" class="btn btn-success" data-toggle="modal"> <span>Add Pessoa</span></a>
</div>
</div>
</form>
</div>
</div>
</div>
<?
@$pesq = $_GET["pesq"];
?>
<table class="table table-striped table-bordered table-responsive table-hover" style="font-size: 14px;" >
<thead class="success">
<tr>
<th>
<span class="custom-checkbox">
<input type="checkbox" id="selectAll">
<label for="selectAll"></label>
</span>
</th>
<th>Name</th>
<th>Email</th>
<th>Endereco</th>
<th>Phone</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
<?php
while($row = mysqli_fetch_assoc($result_pag_data)) {
$fullname=$row['fullname'];
$emailadd=$row['emailadd'];
$address=$row['address'];
$phone=$row['phone'];
?>
<tr>
<td>
<span class="custom-checkbox">
<input type="checkbox" id="checkbox1" name="options" value="<?php echo $row['id']; ?>">
<label for="checkbox1"></label>
</span>
</td>
<td><?php echo $fullname; ?></td>
<td><?php echo $emailadd; ?></td>
<td><?php echo $address; ?></td>
<td><?php echo $phone; ?></td>
<td>
<a href="?editemployee=<?php echo $row['id']; ?>" class="edit" class="btn btn-info" data-toggle="modal"><i class="glyphicon glyphicon-edit" title="Edit"></i></a>
<a title="Delete" href="?deleteemployee=<?php echo $row['id']; ?>" class="delete" data-toggle="modal"><i class="glyphicon glyphicon-trash" ></i></a>
</td>
</tr>
<?php } ?>
</tbody>
</table>
<div class="clearfix">
<?php
$msg = "";
$query_pag_num = mysqli_query($conn,"SELECT COUNT(*) AS mycount FROM tblemployees" ) or die(mysqli_error($this->dblink));
$res = mysqli_fetch_object($query_pag_num);
$count = $res->mycount;
$no_of_paginations = ceil($count / $per_page);
// --------------------------------------------Calculando os valores inicial e final para o loop ----------------------------------
if ($cur_page >= 7) {
$start_loop = $cur_page - 3;
if ($no_of_paginations > $cur_page + 3)
$end_loop = $cur_page + 3;
else if ($cur_page <= $no_of_paginations && $cur_page > $no_of_paginations - 6) {
$start_loop = $no_of_paginations - 6;
$end_loop = $no_of_paginations;
} else {
$end_loop = $no_of_paginations;
}
} else {
$start_loop = 1;
if ($no_of_paginations > 7)
$end_loop = 7;
else
$end_loop = $no_of_paginations;
}
//-----------------------------------------------------------------------------------------------------------
$msg .= "<ul class=\"pagination\">";
// FOR ENABLING THE FIRST BUTTON
if ($first_btn && $cur_page > 1) {
$msg .= "<li p='1' class='page-item active'><a href='?page=1' class='page-link'>First</a></li>";
} else if ($first_btn) {
$msg .= "<li p='1' class='page-item' disabled><a href='?page=1'>First</a></li>";
}
// FOR ENABLING THE PREVIOUS BUTTON
if ($previous_btn && $cur_page > 1) {
$pre = $cur_page - 1;
$msg .= "<li p='$pre' class='page-item active'><a href='?page=$pre' class='page-link'>Previous</a></li>";
} else if ($previous_btn) {
$msg .= "<li class='page-item' disabled><a href='?page=1'>Previous</a></li>";
}
for ($i = $start_loop; $i <= $end_loop; $i++) {
if ($cur_page == $i)
$msg .= "<li p='$i' class='page-item active'><a href='?page=$i' class='page-link'>{$i}</a></li>";
else
$msg .= "<li p='$i' class='page-item'><a href='?page={$i}' class='page-link'>{$i}</a></li>";
}
// TO ENABLE THE NEXT BUTTON
if ($next_btn && $cur_page < $no_of_paginations) {
$nex = $cur_page + 1;
$msg .= "<li p='$nex' class='page-item'><a href='?page=$nex' class='page-link'>Next</a></li>";
} else if ($next_btn) {
$msg .= "<li class='page-item' disabled><a href='#'>Next</a></li>";
}
// TO ENABLE THE END BUTTON
if ($last_btn && $cur_page < $no_of_paginations) {
$msg .= "<li p='$no_of_paginations' class='page-item'><a href='?page=$no_of_paginations' class='page-link'>Last</a></li>";
} else if ($last_btn) {
$msg .= "<li p='$no_of_paginations' class='page-item' disabled><a href='?page=$no_of_paginations'>Last</a></li>";
}
$total_string = "<div class=\"hint-text\">Mostrando <b>" . $cur_page . "</b> out of <b>$no_of_paginations</b> entries</div>";
$msg = $msg . "</ul>";
echo $total_string;
echo $msg;
?>
</div>
</div>
</div>
<!-- add Modal HTML -->
<div id="addEmployeeModal" class="modal fade">
<div class="modal-dialog">
<div class="modal-content">
<form action="" method="post">
<div class="modal-header">
<h4 class="modal-title">Add Funcionario</h4>
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
</div>
<div class="modal-body">
<div class="form-group">
<label>Name</label>
<input type="text" name="fullname" class="form-control" required>
</div>
<div class="form-group">
<label>Email</label>
<input type="email" name="emailadd" class="form-control" required>
</div>
<div class="form-group">
<label>Endereco</label>
<textarea class="form-control" name="address" required></textarea>
</div>
<div class="form-group">
<label>Fone</label>
<input type="text" name="phone" class="form-control" required>
</div>
</div>
<div class="modal-footer">
<input type="button" class="btn btn-default" data-dismiss="modal" value="Cancel">
<input type="submit" class="btn btn-success" name="cmdaddnew" value="Add">
</div>
</form>
</div>
</div>
</div>
<!-- Edit Modal HTML -->
<div id="editEmployeeModal" class="modal fade">
<div class="modal-dialog">
<div class="modal-content">
<form name="frmedit" action="" method="post">
<div class="modal-header">
<h4 class="modal-title">Edit Funcionario</h4>
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
</div>
<div class="modal-body">
<div class="form-group">
<label>Name</label>
<input type="text" name="editname" value="<?php echo $edit_fullname; ?>" class="form-control" required>
</div>
<div class="form-group">
<label>Email</label>
<input type="email" name="editemail" value="<?php echo $edit_emailadd; ?>" class="form-control" required>
</div>
<div class="form-group">
<label>Endereco </label>
<textarea class="form-control" name="editaddress" required><?php echo $edit_address; ?></textarea>
</div>
<div class="form-group">
<label>Fone</label>
<input type="text" name="editphone" value="<?php echo $edit_phone; ?>" class="form-control" required>
</div>
</div>
<div class="modal-footer">
<input type="button" class="btn btn-default" data-dismiss="modal" value="Cancel">
<input type="submit" name="cmdedit" class="btn btn-info" value="Gravar">
</div>
</form>
</div>
</div>
</div>
<!-- Delete Modal HTML -->
<div id="deleteEmployeeModal" class="modal fade">
<div class="modal-dialog">
<div class="modal-content">
<form name="frmdelete" action="" method="post">
<div class="modal-header">
<h4 class="modal-title">Delete Funcionario</h4>
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
</div>
<div class="modal-body">
<p>Confirma a Exclusao ?</p>
<p class="text-warning"><small>Esta acao nao pode ser desfeita.</small></p>
</div>
<div class="modal-footer">
<input type="button" class="btn btn-default" data-dismiss="modal" value="Cancel">
<input type="submit" name="cmdelete" class="btn btn-danger" value="Delete">
</div>
</form>
</div>
</div>
</div>
<div id="deleteEmployeeModalselected" class="modal fade">
<div class="modal-dialog">
<div class="modal-content">
<form name="frmdelete" action="" method="post">
<div class="modal-header">
<h4 class="modal-title">Delete Selected Employee</h4>
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
</div>
<div class="modal-body">
<p>Are you sure you want to all the selected delete Records?</p>
<p class="text-warning"><small>This action cannot be undone.</small></p>
</div>
<div class="modal-footer">
<input type="button" class="btn btn-default" data-dismiss="modal" value="Cancel">
<a href="#" id="cmdeleteselected" class="btn btn-danger">Delete</a>
</div>
</form>
</div>
</div>
</div>
</body>
</html>
<!---
<table class="table table-striped table-hover">
-->
<!-- Modal extra grande -->
<button class="btn btn-primary" data-toggle="modal" data-target=".bd-example-modal-xl">Modal extra grande</button>
<div class="modal fade bd-example-modal-xl" tabindex="-1" role="dialog" aria-labelledby="myExtraLargeModalLabel" aria-hidden="true">
<div class="modal-dialog modal-xl">
<div class="modal-content">
...
</div>
</div>
</div>
<!-- Modal grande -->
<button type="button" class="btn btn-primary" data-toggle="modal" data-target=".bd-example-modal-lg">Modal grande</button>
<div class="modal fade bd-example-modal-lg" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true">
<div class="modal-dialog modal-lg">
<div class="modal-content">
...
</div>
</div>
</div>
<!-- Modal pequeno -->
<button type="button" class="btn btn-primary" data-toggle="modal" data-target=".bd-example-modal-sm">Modal pequeno</button>
<div class="modal fade bd-example-modal-sm" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel" aria-hidden="true">
<div class="modal-dialog modal-sm">
<div class="modal-content">
...
</div>
</div>
</div>
Voce precisa contratar 1 profissional que crie uma rede e passe os cabos de rede .
**Como compartilha uma pasta no Windows
No computaodor que sera o servidor, voce entrar com a senha de administrador do computador
01- Crie o Ggrupo e usuarios no Servidor rede.
02-) Copie a pasta c:\motos para o Servidor de rede
03- Compartilha esta pasta com todos os usuarios com todos privelegios
4- Em cadaa terminais va e rede, e encontrei a pasta \motos compartilhada na rede
5- No executavel motos.exe botao direito
criar atalhos enviar para area de trbalho.
o atalho sera criado, so clicar no icone moto e utilizar o sistems
https://www.youtube.com/watch?v=h7Kkw3ZYhvc
*******************
Atencao nao instalado o sistema em dois computador vc instala somente em 1 unico computador, e compartilha pela rede, desde que a rede esteja instalada as informacoes.
Para instalar a Rede, vc precisa contratar 1 profissional que crie a rede e passe os cabos de rede , Eu nao faco este trabalho.
**Como compartilha uma pasta Rede, no Windows, do sistema c:\Motos
Este procedimento e feito pelo tecnico em informatica que vc ira contratar.
No computaodor que sera o servidor, voce entrar com a senha de administrador do computador
****No computador 1 que e sera o servidor onde esta instalado o sistema \Motos
como esta no video https://www.youtube.com/watch?v=h7Kkw3ZYhvc
01- Crie o Ggrupo e usuarios no Servidor rede.
02-) A pasta c:\motos no computaor 1, e a pasta que será compartilhada no Servidor de rede
03- Compartilha esta pasta com todos os usuarios, e com todos privelegios apos ter feito o compartilhamento
conforme esta no video.
4- No computador 2, que usara a rede, Va pelo explorer do windows , Clck no icone rede em \motos que e pasta compartilhada na rede do computador 1 servidor aparecera para voce, se nao aparecer e que vc fez alguma coisa errada, volte e revise o video.
5- No executavel motos.exe botao direito
criar atalhos enviar para area de trabalho no computador 2.
este procedimento faz com que vc acessar o sistema que esta na rede no computador 1 servidor
o atalho sera criado, so clicar no icone moto
e utilizar o sistemas
Video
VIDEO