Example #1
0
 public function getStatusDataRows()
 {
     $rows = array();
     $rows[] = "<tr><th>OpCache Version</th><td>{$this->_configuration['version']['version']}</td></tr>\n";
     $rows[] = "<tr><th>PHP Version</th><td>" . phpversion() . "</td></tr>\n";
     if (!empty($_SERVER['SERVER_NAME'])) {
         $rows[] = "<tr><th>Host</th><td>{$_SERVER['SERVER_NAME']}</td></tr>\n";
     }
     if (!empty($_SERVER['SERVER_SOFTWARE'])) {
         $rows[] = "<tr><th>Server Software</th><td>{$_SERVER['SERVER_SOFTWARE']}</td></tr>\n";
     }
     $rows[] = "<tr><th>Uptime</th><td>" . duration($this->_status['opcache_statistics']['start_time']) . "</td></tr>\n";
     $rows[] = '<tr><th>Clear cache</th><td><a href="?clear_cache=1">&#10006; Clear Cache</a></td></tr>' . "\n";
     foreach ($this->_status as $key => $value) {
         if ($key === 'scripts') {
             continue;
         }
         if (is_array($value)) {
             foreach ($value as $k => $v) {
                 if ($v === false) {
                     $value = 'false';
                 }
                 if ($v === true) {
                     $value = 'true';
                 }
                 if ($k === 'used_memory' || $k === 'free_memory' || $k === 'wasted_memory') {
                     $v = $this->_size_for_humans($v);
                 }
                 if ($k === 'current_wasted_percentage' || $k === 'opcache_hit_rate') {
                     $v = number_format($v, 2) . '%';
                 }
                 if ($k === 'blacklist_miss_ratio') {
                     $v = number_format($v, 2) . '%';
                 }
                 if ($k === 'start_time' || $k === 'last_restart_time') {
                     $v = $v ? date(DATE_RFC822, $v) : 'never';
                 }
                 if (THOUSAND_SEPARATOR === true && is_int($v)) {
                     $v = number_format($v);
                 }
                 $rows[] = "<tr><th>{$k}</th><td>{$v}</td></tr>\n";
             }
             continue;
         }
         if ($value === false) {
             $value = 'false';
         }
         if ($value === true) {
             $value = 'true';
         }
         $rows[] = "<tr><th>{$key}</th><td>{$value}</td></tr>\n";
     }
     return implode("\n", $rows);
 }
Example #2
0
function send_footers()
{
    global $settings, $c, $session, $theme, $dbconn, $total_query_time, $debuglevel;
    global $REQUEST_URI, $HTTP_USER_AGENT, $HTTP_REFERER, $PHP_SELF;
    $theme->EndContentArea();
    if ($theme->panel_right) {
        $theme->RightPanel();
    }
    $theme->EndPanels();
    if ($theme->panel_bottom) {
        $theme->PageFooter();
    }
    echo <<<CLOSEHTML
<div id="overDiv" style="position:absolute; visibility:hidden; z-index:1000;"></div>
<script language="JavaScript" src="js/overlib.js"></script>
</body>
</html>
CLOSEHTML;
    if (is_object($settings) && $settings->is_modified()) {
        if (!is_numeric($settings->get('counter'))) {
            $settings->set('counter', 0);
        } else {
            $settings->set('counter', $settings->get('counter') + 1);
        }
        $config_data_string = qpg($settings->to_save());
        $query = "UPDATE session SET session_config={$config_data_string} ";
        $query .= "WHERE session_id={$session->session_id} ";
        $query .= "AND session_config != {$config_data_string}; ";
        if ($session->user_no > 0) {
            $query .= "UPDATE usr SET config_data={$config_data_string} WHERE user_no={$session->user_no} ";
            $query .= "AND config_data != {$config_data_string}; ";
        }
        $result = awm_pgexec($dbconn, $query);
    }
    error_reporting(7);
    if ($debuglevel > 0) {
        $total_query_time = sprintf("%3.06lf", $total_query_time);
        error_log($c->sysabbr . " total_query_ TQ: {$total_query_time} URI: {$REQUEST_URI}", 0);
        $total_time = sprintf("%3.06lf", duration($c->started, microtime()));
        error_log($c->sysabbr . " process_time TT: {$total_time}      Agent: {$HTTP_USER_AGENT} Referrer: {$HTTP_REFERER}  ", 0);
        error_log("=============================================== Endof {$PHP_SELF}");
    }
}
Example #3
0
function is_session_valid()
{
    if (empty($_SESSION['timestamp']) or empty($_SESSION['token-issue'])) {
        return FALSE;
    }
    $session = duration($_SESSION['timestamp']);
    $token = duration($_SESSION['token-issue']);
    if ($session > SESSION_DURATION) {
        return false;
    } else {
        if ($token > TOKEN_DURATION) {
            return false;
        } else {
            if (empty($_SESSION["token"])) {
                return false;
            } else {
                return true;
            }
        }
    }
}
Example #4
0
<?php

check_login();
if (!defined('BASEPATH')) {
    exit('Nu poti accesa acest fisier direct.');
}
set_title(site_name() . ' - Caracterele mele');
$data = $DB->query("SELECT * FROM " . PLAYER_DATABASE . ".player WHERE account_id = '" . $_SESSION['user_data']['id'] . "'");
$users = array();
$i = 0;
while ($row = $DB->fetch($data)) {
    $users[$i]['id'] = $row['id'];
    $users[$i]['name'] = $row['name'];
    $users[$i]['level'] = $row['level'];
    $users[$i]['time'] = $row['playtime'] > 0 ? duration($row['playtime'] * 60) : 'nedeterminat';
    $users[$i]['class'] = char_class($row['job']);
    $i++;
}
$smarty->assign('users', $users);
assign('content_tpl', 'content/character');
Example #5
0
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
	<head>
		<link href='http://fonts.googleapis.com/css?family=Josefin+Sans' rel='stylesheet' type='text/css'>
		<link rel="stylesheet" type="text/css" href="dine.css?v=0.1">
        <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>
        <script src='https://www.google.com/recaptcha/api.js'></script>
    </head>
	<body id="plate">
        <div id="text">
            <?php 
$who = name();
$where = place();
$when = when();
$duration = duration();
$email = email();
$why = reason();
$mail_text = "Who:   {$who}\r\n" . "Where: {$where}\r\n" . "When:  {$when}\r\n" . "Duration: {$duration} hour(s) \r\n" . "Email: {$email}\r\n" . "Reason: {$why}\r\n";
if (verify_captcha()) {
    send_mail($mail_text, $email, $who);
    echo "Mail sent, now you must wait for me to respond.";
} else {
    echo "Captcha failed, I don't dine with robots";
}
?>
        </div>
    </body>
</html>
Example #6
0
$h3_ = '<font face="' . $h3['font_face'] . '" size=' . $h3['font_size'] . ' color="' . $h3['color'] . '">' . ($h3['bold'] ? '<b>' : '') . ($h3['italic'] ? '<i>' : '') . ($h3['underline'] ? '<u>' : '');
$_h3 = ($h3['underline'] ? '</u>' : '') . ($h3['italic'] ? '</i>' : '') . ($h3['bold'] ? '</b>' : '') . '</font>';
// Default text style
$d_ = '<font face="' . $default['font_face'] . '" size=' . $default['font_size'] . ' color="' . $default['color'] . '">' . ($default['bold'] ? '<b>' : '') . ($default['italic'] ? '<i>' : '') . ($default['underline'] ? '<u>' : '');
$_d = ($default['underline'] ? '</u>' : '') . ($default['italic'] ? '</i>' : '') . ($default['bold'] ? '</b>' : '') . '</font>';
// Stack trace text style
$st_ = '<font face="' . $strace['font_face'] . '" size=' . $strace['font_size'] . ' color="' . $strace['color'] . '">' . ($strace['bold'] ? '<b>' : '') . ($strace['italic'] ? '<i>' : '') . ($strace['underline'] ? '<u>' : '');
$_st = ($strace['underline'] ? '</u>' : '') . ($strace['italic'] ? '</i>' : '') . ($strace['bold'] ? '</b>' : '') . '</font>';
// Result content
$bigball['width'] = '32';
$bigball['height'] = '32';
$build_url = 'TODO: Find a way to list URL to Jenkins build';
$build_report = 'TODO: Find a way to list URL to HTML report';
$build_project = 'TODO: Find a way to list project';
$build_date = date('D M j H:i:s Y', $result->getTimeStart());
$build_duration = duration($result->getDuration());
$changes = 'TODO: Find a way to list changes';
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
 <body>
  <table border=0 cellpadding=0 cellspacing=4 width="100%">
   <tr>
    <th align="right" width="100"><img src="<?php 
echo $bigball['src'];
?>
" width=<?php 
echo $bigball['width'];
?>
 height=<?php 
echo $bigball['height'];
Example #7
0
function get_time_difference($post_time, $decorate = false)
{
    $timestamp = time() - strtotime($post_time);
    if ($decorate == true) {
        return duration($timestamp);
    } else {
        return $timestamp;
    }
}
Example #8
0
}
if (is_valid_email()) {
    $a_valid_email = "valid";
    $may_or_may_not = "may";
} else {
    $a_valid_email = "invalid";
    $may_or_may_not = "may not";
}
echo "So your name is {$who}.<br>" . "You want to meet at {$where} on {$when} hours for {$duration} {$hours} because {$why}.<br>" . "I think I {$am_free_or_busy}<br>" . "You can be contacted at {$email},<br>" . "which to me looks to be {$a_valid_email} therefore I {$may_or_may_not} try to respond.";
?>
                <input type="hidden" name="email" value="<?php 
echo email();
?>
"/>
                <input type="hidden" name="duration" value="<?php 
echo duration();
?>
"/>
                <input type="hidden" name="when" value="<?php 
echo when();
?>
"/>
                <input type="hidden" name="why" value="<?php 
echo reason();
?>
"/>
                <input type="hidden" name="who" value="<?php 
echo name();
?>
"/>
                <input type="hidden" name="where" value="<?php 
Example #9
0
$html .= '<div class="circle" style="border-color:#' . $color . '; background-color:#' . $color . ';"></div>';
$html .= '</div>';
$html .= '<div class="cell">';
$html .= '<span class="from">' . $from['name'] . '</span>';
$html .= '</div>';
$html .= '</div>';
$html .= '<div class="row middle">';
$html .= '<div class="cell">';
$html .= '<span class="icon" style="color:#' . $color . ';"></span>';
$html .= '</div>';
$html .= '<div class="cell road">';
$html .= '<div class="line" style="border-color:#' . $color . '; background-color:#' . $color . ';"></div>';
$html .= '</div>';
$html .= '<div class="cell">';
$html .= '<span class="direction">' . $displayInformations['direction'] . '</span>';
$html .= '<span class="stop_duration">' . count($stop_date_times) . ' arrêts : ' . duration($duration) . '</span>';
$html .= '</div>';
$html .= '</div>';
$html .= '<div class="row end">';
$html .= '<div class="cell">';
$html .= '<span class="arrival_date_time">' . date_time($arrival_date_time) . '</span>';
$html .= '</div>';
$html .= '<div class="cell road">';
$html .= '<div class="circle" style="border-color:#' . $color . '; background-color:#' . $color . ';"></div>';
$html .= '</div>';
$html .= '<div class="cell">';
$html .= '<span class="to">' . $to['name'] . '</span>';
$html .= '</div>';
$html .= '</div>';
$html .= '</div>';
echo $html;
Example #10
0
 $passtime = $time - $cache['start_time'] > 0 ? $time - $cache['start_time'] : 1;
 // zero division
 $mem_size = $mem['num_seg'] * $mem['seg_size'];
 $mem_avail = $mem['avail_mem'];
 $mem_used = $mem_size - $mem_avail;
 $seg_size = bsize($mem['seg_size']);
 $sharedmem = sprintf($lng['apcuinfo']['sharedmemval'], $mem['num_seg'], $seg_size, $cache['memory_type']);
 $req_rate_user = sprintf("%.2f", $cache['num_hits'] ? ($cache['num_hits'] + $cache['num_misses']) / $passtime : 0);
 $hit_rate_user = sprintf("%.2f", $cache['num_hits'] ? $cache['num_hits'] / $passtime : 0);
 $miss_rate_user = sprintf("%.2f", $cache['num_misses'] ? $cache['num_misses'] / $passtime : 0);
 $insert_rate_user = sprintf("%.2f", $cache['num_inserts'] ? $cache['num_inserts'] / $passtime : 0);
 $apcversion = phpversion('apcu');
 $phpversion = phpversion();
 $number_vars = $cache['num_entries'];
 $starttime = date('Y-m-d H:i:s', $cache['start_time']);
 $uptime_duration = duration($cache['start_time']);
 $size_vars = bsize($cache['mem_size']);
 // check for possible empty values that are used in the templates
 if (!isset($cache['file_upload_progress'])) {
     $cache['file_upload_progress'] = $lng['logger']['unknown'];
 }
 if (!isset($cache['num_expunges'])) {
     $cache['num_expunges'] = $lng['logger']['unknown'];
 }
 $runtimelines = '';
 foreach (ini_get_all('apcu') as $name => $v) {
     $value = $v['local_value'];
     eval("\$runtimelines.=\"" . getTemplate("settings/apcuinfo/runtime_line") . "\";");
 }
 $freemem = bsize($mem_avail) . sprintf(" (%.1f%%)", $mem_avail * 100 / $mem_size);
 $usedmem = bsize($mem_used) . sprintf(" (%.1f%%)", $mem_used * 100 / $mem_size);
Example #11
0
  $unraid = parse_plugin_cfg("dynamix",true);
  $events = explode('|', $unraid['notify']['events']);
  $temps = array(190,194);
  $max = $unraid['display']['max'];
  $hot = $unraid['display']['hot'];
  exec("smartctl -A /dev/$port|awk 'NR>7'",$output);
  foreach ($output as $line) {
    if (!$line) continue;
    $info = explode(' ', trim(preg_replace('/\s+/',' ',$line)), 10);
    $color = "";
    if (array_search($info[0], $events)!==false && $info[9]>0) $color = " class='orange-text'";
    else if (array_search($info[0], $temps)!==false) {
      if ($info[9]>=$max) $color = " class='red-text'"; else if ($info[9]>=$hot) $color = " class='orange-text'";
    }
    echo "<tr{$color}>";
    if ($info[0] == 9 && is_numeric($info[9])) $info[9] .= duration($info[9]);
    foreach ($info as $field) echo "<td>".str_replace('_',' ',$field)."</td>";
    echo "</tr>";
  }
  break;
case "capabilities":
  exec("smartctl -c /dev/$port|awk 'NR>5'",$output);
  $row = ["","",""];
  foreach ($output as $line) {
    if (!$line) continue;
    $line = preg_replace('/^_/','__',preg_replace(array('/__+/','/_ +_/'),'_',str_replace(array(chr(9),')','('),'_',$line)));
    $info = array_map('trim', explode('_', preg_replace('/_( +)_ /','__',$line), 3));
    if (isset($info[0])) $row[0] .= ($row[0] ? " " : "").$info[0];
    if (isset($info[1])) $row[1] .= ($row[1] ? " " : "").$info[1];
    if (isset($info[2])) $row[2] .= ($row[2] ? " " : "").$info[2];
    if (substr($row[2],-1)=='.') {
     case "Meeting":
         $title = '<strong>' . $div["type"] . '</strong> ' . $div["start"] . '<br />' . $div["subject"];
         $caption = $div["type"] . ' ' . $div["start"] . ' to ' . $div["end"] . '<br />(' . duration($div["duration"], 'long') . ')';
         $overdiv = $div["subject"];
         if ($div["notes"]) {
             $overdiv .= "\n\n" . $div["notes"];
         }
         break;
     case "Note":
         $title = '<strong>' . $div["type"] . '</strong> ' . $div["start"] . '<br />' . $div["subject"];
         $caption = $div["type"] . ' ' . $div["start"] . ' to ' . $div["end"] . '<br />(' . duration($div["duration"], 'long') . ')';
         $overdiv = $div["subject"] . "\n\n" . $div["notes"];
         break;
     case "Lunch":
         $title = '<strong>' . $div["type"] . '</strong> ' . $div["start"] . '<br />' . $div["user"];
         $caption = $div["type"] . ' ' . $div["start"] . ' to ' . $div["end"] . '<br />(' . duration($div["duration"], 'long') . ')';
         $overdiv = "User:\n" . $div["user"];
         break;
 }
 if ($div["attendees"]) {
     $overdiv .= "\n\nAttendees:\n" . $div["attendees"];
 }
 $overdiv = str_replace("\n", "<br />", $overdiv);
 $overdiv = str_replace("'", "\\'", $overdiv);
 $div_mouseover = 'return overlib(\'' . $overdiv . '\',CAPTION,\'' . $caption . '\');';
 //calEventOver(this,'.($div["app_height"]-6).');
 $div_mouseout = 'nd();';
 //calEventOut(this,'.($div["app_height"]-6).');
 // write the div
 if ($div["app_height"] < 24) {
     $app_height = 24;
Example #13
0
if (time() > ($endtime - (2 * $week))) {
	$allow_bonuses = true;
}

if (time() < ($endtime - (5 * $day))) {

	$allow_vacation = true;
}

$diff       = $endtime - $time;
if ($time > $endtime) { 
	$game_offline = true;
}

$d = duration($diff);

$resetA = "Reset in: $d";

$conf_announcement = $announce  . ' ' .  $resetA;
 
// If changing these, update User
$conf['start-gold'           ] = 50000;
$conf['start-attackturns'    ] = 50;
$conf['start-uu'             ] = 0;
$conf['start-sasoldiers'     ] = 75;
$conf['start-dasoldiers'     ] = 75;

$conf['officers-per-page'    ] = 5;
$conf['max-officers'         ] = 15;
$conf['users-per-page'       ] = 30;
Example #14
0
            <th class="vtip" title="Seconds since the last access for the most recent item evicted from this class.<br>Use this to judge how recently active your evicted data is">Evicted time</th>
            <th class="vtip" title="Age of the oldest item in the LRU.">Age</th>
            <th class="vtip" title="Details and keys">Link</th>
            </tr>
            </thead>
            <tbody>

EOB;
            foreach ($entries as $slabId => $slab) {
                $itemsCount = $slab['number'];
                $chunkSize = $slabInfo[$server][$slabId]['chunk_size'];
                $itemsSpace = round($itemsCount * $chunkSize * 100 / $memcacheStats['limit_maxbytes'], 3);
                $chunks_total = $slabInfo[$server][$slabId]['total_chunks'];
                $chunks_used = $slabInfo[$server][$slabId]['used_chunks'];
                $percentFree = round(($chunks_total - $chunks_used) * 100 / $chunks_total, 2);
                $totalBytes = $chunks_total * $chunkSize;
                $usedBytes = $slabInfo[$server][$slabId]['used_chunks'] * $chunkSize;
                $unusedBytes = $totalBytes - $usedBytes;
                $dumpUrl = $PHP_SELF . '&op=2&server=' . array_search($server, $MEMCACHE_SERVERS) . '&dumpslab=' . $slabId;
                echo "\n\t\t\t\t\t<tr class=tr-{$m}>\n\t\t\t\t\t<td class=td-0>" . $slabId . "</td>\n\t\t\t\t\t<td>" . $itemsCount . "</td>\n\t\t\t\t\t<td>" . $chunkSize . "</td>\n\t\t\t\t\t<td>" . $slabInfo[$server][$slabId]['chunks_per_page'] . "</td>\n\t\t\t\t\t<td>" . $slabInfo[$server][$slabId]['total_pages'] . "</td>\n\t\t\t\t\t<td class='vtip' title='" . bsize($totalBytes) . "'>" . $chunks_total . "</td>\n\t\t\t\t\t<td class='vtip' title='" . bsize($usedBytes) . "'>" . $chunks_used . "</td>\n\t\t\t\t\t<td class='vtip' title='" . $percentFree . " % allocated chunks in this class'>" . ($chunks_total - $chunks_used) . "</td>\n\t\t\t\t\t<td class='vtip' title='" . bsize($unusedBytes) . "'>" . $unusedBytes . "</td>\n\t\t\t\t\t<td>" . $itemsSpace . "</td>\n\t\t\t\t\t<td>" . (int) $slab['evicted'] . "</td>\n\t\t\t\t\t<td>" . (int) $slab['evicted_time'] . "</td>\n                    <td>" . duration($time - $slab['age']) . "</td>\n\t\t\t\t\t<td class=td-0><center><a href=\"" . $dumpUrl . "\">details</a></center></td>\n\n                    </tr>";
                $m = 1 - $m;
            }
            echo <<<EOB
\t\t\t</tbody></table>
\t\t\t<hr/>
EOB;
        }
        break;
        break;
}
echo getFooter();
Example #15
0
include "config.php";
include "commonfunctions.php";
$irpg_page_title = "Player Info";
include "header.php";
?>

  <h1>Players</h1>
  <h2>Pick a player to view</h2>
  <p class="small">[gray=offline]</p>
  <ol>
<?php 
$file = file($irpg_db);
unset($file[0]);
usort($file, 'cmp_level_desc');
foreach ($file as $line) {
    list($user, , , $level, $class, $secs, , , $online) = explode("\t", trim($line));
    $class = htmlentities($class);
    $next_level = duration($secs);
    print "    <li" . (!$online ? " class=\"offline\"" : "") . "><a" . (!$online ? " class=\"offline\"" : "") . " href=\"playerview.php?player=" . urlencode($user) . "\">" . htmlentities($user) . "</a>, the level {$level} {$class}. Next level in {$next_level}.</li>\n";
}
?>
  </ol>
  <p>For a script to view player stats from a terminal, try <a
  href="idlerpg-adv.txt">this</a> perl script by
  <a href="mailto:daxxar@mental.mine.nu">daxxar</a>.</p>

  <p>See player stats in <a href="db.php">table format</a>.</p>

<?php 
include "footer.php";
Example #16
0
 echo '#### Unstable: ' . $tests_unstable . PHP_EOL;
 echo '#### Skipped: ' . $tests_skipped . PHP_EOL;
 echo '#### OK: ' . $tests_ok . PHP_EOL;
 echo '#### ------------------------------------' . PHP_EOL;
 echo '#### Actual tests run: ' . $total_tests . PHP_EOL;
 echo '#### Assertions: ' . $total_assertions . PHP_EOL;
 echo '#### Assertions with errors: ' . $assertion_errors . PHP_EOL;
 echo '#### Assertions with failures: ' . $assertion_failures . PHP_EOL;
 echo '#### ------------------------------------' . PHP_EOL;
 if ($total_tests > 0) {
     echo '#### Avg. run time pr. test: ' . duration((time() - $result->getTimeStart()) / $total_tests) . PHP_EOL;
     echo '#### Avg. assertions pr. test: ' . $total_assertions / $total_tests . PHP_EOL;
 }
 echo '#### Avg. tests pr. testfile: ' . $total_tests / count($tests) . PHP_EOL;
 echo '#### ------------------------------------' . PHP_EOL;
 echo '#### Run time: ' . duration(time() - $result->getTimeStart()) . PHP_EOL;
 if ($build_error) {
     echo '#### Result: Build failed!' . PHP_EOL;
 } else {
     if ($build_unstable) {
         echo '#### Result: Build unstable!' . PHP_EOL;
     } else {
         echo '#### Result: Build successful!' . PHP_EOL;
     }
 }
 echo '####################################################################' . PHP_EOL;
 echo '####################################################################' . PHP_EOL;
 // Sleep 3 seconds to allow ffmpeg to cleanly shut down on last test
 if (!$onscreen) {
     sleep(3);
 }
    }
    // duration
    $duration = (strtotime($row["app_end"]) - strtotime($row["app_start"])) / 60;
    // array of attendees
    if ($row["attendee_id"]) {
        $attendees[$row["attendee_id"]] = $row["attendee_name"];
    }
    // appointment info
    $appointment_info = '<pre>
  Type:       ' . $app["type"] . ' (ID: ' . $app["id"] . ')
  Booked by:  ' . $app["bookedbyname"] . '
  Created on: ' . $app["created"] . '</pre>';
}
for ($i = 5; $i <= 300;) {
    // what is that 300?
    $app_duration_data[$i] = duration($i);
    $i = $i + 5;
}
//////////////////////////////////////////////////////////////////
// if appointment occours over (default_appointment_delay) hours in the past, divert to appointment_view.php
//////////////////////////////////////////////////////////////////
/*
$app_comparison_today = strtotime($date_mysql);
$app_comparison_start = strtotime($app["start"]);
$app_comparison_start = ($app_comparison_start + $default_appointment_delay);

if ($app_comparison_start < $app_comparison_today) {
	header("Location:appointment_view.php?app_id=$app_id");
	exit;
	}
*/
Example #18
0
 } else {
     $img_class = 'class="img-responsive"';
 }
 $code[] = '<div class="col-sm-6 col-md-3 col-lg-3">';
 $code[] = '<div class="well well-sm m-b-0 m-t-20">';
 $code[] = '<a href="' . $config['BASE_URL'] . '/video/' . $video['VID'] . '/' . prepare_string($video['title']) . '">';
 $code[] = '<div class="thumb-overlay">';
 $code[] = '<img src="' . get_thumb_url($video['VID']) . '/' . $video['thumb'] . '.jpg" title="' . htmlspecialchars($video['title'], ENT_QUOTES, 'UTF-8') . '" alt="' . htmlspecialchars($video['title'], ENT_QUOTES, 'UTF-8') . '" id="rotate_' . $video['VID'] . '_' . $video['thumbs'] . '_' . $video['thumb'] . '" ' . $img_class . ' />';
 if ($video['type'] == 'private') {
     $code[] = '<div class="label-private">' . $lang['global.PRIVATE'] . '</div>';
 }
 if ($video['hd'] == 1) {
     $code[] = '<div class="hd-text-icon">HD</div>';
 }
 $code[] = '<div class="duration">';
 $code[] = duration($video['duration']);
 $code[] = '</div>';
 $code[] = '</div>';
 $code[] = '<span class="video-title title-truncate m-t-5">' . htmlspecialchars($video['title'], ENT_QUOTES, 'UTF-8') . '</span>';
 $code[] = '</a>';
 $code[] = '<div class="video-added">';
 $code[] = time_range($video['addtime']);
 $code[] = '</div>';
 $code[] = '<div class="video-views pull-left">';
 $views = $video['viewnumber'] == '1' ? $lang['global.view'] : $lang['global.views'];
 $code[] = $video['viewnumber'] . ' ' . $views;
 $code[] = '</div>';
 if ($video['rate'] == 0 && $video[dislikes] == 0) {
     $rate_class = 'no-rating"';
     $rate_icon = '<i class="fa fa-heart video-rating-heart no-rating"></i> <b>-</b>';
 } else {
Example #19
0
echo get_url('access', 'clear_cookies');
?>
"><?php 
echo lang('clear cookies');
?>
</a></li>
        <li id="loginForgotPassword"><a href="<?php 
echo get_url('access', 'forgot_password');
?>
"><?php 
echo lang('forgot password');
?>
</a></li>  
        <li>
          <label class="checkbox" for="loginRememberMe"><?php 
echo lang('remember me', duration(config_option('remember_login_lifetime')));
?>
</label>
          <?php 
echo checkbox_field('login[remember]', array_var($login_data, 'remember') == 'checked', array('id' => 'loginRememberMe'));
?>
        </li>
        <li>
          <label class="checkbox" for="trace"><?php 
echo lang('enable trace');
?>
</label>
          <?php 
echo checkbox_field('trace', false, array('id' => 'trace'));
?>
        </li>
Example #20
0
            $player[3]['y'] = $arg[3];
        }
    } elseif ($arg[0] == "P4") {
        $player[4]['name'] = $arg[1];
        if ($type == 2) {
            $player[4]['x'] = $arg[2];
            $player[4]['y'] = $arg[3];
        }
    }
}
if (!$type) {
    echo "        <p>Sorry, there is no active quest.</p>\n";
} else {
    echo "        <p><b>Quest:</b> To {$text}.</p>\n";
    if ($type == 1) {
        echo "        <p><b>Time to completion:</b> " . duration($time - time()) . "</p>\n";
    } elseif ($type == 2) {
        if ($stage == 1) {
            echo "        <p><b>Current goal:</b> [{$p1['0']},{$p1['1']}]</p>\n";
        } else {
            echo "        <p><b>Current goal:</b> [{$p2['0']},{$p2['1']}]</p>>\n";
        }
    }
    echo "        <p><b>Participant 1:</b> <a href=\"playerview.php?player=" . urlencode($player[1]['name']) . "\">" . htmlentities($player[1]['name']) . "</a><br />\n";
    if ($type == 2) {
        echo "        <b>Position:</b> [" . $player[1]['x'] . "," . $player[1]['y'] . "]</p>\n";
    } else {
        echo "<br />\n";
    }
    echo "        <p><b>Participant 2:</b> <a href=\"playerview.php?player=" . urlencode($player[2]['name']) . "\">" . htmlentities($player[2]['name']) . "</a><br />\n";
    if ($type == 2) {
Example #21
0
            $keysql = "UPDATE phpbb_sessions SET session_onlineplay = 1, session_realip = '" . htmlspecialchars(get_ip_address(), ENT_QUOTES) . "' WHERE session_id = '" . $user->session_id . "';";
            $keyresult = $db->sql_query($keysql);
            $db->sql_freeresult($keyresult);
        } else {
            $result['status'] = 'nope';
            $result['error_msg'] = 'interOps is currently down for maintenance.';
        }
    } else {
        $result['status'] = 'nope';
        //$result['error_msg'] = 'User is not allowed to play';
        $result['error_msg'] = 'Online playing privileges revoked';
        if ($canhave[$userID]['can_play_reason']['value']) {
            $result['error_msg'] .= ' - ' . str_replace('#', '@', $canhave[$userID]['can_play_reason']['value']);
        }
        if ($canhave[$userID]['can_play_expire']['value']) {
            $result['error_msg'] .= ' (will expire in ' . duration($canhave[$userID]['can_play_expire']['value'] - time()) . ')';
        }
    }
    $banReason = check_ban($userID, '', '', 1);
    if ($banReason != "") {
        $result['status'] = 'nope';
        $result['error_msg'] = 'User is banned';
        $canPlay = false;
    }
}
// start buffering (to allow kill)
ob_start();
// output the results
echo ($result['status'] == LOGIN_SUCCESS ? 'ok' : 'fail') . '#';
echo ($result['error_msg'] ? isset($user->lang[$result['error_msg']]) ? $user->lang[$result['error_msg']] : $result['error_msg'] : 'Success.') . '#';
echo ($result['status'] == LOGIN_SUCCESS ? $user->data['user_id'] : '1') . '#';
Example #22
0
         $val = intval($val) . " [<font color=\"{$uniquecolor}\">Jeff's Cluehammer of Doom</font>]";
     }
     if ($key == "ring" && substr($val, -1, 1) == "h") {
         $val = intval($val) . " [<font color=\"{$uniquecolor}\">Juliet's Glorious Ring of Sparkliness</font>]";
     }
     echo "      {$key}: {$val}<br />\n";
     $sum += $val;
 }
 echo "      <br />\n      sum: {$sum}<br />\n" . "    </p>" . "    <h2>Penalties</h2>\n" . "    <p>\n";
 ksort($pen);
 $sum = 0;
 foreach ($pen as $key => $val) {
     echo "      {$key}: " . duration($val) . "<br />\n";
     $sum += $val;
 }
 echo "      <br />\n      total: " . duration($sum) . "</p>\n";
 $file = fopen($irpg_mod, "r");
 $temp = array();
 while ($line = fgets($file, 1024)) {
     if (strstr($line, " " . $_GET['player'] . " ") || strstr($line, " " . $_GET['player'] . ", ") || substr($line, 0, strlen($_GET['player']) + 1) == $_GET['player'] . " " || substr($line, 0, strlen($_GET['player']) + 3) == $_GET['player'] . "'s ") {
         array_push($temp, $line);
     }
 }
 fclose($file);
 if (!is_null($temp) && count($temp)) {
     echo '<h2>';
     echo $_GET['allmods'] != 1 ? "Recent " : "";
     echo 'Character Modifiers</h2><p>';
     if ($_GET['allmods'] == 1 || count($temp) < 6) {
         foreach ($temp as $line) {
             $line = htmlentities(trim($line));
Example #23
0
\t\t<tr class=tr-0><td class=td-0>APC Version</td><td>{$apcversion}</td></tr>
\t\t<tr class=tr-1><td class=td-0>PHP Version</td><td>{$phpversion}</td></tr>
EOB;
        if (!empty($_SERVER['SERVER_NAME'])) {
            echo "<tr class=tr-0><td class=td-0>APC Host</td><td>{$_SERVER['SERVER_NAME']} {$host}</td></tr>\n";
        }
        if (!empty($_SERVER['SERVER_SOFTWARE'])) {
            echo "<tr class=tr-1><td class=td-0>Server Software</td><td>{$_SERVER['SERVER_SOFTWARE']}</td></tr>\n";
        }
        echo <<<EOB
\t\t<tr class=tr-0><td class=td-0>Shared Memory</td><td>{$mem['num_seg']} Segment(s) with {$seg_size} 
    <br/> ({$cache['memory_type']} memory, {$cache['locking_type']} locking)
    </td></tr>
EOB;
        echo '<tr class=tr-1><td class=td-0>Start Time</td><td>', date(DATE_FORMAT, $cache['start_time']), '</td></tr>';
        echo '<tr class=tr-0><td class=td-0>Uptime</td><td>', duration($cache['start_time']), '</td></tr>';
        echo '<tr class=tr-1><td class=td-0>File Upload Support</td><td>', $cache['file_upload_progress'], '</td></tr>';
        echo <<<EOB
\t\t</tbody></table>
\t\t</div>

\t\t<div class="info div1"><h2>File Cache Information</h2>
\t\t<table cellspacing=0><tbody>
\t\t<tr class=tr-0><td class=td-0>Cached Files</td><td>{$number_files} ({$size_files})</td></tr>
\t\t<tr class=tr-1><td class=td-0>Hits</td><td>{$cache['num_hits']}</td></tr>
\t\t<tr class=tr-0><td class=td-0>Misses</td><td>{$cache['num_misses']}</td></tr>
\t\t<tr class=tr-1><td class=td-0>Request Rate (hits, misses)</td><td>{$req_rate} cache requests/second</td></tr>
\t\t<tr class=tr-0><td class=td-0>Hit Rate</td><td>{$hit_rate} cache requests/second</td></tr>
\t\t<tr class=tr-1><td class=td-0>Miss Rate</td><td>{$miss_rate} cache requests/second</td></tr>
\t\t<tr class=tr-0><td class=td-0>Insert Rate</td><td>{$insert_rate} cache requests/second</td></tr>
\t\t<tr class=tr-1><td class=td-0>Cache full count</td><td>{$cache['expunges']}</td></tr>
            $render .= remove_lastchar($render2, ",") . '</p>' . "\n";
        }
        $render .= '<hr />';
        break;
    default:
        //$render = "<p>No further printable information available</p>";
}
// heading
$heading = '
<h1>' . $app["user_name"] . ' - ' . $app["type"] . '</h1>
<hr class="title" />
';
if ($app["allday"] == 'Yes') {
    $heading .= '<p>All day appointment</p>';
} else {
    $heading .= '<p>' . date('D jS F g:ia', strtotime($app["start"])) . ' (' . duration($duration, 'long') . ')</p>';
}
// confidentiality statement
$render .= '
<div id="footer">
<h1>Confidentiality notice</h1>
<p>This document contains privileged information which must remain confidential. Under no circumstances should
this document be given to a client, left in a property or your car, or otherwise fall into anyone\'s hands other than a member
of the company. This document should be destroyed after use.</p>';
if ($printed_by) {
    $render .= '<p>Document printed on ' . date('d/m/Y h:ia') . ' by ' . $printed_by . '</p>';
}
$render .= '</div>';
$js_footer = '<script type="text/javascript">
// <!--
window.onLoad = window.focus(); window.print();
Example #25
0
$sql .= "WHERE ((last_status IN ('F', 'C') AND status_on BETWEEN " . qpg($from_date) . " AND " . qpg($to_date) . ") ";
$sql .= "OR last_status NOT IN ('F','C')) ";
if (isset($system_id)) {
    $sql .= "AND request.system_id={$system_id} ";
}
if (isset($request_type)) {
    $sql .= "AND request.request_type={$request_type} ";
}
if (isset($requested_by)) {
    $sql .= "AND requester_id = {$requested_by} ";
}
$sql .= "GROUP BY status_lookup.lookup_desc, request.last_status ";
$sql .= "ORDER BY 2 DESC;";
// echo "$sql";
$debuggroups['PieChart'] = 1;
$pie = new PieChart($sql);
/*
  include("page-header.php");
*/
$pie->Render();
/*
  include("page-footer.php");
*/
error_reporting(7);
if ($debuglevel > 0) {
    $total_query_time = sprintf("%3.06lf", $total_query_time);
    error_log("{$sysabbr} total_query_ TQ: {$total_query_time} URI: {$REQUEST_URI}", 0);
    $total_time = sprintf("%3.06lf", duration($begin_processing, microtime()));
    error_log("{$sysabbr} process_time TT: {$total_time}      Agent: {$HTTP_USER_AGENT} Referrer: {$HTTP_REFERER}  ", 0);
    error_log("=============================================== Endof {$PHP_SELF}");
}
/**
 * create torrent with Mainline
 *
 * @return string $onLoad
 */
function createTorrentMainline()
{
    global $cfg, $path, $tfile, $comment, $piece, $use_tracker, $tracker_name, $alert;
    $onLoad = "";
    // Clean up old files
    if (@file_exists($cfg["transfer_file_path"] . $tfile)) {
        @unlink($cfg["transfer_file_path"] . $tfile);
    }
    // build command-string
    $command = "cd " . tfb_shellencode($cfg["transfer_file_path"]) . ";";
    $command .= " HOME=" . tfb_shellencode($cfg["path"]);
    $command .= "; export HOME;";
    $command .= "nohup " . $cfg["pythonCmd"] . " -OO ";
    $command .= tfb_shellencode($cfg["docroot"] . "bin/clients/mainline/maketorrent-console.py");
    $command .= " --no_verbose";
    $command .= " --no_debug";
    // $command .= " --language en";
    // Is there comments to add?
    if (!empty($comment)) {
        $command .= " --comment " . tfb_shellencode($comment);
    }
    // Set the piece size
    if (!empty($piece)) {
        $command .= " --piece_size_pow2 " . tfb_shellencode($piece);
    }
    // trackerless / tracker
    /*
    if ((isset($use_tracker)) && ($use_tracker == 1))
    	$command .= " --use_tracker";
    else
    	$command .= " --no_use_tracker";
    */
    $command .= " --use_tracker";
    // tracker-name
    //if ((!empty($tracker_name)) && ($tracker_name != "http://"))
    $command .= " --tracker_name " . tfb_shellencode($tracker_name);
    // Set the target torrent field
    $command .= " --target " . tfb_shellencode($cfg["transfer_file_path"] . $tfile);
    // tracker (i don't know...)
    $command .= " " . tfb_shellencode($tracker_name);
    // input
    $command .= " " . tfb_shellencode($cfg["path"] . $path);
    // Set to never timeout for large torrents
    @set_time_limit(0);
    // Let's see how long this takes...
    $time_start = microtime(true);
    // Execute the command
    exec($command);
    // We want to check to make sure the file was successful
    $success = false;
    $raw = @file_get_contents($cfg["transfer_file_path"] . $tfile);
    if (preg_match("/6:pieces([^:]+):/i", $raw, $results)) {
        // This means it is a valid torrent
        $success = true;
        // Make an entry for the owner
        AuditAction($cfg["constants"]["file_upload"], $tfile);
    } else {
        // Something went wrong, clean up
        if (@file_exists($cfg["transfer_file_path"] . $tfile)) {
            @unlink($cfg["transfer_file_path"] . $tfile);
        }
    }
    // We are done! how long did we take?
    $time_end = microtime(true);
    $diff = duration($time_end - $time_start);
    // make path URL friendly to support non-standard characters
    $downpath = urlencode($tfile);
    // Depending if we were successful, display the required information
    $onLoad = $success ? "completed('" . $downpath . "'," . $alert . ",'" . $diff . "');" : "failed('" . $downpath . "'," . $alert . ");";
    return $onLoad;
}
Example #27
0
 
											<br/> (<?php 
echo $cache['memory_type'];
?>
 memory, <?php 
echo $cache['locking_type'];
?>
 locking)
											</td>
										</tr>
										<tr><td>Start Time</td><td><?php 
echo date(DATE_FORMAT, $cache['start_time']);
?>
</td></tr>
										<tr><td>Uptime</td><td><?php 
echo duration($cache['start_time']);
?>
</td></tr>
										<tr><td>File Upload Support</td><td><?php 
echo $cache['file_upload_progress'];
?>
</td></tr>
									</tbody>
								</table>
							</div>
						</div>
						
					</div>
					
					<div class="col-md-6" style="padding-left: 0px">
						<div class="panel panel-info">
                    @fwrite($fp, "7:privatei1eee");
                } else {
                    @fwrite($fp, "e7:privatei0e17:dht_backup_enablei1e20:dht_backup_requestedi1eee");
                }
                @fclose($fp);
            }
        }
    } else {
        // Something went wrong, clean up
        if (@file_exists($tpath . $tfile)) {
            @unlink($tpath . $tfile);
        }
    }
    // We are done! how long did we take?
    $time_end = microtime(true);
    $diff = duration($time_end - $time_start);
    // make path URL friendly to support non-standard characters
    $downpath = urlencode($tfile);
    // Depending if we were successful, display the required information
    if ($success) {
        $onLoad = "completed( '" . $downpath . "', " . $alert . ", '" . $diff . "' );";
    } else {
        $onLoad = "failed( '" . $downpath . "', " . $alert . " );";
    }
}
// This is the torrent download prompt
if (!empty($_GET["download"])) {
    $tfile = $_GET["download"];
    if (isValidTransfer($tfile) === true) {
        // Does the file exist?
        if (file_exists($tpath . $tfile)) {
Example #29
0
        // variables
        $m = 0;
        $cacheItems = getCacheItems();
        $items = $cacheItems['items'];
        $totals = $cacheItems['counts'];
        $maxDump = MAX_ITEM_DUMP;
        foreach ($items as $server => $entries) {
            echo <<<EOB

\t\t\t<div class="info"><table cellspacing=0><tbody>
\t\t\t<tr><th colspan="2">{$server}</th></tr>
\t\t\t<tr><th>Slab Id</th><th>Info</th></tr>
EOB;
            foreach ($entries as $slabId => $slab) {
                $dumpUrl = $PHP_SELF . '&op=2&server=' . array_search($server, $MEMCACHE_SERVERS) . '&dumpslab=' . $slabId;
                echo "<tr class=tr-{$m}>", "<td class=td-0><center>", '<a href="', $dumpUrl, '">', $slabId, '</a>', "</center></td>", "<td class=td-last><b>Item count:</b> ", $slab['number'], '<br/><b>Age:</b>', duration($time - $slab['age']), '<br/> <b>Evicted:</b>', isset($slab['evicted']) && $slab['evicted'] == 1 ? 'Yes' : 'No';
                if (isset($_GET['dumpslab']) && $_GET['dumpslab'] == $slabId && (isset($_GET['server']) && $_GET['server'] == array_search($server, $MEMCACHE_SERVERS))) {
                    echo "<br/><b>Items: item</b><br/>";
                    $items = dumpCacheSlab($server, $slabId, $slab['number']);
                    // maybe someone likes to do a pagination here :)
                    $i = 1;
                    foreach ($items['ITEM'] as $itemKey => $itemInfo) {
                        $itemInfo = trim($itemInfo, '[ ]');
                        echo '<a href="', $PHP_SELF, '&op=4&server=', array_search($server, $MEMCACHE_SERVERS), '&key=', base64_encode($itemKey) . '">', $itemKey, '</a>';
                        if ($i++ % 10 == 0) {
                            echo '<br/>';
                        } elseif ($i != $slab['number'] + 1) {
                            echo ',';
                        }
                    }
                }
Example #30
0
             <img src="up.png" border="0">
           </a>
           /
          <a href="db.php?sort=cmp_alignment_desc">
             <img src="down.png" border="0">
          </a>)
        </th>
      </tr>
<?php 
foreach ($file as $line) {
    list($user, $isadmin, $level, $class, $secs, $online, $idled, $created, $lastlogin, $alignment, ) = explode("\t", trim($line));
    $class = str_replace("<", "&lt;", $class);
    $user = str_replace("<", "&lt;", $user);
    $class = str_replace(">", "&gt;", $class);
    $user = str_replace(">", "&gt;", $user);
    $sum = 0;
    foreach ($item as $k => $v) {
        $sum += $v;
    }
    $pentot = 0;
    foreach ($pen as $k => $v) {
        $pentot += $v;
    }
    echo "      <tr>\n" . "        <td nowrap>{$user}</td>\n" . "        <td>{$level}</td>\n" . "        <td>" . ($isadmin ? "Yes" : "No") . "</td>\n" . "        <td nowrap>{$class}</td>\n" . "        <td nowrap>" . duration($secs) . "</td>\n" . "        <td>" . ($online == 1 ? "Yes" : "No") . "</td>\n" . "        <td nowrap>" . duration($idled) . "</td>\n" . "        <td nowrap>{$x}</td>\n" . "        <td nowrap>{$y}</td>\n" . "        <td nowrap>" . duration($pentot) . "</td>\n" . "        <td nowrap>" . date("D M j H:i:s Y", $created) . "</td>\n" . "        <td nowrap>" . date("D M j H:i:s Y", $lastlogin) . "</td>\n" . "        <td>{$sum}</td>\n" . "        <td>" . ($alignment == 'e' ? "Evil" : ($alignment == 'n' ? "Neutral" : "Good")) . "</td>\n" . "      </tr>\n";
}
echo '
    </table>
    <br><br>
    * Accounts created before Aug 29, 2003 may have incowrect data fields.
    ';
include "footer.php";