Example #1
0
 public static function setWarnings($tracker, $warning)
 {
     $date = date('Y-m-d H:i:s');
     Database::setWarnings($date, $tracker, $warning);
     $countErrors = Database::getWarningsCount($tracker);
     if ($countErrors == 1) {
         Notification::sendNotification('warning', $date, $tracker, $message);
     }
 }
 public static function findWarning()
 {
     $trackersArray = Database::getTrackersList();
     foreach ($trackersArray as $tracker) {
         $warningsCount = Database::getWarningsCount($tracker);
         if ($warningsCount == 1) {
             $warningsArray = Database::getWarnings($tracker);
             Notification::sendNotification('warning', $warningsArray['time'], $tracker, $warningsArray['reason']);
         }
     }
 }
Example #3
0
<?php

$dir = dirname(__FILE__);
$dir = str_replace('include', '', $dir);
include_once $dir . "config.php";
include_once $dir . "class/System.class.php";
include_once $dir . "class/Database.class.php";
include_once $dir . "class/Errors.class.php";
$count = Database::getWarningsCount();
if (!empty($count)) {
    ?>
<table class="warning_table" border="0" cellpadding="0" cellspacing="1">
	<thead> 
	<tr>
		<th width="20%">Время</th>
		<th width="15%">Трекер</th>
		<th width="65%">Причина</th>
 	</tr>
	</thead>
	<?php 
    for ($i = 0; $i < count($count); $i++) {
        $errors = Database::getWarningsList($count[$i]['where']);
        $countErrorsByTracker = count($errors);
        if ($countErrorsByTracker > 5) {
            for ($x = 0; $x < 2; $x++) {
                if ($x % 2 == 0) {
                    $class = "second";
                } else {
                    $class = "first";
                }
                $date = $errors[$x]['day'] . " " . Sys::dateNumToString($errors[$x]['month']) . " " . $errors[$x]['year'] . " " . $errors[$x]['time'];
Example #4
0
include_once $dir . "class/System.class.php";
?>
        <h1 class="h-title">TorrentMonitor v.
        <?php 
echo Sys::version();
?>
        </h1>
        <menu class="h-menu">
            <li id="show_table" class="active"><a href="#" onclick="show('show_table')" class="h-menu-item1">Торренты</a></li>
            <li id="show_watching"><a href="#" onclick="show('show_watching')" class="h-menu-item2">Пользователи</a></li>
            <li id="add"><a href="#" onclick="show('add')" class="h-menu-item3">Добавить</a></li>
            <li id="credentials"><a href="#" onclick="show('credentials')" class="h-menu-item4">Учётные данные</a></li>
            <li id="settings"><a href="#" onclick="show('settings')" class="h-menu-item5">Настройки</a></li>
            <li id="show_warnings"><a href="#" onclick="show('show_warnings')" class="h-menu-item6">Ошибки
            <?php 
$errors = Database::getWarningsCount();
if (!empty($errors)) {
    $count = 0;
    for ($i = 0; $i < count($errors); $i++) {
        $count += $errors[$i]['count'];
    }
    if ($count > 0) {
        echo ' (' . $count . ')';
    }
}
?>
            </a></li>
            <li><a href="#" onclick="show('check')" class="h-menu-item7">Тест</a></li>
        </menu>
    </header>
    <div id="content">