Folder reorganize 1
This commit is contained in:
35
OLD/charts/highchart/chartdata.php
Normal file
35
OLD/charts/highchart/chartdata.php
Normal file
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
header("Content-type: text/json");
|
||||
|
||||
|
||||
include_once 'config.php';
|
||||
$db = new DB_Class();
|
||||
|
||||
|
||||
$query = "select * from milling ";
|
||||
$result = mysql_query( $query );
|
||||
$rows = array();
|
||||
$count = 0;
|
||||
|
||||
while( $row = mysql_fetch_array( $result ) ) {
|
||||
$SQL1 = "SELECT knife1spd, knife2spd, knife3spd FROM milling ORDER BY id DESC LIMIT 1";
|
||||
|
||||
$serie = new StdClass;
|
||||
$serie->name = $row['0'];
|
||||
$result1 = mysql_query($SQL1);
|
||||
|
||||
$points = array();
|
||||
while ($rows = mysql_fetch_array($result1)) {
|
||||
$points[] = array(strtotime($rows['0']) * 1000, $rows['1']);
|
||||
}
|
||||
|
||||
$serie->data = $points;
|
||||
$series[] = $serie;
|
||||
}
|
||||
|
||||
|
||||
// Create a PHP array and echo it as JSON
|
||||
$ret = $series;
|
||||
echo json_encode($ret);
|
||||
?>
|
||||
Reference in New Issue
Block a user