$key = substr($sort, 1, strlen($sort) - 1); foreach ($urls as $url) { $tmp = $url[$key]; //echo($tmp.">".$avg_data[$key]."<br>");//(($sum_data[$key]/100.0)*($avg_data[$key]/($sum_data[$key]/$min_data[$key])))."<br>"); $g = $sort[0] == ">" ? $tmp > $avg_data[$key] : $tmp < $avg_data[$key]; if ($g && count($data) < 12) { $data[] = $tmp; $tmpstr = $key == "length" ? make_fsize_str($tmp) : $tmp; $labels[] = ($groupby == 'cid' ? $url['cattitle'] : $url['url']) . " - " . $tmpstr; } else { $data_other['data'] += $tmp; } } if ($data_other['data']) { $data[] = $data_other['data']; $tmpstr = $key == "length" ? make_fsize_str($data_other['data']) : $data_other['data']; $labels[] = $data_other['label'] . " - " . $tmpstr; } break; case "today": $accts = $BILL->GetTodayUsersAccts(0, 1, $gid); $params[14] = "Статистика на " . date("d") . " " . $monthsof[date("n") - 1] . ", " . date("H:i:s") . ""; for ($i = 0; $i < count($accts); ++$i) { $data[$i] = $accts[$i]["traffic"]; $tmp = explode(" ", $accts[$i]["fio"]); $fio = $tmp[0]; $labels[$i] = $fio . " (" . bytes2mb($accts[$i]["traffic"]) . " Мб)"; } break; case "month": $accts = $BILL->GetMonthUsersAccts(0, 1, $gid);
%"></td> <td class=tbl1>Скачано:<?php echo make_fsize_str($cur["traffic"]); ?> <br> (<?php OUT(round($prc_tr, 3)); ?> %)</td> </tr> </table> </td> <td width=50% height=100% valign=bottom class=tbl1><?php echo utils::cp2utf($months[date("n") - 1]); ?> (норма <?php echo make_fsize_str($daynorm[0]); ?> ): <table width=100% height=150px cellspacing=0 cellpadding=0 valign=bottom border=0> <?php for ($i = 0; $i < $daycount; ++$i) { $prc = (double) $history[$i]["traffic"] / (double) $maxtraf * 100.0; $k = $daynorm[$i] < 0 ? -90000 : 0; $prci = (double) $history[$i]["traffic"] / (double) $daynorm[$i] * 100.0 - $k; if ($prci < 100) { $colorr = "00"; $colorg = "FF"; } else { if ($prci > 200) { $prci = 200.0; }
$chart['draw'] = array(array('type' => "text", 'transition' => 'slide_left', 'delay' => 0, 'duration' => 0, 'x' => 0, 'y' => 10, 'width' => 600, 'height' => 100, 'h_align' => "center", 'v_align' => "top", 'rotation' => 90, 'text' => $title, 'font' => "Tahoma", 'bold' => true, 'size' => 16, 'color' => "4400ff", 'alpha' => 90)); $chart['chart_value'] = array('font' => "Tahoma", 'bold' => true, 'size' => 16, 'color' => "4400ff", 'suffix' => " Mb"); SendChartData($chart); break; //-------------------- //-------------------- case "week": $accts = $BILL->GetWeekUsersAccts(0, 1, $gid); $title = "Статистика за неделю:"; $labels = array(""); $data = array(""); for ($i = 0; $i < count($accts); ++$i) { $data[$i] = bytes2mb($accts[$i]["traffic"]); $tmp = explode(" ", $accts[$i]["fio"]); $fio = iconv('cp1251', 'utf-8', $tmp[0]); $labels[$i] = $fio . " (" . make_fsize_str($accts[$i]["traffic"]) . " )"; } $chart['chart_type'] = "3D pie"; $chart['legend_label'] = array('font' => "Tahoma", 'size' => 10); $chart['chart_data'] = array($labels, $data); $chart['draw'] = array(array('type' => "text", 'transition' => 'slide_left', 'delay' => 0, 'duration' => 0, 'x' => 0, 'y' => 10, 'width' => 600, 'height' => 100, 'h_align' => "center", 'v_align' => "top", 'rotation' => 90, 'text' => $title, 'font' => "Tahoma", 'bold' => true, 'size' => 16, 'color' => "4400ff", 'alpha' => 90)); $chart['chart_value'] = array('font' => "Tahoma", 'bold' => true, 'size' => 16, 'color' => "4400ff", 'suffix' => " Mb"); SendChartData($chart); break; //-------------------- //-------------------- case "tarifs": if (!isset($fdate)) { $fdate = ""; } else { $fdate .= " 00:00:00";
function log_url_protocol_template($session) { ?> <table class=tbl1 width=100%> <tr> <td width=100% class=tbl1> <div align=center><b><STRONG>Protocol:</STRONG></b></div> <?php OUT(nl2br($session['protocol']['data'])); ?> </td> </tr> <tr> <td width=100% class=tbl1><div align=center><b>Total data recieved: <?php OUT(make_fsize_str($session['protocol']['length'])); ?> </b></div></td> </tr> </table> <?php }
</b> </td> <td> <b><?php echo make_fsize_str($sum_of_day_limits); ?> / <?php echo make_fsize_str($daylimits->getAllowedDayTraffic()); ?> / <?php echo make_fsize_str($daylimits->getRestMonthTraffic()); ?> </b> </td> </tr> </table> Стоимость 1 балла ранга равна <?php echo make_fsize_str($daylimits->getOnePointCost()); ?> на человека <?php $ajaxbuf->end(); ?> <input class="button" type="button" onclick="<?php echo $ajaxbuf->client_id(); ?> .update()" value="Пересчитать"/> <br/><br/> <a href="javascript:history.back(1);">Назад</a>
<td class=tbl1><b>TOTAL:</b></td> <td class=tbl1></td> <?php if (!$uid) { ?> <td class=tbl1>MAX: <?php echo $total_ucount; ?> </td><?php } ?> <td class=tbl1><?php echo $total_count; ?> </td> <td class=tbl1><?php echo make_fsize_str($total_length); ?> </td> </tr> </table> <?php if ($BILLEVEL >= 3) { ?> <a target=_blank href="<?php OUT("?act=noskin&page={$p}&noskinact=smadbisrept&action={$action}&sort={$sort}&modurl={$modurl}&hideother={$hideother}&limit={$limit}&graf={$graf}&uid={$uid}&showdenied={$showdenied}&modurl={$modurl}&gid={$gid}&groupby={$groupby}&uid={$uid}&mod=show&monsel[]=" . $monsel[0] . "&monsel[]=" . $monsel[1] . "&daysel[]=" . $daysel[0] . "&daysel[]=" . $daysel[1] . "&yearsel[]=" . $yearsel[0] . "&yearsel[]=" . $yearsel[1]); ?> ">Версия для печати</a><br> <?php }