]> matita.cs.unibo.it Git - logicplayer.git/commitdiff
Timestamp on exercises.
authorClaudio Sacerdoti Coen <claudio@zenone.casamia.org>
Tue, 16 Dec 2014 16:07:13 +0000 (17:07 +0100)
committerClaudio Sacerdoti Coen <claudio@zenone.casamia.org>
Tue, 16 Dec 2014 16:07:13 +0000 (17:07 +0100)
public_html/esForUsr.php
public_html/logout.js [deleted file]
public_html/logout.php [deleted file]
public_html/main.php
public_html/prova.js
public_html/prova.pho [deleted file]
public_html/prova.txt [deleted file]
public_html/serverRequest.php

index 9c5ab125891b95898088af191bbdd6ca92e4bd10..4f6dffc32f786fa36bb90460b619e50ff1b5ba5c 100755 (executable)
@@ -14,7 +14,7 @@
        if($result->name=='all')
                $str="SELECT * FROM ".$DATA['tbEsercizi'].";";
        else
-               $str="SELECT * FROM ".$DATA['tbEsercizi']." WHERE ".$DATA['clUser']."='".$result->name."' ORDER BY esercizio;";
+               $str="SELECT * FROM ".$DATA['tbEsercizi']." WHERE ".$DATA['clUser']."='".$result->name."' ORDER BY ".$DATA['clEsercizio'].", ".$DATA['clTime'].";";
        $str=mysqli_query($con,$str);
        if (!$str)
        {
@@ -32,7 +32,7 @@
                if($esercizio['esercizio']==$risp[$DATA['clEsercizio']])
                {
                        //aggiungo utenti e click ell'es corrente
-                       $risultati[]=array('id'=>$risp[$DATA['clId']],'utente'=>$risp[$DATA['clUser']],'click'=>$risp[$DATA['clVoto']]);
+                       $risultati[]=array('id'=>$risp[$DATA['clId']],'utente'=>$risp[$DATA['clUser']],'click'=>$risp[$DATA['clVoto']],'time'=>$risp[$DATA['clTime']]);
                }
                else
                {
@@ -42,7 +42,7 @@
                        unset($esercizio);
                        unset($risultati);
                        $esercizio['esercizio']=$risp[$DATA['clEsercizio']];
-                       $risultati[]=array('id'=>$risp[$DATA['clId']],'utente'=>$risp[$DATA['clUser']],'click'=>$risp[$DATA['clVoto']]);
+                       $risultati[]=array('id'=>$risp[$DATA['clId']],'utente'=>$risp[$DATA['clUser']],'click'=>$risp[$DATA['clVoto']],'time'=>$risp[$DATA['clTime']]);
                }
        }while($risp=mysqli_fetch_array($str));      
        $esercizio['risultati']=$risultati;
diff --git a/public_html/logout.js b/public_html/logout.js
deleted file mode 100755 (executable)
index 9817f6a..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-function change()
-{
-       document.location.href="index.html";
-}
-function logout()
-{
-        $.ajax({
-                                       type: 'POST',
-                                       url: 'logout.php',
-                                       async: false
-                }).success
-                        (
-                                                       function(response)
-                                                       {
-                                                               change();
-                                                       }
-                        );
-}
diff --git a/public_html/logout.php b/public_html/logout.php
deleted file mode 100755 (executable)
index 7060d00..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-<?php
-       session_start();
-       unset($_SESSION['ID']);
-       $arr=array('result'=>"logout effettuato con successo");
-       $ris=json_encode($arr);
-       echo $ris;
-?>
index d88e8ca1471318debfc351e7192d69f9bc9cb920..952bb70bc63d4a968b652b8995ac1ca2ece275f0 100755 (executable)
@@ -35,6 +35,7 @@
                                        <th>Nome Esercizio</th>
                                        <th>Studente</th>
                                        <th>voto</th>
+                                       <th>ora</th>
                                </tr>
                        </table>
                </div>
@@ -50,6 +51,7 @@
                                        <th>Studente</th>
                                        <th>Nome Esercizio</th>
                                        <th>voto</th>
+                                       <th>ora</th>
                                </tr>
                        </table>
                </div>
