Certo, che voglio essere aiutato altrimenti non postavo sul forum. Il file salva.php contiene quei dati, era giusto per fare una prova, senza estrarre dati dal database.
Mentre di seguito e il metodo che utilizzo, che va adattato. Io vorrei capire il funzionamento...
Codice PHP:
<?php##########################################################
header('Access-Control-Allow-Origin: *');// Includo la connessione al databaserequire('../../includes/connect.php');
#########################################################
//settiamo italiano come linguasetlocale( LC_TIME,"it_IT");//stampiamo giorno e mese$mese = strftime('%B');
$ute = trim($_POST['utente_id']);
/* Query somma dati tabella */
$sql = "SELECT IFNULL(sum(ore_notti),0),IFNULL(sum(ore_stra),0), IFNULL(sum(ticket_pasto),0),IFNULL(sum(cambio_turno),0), IFNULL(sum(recuper_riposo),0), IFNULL(sum(ser_esterno),0), IFNULL(sum(o_p_cek),0)FROM tb_turni WHERE MONTH (giorno) = MONTH(curdate()) and id_utente = '$ute'";
$res = mysql_query($sql);$row = mysql_fetch_row($res);
$return = array( 'a' => $row[0], 'b' => $row[1], 'c' => $row[2], 'd' => $row[3], 'e' => $row[4], 'f' => $row[5], 'g' => $row[6], 'mese' => $mese);
echo json_encode($return);
?>