Esempio n. 1
0
function show_wahlen($row)
{
    extract($row);
    $listen_gueltig = $stimmen_gesamt - $stimmzettel_ungueltig - $listen_ungueltig;
    $listen_summe = $listen_gueltig - $listen_enthaltungen;
    $kandidaten_gueltig = $stimmen_gesamt - $stimmzettel_ungueltig - $kandidaten_ungueltig;
    $kandidaten_summe = $kandidaten_gueltig - $kandidaten_enthaltungen;
    print "\\section{Wahl zum {$wahl_name}}\n";
    if (simple_query("SELECT count(*) FROM liste " . "WHERE wahl = {$wahl_id}") > 1) {
        print "\\subsection*{Listenstimmen}\n";
        // Gesamt-Informationen
        print "Wahlberechtigte: {$wahlberechtigt}, " . "abgegebene Stimmzettel: {$stimmen_gesamt}, " . "Wahlbeteiligung: " . percent($stimmen_gesamt, $wahlberechtigt) . "\\%" . "\n\n" . "ungültige Stimmzettel: {$stimmzettel_ungueltig}, " . "ungültige Stimmen: {$listen_ungueltig} " . "gültige Stimmen: {$listen_gueltig}, " . "\n\n" . "Enthaltungen: {$listen_enthaltungen} " . "\n\n";
        print "\\begin{tabular}{lrrrrl}\n" . "Liste & Stimmen & Anteil & Quote & Sitze & \\\\\\hline\n";
        // Listen-Tabelle
        do_query("SELECT liste.name_kurz, liste.name_lang, " . "anzeige_red as r, anzeige_green as g, " . "anzeige_blue as b, " . "hoechstzahl, sitze, los, " . "sum(liste_urne.stimmen) AS stimmen, " . "{$listen_summe} AS summe " . "FROM liste, urne, liste_urne " . "WHERE liste.id = liste_urne.liste " . "AND urne.id = liste_urne.urne " . "AND urne.status = " . $GLOBALS["ok_status"] . " " . "AND wahl = {$wahl_id} " . "GROUP BY liste.id " . "ORDER by liste.nummer", show_listen);
        print "\\hline\\end{tabular}\n\n";
        $num_los = simple_query("SELECT los FROM liste " . "WHERE wahl = {$wahl_id} " . "AND los > 0");
        if ($num_los > 0) {
            print "(+1): ggf. +1 von {$num_los} Restsitzen " . "per Los\n\n";
        }
    }
    // Kandidaten
    print "\\subsection*{Kandidierendenstimmen}\n";
    // Gesamt-Daten
    print "Wahlberechtigte: {$wahlberechtigt}, " . "abgegebene Stimmzettel: {$stimmen_gesamt}, " . "Wahlbeteiligung: " . percent($stimmen_gesamt, $wahlberechtigt) . "\\%" . "\n\n" . "ungültige Stimmzettel: {$stimmzettel_ungueltig}, " . "ungültige Stimmen: {$kandidaten_ungueltig}, " . "gültig: {$kandidaten_gueltig} " . "\n\n";
    if ($max_stimmen_wert == 1) {
        print "Enthaltungen: {$kandidaten_enthaltungen} " . "\n\n";
    }
    // Kandidaten
    do_query("SELECT liste.id AS liste_id, " . "liste.name_kurz AS liste_name_kurz, " . "liste.name_lang AS liste_name_lang, " . "anzeige_red AS r, " . "anzeige_green AS g, " . "anzeige_blue AS b, " . "kandidat.typ AS kandidat_typ, " . "kandidat.status AS status, " . "kandidat.vorname AS kandidat_vorname, " . "kandidat.nachname AS kandidat_nachname, " . "sum(kandidat_urne.stimmen) AS stimmen " . "FROM liste, kandidat, urne, kandidat_urne " . "WHERE kandidat.id = kandidat_urne.kandidat " . "AND urne.id = kandidat_urne.urne " . "AND liste.id = kandidat.liste " . "AND urne.status = " . $GLOBALS["ok_status"] . " " . "AND liste.wahl = {$wahl_id} " . "GROUP BY kandidat.id " . "ORDER BY liste.nummer, liste.id, status, stimmen DESC, " . "kandidat.listenplatz", show_kandidaten);
    if ($num_los != 0) {
        print "\\footnotemark{(*)} {$num_los} Restsitze werden per " . "Los auf die gekennzeichneten Listen verteilt.\n\n";
    }
}
Esempio n. 2
0
function GetStatsByField($fieldName)
{
    global $db, $NowBots, $BuildId;
    $BuildStr = $BuildId ? "WHERE statBuildId = '{$BuildId}'" : "";
    $stats = $db->query("SELECT {$fieldName},\r\n                        SUM(statBots) as statBots,\r\n                        SUM(statBotsOnline) as statBotsOnline,\r\n                        SUM(statBotsDead) as statBotsDead,\r\n                        SUM(statBotsLifeTime) as statBotsLifeTime,\r\n                        SUM(statBotsNetTime) as statBotsNetTime\r\n                     FROM stats {$BuildStr} GROUP BY ({$fieldName})")->fetchAllAssoc();
    echo "<table cellpadding='3' cellspacing='0' width='100%' class='light_table box' rules='all'>\r\n        <tr>\r\n            <th>{$fieldName}</th>\r\n            <th>Count* (% Now)</th>\r\n            <th>Average Life time **</th>\r\n            <th>% Dead/Month</th>\r\n        </tr>";
    $count = 0;
    foreach ($stats as $s) {
        $bots = $s['statBots'];
        $botsDead = $s['statBotsDead'];
        $botsAlive = $bots - $botsDead;
        $botsSrOnline = $s['statBotsOnline'];
        $botsPC = percent($bots, $NowBots);
        $botsAlivePC = percent($botsAlive, $NowBots);
        $botsDeadPC = percent($botsDead, $NowBots);
        $botsSrOnlinePC = percent($botsSrOnline, $NowBots);
        $srLifeTime = round($s['statBotsLifeTime'] / $bots, 2);
        $srBotNetTime = round($s['statBotsNetTime'] / $bots, 2);
        $ovm = round($s['statBotsNetTime'] / $bots * $s['statBotsDead'] / $bots / 30 * 100, 2);
        $color = $count % 2 ? "#d3e7f0" : "#ebf4f8";
        echo "<tr bgcolor='{$color}' onmouseover=\"this.style.background='#ffffff'\" onmouseout=\"this.style.background='{$color}'\">\r\n                <td align='center'><b>{$s[$fieldName]}</b></td>\r\n                <td align='center'>{$bots} ({$botsPC}%) /\r\n                    <span style='color:green;'>{$botsAlive} ({$botsAlivePC}%)</span> /\r\n                    <span style='color:#808080;'>{$botsDead} ({$botsDeadPC}%)</span> /\r\n                    <span style='color:#ffa500;'>{$botsSrOnline} ({$botsSrOnlinePC}%)</span></td>\r\n                <td align='center'>{$srLifeTime} д. / {$srBotNetTime} д.</td>\r\n                <td align='center'>{$ovm}%</td>\r\n          </tr>";
        $count++;
    }
    echo "<tr style='background:#ffffff !important;'><th colspan='4'>&nbsp;</th></tr></table>";
    echo "<small>*<i>« bots / <span style='color:green'>Alive</span> / <span style='color:#808080'>Dead</span> / <span style='color:#ffa500'>Online</span> »</i></small><br>\r\n     ";
    // <small>**<i>«среднее кол-во дней жизнеспособности ботов / среднее кол-во дней существования ботов»</i></small><br><br>";
}
Esempio n. 3
0
 function getVersionContrast($from1, $to1, $from2, $to2)
 {
     $currentProduct = $this->common->getCurrentProduct();
     $productId = $currentProduct->id;
     //get sum num
     $total1 = $this->versionmodel->getNewAndActiveAllCount($productId, $from1, $to1);
     $total2 = $this->versionmodel->getNewAndActiveAllCount($productId, $from2, $to2);
     $query1 = $this->versionmodel->getVersionContrast($productId, $from1, $to1);
     $query2 = $this->versionmodel->getVersionContrast($productId, $from2, $to2);
     $result1 = array();
     $result2 = array();
     $sum1 = $total1[0]['newusers'];
     $sum12 = $total1[0]['startusers'];
     $sum2 = $total2[0]['startusers'];
     $sum21 = $total2[0]['newusers'];
     foreach ($query1->result_array() as $row) {
         $row['newuserpercent'] = percent($row['newusers'], $sum1);
         $row['startuserpercent'] = percent($row['startusers'], $sum12);
         array_push($result1, $row);
     }
     foreach ($query2->result_array() as $row) {
         $row['newuserpercent'] = percent($row['newusers'], $sum21);
         $row['startuserpercent'] = percent($row['startusers'], $sum2);
         array_push($result2, $row);
     }
     $result = array($result1, $result2);
     echo json_encode($result);
 }