index 454156b2b37f984eb7fa263263fa20362bed7643..067eb7227f826d43b3f7949542a4206ce6fb45c8 100755 (executable)
@@ -21,7 +21,7 @@ function update(event)
                success:function(val)
                {
                        $("#tabella").empty();
-                       $("#tabella").append("<tr><th>Nome Esercizio</th><th>Studente</th><th>voto</th>");
+                       $("#tabella").append("<tr><th>Nome Esercizio</th><th>Studente</th><th>voto</th><th>ora</th>");
                        $.each(val.esercizi, function(i, item) {
                                var id="es"+i;
                                if(item.risultati[0].id!=null)
@@ -30,11 +30,14 @@ function update(event)
                                        {
                                                var id_i=id+j;
                                                var tmpel='<input class="elimina" type="submit" risultato='+item.risultati[j].id+' value="elimina">';
+                                               var date= new Date(item.risultati[j].time*1000/1000);
+                                               var data_ora=date.getDate()+"/"+date.getMonth()+"/"+date.getFullYear()+"\t"+date.getHours()+":"+date.getMinutes();
                                                $("#tabella").append($('<tr>').attr('id',id_i));
                                                id_i="#"+id_i;
                                                $(id_i).append($('<td>').text(item.esercizio));
                                                $(id_i).append($('<td>').text(item.risultati[j].utente));
                                                $(id_i).append($('<td>').text(item.risultati[j].click));
+                                               $(id_i).append($('<td>').text(data_ora));
                                                $(id_i).append($('<td>').append(tmpel));
                                        }
                                }
@@ -67,7 +70,7 @@ function updateUsr(event)
                success:function(val)
                {
                        $("#tab").empty();
-                       $("#tab").append("<tr><th>Studente</th><th>Nome Esercizio</th><th>voto</th>");
+                       $("#tab").append("<tr><th>Studente</th><th>Nome Esercizio</th><th>voto</th><th>ora</th>");
                        $.each(val.esercizi, function(i, item) {
                                var id="ut"+i;
                                if(item.risultati[0].id!=null)
@@ -76,11 +79,14 @@ function updateUsr(event)
                                        {
                                                var id_i=id+j;
                                                var tmpel='<input class="elimina" type="submit" risultato='+item.risultati[j].id+' value="elimina">';
+                                               var date= new Date(item.risultati[j].time*1000/1000);
+                                               var data_ora=date.getDate()+"/"+date.getMonth()+"/"+date.getFullYear()+"\t"+date.getHours()+":"+date.getMinutes();
                                                $("#tab").append($('<tr>').attr('id',id_i));
                                                id_i="#"+id_i;
                                                $(id_i).append($('<td>').text(item.risultati[j].utente));
                                                $(id_i).append($('<td>').text(item.esercizio));
                                                $(id_i).append($('<td>').text(item.risultati[j].click));
+                                               $(id_i).append($('<td>').text(data_ora));
                                                $(id_i).append($('<td>').append(tmpel));
                                        }
                                }
diff --git a/public_html/prova.pho b/public_html/prova.pho
deleted file mode 100755 (executable)
index e69de29..0000000
diff --git a/public_html/prova.txt b/public_html/prova.txt
deleted file mode 100755 (executable)
index 28c1837..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-mi sei riuscito a scaricare
-
index 230344087a7293f03e1e35f2bb23d3f1676c0122..2f8e68a6e453721abfba2c872facd1e4242464ab 100755 (executable)
@@ -14,7 +14,7 @@
        if($result->name=='all')
                $str="SELECT * FROM ".$DATA['tbEsercizi'].";";
        else
-               $str="SELECT * FROM ".$DATA['tbEsercizi']." WHERE ".$DATA['clEsercizio']."='".$result->name."' ORDER BY ".$DATA['clEsercizio'].";";
+               $str="SELECT * FROM ".$DATA['tbEsercizi']." WHERE ".$DATA['clEsercizio']."='".$result->name."' ORDER BY ".$DATA['clEsercizio'].", ".$DATA['clTime']." ;";
        $str=mysqli_query($con,$str);
        if (!$str)
        {
@@ -32,7 +32,7 @@
                if($esercizio['esercizio']==$risp[$DATA['clEsercizio']])
                {
                        //aggiungo utenti e click ell'es corrente
-                       $risultati[]=array('id'=>$risp[$DATA['clId']],'utente'=>$risp[$DATA['clUser']],'click'=>$risp[$DATA['clVoto']]);
+                       $risultati[]=array('id'=>$risp[$DATA['clId']],'utente'=>$risp[$DATA['clUser']],'click'=>$risp[$DATA['clVoto']], 'time'=>$risp[$DATA['clTime']]);
                }
                else
                {
@@ -42,7 +42,7 @@
                        unset($esercizio);
                        unset($risultati);
                        $esercizio['esercizio']=$risp[$DATA['clEsercizio']];
-                       $risultati[]=array('id'=>$risp[$DATA['clId']],'utente'=>$risp[$DATA['clUser']],'click'=>$risp[$DATA['clVoto']]);
+                       $risultati[]=array('id'=>$risp[$DATA['clId']],'utente'=>$risp[$DATA['clUser']],'click'=>$risp[$DATA['clVoto']], 'time'=>$risp[$DATA['clTime']]);
                }
        }while($risp=mysqli_fetch_array($str));      
        $esercizio['risultati']=$risultati;