当前位置: 首页>>代码示例>>PHP>>正文


PHP Division::recruitsThisMonth方法代码示例

本文整理汇总了PHP中Division::recruitsThisMonth方法的典型用法代码示例。如果您正苦于以下问题:PHP Division::recruitsThisMonth方法的具体用法?PHP Division::recruitsThisMonth怎么用?PHP Division::recruitsThisMonth使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Division的用法示例。


在下文中一共展示了Division::recruitsThisMonth方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: _generateDivisionTop10

 public static function _generateDivisionTop10($division)
 {
     $division = Division::findByName($division)->id;
     // error_reporting(E_ALL);
     // ini_set('display_errors', 1);
     header('Content-Type: image/png');
     date_default_timezone_set('America/New_York');
     $im = imagecreatetruecolor(960, 330);
     // color
     $white = imagecolorallocate($im, 255, 255, 255);
     $grey = imagecolorallocate($im, 128, 128, 128);
     $darkergrey = imagecolorallocate($im, 30, 30, 30);
     $orange = imagecolorallocate($im, 255, 108, 0);
     $darkGrey = imagecolorallocate($im, 50, 50, 50);
     $im = imagecreatefrompng("assets/images/stats_templates/top10/big-bg.png");
     $text = "Battlefield Division";
     $dateText = date('d M', strtotime('-30 days')) . " - " . date('d M');
     $tinyfont = "assets/fonts/copy0855.ttf";
     $tinyboldfont = "assets/fonts/copy0866.ttf";
     $bigfont = "assets/fonts/din-black.otf";
     // x value positions
     $games_col_1 = 190;
     $num_col_1 = 23;
     $name_col_1 = 45;
     $games_col_2 = 465;
     $num_col_2 = 300;
     $name_col_2 = 320;
     $total_count_x = 639;
     $total_count_y = 110;
     $recruits_x = 639;
     $recruits_y = 205;
     /**
      * get data
      */
     try {
         $daily = BfActivity::topListTodayByDivision($division);
         $monthly = BfActivity::topList30DaysByDivision($division);
         if (!$daily) {
             throw new Exception($daily['message'], 1);
         }
         if (!$monthly) {
             throw new Exception($monthly['message'], 1);
         }
         /**
          * create elements
          */
         // date
         // imagettftext($im, 6, 0, 715, 240, $darkGrey, $tinyfont, strtoupper($dateText));
         // daily stats
         $y = 65;
         $i = 1;
         imagettftext($im, 6, 0, $num_col_1, $y, $orange, $tinyfont, strtoupper("#"));
         imagettftext($im, 6, 0, $name_col_1, $y, $orange, $tinyfont, strtoupper("Player"));
         imagettftext($im, 6, 0, $games_col_1, $y, $orange, $tinyfont, strtoupper("AOD Games"));
         foreach ($daily as $player) {
             $y = $y + 20;
             $name = strtoupper($player->rank) . " " . strtoupper($player->forum_name);
             // number
             imagettftext($im, 6, 0, $num_col_1, $y, $orange, $tinyfont, "{$i}.");
             // name
             imagettftext($im, 6, 0, $name_col_1, $y, $white, $tinyfont, $name);
             // games
             imagettftext($im, 6, 0, $games_col_1, $y, $white, $tinyboldfont, "{$player->aod_games}");
             $i++;
         }
         // monthly stats
         $y = 65;
         $i = 1;
         imagettftext($im, 6, 0, $num_col_2, $y, $orange, $tinyfont, strtoupper("#"));
         imagettftext($im, 6, 0, $name_col_2, $y, $orange, $tinyfont, strtoupper("Player"));
         imagettftext($im, 6, 0, $games_col_2, $y, $orange, $tinyfont, strtoupper("AOD Games"));
         foreach ($monthly as $player) {
             $y = $y + 20;
             $name = strtoupper($player->rank) . " " . strtoupper($player->forum_name);
             // number
             imagettftext($im, 6, 0, $num_col_2, $y, $orange, $tinyfont, "{$i}.");
             // name
             imagettftext($im, 6, 0, $name_col_2, $y, $white, $tinyfont, $name);
             // games
             imagettftext($im, 6, 0, $games_col_2, $y, $white, $tinyboldfont, "{$player->aod_games}");
             $i++;
         }
         // total aod games stat
         $personnel = new stdClass();
         $personnel->recruitsThisMonth = Division::recruitsThisMonth($division)->count;
         $personnel->totalCount = Division::totalCount($division)->count;
         $personnel->recruitsThisMonth = sprintf('%03d', $personnel->recruitsThisMonth);
         imagettftext($im, 36, 0, $total_count_x, $total_count_y, $white, $bigfont, $personnel->totalCount);
         imagettftext($im, 36, 0, $recruits_x, $recruits_y, $white, $bigfont, $personnel->recruitsThisMonth);
     } catch (Exception $e) {
         $im = imagecreatefrompng("assets/images/stats_templates/top10/big-bg-error.png");
         imagettftext($im, 6, 0, 10, 320, $darkGrey, $tinyfont, strtoupper($e->getMessage()));
     }
     imagepng($im);
     imagepng($im, "assets/images/toplist-cache.png");
     imagedestroy($im);
 }
开发者ID:Oogieboogie23,项目名称:Division-Tracker,代码行数:97,代码来源:GraphicsController.php

示例2:

        </div>
    </div>
</div>

<div class='row'>
    <div class='col-md-6'>
        <div class='panel panel-primary toplist'>
            <div class='panel-heading'>Total Membership</div>
            <div class="panel-body count-detail-big follow-tool striped-bg">
                <span class="count-animated"><?php 
echo Division::totalCount($division->id);
?>
</span>
            </div>
        </div>
    </div>

    <div class='col-md-6'>
        <div class='panel panel-primary toplist'>
            <div class='panel-heading'>Recruits This Month</div>
            <div class="panel-body count-detail-big follow-tool striped-bg">
                <span class="count-animated"><?php 
echo Division::recruitsThisMonth($division->id);
?>
</span>
            </div>
        </div>
    </div>

</div>
开发者ID:higginsd,项目名称:Division-Tracker,代码行数:30,代码来源:statistics.php


注:本文中的Division::recruitsThisMonth方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。