Esempio n. 4
0
function head($title, $file = "")
{
    if ($file != "") {
        print "\n<NEWFILE {$file} {$title}>\n";
    }
    $urnen_total = simple_query("SELECT count(*) FROM urne");
    $urnen_done = simple_query("SELECT count(*) FROM urne WHERE status=" . $GLOBALS["ok_status"]);
    $stimmen_total = simple_query("SELECT sum(stimmen) FROM urne");
    $stimmen_done = simple_query("SELECT sum(stimmen) FROM urne WHERE status=" . $GLOBALS["ok_status"]);
    ?>
<html>
  <head><title>Unabhängige Wahlen KIT - <?php 
    echo $title;
    ?>
</title>
  <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-15">
  <link rel="stylesheet" href="style.css">
  <link rel="stylesheet" href="http://www.usta.de/sites/www.usta.de/themes/usta/font.css">
  </head>
  <body>
     <div id="content">
       <div id="header">
         <h2>Wahlen zum Unabhängigen Modell am Karlsruher Institut für Technologie (KIT)</h2>
         <h1><?php 
    echo $title;
    ?>
</h1>
         <div class="orange-border">
	   Zwischenstand <?php 
    echo date("j.n.Y H:i");
    ?>
, 
           <?php 
    echo $urnen_done;
    ?>
 von <?php 
    echo $urnen_total;
    ?>
 Urnen,
           ca. <?php 
    echo percent($stimmen_done, $stimmen_total);
    ?>
% der Stimmzettel,
           <a href="index.html?cache_dummy=<?php 
    echo time();
    ?>
">&Uuml;bersicht</a>
         </div>
       </div>
<?php 
}
 /**
  * 欢迎页面
  * @author 罗江涛
  */
 public function index()
 {
     $adminId = session('adminId');
     // 获取管理员自己的个人信息
     $admin = M('admin')->where(array('adminId' => $adminId))->find();
     // 获取管理员权限组名称
     $admin['groupName'] = M('group')->where(array('groupId' => $admin['groupId']))->getField('groupName');
     // 统计文章,草稿,审核,发布,撤回,退回,回收站的数目
     $article['allArticleNumber'] = M('article')->where(array('adminId' => $adminId))->count();
     $article['draftArticleNumber'] = M('article')->where(array('adminId' => $adminId, 'status' => 3))->count();
     $article['examineArticleNumber'] = M('article')->where(array('adminId' => $adminId, 'status' => 2))->count();
     $article['publishArticleNumber'] = M('article')->where(array('adminId' => $adminId, 'status' => 1))->count();
     $article['returnArticleNumber'] = M('article')->where(array('adminId' => $adminId, 'status' => -1))->count();
     $article['backArticleNumber'] = M('article')->where(array('adminId' => $adminId, 'status' => -2))->count();
     $article['recycleArticleNumber'] = M('article')->where(array('adminId' => $adminId, 'status' => 0))->count();
     // 统计文章,草稿,审核,发布,撤回,退回,回收站的百分比
     $article['allArticlePercent'] = percent($article['allArticleNumber'], $article['allArticleNumber']);
     $article['draftArticlePercent'] = percent($article['allArticleNumber'], $article['draftArticleNumber']);
     $article['examineArticlePercent'] = percent($article['allArticleNumber'], $article['examineArticleNumber']);
     $article['publishArticlePercent'] = percent($article['allArticleNumber'], $article['publishArticleNumber']);
     $article['returnArticlePercent'] = percent($article['allArticleNumber'], $article['returnArticleNumber']);
     $article['backArticlePercent'] = percent($article['allArticleNumber'], $article['backArticleNumber']);
     $article['recycleArticlePercent'] = percent($article['allArticleNumber'], $article['recycleArticleNumber']);
     // 统计全部用户,男性用户,女性用户,所有文章,已发布,活动,收藏,反馈,管理员,点赞,订阅,标签,管理员日志,待审核,的数目
     $count['allUserNumber'] = M('user')->count();
     $count['manUserNumber'] = M('user')->where(array('sex' => 1))->count();
     $count['womenUserNumber'] = M('article')->where(array('sex' => 2))->count();
     $count['allArticleNumber'] = M('article')->count();
     $count['publishArticleNumber'] = M('article')->where(array('status' => 1))->count();
     $count['campaignNumber'] = M('campaign')->count();
     $count['favoriteNumber'] = M('favorite')->count();
     $count['feedbackNumber'] = M('feedback')->count();
     $count['adminNumber'] = M('admin')->count();
     $count['praiseNumber'] = M('praise')->count();
     $count['subscribeNumber'] = M('subscribe')->count();
     $count['tagNumber'] = M('tag')->count();
     $count['adminLogNumber'] = M('admin_log')->count();
     $count['examineArticleNumber'] = M('article')->where(array('status' => 2))->count();
     $group = M('group')->select();
     foreach ($group as $key => $value) {
         // 统计每个权限组下面有多少人
         $group[$key]['groupUserNumber'] = M('admin')->where(array('groupId' => $group[$key]['groupId']))->count();
     }
     // 分配变量
     $this->assign("admin", $admin);
     $this->assign("article", $article);
     $this->assign("group", $group);
     $this->assign("count", $count);
     $this->display();
 }
