- Timestamp:
- Jan 5, 2009, 7:31:45 AM (16 years ago)
- Location:
- www
- Files:
-
- 2 added
- 1 deleted
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
www/aktuality/rss.php
r4 r129 21 21 foreach($Parts as $Part) 22 22 { 23 $Where .= 'OR (category='.($Part * 1).')'; 23 $Where .= 'OR (category='.($Part * 1).')'; 24 24 } 25 25 $Where = substr($Where, 2); … … 35 35 36 36 // Update news from discussion forum 37 $ForumCategory = 4; 37 $ForumCategory = 4; 38 38 $Database->select_db('forum'); 39 39 $DbResult = $Database->query('SELECT posts.post_time, posts_text.post_subject, posts_text.post_text, users.username, topics.topic_title FROM posts JOIN posts_text ON posts.post_id = posts_text.post_id JOIN users ON users.user_id = posts.poster_id JOIN topics ON topics.topic_id= posts.topic_id ORDER BY post_time DESC LIMIT '.$NewsCount); 40 40 41 $Index = 0; 41 42 //echo(DB_NumRows().','); 42 43 while($Row = $DbResult->fetch_array()) 43 44 { 44 $Row['post_text'] = StrTr($Row['post_text'], "\x8A\x8D\x8E\x9A\x9D\x9E", "\xA9\xAB\xAE\xB9\xBB\xBE"); 45 $Row['post_text'] = str_replace("\n","<br>", $Row['post_text']); 46 $Row['post_subject'] = StrTr($Row['post_subject'], "\x8A\x8D\x8E\x9A\x9D\x9E", "\xA9\xAB\xAE\xB9\xBB\xBE"); 47 $Row['topic_title'] = StrTr($Row['topic_title'], "\x8A\x8D\x8E\x9A\x9D\x9E", "\xA9\xAB\xAE\xB9\xBB\xBE"); 48 $Index = $Index + 1; 49 45 $Row['post_text'] = StrTr($Row['post_text'], "\x8A\x8D\x8E\x9A\x9D\x9E", "\xA9\xAB\xAE\xB9\xBB\xBE"); 46 $Row['post_text'] = str_replace("\n","<br>", $Row['post_text']); 47 $Row['post_subject'] = StrTr($Row['post_subject'], "\x8A\x8D\x8E\x9A\x9D\x9E", "\xA9\xAB\xAE\xB9\xBB\xBE"); 48 $Row['topic_title'] = StrTr($Row['topic_title'], "\x8A\x8D\x8E\x9A\x9D\x9E", "\xA9\xAB\xAE\xB9\xBB\xBE"); 49 $Index = $Index + 1; 50 50 51 $Title = $Row['topic_title'].'-'.$Row['post_subject']; 51 52 $Content = $Row['post_text']; -
www/aktuality/rss_generator.php
r4 r129 6 6 { 7 7 global $Config; 8 8 9 9 $Result = '<?xml version="1.0" encoding="'.$Config['Web']['Charset'].'" ?>'."\n". //<? 10 10 '<rss version="2.0">'."\n". … … 15 15 " <language>cs</language>\n". 16 16 " <webMaster>".$Data['WebmasterEmail']."</webMaster>\n". 17 " <pubDate>".date('r')."</pubDate>\n". 17 " <pubDate>".date('r')."</pubDate>\n". 18 18 " <ttl>20</ttl>\n"; 19 19 foreach($Data['Items'] as $Item) … … 22 22 ' <title>'.htmlspecialchars($Item['Title'])."</title>\n". 23 23 ' <description>'.htmlspecialchars($Item['Description'])."</description>\n". 24 25 24 ' <pubDate>'.date('r',$Item['Time'])."</pubDate>\n". 25 ' <link>'.$Item['Link']."</link>\n". 26 26 " </item>\n"; 27 27 } -
www/database.php
r67 r129 73 73 function charset($Charset) 74 74 { 75 $this->LastQuery = 'SET CHARACTER SET '.$Charset;75 $this->LastQuery = "SET NAMES '".$Charset."'"; 76 76 $this->query($this->LastQuery); 77 77 } -
www/finance/bills.php
r79 r129 83 83 global $Database; 84 84 85 $Database->insert('finance_bills', array('time_create' => TimeToMysqlDateTime( $TimeFrom), 'user_id' => $UserId, 'time_from' => TimeToMysqlDateTime($TimeFrom), 'time_to' => TimeToMysqlDateTime($TimeTo), 'time_due' => TimeToMysqlDateTime($TimeFrom + 15*24*3600)));85 $Database->insert('finance_bills', array('time_create' => TimeToMysqlDateTime(time()), 'user_id' => $UserId, 'time_from' => TimeToMysqlDateTime($TimeFrom), 'time_to' => TimeToMysqlDateTime($TimeTo), 'time_due' => TimeToMysqlDateTime($TimeFrom + 15*24*3600))); 86 86 $BillId = $Database->insert_id; 87 87 foreach($Items as $Item) -
www/finance/monthly_overall.php
r66 r129 5 5 ShowHeader('Měsíční přehledy', 'Měsíční přehledy'); 6 6 7 echo('<table cellspacing="0" cellpadding="2" border="1"><tr><th>Rok</th><th>Měsíc</th><th>Internet [Kč]</th><th>Účastníků</th><th>Správa [Kč/účastníka]</th><th>Správa [Kč]</th><th>Spotřeba [Kč/kWh]</th><th>Spotřeba [Kč]</th><th>Obrat [Kč]</th><th>Průměrná cena [Kč/účastníka]</th>< /tr>');8 $Total = array('money' => 0, 'administration_total' => 0, 'consumption_total' => 0, 'total_paid' => 0 );9 $DbResult = $Database->select('finance_monthly_overall', '*', '1 ORDER BY date DESC');7 echo('<table cellspacing="0" cellpadding="2" border="1"><tr><th>Rok</th><th>Měsíc</th><th>Internet [Kč]</th><th>Účastníků</th><th>Správa [Kč/účastníka]</th><th>Správa [Kč]</th><th>Spotřeba [Kč/kWh]</th><th>Spotřeba [Kč]</th><th>Obrat [Kč]</th><th>Průměrná cena [Kč/účastníka]</th><th>Investice [Kč]</th></tr>'); 8 $Total = array('money' => 0, 'administration_total' => 0, 'consumption_total' => 0, 'total_paid' => 0, 'investment' => 0); 9 $DbResult = $Database->select('finance_monthly_overall', '*', '1 ORDER BY date ASC'); 10 10 while($Month = $DbResult->fetch_array()) 11 11 { 12 12 $DateParts = explode('-', $Month['date']); 13 echo('<tr><td>'.$DateParts[0].'</td><td align="center">'.$MonthNames[$DateParts[1]*1].'</td><td align="center">'.$Month['money'].'</td><td align="center">'.$Month['member_count'].'</td><td align="center">'.$Month['administration'].'</td><td align="center">'.$Month['administration_total'].'</td><td align="center">'.$Month['kWh'].'</td><td align="center">'.$Month['consumption_total'].'</td><td align="center">'.$Month['total_paid'].'</td><td align="center">'.round($Month['total_paid'] / $Month['member_count']).'</td></tr>'); 13 echo('<tr><td>'.$DateParts[0].'</td><td align="center">'.$MonthNames[$DateParts[1]*1].'</td><td align="center">'.$Month['money'].'</td><td align="center">'.$Month['member_count'].'</td><td align="center">'.$Month['administration'].'</td><td align="center">'.$Month['administration_total'].'</td><td align="center">'.$Month['kWh'].'</td><td align="center">'.$Month['consumption_total'].'</td><td align="center">'.$Month['total_paid'].'</td><td align="center">'.round($Month['total_paid'] / $Month['member_count']).'</td><td align="center">'.$Month['investment'].'</td></tr>'); 14 // echo('<tr><td>'.$Month['date'].'</td><td align="center">'.$MonthNames[$DateParts[1]*1].'</td><td align="center">'.$Month['money'].'</td><td align="center">'.$Month['member_count'].'</td><td align="center">'.$Month['administration'].'</td><td align="center">'.$Month['administration_total'].'</td><td align="center">'.$Month['kWh'].'</td><td align="center">'.$Month['consumption_total'].'</td><td align="center">'.$Month['total_paid'].'</td><td align="center">'.round($Month['total_paid'] / $Month['member_count']).'</td></tr>'); 14 15 15 16 $Total['money'] += $Month['money']; … … 17 18 $Total['consumption_total'] += $Month['consumption_total']; 18 19 $Total['total_paid'] += $Month['total_paid']; 20 $Total['investment'] += $Month['investment']; 19 21 //if($DateParts[1] == '01') echo('<tr><td style="font-size: 4;" colspan="10"> </td></tr>'); 20 22 } 21 echo('<tr><th colspan="2">Celkem</th><th>'.$Total['money'].'</th><th> </th><th> </th><th>'.$Total['administration_total'].'</th><th> </th><th>'.$Total['consumption_total'].'</th><th>'.$Total['total_paid'].'</th><th> </th> ');23 echo('<tr><th colspan="2">Celkem</th><th>'.$Total['money'].'</th><th> </th><th> </th><th>'.$Total['administration_total'].'</th><th> </th><th>'.$Total['consumption_total'].'</th><th>'.$Total['total_paid'].'</th><th> </th><th>'.$Total['investment'].'</tr>'); 22 24 echo('</table>'); 23 25 -
www/finance/prepocet.php
r55 r129 164 164 echo("Odečítám měsíční poplatek...<br>\n"); 165 165 166 $BillingPeriodMonthCount = array('never' => 0, 'monthly' => 1, 'quarterly' => 3, 'half-yearly' => 6, 'yearly' => 12); 167 166 168 // Generuj účetní položky 167 $DbResult = $Database->query("SELECT *,CONCAT(second_name, ' ', first_name) as fullname FROM users WHERE role=2"); 168 while($Row = $DbResult->fetch_array()) 169 { 170 echo($Row['fullname'].': '.($Row['plus'] - $Row['monthly'])."<br>\n"); 171 172 $BillId = $InvoiceGenerator->CreateBill($Row['id'], array(array('description' => 'Poplatek za připojení k síti', 'price' => ($Row['monthly'] - $Row['plus']), 'quantity' => 1)), time(), time() + (date("t", time()) - 1) * 24 * 3600); 173 174 $Database->insert('finance_operations',array('money' => ($Row['plus'] - $Row['monthly']), 'user' => $Row['id'], 'type' => 2, 'date' => 'NOW()', 'comment' => 'Poplatek za měsíc '.$Mesice[$Mesic], 'group' => 1, 'bill_id' => $BillId)); 175 } 176 169 $DbResult = $Database->query("SELECT *, CONCAT(second_name, ' ', first_name) as fullname FROM users WHERE (role = 2)"); 170 while($User = $DbResult->fetch_array()) 171 { 172 echo($User['fullname'].': '); 173 $MonthCount = $BillingPeriodMonthCount[$User['BillingPeriod']]; 174 if(($MonthCount > 0) and (((($Mesic - 1) % 12) % $MonthCount) == 0) and ($User['inet_tarif_now'] != 6)) 175 { 176 //echo($Mesic.'%'.$MonthCount.'='.($Mesic % $MonthCount).' '); 177 $PayPerMonth = -($User['plus'] - $User['monthly']); 178 $PayPerPeriod = $PayPerMonth * $MonthCount; 179 $PeriodFrom = mktime(0, 0, 0, date('n'), 1, date('Y')); 180 $PeriodTo = mktime(0, 0, 0, date('n') + $MonthCount - 1, date('t', mktime(0, 0, 0, date('n') + $MonthCount - 1, 1, date('Y'))) , date('Y')); 181 $TimePeriodText = date('j.n.Y', $PeriodFrom).' - '.date('j.n.Y', $PeriodTo); 182 echo($TimePeriodText.': '.$PayPerMonth." * ".$MonthCount." = ".$PayPerPeriod."\n"); 183 $BillId = $InvoiceGenerator->CreateBill($User['id'], array(array('description' => 'Připojení k síti', 'price' => $PayPerPeriod, 'quantity' => 1)), $PeriodFrom, $PeriodTo); 184 $Database->insert('finance_operations', array('money' => -$PayPerPeriod, 'user' => $User['id'], 'type' => 2, 'date' => 'NOW()', 'comment' => 'Připojení k síti za období '.$TimePeriodText, 'group' => 1, 'bill_id' => $BillId)); 185 } else echo("\n"); 186 } 177 187 echo('Měním aktuální parametry sítě...<br>\n'); 178 188 … … 184 194 $DbResult = $Database->insert('finance_charge', array('period' => 0, 'internet' => $Charge['internet'], 185 195 'internet_speed' => $Charge['internet_speed'], 'internet_speed_reserve' => $Charge['internet_speed_reserve'], 'administration_per_user' => $Charge['administration_per_user'], 'kWh' => $Charge['kWh'], 'base_speed_element' => $Charge['base_speed_element'], 'BaseTariffPrice' => $Charge['BaseTariffPrice'], 'TopTariffPrice' => $Charge['TopTariffPrice'])); 186 196 187 197 echo("Přidávám měsíční přehled...<br>\n"); 188 198 189 $Database->insert('finance_monthly_overall', array('date' => 'NOW()', 'money' => $Internet, 'kWh' => $kWh, 'administration' => $Sprava, 'administration_total' => $SpravaCelkem, 'consumption_total' => $CelkemSpotreba, 'total_paid' => $TotalPaid, 'BaseTariffPrice' => $Charge['BaseTariffPrice'], 'TopTariffPrice' => $Charge['TopTariffPrice'] ));190 199 $Database->insert('finance_monthly_overall', array('date' => 'NOW()', 'money' => $Internet, 'kWh' => $kWh, 'administration' => $Sprava, 'administration_total' => $SpravaCelkem, 'consumption_total' => $CelkemSpotreba, 'total_paid' => $TotalPaid, 'BaseTariffPrice' => $Charge['BaseTariffPrice'], 'TopTariffPrice' => $Charge['TopTariffPrice'], 'member_count' => $InternetUsers)); 200 191 201 echo("Měním aktuální tarify....<br>\n"); 192 202 … … 199 209 'speed_factor' => $Tariff['speed_factor'], 'price_units' => $Tariff['price_units'], 'group_id' => $Tariff['group_id'], 'min_speed' => $Tariff['min_speed'], 'max_speed' => $Tariff['max_speed'], 'price' => $Tariff['price'])); 200 210 } 201 211 202 212 echo("Měním aktuální tarify uživatelů...<br>\n"); 203 213 … … 211 221 RecalculateTariffs(); 212 222 RecalculateUsersFinance(); 213 CreateMonthlyOverallBill();223 //CreateMonthlyOverallBill(); 214 224 RecalculateUsersFinance(); 215 225 216 226 // Restart traffic shaping 217 227 $Database->update('services_restart', 'id=3', array('changed' => 1)); -
www/index.php
r114 r129 174 174 while($Row = $DbResult->fetch_array()) 175 175 { 176 echo( $Row['name'].'<br />');176 echo(strtoupper($Row['name']).'<br>'); 177 177 } 178 178 echo('</span>'); -
www/is/tc.php
r1 r129 6 6 <title>Traffic Control stat</title> 7 7 <meta http-equiv="Content-Language" content="cs"> 8 <meta http-equiv="Content-Type" content="text/html; charset= iso-8859-2">8 <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> 9 9 <style type="text/css"> 10 10 table td … … 121 121 { 122 122 global $ClassList; 123 123 124 if(array_key_exists('Leaf', $Class)) $Class['Id'] .= ' Leaf'; 124 125 if(!array_key_exists('Prio', $Class)) $Class['Prio'] = ' '; … … 136 137 foreach($Class['SubClasses'] as $Index => $SubClassId) 137 138 ShowClass($ClassList[$SubClassId], $Level + 1); 138 //echo('</table></td></tr>'); 139 //echo('</table></td></tr>'); 139 140 } 140 141 } 141 142 142 echo('<table style="font-size: small;" border="0" cellspacing="0" cellpadding="1"><tr><th>Id</th><th>Level</th><th>Description</th><th>Prio</th>143 echo('<table style="font-size: x-small;" border="0" cellspacing="0" cellpadding="1"><tr><th>Id</th><th>Level</th><th>Description</th><th>Prio</th> 143 144 <th>Rate [bit/s]</th><th>Ceil [bit/s]</th><th>Burst [B/s]</th><th>CBurs [B/s]t</th><th>Quantum [B]</th> 144 145 <th>CurrentRate [bit/s]</th><th>Dropped</th></tr>'); -
www/is/topologie-img.php
r16 r129 5 5 if(array_key_exists('debug', $_GET)) $debug = $_GET['debug']; 6 6 else $debug = 0; 7 $TopHostName = ' NIX-ROUTER';7 $TopHostName = 'nix-router'; 8 8 // $debug = 0; 9 9 … … 179 179 $im_dev = imagecreatefrompng('images/device.png'); 180 180 // === Generování obrázku ====================================================== 181 $im = imagecreate(($ width + 1.6) * $spacex, ($height + 1) * $spacey);181 $im = imagecreate(($datawidth+$width+3.2) * $halfx, ($height + 1) * $spacey); 182 182 $background_color = imagecolorallocate($im, 255, 255, 255); 183 183 $black = imagecolorallocate($im, 0, 0, 0); … … 236 236 // imagerectangle($im,xpos($id)+$halfx-6,$vtop[$id]*$spacey+16,xpos($id)+$halfx+6,$vtop[$id]*$spacey+28,$color); 237 237 if ($debug) { 238 imagestring($im, 2,xpos($id)+($spacex-strlen($item['id'])*imagefontwidth(2))/2,$vtop[$id]*$spacey+31+imagefontheight(2),$item['id'],$color);239 } else imagestring($im, 2,xpos($id)+($spacex-strlen($item['name'])*imagefontwidth(2))/2,$vtop[$id]*$spacey+31+imagefontheight(2),$item['name'],$color);240 } 238 imagestring($im, 2, xpos($id) + ($spacex - strlen($item['id']) * imagefontwidth(2)) / 2, $vtop[$id] * $spacey + 31 + imagefontheight(2), $item['id'], $color); 239 } else imagestring($im, 2, xpos($id) + ($spacex - strlen($item['name']) * imagefontwidth(2)) / 2, $vtop[$id] * $spacey + 31 + imagefontheight(2), strtoupper($item['name']), $color); 240 } 241 241 } 242 242 -
www/share/browse.php
r40 r129 1 1 <?php 2 2 include('../style.php'); 3 $SambaBinDir = '/usr/bin/'; 4 $SambaSbinDir = '/usr/sbin/'; 3 5 $Database->select_db('share'); 4 6 $ZanoreniMax = 8; // Maximální úroven zanoreni … … 18 20 echo("Nacitam seznam sdileni pro ".$Host.'('.$HostID.')...'); 19 21 $Output = array(); 20 exec( 'smbclient -d0 -N -L='.$Host,$Output);22 exec($SambaBinDir.'smbclient -d0 -N -L='.$Host,$Output); 21 23 echo("OK\n"); 22 24 //print_r($Output); … … 158 160 echo("Načítám strom sdílení ".$Share."..."); 159 161 unset($Output); 160 passthru("mount.cifs '".$ShareFull."' ".$MountDir.' -o guest,codepage=cp852,iocharset=iso8859-2'); 161 PassThru('ls -A -R -X -l --time-style=+"%Y-%m-%d %I:%M:%S" '.$MountDir.'>'.$TempDir.$Host.'.list 2>'.$TempDir.'errors/'.$Host.'_'.$Share.'.err',$Result); 162 passthru($SambaSbinDir."mount.cifs '".$ShareFull."' ".$MountDir.' -o guest codepage=cp852 iocharset=iso8859-2'); 163 // echo($SambaSbinDir."mount.cifs '".$ShareFull."' ".$MountDir.' -o guest,codepage=cp852,iocharset=iso8859-2'); 164 passthru('ls -A -R -X -l --time-style=+"%Y-%m-%d %I:%M:%S" '.$MountDir.'>'.$TempDir.$Host.'.list 2>'.$TempDir.'errors/'.$Host.'_'.$Share.'.err',$Result); 162 165 //if($Result==0) 163 166 //{ … … 182 185 $Soubor = fopen($TempDir.$Host.'.list','r'); 183 186 $Citac = 0; 184 Vetev('/', 0); // Skenuj sdileni187 Vetev('/', 0); // Skenuj sdileni 185 188 fclose($Soubor); // Uzavřít soubor 186 189 unlink($TempDir.$Host.'.list'); // Smazat soubor stromu adresářové struktury -
www/share/update.sh
r1 r129 1 1 #!/bin/bash 2 php - c php.ini -f update.php2 php -f update.php -
www/statistic/bandwidth.php
r4 r129 41 41 if($Host['vpn'] == 1) $Host['IP'] = ToVpnIp($Host); 42 42 43 $Host['traffic_down'] = $HostsStat[$Host['IP']]['traffic_avg_down']; 44 $Host['traffic_up'] = $HostsStat[$Host['IP']]['traffic_avg_up']; 43 if(array_key_exists($Host['IP'], $HostsStat)) 44 { 45 $Host['traffic_down'] = $HostsStat[$Host['IP']]['traffic_avg_down']; 46 $Host['traffic_up'] = $HostsStat[$Host['IP']]['traffic_avg_up']; 47 } else 48 { 49 $Host['traffic_down'] = 0; 50 $Host['traffic_up'] = 0; 51 } 45 52 46 53 if($Host['name'] == 'CENTRALA') $Host['IP'] = $Host['external_ip']; -
www/statistic/graf2.php
r4 r129 68 68 $Krok = $Sirka/$Pocet; 69 69 } 70 71 70 //echo('Maximum...<br>'); 72 71 //flush(); … … 87 86 $Max = 0; 88 87 $Min = 10000000000000000; 89 88 90 89 for($I=0; $I<$Pocet; $I++) 91 90 { … … 94 93 //echo('SELECT AVG('.$type.'),MAX('.$type.') FROM traffic WHERE time>FROM_UNIXTIME('.$StartTime.') AND time<FROM_UNIXTIME('.$EndTime.')'); 95 94 $DbResult = $Database->query('SELECT AVG('.$type.'),MAX('.$type.') FROM traffic WHERE time>FROM_UNIXTIME('.$StartTime.') AND time<FROM_UNIXTIME('.$EndTime.')'); 95 // echo($Database->error); 96 96 //if($DbResult->num_rows > 0) 97 97 //{ … … 132 132 // Ramecek 133 133 imagerectangle($im,0,0,$Sirka-1,$Vyska-1,$black); 134 135 134 foreach($BodyMAX as $Index => $Item) 136 135 { -
www/statistic/index.php
r1 r129 1 <? 2 session_start(); 3 include_once('../style.php'); 4 //$refresh = 60; 5 ShowHeader('Èasové záznamy','Statistika'); 6 include_once('../is/db.php'); 7 DB_Init('localhost','root','','statistic'); 8 9 // Preload measure table 10 DB_Select('stat_measure', '*'); 11 while($Row = DB_Row()) $Measures[$Row['name']] = $Row; 12 13 $GrafTimeRanges = array( 14 'hour' => array( 15 'caption' => 'Hodina', 16 'seconds' => 60*60, 17 ), 18 'day' => array( 19 'caption' => 'Den', 20 'seconds' => 24*60*60, 21 ), 22 'week' => array( 23 'caption' => 'Týden', 24 'seconds' => 7*24*60*60, 25 ), 26 'month' => array( 27 'caption' => 'Mìsíc', 28 'seconds' => 30*24*60*60, 29 ), 30 'year' => array( 31 'caption' => 'Rok', 32 'seconds' => 12*30*24*60*60, 33 ), 34 'years' => array( 35 'caption' => 'Roky', 36 'seconds' => 3*12*30*24*60*60, 37 ), 38 ); 39 40 $Perioda = 'day'; 41 if(array_key_exists('period',$_SESSION)) $Perioda = $_SESSION['period']; 42 if(array_key_exists('period',$_GET)) $Perioda = $_GET['period']; 43 if(!array_key_exists($Perioda, $GrafTimeRanges)) $Perioda = 'day'; 44 $_SESSION['period'] = $Perioda; 45 46 $MeasureName = 'inet'; 47 if(array_key_exists('measure', $_SESSION)) $MeasureName = $_SESSION['measure']; 48 if(array_key_exists('measure', $_GET)) $MeasureName = $_GET['measure']; 49 if(!array_key_exists($MeasureName, $Measures)) $MeasureName = 'inet_down'; 50 $_SESSION['measure'] = $MeasureName; 51 52 // Show graf time range menu 53 echo('Èasový úsek: '); 54 foreach($GrafTimeRanges as $Index => $Item) 55 echo('<a href="?period='.$Index.'">'.$Item['caption'].'</a> '); 56 57 // Show graf type menu 58 echo('<br>Výbìr záznamu: '); 59 foreach($Measures as $Item) 60 echo('<a href="?measure='.$Item['name'].'">'.$Item['description'].'</a> '); 61 62 // Insert graf 63 echo('<br><br>'.$Measures[$MeasureName]['description'].' za poslední '.strtolower($GrafTimeRanges[$Perioda]['caption']).':<br>'); 64 echo('<img alt="Graf '.strtolower($Measures[$MeasureName]['description']).' za poslední '.strtolower($GrafTimeRanges[$Perioda]['caption']).'"'. 65 'src="graph.php?measure='.$Measures[$MeasureName]['name'].'&from='.(time() - $GrafTimeRanges[$Perioda]['seconds']).'&to='.time().'" width="750" height="214"><br>'); 66 67 echo('<span style="color: #ffb4b4">Maximálnì</span> '); 68 echo('<span style="color: #7878ff">Prùmìrnì</span>'); 69 echo('<br><br>'); 70 71 flush(); 72 // Online status check 73 if(($MeasureName == 'inet') or ($MeasureName == 'inet_down') or ($MeasureName == 'inet_up')) 74 { 75 echo('Stav: '); 76 $Output = array(); 77 $Online = 0; 78 exec('ping 195.47.235.3 -c 1 | grep received', $Output); 79 if(count($Output) == 1) 80 { 81 $Output = explode(" ",$Output[0]); 82 if($Output[3]=='1') $Online = 1; 83 } 84 // exec('ifconfig | grep ppp0',$Output); 85 //$Online = count($Output); 86 if($Online == 1) echo('<font style="color: green; font-weight: bold;">ONLINE</font>'); else echo('<font style="color: red; font-weight: bold;">OFFLINE</font>'); 87 88 echo('<br>'); 89 90 $EndTime = time(); 91 $StartTime = $EndTime - $GrafTimeRanges[$Perioda]['seconds']; 92 DB_Select('traffic', 'sum(inet_down),sum(inet_up)', 'time>FROM_UNIXTIME('.$StartTime.') AND time<FROM_UNIXTIME('.$EndTime.')'); 93 $Row = DB_Row(); 94 echo('Za úsek sta¾eno: '.Round($Row[0]*60/1024/1024).' MB Za úsek odesláno: '.Round($Row[1]*60/1024/1024).' MB<br>'); 95 96 // Total downloaded and uploaded 97 DB_Query('select sum(inet_down),sum(inet_up) from traffic'); 98 $Row = DB_Row(); 99 echo('Celkem sta¾eno: '.Round($Row[0]*60/1024/1024).' MB Celkem odesláno: '.Round($Row[1]*60/1024/1024).' MB<br><br>'); 100 echo('<a href="bandwidth.php">Tabulka zatí¾ení linky podle poèítaèù</a><br>'); 101 echo('<a href="http://rychlost.cz/statistika/ip/">Mìøení rychlost pøipojení k internetu (rychlost.cz)</a><br>'); 102 103 } 104 /* 105 echo('Zatí¾ení internetu za posledních den<br>'); 106 echo('<img align="center" src="graf2.php?count=1440&size=60" width="100%" height="198"><br><br>'); 107 */ 108 109 //echo('Zatí¾ení internetu za poslední mìsíc<br>'); 110 //echo('<img align="center" src="graf.php?krok=9000" width="901" height="198"><br><br>'); 111 112 // Výpis selhání 113 /* 114 echo('<strong>15 posledních zachycených selhání:</strong><br>'); 115 echo('<table border="1" cellspacing="0" cellpadding="1"><tr><th>Èas</th><th>Pokus</th></tr>'); 116 DB_Query('select * from failure order by time desc limit 0,15'); 117 while($Row = DB_Row()) 118 { 119 echo('<tr><td>'.$Row['time'].'</td><td>'.($Row['attempt']+1).'</td></tr>'); 120 } 121 echo('</table><i>Poznámka: vytoèeno na první(1), druhý(2), tøetí(3) pokus, jinak restart(4)</i>'); 122 123 // echo('informace jsou aktualizovány ka¾dou minutu. stránku je nutno obnovovat.'); 124 */ 125 ShowFooter(); 1 <?php 126 2 ?>
Note:
See TracChangeset
for help on using the changeset viewer.