37 if (strcmp($arr[$j], ".") == 0) |
37 if (strcmp($arr[$j], ".") == 0) |
38 break; |
38 break; |
39 if ($j > 1) |
39 if ($j > 1) |
40 $row .= ','; |
40 $row .= ','; |
41 $f = explode(",", $arr[$j]); |
41 $f = explode(",", $arr[$j]); |
42 $heater = $f[5] / 100; |
42 $reply = array ( |
43 $cooler = $f[6] / 100; |
43 'Date' => $f[0], |
44 $row .= '{"Date":"'.$f[0].'","Mode":"'.$f[1].'","Air":"'.$f[2].'","Beer":"'.$f[3].'","Target_lo":"'.$f[4].'",'; |
44 'Mode' => $f[1], |
45 $row .= '"Heater":'.$heater.',"Cooler":'.$cooler.',"HeatUse":'.$f[7].',"CoolUse":"'.$f[8].'","Room":"'.$f[9].'","Target_hi":"'.$f[10].'"}'; |
45 'Air' => $f[2], |
|
46 'Beer' => $f[3], |
|
47 'Target_lo' => $f[4], |
|
48 'Heater' => $f[5] / 100, |
|
49 'Cooler' => $f[6] / 100, |
|
50 'HeatUse' => $f[7], |
|
51 'CoolUse' => $f[8], |
|
52 'Room' => $f[9], |
|
53 'Target_hi' => $f[10] |
|
54 ); |
|
55 $row .= json_encode($reply, JSON_NUMERIC_CHECK); |
46 $j++; |
56 $j++; |
47 } |
57 } |
48 } |
58 } |
49 |
59 |
50 $row .= ']'; |
60 $row .= ']'; |