Вот код:
https://yadi.sk/d/SkT5nRIBvQF3UA
А это подключаемый файл config.php:
function gettoseries($f,$selectotypo){
$series="";
$result = mysql_query("select name,nav,yaxis from dataschema where 1=1 and flot = ".$f." order by rid");
$num_rows = mysql_num_rows($result);
for($i=0;$i < $num_rows;$i++) {
$row=mysql_fetch_array($result);
$addon = '';
if($row['yaxis'] <> 0) { $addon = ', yAxis: '.$row['yaxis']; }
if($selectotypo=='lazy'){
$series .= '{name: \''.$row['name'].'\', data: data['.$i.'], showInNavigator: '.$row['nav'].', tooltip: {valueDecimals: 2}'.$addon.'},'."\n";
}
if($selectotypo=='live'){
$series .= '{name: \''.$row['name'].'\', data: requestDataZ('.$i.')'.$addon.'},'."\n";
}
}
return $series;
}
function gettoyaxisparams($f){
$yaxisparams="";
$result = mysql_query("select name,nav,yaxis from dataschema where 1=1 and flot = ".$f." order by yaxis,rid");
$num_rows = mysql_num_rows($result);
$yaxis_cur = -1;
for($i=0;$i < $num_rows;$i++) {
$row=mysql_fetch_array($result);
if($yaxis_cur == $row['yaxis']){
$yaxisparams .= '<tr><td>'.$row['name'].'</td><td> </td><td></td><td></td><td></td></tr>';
} else {
$yaxis_cur++;
$yaxisparams .= '<tr><td>'.$row['name'].'</td><td> </td><td>min</td><td><input type="text" value="0" id="val'.$yaxis_cur.'min"/></td><td>max</td><td><input type="text" value="1000" id="val'.$yaxis_cur.'max"/></td></tr>';
}
}
return $yaxisparams;
}
function gettoselectolisto($u,$f){
$selectlist="";
//$result = mysql_query("select distinct flot from dataschema order by id");
$result = mysql_query("select distinct d.flot from dataschema d where not exists (select 1 from acl a where a.username like '%".$u."%') union all select distinct d.flot from dataschema d inner join acl a on a.flotnum = d.flot and a.username like '%".$u."%' where exists (select 1 from acl aa where aa.username like '%".$u."%')");
$num_rows = mysql_num_rows($result);
for($i=0;$i < $num_rows;$i++) {
$row=mysql_fetch_array($result);
$selected = '';
if($f == $row["flot"]) $selected='selected';
$selectlist .= '<option '.$selected.' value="'.$row["flot"].'">'.$row["flot"].'</option>';
}
return $selectlist;
}