Esempio n. 6
0
function show_wahlen($row)
{
    extract($row);
    $wahl_file = str_replace(" ", "_", $wahl_name_kurz);
    $listen_gueltig = $stimmen_gesamt - $stimmzettel_ungueltig - $listen_ungueltig;
    $listen_summe = $listen_gueltig - $listen_enthaltungen;
    $kandidaten_gueltig = $stimmen_gesamt - $stimmzettel_ungueltig - $kandidaten_ungueltig;
    $kandidaten_summe = $kandidaten_gueltig - $kandidaten_enthaltungen;
    if (simple_query("SELECT count(*) FROM liste " . "WHERE wahl = {$wahl_id}") > 1) {
        head($wahl_name_kurz . " (Listen)", "{$wahl_file}-listen.html");
        // Gesamt-Informationen
        print "Wahlberechtigte: {$wahlberechtigt}, " . "abgegebene Stimmzettel: {$stimmen_gesamt}, " . "Wahlbeteiligung: " . percent($stimmen_gesamt, $wahlberechtigt) . "%" . "<BR>\n" . "ung&uuml;ltige Stimmzettel: {$stimmzettel_ungueltig}, " . "ung&uuml;ltige Stimmen: {$listen_ungueltig} " . "g&uuml;ltige Stimmen: {$listen_gueltig}, " . "<BR>\n" . "Enthaltungen: {$listen_enthaltungen} " . "<BR>\n";
        // Listen-Tabelle
        print "<TABLE><TR valign=top>" . "<TD><TABLE cellpadding=2>" . "<TR>" . "<TD>Liste</TD>" . "<TD colspan=2>Stimmen</TD>" . "<TD>Sitze</TD>" . "</TR>\n";
        do_query("SELECT liste.name_kurz, anzeige_red as r, " . "anzeige_green as g, anzeige_blue as b, " . "sitze, los, " . "sum(liste_urne.stimmen) AS stimmen, " . "{$listen_summe} AS summe " . "FROM liste, urne, liste_urne " . "WHERE liste.id = liste_urne.liste " . "AND urne.id = liste_urne.urne " . "AND urne.status = " . $GLOBALS["ok_status"] . " " . "AND wahl = {$wahl_id} " . "GROUP BY liste.id " . "ORDER by liste.nummer", show_listen);
        print "</TABLE>";
        $num_los = simple_query("SELECT los FROM liste " . "WHERE wahl = {$wahl_id} " . "AND los > 0");
        if ($num_los > 0) {
            print "(+1): ggf. +1 von {$num_los} Restsitzen " . "per Los\n";
        }
        print "</TD>\n" . "<TD width=20></TD>\n";
        // Listen-Graph
        $chart = array();
        do_query_pass("SELECT sitze, " . "anzeige_red, anzeige_green, anzeige_blue " . "FROM liste " . "WHERE wahl = {$wahl_id} " . "ORDER by liste.anzeige_nummer", set_listen_chart, $chart);
        if ($num_los > 0) {
            array_push($chart, $num_los, 0.5, 0.5, 0.5);
        }
        print "<TD>";
        piechart(400, 200, $chart, "{$wahl_file}-liste.png");
        image("{$wahl_file}-liste.png");
        print "</TD></TR>\n" . "</TABLE>\n" . "<BR>\n";
        foot();
    }
    // Kandidaten
    head($wahl_name_kurz, "{$wahl_file}-kandi.html");
    // Gesamt-Daten
    print "Wahlberechtigte: {$wahlberechtigt}, " . "abgegebene Stimmzettel: {$stimmen_gesamt}, " . "Wahlbeteiligung: " . percent($stimmen_gesamt, $wahlberechtigt) . "%" . "<BR>\n" . "ung&uuml;ltige Stimmzettel: {$stimmzettel_ungueltig}, " . "ung&uuml;ltige Stimmen: {$kandidaten_ungueltig}, " . "g&uuml;ltig: {$kandidaten_gueltig} " . "<BR>\n";
    if ($max_stimmen_wert == 1) {
        print "Enthaltungen: {$kandidaten_enthaltungen} " . "<BR>\n";
    }
    // Kandidaten
    print "<p><div class=\"auswert_tab\"><TABLE><TR valign=top>\n";
    do_query("SELECT liste.id AS liste_id, " . "liste.name_kurz AS liste_name_kurz, " . "anzeige_red AS r, " . "anzeige_green AS g, " . "anzeige_blue AS b, " . "kandidat.status AS status, " . "kandidat.vorname AS kandidat_vorname, " . "kandidat.nachname AS kandidat_nachname, " . "sum(kandidat_urne.stimmen) AS stimmen " . "FROM liste, kandidat, urne, kandidat_urne " . "WHERE kandidat.id = kandidat_urne.kandidat " . "AND urne.id = kandidat_urne.urne " . "AND liste.id = kandidat.liste " . "AND urne.status = " . $GLOBALS["ok_status"] . " " . "AND liste.wahl = {$wahl_id} " . "GROUP BY kandidat.id " . "ORDER BY liste.nummer, status, stimmen DESC, " . "kandidat.listenplatz", show_kandidaten);
    print "</TR></TABLE></div></p>\n";
    if ($num_los != 0) {
        print "(*): {$num_los} Restsitze werden per Los auf " . "die gekennzeichneten Listen verteilt.<BR>";
    }
    foot();
}
Esempio n. 7
0
 /**
  * Runs the widget.
  */
 public function run()
 {
     function percent($num_amount, $num_total)
     {
         $count1 = $num_amount / $num_total;
         $count2 = $count1 * 100;
         $count = number_format($count2, 0);
         return $count;
     }
     if (!Yii::app()->getModule('likedislike')->countlikes($this->field_id) == 0) {
         echo $rate_like_percent = percent(Yii::app()->getModule('likedislike')->countlikes($this->field_id), Yii::app()->getModule('likedislike')->countlikesall($this->field_id) + Yii::app()->getModule('likedislike')->countlikesall1($this->field_id));
     } else {
         echo '0';
     }
 }
Esempio n. 8
0
function make_thumbs($img)
{
    global $BASE_DIR, $BASE_URL;
    $path_info = pathinfo($img);
    $path = $path_info['dirname'] . "/";
    $img_file = $path_info['basename'];
    $thumb = $path . '.' . $img_file;
    $img_info = getimagesize($BASE_DIR . $path . $img_file);
    $w = $img_info[0];
    $h = $img_info[1];
    $nw = 96;
    $nh = 96;
    if ($w <= $nw && $h <= $nh) {
        header('Location: ' . $BASE_URL . $path . $img_file);
        exit;
    }
    if (is_file($BASE_DIR . $thumb)) {
        $t_mtime = filemtime($BASE_DIR . $thumb);
        $o_mtime = filemtime($BASE_DIR . $img);
        if ($t_mtime > $o_mtime) {
            //echo $BASE_URL.$path.'.'.$img_file;
            header('Location: ' . $BASE_URL . $path . '.' . $img_file);
            exit;
        }
    }
    $img_thumbs = Image_Transform::factory(IMAGE_CLASS);
    $img_thumbs->load($BASE_DIR . $path . $img_file);
    if ($w > $h) {
        $nh = unpercent(percent($nw, $w), $h);
    } else {
        if ($h > $w) {
            $nw = unpercent(percent($nh, $h), $w);
        }
    }
    $img_thumbs->resize($nw, $nh);
    $img_thumbs->save($BASE_DIR . $thumb);
    $img_thumbs->free();
    chmod($BASE_DIR . $thumb, 0666);
    if (is_file($BASE_DIR . $thumb)) {
        //echo "Made:".$BASE_URL.$path.'.'.$img_file;
        header('Location: ' . $BASE_URL . $path . '.' . $img_file);
        exit;
    }
}
Esempio n. 9
0
 public function days($days = 30)
 {
     //hits
     $hits = Hit::factory()->fetch(time() - 3600 * 24 * $days)->cnt();
     $hitsflow = Hit::timeflow(time() - 3600 * 24 * $days, null, 30, false);
     $unique = Hit::factory()->fetch(time() - 3600 * 24 * $days)->unique()->cnt();
     $uniqueflow = Hit::timeflow(time() - 3600 * 24 * $days, null, 30, true);
     $this->templatemanager->assign('hits', $hits);
     $this->templatemanager->assign('hitsflow', $hitsflow);
     $this->templatemanager->assign('unique', $unique);
     $this->templatemanager->assign('uniqueflow', $uniqueflow);
     $this->templatemanager->assign('days', $days);
     //pages
     $pagehits = Hit::factory()->select('*')->select_func('COUNT', '@id', 'cnt')->include_related('page', null, TRUE, TRUE)->where('page_id >', 0)->fetch(time() - 3600 * 24 * $days)->unique('page_id')->limit(100)->get();
     for ($i = 0; $i < count($pagehits->all); $i++) {
         $pagehits->all[$i]->timeflow = Hit::timeflow(time() - 3600 * 24 * $days, null, 30, false, $pagehits->all[$i]->page_id);
     }
     $this->templatemanager->assign('pagehits', $pagehits);
     //sasa
     $returning = Hit::factory()->fetch(time() - 3600 * 24 * $days)->unique()->where('returning', true)->cnt();
     $returningflow = Hit::timeflow(time() - 3600 * 24 * $days, null, 30, true, null, true);
     $this->templatemanager->assign('returning', $returning);
     $this->templatemanager->assign('returningflow', $returningflow);
     //contents edited
     $cnt_edits = ContentRevision::factory()->where('created >=', time() - 3600 * 24 * $days)->get()->result_count();
     $new_users = User::factory()->where('created >=', time() - 3600 * 24 * $days)->get();
     $new_users = $new_users->result_count();
     $new_pages = Page::factory()->where('created >=', time() - 3600 * 24 * $days)->get()->result_count();
     $repeats = RepeatableItem::factory()->where('timestamp >=', time() - 3600 * 24 * $days)->get()->result_count();
     $this->templatemanager->assign('cnt_edits', $cnt_edits);
     $this->templatemanager->assign('new_users', $new_users);
     $this->templatemanager->assign('new_pages', $new_pages);
     $this->templatemanager->assign('repeatables', $repeats);
     //get stats for browsers
     $browsers = Hit::factory()->select('browser')->select_func('COUNT', '@id', 'cnt')->fetch(time() - 3600 * 24 * $days)->unique('browser')->order_by('cnt DESC')->get();
     $browsersarr = array();
     $browsers->iu_total = 0;
     foreach ($browsers as $bro) {
         $browsers->iu_total += $bro->cnt;
     }
     $limit = $browsers->result_count() > 10 ? 10 : $browsers->result_count();
     for ($i = 0; $i < $limit; $i++) {
         $br = $browsers->all[$i];
         $obj = new stdClass();
         $obj->label = str_replace("'", "\\'", $br->browser) . ' (' . percent($br->cnt, $browsers->iu_total) . '%)';
         $obj->data = (int) $br->cnt;
         $browsersarr[] = $obj;
     }
     //usort($browsersarr, array($this, 'compare_series'));
     $this->templatemanager->assign('browsers', $browsers);
     $this->templatemanager->assign('browsers_series', $browsersarr);
     //get stats for operating systems
     $oses = Hit::factory()->select('os')->select_func('COUNT', '@id', 'cnt')->fetch(time() - 3600 * 24 * $days)->unique('os')->order_by('cnt DESC')->get();
     $osarr = array();
     $oses->iu_total = 0;
     foreach ($oses as $osi) {
         $oses->iu_total += $osi->cnt;
     }
     $limit = $oses->result_count() > 10 ? 10 : $oses->result_count();
     for ($i = 0; $i < $limit; $i++) {
         $os = $oses->all[$i];
         $obj = new stdClass();
         $obj->label = str_replace("'", "\\'", $os->os) . ' (' . percent($os->cnt, $oses->iu_total) . '%)';
         $obj->data = (int) $os->cnt;
         $osarr[] = $obj;
     }
     //usort($osarr, array($this, 'compare_series'));
     $this->templatemanager->assign('oses', $oses);
     $this->templatemanager->assign('oses_series', $osarr);
     //get stats for countries
     $geoip_db_filename = './iu-resources/geoip/GeoIP.dat';
     if (is_file($geoip_db_filename)) {
         $countries = Hit::factory()->select('country')->select_func('COUNT', '@id', 'cnt')->fetch(time() - 3600 * 24 * $days)->unique('country')->order_by('cnt DESC')->get();
         $conarr = array();
         $countries->iu_total = 0;
         foreach ($countries as $cou) {
             $countries->iu_total += $cou->cnt;
         }
         //var_dump(percent(20,100));
         $limit = $countries->result_count() > 10 ? 10 : $countries->result_count();
         for ($i = 0; $i < $limit; $i++) {
             $c = $countries->all[$i];
             $obj = new stdClass();
             $obj->label = str_replace("'", "\\'", empty($c->country) ? __("(unknown)") : $c->country) . ' (' . percent($c->cnt, $countries->iu_total) . '%)';
             $obj->data = (int) $c->cnt;
             $conarr[] = $obj;
         }
         //usort($conarr, array($this, 'compare_series'));
         $this->templatemanager->assign('countries', $countries);
         $this->templatemanager->assign('countries_series', $conarr);
     }
     $this->templatemanager->show_template('statistics');
 }
Esempio n. 10
0
    $wrt = '<table border="0" cellspacing="0" cellpadding="0" width="100%">';
    $wrt .= '<tr><th class="left ft_head font_m">Ship</th><th class="left ft_head font_m">Attacker</th><th class="left ft_head font_m">Damage</th></tr>';
    foreach ($att as $attacker) {
        //$dmgDone = number_format((double)$value['damageDone']);
        if ($evenOdd) {
            $odder = "even";
            $splitter = false;
        } else {
            $odder = "odd";
            $splitter = true;
        }
        $evenOdd = !$evenOdd;
        if ($attacker['fb'] == true) {
            $fb = '_fb';
        } else {
            $fb = '';
        }
        $wrt .= '<tr>';
        $wrt .= '<td class="left font_s tcell' . $odder . '">' . ldimg($attacker['ship'], 'type', 'left', 'kb_border' . $fb . '', '32') . '' . get_name($attacker['ship']) . '<br />' . get_name($attacker['wpn_id']) . '</td>';
        if (!empty($attacker['all_name'])) {
            $alli = '<a onclick="CCPEVE.showInfo(16159, ' . $attacker['all_id'] . ')" href="#">' . $attacker['all_name'] . '</a>';
        } else {
            $alli = '';
        }
        $wrt .= '<td class="left font_s tcell' . $odder . '">' . ldimg($attacker['plt_id'], 'char', 'left', 'kb_border' . $fb . '') . '<a onclick="CCPEVE.showInfo(1377, ' . $attacker['plt_id'] . ')" href="#">' . $attacker['plt_name'] . '</a><br /><a onclick="CCPEVE.showInfo(2, ' . $attacker['crp_id'] . ')" href="#">' . $attacker['crp_name'] . '</a><br />' . $alli . '</td>';
        $wrt .= '<td class="left font_s tcell' . $odder . '">' . number_format((double) $attacker['dmgdone']) . '<br />' . percent($attacker['dmgdone'], $perc['SUM(dmgdone)']) . '%</td>';
        $wrt .= '</tr>';
    }
    $wrt .= '</table>';
    echo $wrt;
}
    $weekly_percent = percent($week["total"], $total_records);
} else {
    $weekly_percent = "0";
}
if (!empty($monthly) || $monthly["total"] != '0') {
    $monthly_percent = percent($monthly["total"], $total_records);
} else {
    $monthly_percent = "0";
}
if (!empty($quarterly) || $quarterly["total"] != '0') {
    $quarterly_percent = percent($quarterly["total"], $total_records);
} else {
    $quarterly_percent = "0";
}
if (!empty($halfyearly) || $halfyearly["total"] != '0') {
    $halfyearly_percent = percent($halfyearly["total"], $total_records);
} else {
    $halfyearly_percent = "0";
}
?>
                        <a href="invoice/index">
                            <div class="circle">
                                <div class="circle-inner">
                                    <h2><span class="counter"><?php 
echo $weekly_percent;
?>
</span>%</h2>
                                    <h4>Weekly</h4>
                                </div>
                            </div>
                        </a>
Esempio n. 12
0
if (is_writable('../languages/')) {
    $tally = $tally + 1;
}
foreach (glob("../languages/*.conf") as $filename) {
    $required = $required + 1;
    if (is_writable($filename)) {
        $tally = $tally + 1;
    }
}
if (is_writable('../libs/dbconnect.php')) {
    $tally = $tally + 1;
}
if (is_writable('../settings.php')) {
    $tally = $tally + 1;
}
$percent = percent($tally, $required);
if ($tally < $required) {
    echo '<div class="alert alert-warning">
		<p><strong>Warning:</strong> Your server has only met <strong>' . $tally . '</strong> of  the <strong>' . $required . '</strong> requirements to run Pligg CMS. While not all of the items on this page are required to run Pligg, we suggest that you try to comply with the suggestions made on this page. Please see the list below to discover what issues need to be addressed.</p><br />';
    echo '<div class="progress" style="margin-bottom: 9px;">
				<div class="progress-bar progress-bar-danger" role="progressbar" aria-valuenow="' . $percent . '" aria-valuemin="0" aria-valuemax="100" style="width: ' . $percent . '%;">
					<span class="sr-only">' . $percent . '% Complete</span>
				</div>
			</div>';
} else {
    echo '<div class="alert alert-success">
		<p>Your server met all of the requirements needed to run Pligg CMS. See the information below for a detailed report.</p><br />';
    echo '<div class="progress" style="margin-bottom: 9px;">
				<div class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="' . $percent . '" aria-valuemin="0" aria-valuemax="100" style="width: ' . $percent . '%;">
					<span class="sr-only">' . $percent . '% Complete</span>
				</div>
Esempio n. 13
0
function printResults($human, $comp, $winner)
{
    $guessName = array("Rock", "Paper", "Scissors");
    ?>
  <div>
   <dl class="results">
     <dt>Human Guess:</dt>
      <dd><?php 
    echo $guessName[$human];
    ?>
</dd>
     <dt>Computer Guess:</dt>
      <dd><?php 
    echo $guessName[$comp];
    ?>
</dd>
     <dt>Winner:</dt>
      <dd><?php 
    echo $winner;
    ?>
</dd>
   </dl>
   <dl class="results">
     <dt>Human Wins:</dt>
      <dd><?php 
    echo $_SESSION['WIN'] ? $_SESSION['WIN'] : 0;
    ?>
(<?php 
    echo percent('WIN');
    ?>
%)</dd>
     <dt>Computer Wins:</dt>
      <dd><?php 
    echo $_SESSION['LOSS'] ? $_SESSION['LOSS'] : 0;
    ?>
(<?php 
    echo percent('LOSS');
    ?>
%)</dd>
     <dt>Ties:</dt>
      <dd><?php 
    echo $_SESSION['TIE'] ? $_SESSION['TIE'] : 0;
    ?>
(<?php 
    echo percent('TIE');
    ?>
%)</dd>
   </dl>
   <?php 
    ?>
  </div> 
<?php 
}
Esempio n. 14
0
    echo $todayDataArray[$i]['allusers'];
    ?>
</td>
					<td><?php 
    if ($todayDataArray[$i]['allusers'] == 0) {
        echo '0.0%';
    } else {
        echo percent($sevenDayActive[$i]['startusers'], $todayDataArray[$i]['allusers']);
    }
    ?>
</td>
					<td><?php 
    if ($todayDataArray[$i]['allusers'] == 0) {
        echo '0.0%';
    } else {
        echo percent($thirtyDayActive[$i]['startusers'], $todayDataArray[$i]['allusers']);
    }
    ?>
</td>
					<!--  td><?php 
    // echo ($new_user_time_phase[$i]*100)."%" ;
    ?>
</td>-->
				</tr>
		<?php 
}
?>

	</tbody>
		</table>
	</article>
 				
 		<center>
 			<?php 
 $bar_width = "273px";
 $bar_height = "20px";
 $ally_img = "wow/static/images/services/status/ally.png";
 $horde_img = "wow/static/images/services/status/horde.png";
 //Show percent online (true = yes, false = no)
 $show_percent = true;
 $alliance = array("1", "3", "4", "7", "11", "22");
 $horde = array("2", "5", "6", "8", "9", "10");
 $p = @getPlayers($server_cdb);
 $a = @doFaction($server_cdb, $alliance);
 $h = @doFaction($server_cdb, $horde);
 $ap = @percent($a, $p);
 $hp = @percent($h, $p);
 $b = @barWidth($a, $p, 273);
 $c = @barWidth($h, $p, 273);
 echo "<a data-tooltip='" . doFaction($server_cdb, $alliance) . " <font style=\"color:#3399ff;font-weight:bold;\">" . $Status['Ali'] . "</font> <small>" . $Status['PlOnLine'] . "</small>'\\><div style=\"width:" . $bar_width . ";height:" . $bar_height . ";\">\n    \t\t\t<div style=\"float:left;text-align:right;background:url(./" . $ally_img . ");width:" . $b . "px;height:20px;\">";
 if ($show_percent) {
     echo "<font style=\"color:#FFFFFF;font-weight:bold;\"><center>{$ap}%</center></font></a>";
 }
 echo "<a data-tooltip='" . doFaction($server_cdb, $horde) . " <font style=\"color:#ff3333;font-weight:bold;\">" . $Status['Horde'] . "</font> <small>" . $Status['PlOnLine'] . "</small>'\\></div>\n    \t\t\t<div style=\"float:right;text-align:left;background:url(./" . $horde_img . ");background-position:right;width:" . $c . "px;height:20px;\">";
 if ($show_percent) {
     echo "<font style=\"color:#FFFFFF;font-weight:bold;\"><center>{$hp}%</center></font></a>";
 }
 echo "</div>\n    \t\t\t</div>";
 ?>
 		</center>
 		</div>
 	</div>
Esempio n. 16
0
             $bg2 = BG_2;
         } else {
             $bg1 = BG_3;
             $bg2 = BG_4;
         }
         $country = '[flag]' . getcountry($id) . '[/flag]';
         $country = flags($country);
         $member = '<a href="index.php?site=profile&amp;id=' . $id . '"><b>' . getnickname($id) . '</b></a>';
         if (!isset($anz[$id])) {
             $anz[$id] = '';
         }
         $wars = $anz[$id];
         if (empty($wars)) {
             $wars = '0';
         }
         $perc = percent($wars, $total, 2);
         if ($perc) {
             $percpic = '<img src="images/icons/poll_start.gif" width="1" height="5" alt="" /><img src="images/icons/poll.gif" width="' . round($perc, 0) . '" height="5" alt="" /><img src="images/icons/poll_end.gif" width="1" height="5" alt="" /> ' . $perc . '%';
         } else {
             $percpic = '<img src="images/icons/poll_start.gif" width="1" height="5" alt="" /><img src="images/icons/poll_end.gif" width="1" height="5" alt="" /> ' . $perc . '%';
         }
         eval("\$clanwars_stats_player_content = \"" . gettemplate("clanwars_stats_player_content") . "\";");
         echo $clanwars_stats_player_content;
         $i++;
     }
 }
 echo '</table>';
 unset($wonall);
 unset($loseall);
 unset($drawall);
 unset($playerlist);
    function getPlayers()
    {
        if ($this->request->is('ajax')) {
            $this->disableCache();
            //Configure::write('debug', 0);
            $this->autoRender = false;
            include APP . 'spacebukkitcall.php';
            //Get Players
            $args = array();
            $players = $api->call("getPlayers", $args, false);
            $ops = $api->call("getOps", $args, false);
            $playerslist = array();
            foreach ($players as $player) {
                $args = array($player);
                $playerslist[] = $api->call("getPlayerInformations", $args, false);
            }
            //Function to get percentage
            function percent($num_amount, $num_total)
            {
                $count1 = @($num_amount / $num_total);
                $count2 = $count1 * 100;
                $count = number_format($count2, 0);
                return $count;
            }
            //Output
            $args = array();
            $server = $api->call("getServer", $args, false);
            $num = count($playerslist);
            if ($server['OnlinePlayers'] == 0) {
                $noPl = __('There are no players online!');
                echo <<<END
{ "aaData": [
[
"",
"",
"",
"{$noPl}",
"",
""
]
] }
END;
            } else {
                $i = 1;
                echo '{ "aaData": [';
                foreach ($playerslist as $p) {
                    $name = $p['Name'];
                    $ip = $p['IP'];
                    $life = percent($p['Health'], '20');
                    $hunger = percent($p['FoodLevel'], '20');
                    $lvl = $p['Level'];
                    $gamemode = $p['GameMode'];
                    if ($p['GameMode'] == 'SURVIVAL') {
                        $gamemode = __('Survival');
                        $gamemode .= perm_action('users', 'changeGamemode', $this->Session->read("user_perm"), '<span class=\'button-group\'><a href=\'./tplayers/gameMode/' . $name . '/1\'  class=\'button icon arrowup ajax_table1\'>' . __('Set to creative') . '</a></span>');
                    } elseif ($p['GameMode'] == 'CREATIVE') {
                        $gamemode = __('Creative');
                        $gamemode .= perm_action('users', 'changeGamemode', $this->Session->read("user_perm"), '<span class=\'button-group\'><a href=\'./tplayers/gameMode/' . $name . '/0\'  class=\'button icon arrowdown ajax_table1\'>' . __('Set to survival') . '</a></span>');
                    }
                    $exp = $p['TotalExperience'];
                    if (in_array($name, $ops)) {
                        $op = __('Yes');
                        $op .= perm_action('users', 'op', $this->Session->read("user_perm"), '  <span class=\'button-group\'><a href=\'./tplayers/deop/' . $name . '\'  class=\'button icon arrowdown ajax_table1\'>' . __('Deop') . '</a>');
                    } else {
                        $op = __('No');
                        $op .= perm_action('users', 'op', $this->Session->read("user_perm"), '  <span class=\'button-group\'><a href=\'./tplayers/op/' . $name . '\'  class=\'button icon arrowup ajax_table1\'>' . __('Op') . '</a>');
                    }
                    $lifeText = '<div id=\'progress1\' class=\'sprogress green\'><span style=\'width: ' . $life . '%\'><b> ' . __('Health') . ' </b> </span></div><div id=\'progress1\' class=\'sprogress red\'><span style=\'width: ' . $hunger . '%\'> <b> ' . __('Food') . ' </b> </span></div> ' . __('Lvl') . ': ' . $lvl . ' // ' . __('Exp') . ': ' . $exp . ' <br />';
                    $action1 = perm_action('users', 'healAndFeed', $this->Session->read("user_perm"), '<a href=\'./tplayers/heal/' . $name . '\'  class=\'button icon like ajax_table1\'>' . __('Heal') . '</a><a href=\'./tplayers/feed/' . $name . '\'  class=\'button icon like ajax_table1\'>' . __('Feed') . '</a>');
                    $action2 = perm_action('users', 'seeInventory', $this->Session->read("user_perm"), '<a href=\'./tplayers/inventory/' . $name . '\' class=\'button fancy icon user\'>' . __('Inventory') . '</a>');
                    $action3 = perm_action('users', 'kill', $this->Session->read("user_perm"), '<a href=\'./tplayers/kill/' . $name . '\' class=\'button icon remove danger ajax_table1\'>' . __('Kill') . '</a>');
                    $action4 = perm_action('users', 'kick', $this->Session->read("user_perm"), '<a href=\'./tplayers/kick/' . $name . '\' class=\'button icon remove danger ajax_table1\'>' . __('Kick') . '</a>');
                    $action5 = perm_action('users', 'ban', $this->Session->read("user_perm"), '<a href=\'./tplayers/ban/' . $name . '\' class=\'button icon remove danger ajax_table3\'>' . __('Ban') . '</a>');
                    $action6 = perm_action('users', 'ban', $this->Session->read("user_perm"), '<a href=\'./tplayers/ipban/' . $name . '/' . $ip . '\' class=\'button icon remove danger ajax_table4\'>' . __('IPBan') . '</a>');
                    $actionText = '<span class=\'button-group\'>' . $action1 . $action2 . '</span> <span class=\'button-group\'>' . $action3 . $action4 . $action5 . $action6 . '</span>';
                    echo <<<END
                [
                  "<img src=\\"./global/avatar/{$name}/40\\" class=\\"avatar\\" />",
                  "{$lifeText}",
                  "{$name} ({$ip})",
                  "{$gamemode}",
                  "{$op}",
                  "{$actionText}"

                ]
            
END;
                    if ($i < $num) {
                        echo ",";
                    }
                    $i++;
                }
                echo '] }';
            }
        }
    }
Esempio n. 18
0
        </tr>
        <tr>
        <?php 
        for ($i = 1; $i < 3; $i++) {
            if ($row['Drop' . $i . 'id'] == 0) {
                continue;
            }
            ?>
        <td><img src="images/item/icons/<?php 
            echo $row['MVP' . $i . 'id'];
            ?>
.png"></td><td><?php 
            echo get_item_name($row['MVP' . $i . 'id']);
            ?>
</td><td><?php 
            echo percent($row['MVP' . $i . 'per']);
            ?>
</td>
        </tr>
        <?php 
        }
        ?>
        </table>
    	</td>
<?php 
    }
    ?>
    </tr>
</table>
</form>
<?php 
Esempio n. 19
0
SettingsForm::start();
SettingsForm::text('tries', __('The number of tries allowed for this quiz.  Leave blank or set to 1 for a single try.'));
SettingsForm::text('delay', __('The number of seconds between retries.  Leave blank or set to zero to allow immediate retries.'));
SettingsForm::dueDate();
SettingsForm::done();
SettingsForm::end();
$OUTPUT->welcomeUserCourse();
$OUTPUT->flashMessages();
// Clean up the JSON for presentation
if ($gift === false || strlen($gift) < 1) {
    echo '<p class="alert-warning" style="clear:both;">This quiz has not yet been configured</p>' . "\n";
    $OUTPUT->footer();
    return;
}
if ($RESULT->grade > 0) {
    echo '<p class="alert alert-info" style="clear:both;">Your current grade on this assignment is: ' . percent($RESULT->grade) . '</p>' . "\n";
}
if (!$ok) {
    if ($USER->instructor) {
        echo '<p class="alert alert-info" style="clear:both;">' . $why . ' (except for the fact that you are the instructor)</p>' . "\n";
    } else {
        echo '<p class="alert alert-danger" style="clear:both;">' . $why . '</p>' . "\n";
    }
}
// parse the GIFT questions
$questions = array();
$errors = array();
parse_gift($gift, $questions, $errors);
?>
<form method="post">
<ol id="quiz">
Esempio n. 20
0
    $count2 = $count1 * 100;
    $count = number_format($count2, 0);
    return $count;
}
$total_records = $total;
//                        $week = arrIndex($row, 'W');
//                        $monthly = arrIndex($row, 'M');
//                        $quarterly = arrIndex($row, 'Q');
//                        $halfyearly = arrIndex($row, 'HF');
if (!empty($total_rows_weekly) || $total_rows_weekly != '0') {
    $weekly_percent = percent($total_rows_weekly, $total_records);
} else {
    $weekly_percent = "0";
}
if (!empty($total_rows_monthly) || $total_rows_monthly != '0') {
    $monthly_percent = percent($total_rows_monthly, $total_records);
} else {
    $monthly_percent = "0";
}
?>
                        <a href="invoice/index">
                            <div class="circle">
                                <div class="circle-inner">
                                    <h2><span class="counter"><?php 
echo $weekly_percent;
?>
</span>%</h2>
                                    <h4>Weekly</h4>
                                </div>
                            </div>
                        </a>
/loading.gif" src2="<?php 
        echo G_UPLOAD_PATH;
        ?>
/<?php 
        echo $renqi['thumb'];
        ?>
" border=0 alt="" />
			                    </a>
			                    <ins class="u-promo">价值:¥<?php 
        echo $renqi['money'];
        ?>
</ins>
			                </div>
			                <div class="Progress-bar">
								<p class="u-progress" title="已完成<?php 
        echo percent($renqi['canyurenshu'], $renqi['zongrenshu']);
        ?>
">
								<span class="pgbar" style="width:<?php 
        echo $renqi['canyurenshu'] / $renqi['zongrenshu'] * 100;
        ?>
%;">
								<span class="pging"></span>
								</span>
								</p>
								<ul class="Pro-bar-li">
									<li class="P-bar01"><em><?php 
        echo $renqi['canyurenshu'];
        ?>
</em>已参与</li>
									<li class="P-bar02"><em><?php 
Esempio n. 22
0
        ?>
</td> 
    				<td><?php 
        echo $row['total'] . "(" . percent($row["total"], $allusers) . ")";
        ?>
</td> 
    				<td><?php 
        echo $row["new"];
        ?>
</td> 
    				<td><?php 
        echo $row["update"];
        ?>
</td>
    				<td><?php 
        echo $row['active'] . "(" . percent($row["active"], $activeusers) . ")";
        ?>
</td>
    				<td><?php 
        echo $row["start"];
        ?>
</td>
				</tr> 
			<?php 
    }
}
?>
											
			</tbody> 			
			</table>
	</article>
Esempio n. 23
0
*/
require_once 'bugconfig.php';
$counter = array('passed' => 0, 'error' => 0);
function runBugfile($file)
{
    global $counter;
    $lastline = trim(exec(PHP_EXECUTABLE . ' ' . $file));
    if ($lastline == 'ok') {
        $status = 'passed';
    } else {
        $status = 'error';
    }
    echo str_pad($file, 60, ' ') . $status . "\r\n";
    $counter[$status]++;
}
function percent($value, $all)
{
    if ($all == 0 || $value == 0) {
        return '  0.00';
    }
    return number_format(100 / $all * $value, 2);
}
$files = glob('bug_*.phpw');
foreach ($files as $bugfile) {
    runBugfile($bugfile);
}
echo "\r\nScore:\r\n";
$sum = array_sum($counter);
foreach ($counter as $id => $value) {
    echo ' ' . str_pad($id, 7, ' ') . ': ' . str_pad($value, 5, ' ', STR_PAD_LEFT) . ' (' . percent($value, $sum) . '%)' . "\r\n";
}
            ?>
" target="_blank" title="<?php 
            echo $shop['title'];
            ?>
 "><?php 
            echo $shop['title'];
            ?>
</a>
			</p>
			<p class="money">价值:<span class="rmbgray"><?php 
            echo $shop['money'];
            ?>
</span></p>
			<div class="Progress-bar">
				<p title="已完成<?php 
            echo percent($shop['canyurenshu'], $shop['zongrenshu']);
            ?>
"><span style="width:<?php 
            echo width($shop['canyurenshu'], $shop['zongrenshu'], 213);
            ?>
px;"></span></p>
				<ul class="Pro-bar-li">
					<li class="P-bar01"><em><?php 
            echo $shop['canyurenshu'];
            ?>
</em>已参与人次</li>
					<li class="P-bar02"><em><?php 
            echo $shop['zongrenshu'];
            ?>
</em>总需人次</li>
					<li class="P-bar03"><em><?php 
