$v) echo "$k - $v
\n";
//exit;
if ((!$_COOKIE[AdM_ra]) AND (!$_COOKIE[AdM_rp]))
{ if (is_numeric($_GET[ra]))
{ $user = get_user_variables('a',$_GET[ra]);
if ($user[n]) setcookie('AdM_ra',$user[n],$s[cas]+5184000);
}
elseif (is_numeric($_GET[rp]))
{ $user = get_user_variables('p',$_GET[rp]);
if ($user[n]) setcookie('AdM_rp',$user[n],$s[cas]+5184000);
}
}
foreach ($_GET as $k => $v) { if ((!$v) AND (preg_match("/^([a-z0-9\-_]+)$/i",$k)) AND (file_exists($s[phppath].'/styles/_common/templates/'.$k.'.html'))) page_from_template($k.'.html',$a); }
if (($_GET[page]) AND (preg_match("/^([a-z0-9\-_]+)$/i",$_GET[page])) AND (file_exists($s[phppath].'/styles/_common/templates/'.$_GET[page].'.html'))) page_from_template($_GET[page].'.html',$a);
$q = dq("select sum(i0+i1+i2+i3+i4+i5+i6+i7+i8+i9+i10+i11+i12+i13+i14+i15+i16+i17+i18+i19+i20+i21+i22+i23) as i,sum(c0+c1+c2+c3+c4+c5+c6+c7+c8+c9+c10+c11+c12+c13+c14+c15+c16+c17+c18+c19+c20+c21+c22+c23) as c from $s[pr]c_day",1);
$x = mysqli_fetch_assoc($q); $a[i_today] = $x[i]; $a[c_today] = $x[c];
$q = dq("select * from $s[pr]statistic where what = 'ads'",1); $x = mysqli_fetch_assoc($q);
$a[i_total] = round($x[i]); $a[c_total] = round($x[c]);
$q = dq("select sum(i) as i,sum(c) as c from $s[pr]statistic_days where what = 'ads' and d = $s[day] and m = $s[month] AND y = $s[year]",1); $x = mysqli_fetch_assoc($q);
$a[i_total] = $a[i_total] - $x[i] + $a[i_today];
$a[c_total] = $a[c_total] - $x[c] + $a[c_today];
$x[show] = 'days_30'; get_range_dates($x);
$q = dq("select sum(i) as i,sum(c) as c from $s[pr]statistic_days where what = 'ads' and d > 0 and d != $s[day] and time > $s[timestamp1] and time < $s[timestamp2]",1);
$x = mysqli_fetch_assoc($q);
$a[i_days_30] = $x[i] + $a[i_today]; $a[c_days_30] = $x[c] + $a[c_today];
$q = dq("select * from $s[pr]statistic_days where what = 'ads' and d > 0 and d != $s[day] and time > $s[timestamp1] and time < $s[timestamp2]",1);
while ($x = mysqli_fetch_assoc($q)) $data[data][$x[y]][$x[m]][$x[d]] = $x;
$data[data][$s[year]][$s[month]][$s[day]][i] = $a[i_today];
$data[data][$s[year]][$s[month]][$s[day]][c] = $a[c_today];
stats_table($data,'days');
$a[chart_days_30] = chart('days_30');
if (!$a[i_total]) $a[i_total] = 0; if (!$a[c_total]) $a[c_total] = 0;
if (!$a[i_days_30]) $a[i_days_30] = 0; if (!$a[c_days_30]) $a[c_days_30] = 0;
if (!$a[i_today]) $a[i_today] = 0; if (!$a[c_today]) $a[c_today] = 0;
$q = dq("select count(n) from $s[pr]p_pl",1); $x = mysqli_fetch_row($q); $a[total_places] = $x[0];
//$neco = 'neco.html html hohoho';
//echo preg_replace('#[\.html]{2,}#','.html',$neco);
$q = dq("select * from $s[pr]zones order by title",1);
while ($b=mysqli_fetch_assoc($q))
{ $a[zones] .= '