Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script>
- $(document).ready(function() {
- var notify = function(){
- Notification.requestPermission(function() {
- var notification = new Notification("Player Control Panel", {
- icon: 'http://i.stack.imgur.com/dmHl0.png',
- body: "A uma nova denuncia de uso Hack"
- });
- notification.onclick = function() {
- window.open("localhost");
- }
- });
- }
- var carrega = function() {
- //
- jQuery.ajax({
- type: "POST",
- url: "config.php",
- dataType: "html",
- data: "",
- // enviado com sucesso
- success: function(response){
- if( response >= 1 ) { // TOTAL DE LINHAS DO BANCO DE DADOS
- notify();
- }
- },
- // quando houver erro
- error: function(){
- alert("Ocorreu um erro durante a requisição");
- }
- });
- //
- }
- setInterval(function() {
- carrega();
- }, 1); // TEMPO DE INTERVALO ENTRE CADA REQUISIÇÃO
- });
- </script>
- <?php
- $servername = "";
- $username = "";
- $password = "";
- $dbname = "";
- $conn = new mysqli($servername, $username, $password, $dbname);
- // Check connection
- if ($conn->connect_error) {
- die("Connection failed: " . $conn->connect_error);
- }
- $sql = "SELECT * FROM denuncias";
- $result = $conn->query($sql);
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement