How to create a notification system similar to facebook [closed]

1

I am a beginner and need to develop a system to control tasks in php . I would like this system to have an icon in the upper right corner, which would show a number of tasks expired on that day for the user, similar to notifications of facebook .

Is there anything ready to use?

    
asked by anonymous 02.05.2015 / 00:52

1 answer

3

I tested the code and it works. Any questions just ask.

index.php

!DOCTYPE html>
 <html>
 <head>
    <title></title>
        <script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>     
        <script type="text/javascript">
        function atualizarTarefas() {
           // aqui voce passa o id do usuario
           var url="get.php?id=1";
            jQuery("#tarefas").load(url);
        }
        setInterval("atualizarTarefas()", 1000);
        </script>   
 </head>
 <body>
INFORMACAO EH EXIBIDA AQUI: <div id="tarefas"></div> 
 </body>
 </html>

get.php

<?php 
    $con = mysqli_connect('localhost', 'root', '', 'tarefas');

    $id = $_GET['id'];

    $sql = "select * from tarefas where id = $id";

    $query = mysqli_query($con, $sql);
    $resultado = mysqli_fetch_assoc($query);

        $retorna = $resultado['vencidas'];
        echo $retorna;
?>
    
02.05.2015 / 01:36