2020-04-27 23:27:39 +02:00
< ? php
$start = true ;
$minuti = 5 ;
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 arraynum (){
global $database ;
2020-05-29 12:13:33 +02:00
$risultato = $database -> exec ( " SELECT * FROM `%PREFIX%_profiles` ORDER BY avaible DESC, caposquadra DESC, interventi ASC, name ASC " , true ); // Pesco i dati della table e li ordino in base alla disponibilità
2020-04-27 23:27:39 +02:00
$incremento = array ();
$minuti_dispo_old = array ();
foreach ( $risultato as $row ){
2020-05-20 23:16:45 +02:00
if ( $row [ 'avaible' ] == " 1 " ){
2020-05-25 22:43:56 +02:00
$incremento [] = $row [ 'name' ];
2020-04-27 23:27:39 +02:00
$minuti_dispo_old [] = $row [ 'minuti_dispo' ];
}
}
return $incremento ;
}
2020-05-25 22:43:56 +02:00
if ( ! isset ( $_GET [ 'name' ])){
2020-04-27 23:27:39 +02:00
print_r ( arraynum ());
} else {
2020-05-25 22:43:56 +02:00
if ( isset ( $_GET [ 'name' ])){
2020-04-27 23:27:39 +02:00
$arr = arraynum ();
2020-05-25 22:43:56 +02:00
$name = str_replace ( " _ " , " " , $_GET [ 'name' ]);
if ( in_array ( $name , $arr )){
2020-04-27 23:27:39 +02:00
echo " si " ;
} else {
echo " no " ;
}
}
}
?>