2020-04-27 23:27:39 +02:00
< ? php
2020-05-02 12:06:45 +02:00
include_once ( " ../../core.php " );
2020-04-27 23:27:39 +02:00
init_class ();
2020-05-25 22:43:56 +02:00
$user -> requirelogin ();
2020-04-27 23:27:39 +02:00
function ancora ( $content , $id ) {
$content = substr ( $content , 0 , $limit );
$content = substr ( $content , 0 , strrpos ( $content , ' ' ));
$content = $content . " <a href='dettagli.php?iid= $id #note'>...Leggi ancora</a> " ;
return $content ;
}
$impostazioni [ 'modifica' ] = false ;
$impostazioni [ 'elimina' ] = false ;
2020-05-29 12:13:33 +02:00
$risultato = $database -> exec ( " SELECT * FROM `%PREFIX%_esercitazioni` ORDER BY data DESC, inizio desc " , true ); // Pesco i dati della table e li ordino in base alla data
2020-04-27 23:27:39 +02:00
?>
< link rel = " stylesheet " href = " https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css " >
< style >
#add {
outline : none ;
cursor : pointer ;
text - align : center ;
text - decoration : none ;
font : bold 12 px Arial , Helvetica , sans - serif ;
color : #fff;
padding : 10 px 20 px ;
border : solid 1 px #0076a3;
background : #0095cd;
}
#href {
outline : none ;
cursor : pointer ;
text - align : center ;
text - decoration : none ;
font : bold 12 px Arial , Helvetica , sans - serif ;
color : #fff;
padding : 10 px 20 px ;
border : solid 1 px #0076a3;
background : #0095cd;
}
th , td {
border : 1 px solid grey ;
border - collapse : collapse ;
padding : 5 px ;
}
table {
box - shadow : 0 px 3 px 15 px rgba ( 0 , 0 , 0 , 0.5 );
border - radius : 5 px ;
margin : auto ;
}
#new-search-area {
width : 100 % ;
clear : both ;
padding - top : 20 px ;
padding - bottom : 20 px ;
}
#new-search-area input {
width : 600 px ;
font - size : 20 px ;
padding : 5 px ;
margin - right : 150 px ;
margin - left : 80 px ;
}
</ style >
< div style = 'margin: 20px 0;' class = " mx-auto " >
< div style = 'margin: 2px auto' id = " new-search-area " ></ div >
< div class = " table-responsive " >
< div style = " overflow-x:auto; " >
< table id = " esercitazioni " cellspacing = '0' class = " display table table-striped table-bordered dt-responsive nowrap " style = " width: 90%; text-align:center; " >
< thead >
< tr >
< th > Data </ th >
2020-05-25 22:43:56 +02:00
< th > name </ th >
2020-04-27 23:27:39 +02:00
< th > Ora inizio </ th >
< th > Ora fine </ th >
< th > Capo </ th >
< th > Personale </ th >
< th > Luogo </ th >
< th > Note </ th >
< ? php if ( $impostazioni [ 'modifica' ]) { echo " <th>Modifica</th> " ; } ?>
< ? php if ( $impostazioni [ 'elimina' ]) { echo " <th>Elimina</th> " ; } ?>
</ tr >
</ thead >
< tbody >
< ? php
foreach ( $risultato as $row ){
$persone = base64_encode ( $row [ 'dec' ] );
2020-05-25 22:43:56 +02:00
echo " <tr><td> " . $row [ 'data' ] . " </td><td> " . $row [ 'name' ] . " </td><td> " . $row [ 'inizio' ] . " </td><td> " . $row [ 'fine' ] . " </td><td> " . $row [ 'capo' ] . " </td><td> " . $row [ 'personale' ] . " </td><td> " . $row [ 'luogo' ] . " </td><td> " . $row [ 'note' ] . " </td> " ;
2020-04-27 23:27:39 +02:00
if ( $impostazioni [ 'modifica' ]) {
2020-05-25 22:43:56 +02:00
echo " <td><a href='modifica.php?modifica&id= { $row [ 'id' ] } &data= { $row [ 'data' ] } &name= { $row [ 'name' ] } &inizio= { $row [ 'inizio' ] } &fine= { $row [ 'fine' ] } &luogo= { $row [ 'luogo' ] } ¬e= { $row [ 'note' ] } '><i style='font-size: 40px' class='fa fa-edit'></i></a></td> " ;
2020-04-27 23:27:39 +02:00
}
if ( $impostazioni [ 'elimina' ]) {
echo " <td><a href='modifica.php?elimina&id= { $row [ 'id' ] } &persone= { $persone } '><i style='font-size: 40px' class='fa fa-trash'></i></a></td></tr> " ;
}
}
?>
</ tbody >
</ table >
</ div >
</ div >
</ div >