Esempio n. 25
0
					if(!empty($split[5])){
						echo ' ... [<a href="" onClick="javascript:popUp(\'other/showall.php?id='.safe_xss($row['id']).'\')">show all</a>]';
					}
				}
		  
		  echo '</td>
				<td>'.safe_xss($row['time']).'</td>';
		  
		  
		  if(safe_xss($row['bots']) == safe_xss($row['done'])){
			echo '<td style="background-color: #ABC886">'.safe_xss($row['bots']).' / '.safe_xss($row['done']).'</td>';
		  }else{
			echo '<td style="background-color: #FFC2C2;">'.safe_xss($row['bots']).' / '.safe_xss($row['done']).'</td>';
		  }
		  
		  echo '<td style=""><div style="background-color: #AFDCEC; width: '.percent(safe_xss($row['done']),safe_xss($row['bots'])).'%">'.percent(safe_xss($row['done']),safe_xss($row['bots'])).'%</div></td>';
		  
		  if(safe_xss($row['bots']) != safe_xss($row['done'])){
			echo '<td style=""><a href="befehle.php?cmd='.safe_xss($row['command']).'" onClick="javascript:return(confirm(\'bots != done\nTask '.safe_xss($row['id']).' delete now?\'))"><b style="color: red;"><img src="img/del.png" /></b></a></td>';
		  }else{
			echo '<td style=""><a href="befehle.php?cmd='.safe_xss($row['command']).'" onClick="javascript:return(confirm(\'Task '.safe_xss($row['id']).' delete now?\'))"><b style="color: red;"><img src="img/del.png" /></b></a></td>';
		  }
		  
		  echo '</tr>';
		}
		  
	echo '</table>';
	
	//Del tasks / Add new
	echo '<br />
		  <div style="font-family: Tahoma; font-size: 11px;">
Esempio n. 26
0
function show_beteiligung($row)
{
    extract($row);
    printf("<tr class=\"%s\"><td>{$wahl_name}</td>", $row_number % 2 ? "even" : "odd");
    print "<td>{$wahlberechtigt}</td>" . "<td>{$stimmen_gesamt}</td>" . "<td>" . percent($stimmen_gesamt, $wahlberechtigt) . "%</td>" . "</tr>\n";
}
Esempio n. 27
0
                                        <div class="tnp-data-title">Opened</div>
                                        <div class="tnp-data-value"><?php 
echo $open_count - $click_count;
?>
 (<?php 
echo percent($open_count - $click_count, $total_sent);
?>
)</div>
                                    </div>
                                    <div class="tnp-data">
                                        <div class="tnp-data-title">Clicked</div>
                                        <div class="tnp-data-value"><?php 
echo $click_count;
?>
 (<?php 
echo percent($click_count, $total_sent);
?>
)</div>
                                    </div>
                                </div>
                            </div>

                        </div>

                    </div>
                </div>

                <div class="col-md-6">
                    <div class="tnp-widget">
                        <h3>World Map</h3>
                        <div class="inside">
Esempio n. 28
0
            // The ID of the page, the article or the video ...
            //function to calculate the percent
            // check if the user has already clicked on the unlike (rate = 2) or the like (rate = 1)
            $dislike_sql = mysql_query('SELECT COUNT(*) FROM  topic_like WHERE topic_by = "' . $user_ip . '" and topic_id = "' . $pageID . '" and rate = 2 ');
            $dislike_count = mysql_result($dislike_sql, 0);
            $like_sql = mysql_query('SELECT COUNT(*) FROM  topic_like WHERE topic_by = "' . $user_ip . '" and topic_id = "' . $pageID . '" and rate = 1 ');
            $like_count = mysql_result($like_sql, 0);
            // count all the rate
            $rate_all_count = mysql_query('SELECT COUNT(*) FROM  topic_like WHERE topic_id= "' . $pageID . '"');
            $rate_all_count = mysql_result($rate_all_count, 0);
            $rate_like_count = mysql_query('SELECT COUNT(*) FROM  topic_like WHERE topic_id = "' . $pageID . '" and rate = 1');
            $rate_like_count = mysql_result($rate_like_count, 0);
            $rate_like_percent = percent($rate_like_count, $rate_all_count);
            $rate_dislike_count = mysql_query('SELECT COUNT(*) FROM topic_like WHERE topic_id = "' . $pageID . '" and rate = 2');
            $rate_dislike_count = mysql_result($rate_dislike_count, 0);
            $rate_dislike_percent = percent($rate_dislike_count, $rate_all_count);
            $rep = "SELECT COUNT(*) as reply FROM posts WHERE post_topic='" . $topicrow['topic_id'] . "'";
            $rep_res = mysql_query($rep) or die;
            $tool = mysql_fetch_array($rep_res);
            $reply = $tool['reply'];
            $reply -= 1;
            $user = "******" . $topicrow['topic_by'] . "'";
            $user_res = mysql_query($user) or die;
            $user_result = mysql_fetch_array($user_res);
            $cat = "SELECT * FROM categories WHERE cat_id='" . $topicrow['topic_cat'] . "'";
            $cat_res = mysql_query($cat) or die;
            $cat_result = mysql_fetch_array($cat_res);
            $l = 'like-h' . $topicrow['topic_id'];
            $d = 'dislike-h' . $topicrow['topic_id'];
            echo ' <tr class="tbl-item">
	 <td class="img" style="width:150px;height:150px;"><img src="' . $im['cat_img'] . '" alt="" class="img-responsive" height="100"title="" /></td>
		</div>

		<div style="min-height: 100px;" class="col-lg-5 cf-item-status tickets all">
			<header>
				<p><span></span><?php 
echo __('Total');
?>
</p>
			</header>
			<div class="content">
				<div class="metric5"><?php 
echo $total;
?>
</div>
				<div class="metric-small5"><?php 
percent($total, $totaly);
?>
</div>			
			</div>
		</div>
</div> <!-- fim row1 -->


<div class="row" style="margin-top: 10px;">	
		<div style="min-heightx: 300px;" class="col-lg-3 cf-item">
				<!--Display the time and date. For 12hr clock add class 'cf-td-12' to the 'cf-td' div -->
			<header>
				<p><span></span><?php 
echo __('Time') . " &amp; " . __('Date');
?>
 </p>
Esempio n. 30
0
         echo $usergallery_add;
     } elseif ($_GET['action'] == "edit") {
         $ergebnis = safe_query("SELECT * FROM " . PREFIX . "gallery WHERE galleryID='" . $_GET['galleryID'] . "' AND userID='" . $userID . "'");
         $ds = mysql_fetch_array($ergebnis);
         $name = getinput($ds['name']);
         $galleryID = $ds['galleryID'];
         eval("\$usergallery_edit = \"" . gettemplate("usergallery_edit") . "\";");
         echo $usergallery_edit;
     } elseif ($_GET['action'] == "upload") {
         $id = (int) $_GET['galleryID'];
         eval("\$usergallery_upload = \"" . gettemplate("usergallery_upload") . "\";");
         echo $usergallery_upload;
     }
 } else {
     $size = $galclass->getuserspace($userID);
     $percent = percent($size, $maxusergalleries, 0);
     if ($percent > 95) {
         $color = $loosecolor;
     } else {
         $color = $wincolor;
     }
     $bg1 = BG_1;
     $bg2 = BG_2;
     $pagebg = PAGEBG;
     $border = BORDER;
     $bghead = BGHEAD;
     $bgcat = BGCAT;
     $vars = array('%spacecolor%', '%used_size%', '%available_size%');
     $repl = array($color, round($size / (1024 * 1024), 2), round($maxusergalleries / (1024 * 1024), 2));
     $space_max_in_user = str_replace($vars, $repl, $_language->module['x_of_y_mb_in_use']);
     eval("\$usergallery_head = \"" . gettemplate("usergallery_head") . "\";");