st json_decode st if count scrollBox1 controlList foreach scrollBox1 c

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
$st = json_decode($st);
if(count(t::c('scrollBox1')->controlList)>0) foreach(t::c('scrollBox1')->controlList as $obj) {$obj->free();}
foreach($st as $server=>$info) {
$s = explode('.', $server);
$i++; if($i>1) $i=22 + $i++;
if(!$info[1]) {$offline++; $errs.=$server." ";}
if($i%2) {$pcolor = 0xF2F2F2;} else {$pcolor = 0xF8F8F8;}
if(!$info[1]==1) {$tcolor = 0x0000FF; $symbol='x'; $pcolor = 0x9999FF;}
else {$tcolor = 0x444444; $symbol='•';}
$panel = new TPanel(c('scrollBox1'));
$panel->visible = false;
$panel->parent = t::c('scrollBox1');
$panel->name = $server;
$panel->hint = gethostbyname($server);
$panel->caption = " $s[0]\t$info[0]\t\t$symbol";
$panel->w = c('scrollBox1')->width - 23;
$panel->h = 21; $panel->x = 1; $panel->y = $i;
$panel->parentColor = false; $panel->ParentBackground = false;
$panel->color = $pcolor;
$panel->font->color = $tcolor;
$panel->font->style = fsNormal;
$panel->font->size = 8;