public static function execute($reportName = 'playerPresense', $params = array())
 {
     $dates = array();
     for ($i = date('t'); $i > 0; $i--) {
         $date = date_create('now');
         date_add($date, date_interval_create_from_date_string("-{$i} days"));
         $dates[] = date_format($date, 'Y-m-d');
     }
     $data = parent::execute($reportName, $params);
     $result = array();
     $names = array();
     foreach ($data as $row) {
         if (!isset($result[$row['player_id']])) {
             $result[$row['player_id']] = array('player_name' => $row['player_name'], 'clan_role_name' => $row['clan_role_name']);
             foreach ($dates as $date) {
                 $result[$row['player_id']][$date] = 0;
             }
             $result[$row['player_id']]['total'] = 0;
         }
         if (in_array($row['dte'], $dates)) {
             $pres = 0;
             if ($row['ab'] > 0) {
                 $pres = 1;
             }
             if (!empty($row['dts'])) {
                 $pres = $pres + 2;
             }
             if ($row['gb'] > 0) {
                 $pres = $pres + 4;
             }
             if ($pres > 0) {
                 $result[$row['player_id']][$row['dte']] = $pres;
             }
             $coins = 0;
             if ($row['ab'] > 0) {
                 if (empty($row['dts']) && $row['gb'] == 0) {
                     $coins = -1;
                 } else {
                     if (!empty($row['dts'])) {
                         $coins++;
                     }
                     if ($row['gb'] > 0) {
                         $coins++;
                     }
                 }
             }
             $result[$row['player_id']]['total'] += $coins;
         }
     }
     $res = array();
     foreach ($result as $row) {
         $res[] = $row;
     }
     return array('data' => $res, 'dates' => $dates);
 }
Esempio n. 2
0
<div class="row-fluid">
	<div class="col-md-2">
		<div class="portlet">
			<div class="portlet-title">
				<div class="caption">
					<i class="fa fa-cogs"></i>Игроки
				</div>
				<div class="tools">
					<a href="javascript:;" class="reload"></a>
				</div>
			</div>
			<div class="portlet-body">
				<div class="scroller" data-height="700px">
<?php 
$this->widget('zii.widgets.grid.CGridView', array('itemsCssClass' => 'table table-condensed table-striped', 'dataProvider' => new CArrayDataProvider(RptReport::execute('players'), array('keyField' => 'player_name', 'pagination' => false)), 'columns' => array(array('class' => 'CLinkColumn', 'id' => 'player_name', 'labelExpression' => '$data["player_name"]', 'urlExpression' => '"javascript:chart(".$data["player_id"].",' . "'" . '".$data["player_name"]."' . "'" . ')"')), 'htmlOptions' => array('class' => 'portlet-body'), 'template' => "{items}", 'hideHeader' => true));
?>
				</div>
			</div>
		</div>
	</div>
	<div class="col-md-10">
		<div class="portlet">
			<div class="portlet-title">
				<div class="caption">
					<i class="fa fa-users"></i>
				</div>
			</div>
			<div class="portlet-body">
				<div class="row">
					<div class="col-md-12">
						<div class="portlet">
Esempio n. 3
0
\t\treturn 'style="color:green" title="'+v+' (+'+ val +')"';
\telse if(val<0)
\t\treturn 'style="color:red" title="'+v+' ('+ val +')"';
\telse
\t\treturn 'title="'+val+'"';
}
FUNC;
$formatter = <<<FUNCF
function jqcFormatter(cellvalue, options, rowObject)
{
\tif(cellvalue>0)
\t\tcellvalue='+'+cellvalue;
\tvar v=rowObject[options.colModel.name.substr(1)];
\treturn parseFloat(v).toFixed(2) +'('+cellvalue+')';
}
function jqcFormatter1(cellvalue, options, rowObject)
{
\tif(cellvalue>0)
\t\tcellvalue='+'+cellvalue;
\tvar v=rowObject[options.colModel.name.substr(1)];
\treturn parseFloat(v).toFixed(0) +'('+cellvalue+')';
}
FUNCF;
$cs->registerScript(__CLASS__ . $this->getId() . '1', $cellAttr, CClientScript::POS_READY);
$cs->registerScript(__CLASS__ . $this->getId() . '2', $formatter, CClientScript::POS_READY);
$options = CJavaScript::encode(array('datatype' => 'local', 'data' => RptReport::execute('progress'), 'colNames' => array('Игрок', 'Боев', 'РЭ', 'WN8', 'Побед', 'Опыт', 'Дамаг', 'Фраги', 'Засвет', 'Захват', 'Защита', 'Живучесть', 'Точность', 'Макс. опыт'), 'colModel' => array(array('name' => 'player_name', 'index' => 'player_name', 'width' => 140, 'align' => 'left'), array('name' => 'battles_count', 'index' => 'battles_count', 'width' => 80, 'align' => 'right', 'sorttype' => 'number'), array('name' => 'heffect', 'index' => 'heffect', 'width' => 100, 'align' => 'right', 'sorttype' => 'number', 'cellattr' => 'js:jqcCellattr', 'formatter' => 'js:jqcFormatter'), array('name' => 'hwn8', 'index' => 'hwn8', 'width' => 100, 'align' => 'right', 'sorttype' => 'number', 'cellattr' => 'js:jqcCellattr', 'formatter' => 'js:jqcFormatter'), array('name' => 'hwinp', 'index' => 'hwinp', 'width' => 80, 'align' => 'right', 'sorttype' => 'number', 'cellattr' => 'js:jqcCellattr', 'formatter' => 'js:jqcFormatter'), array('name' => 'hbattle_avg_xp', 'index' => 'hbattle_avg_xp', 'width' => 60, 'align' => 'right', 'sorttype' => 'number', 'cellattr' => 'js:jqcCellattr', 'formatter' => 'js:jqcFormatter1'), array('name' => 'hdamage', 'index' => 'hdamage', 'width' => 100, 'align' => 'right', 'sorttype' => 'number', 'cellattr' => 'js:jqcCellattr', 'formatter' => 'js:jqcFormatter'), array('name' => 'hfrags', 'index' => 'hfrags', 'width' => 100, 'align' => 'right', 'sorttype' => 'number', 'cellattr' => 'js:jqcCellattr', 'formatter' => 'js:jqcFormatter'), array('name' => 'hspotted', 'index' => 'hspotted', 'width' => 100, 'align' => 'right', 'sorttype' => 'number', 'cellattr' => 'js:jqcCellattr', 'formatter' => 'js:jqcFormatter'), array('name' => 'hcp', 'index' => 'hcp', 'width' => 100, 'align' => 'right', 'sorttype' => 'number', 'cellattr' => 'js:jqcCellattr', 'formatter' => 'js:jqcFormatter'), array('name' => 'hdcp', 'index' => 'hdcp', 'width' => 100, 'align' => 'right', 'sorttype' => 'number', 'cellattr' => 'js:jqcCellattr', 'formatter' => 'js:jqcFormatter'), array('name' => 'hsb', 'index' => 'hsb', 'width' => 100, 'align' => 'right', 'sorttype' => 'number', 'cellattr' => 'js:jqcCellattr', 'formatter' => 'js:jqcFormatter'), array('name' => 'hhitp', 'index' => 'hhitp', 'width' => 100, 'align' => 'right', 'sorttype' => 'number', 'cellattr' => 'js:jqcCellattr', 'formatter' => 'js:jqcFormatter1'), array('name' => 'hmax_xp', 'index' => 'hmax_xp', 'width' => 100, 'align' => 'right', 'sorttype' => 'number', 'cellattr' => 'js:jqcCellattr', 'formatter' => 'js:jqcFormatter1')), 'rowNum' => 1000, 'sortname' => 'heffect', 'sortorder' => 'desc', 'height' => 'auto', 'caption' => 'Прогресс за последние 2 суток', 'viewrecords' => true));
$cs->registerScript($this->getId() . 'jqGrid', "jQuery('#jqgrid').jqGrid({$options});", CClientScript::POS_READY);
$cs->registerPackage('jqGrid');
?>
	</div>
</div>
Esempio n. 4
0
<table id="jqgrid"></table>
<?php 
$options = CJavaScript::encode(array('datatype' => 'local', 'data' => RptReport::execute('tanks'), 'colNames' => array('Игрок', 'Танк', 'Боев', 'Побед', 'Процент побед'), 'colModel' => array(array('name' => 'player_name', 'index' => 'player_name', 'width' => 140, 'align' => 'left', 'summaryType' => 'count'), array('name' => 'tank_localized_name', 'index' => 'tank_localized_name', 'width' => 100), array('name' => 'battles', 'index' => 'battles', 'width' => 80, 'align' => 'right', 'sorttype' => 'number'), array('name' => 'wins', 'index' => 'wins', 'width' => 60, 'align' => 'right', 'sorttype' => 'number'), array('name' => 'wp', 'index' => 'wp', 'width' => 100, 'align' => 'right', 'sorttype' => 'number', 'formatter' => 'number')), 'rowNum' => 1000, 'height' => 'auto', 'caption' => 'Танки', 'viewrecords' => true, 'grouping' => true, 'groupDataSorted' => false, 'groupingView' => array('groupField' => array('player_name'), 'groupColumnShow' => array(true), 'groupText' => array('<b>{0}</b> Всего танков: {player_name}', '{0} Sum of totaly: {b}'), 'groupCollapse' => true, 'groupOrder' => array('desc'), 'groupSummary' => array(false, false))));
$cs = Yii::app()->clientScript;
$cs->registerScript($this->getId() . 'jqGrid', "jQuery('#jqgrid').jqGrid({$options});", CClientScript::POS_READY);
$cs->registerPackage('jqGrid');
Esempio n. 5
0
			<?php 
$this->widget('zii.widgets.grid.CGridView', array('itemsCssClass' => 'table table-condensed table-striped', 'dataProvider' => new CArrayDataProvider(RptReport::execute('escapedMembers'), array('keyField' => 'player_name', 'pagination' => false)), 'columns' => array(array('class' => 'CLinkColumn', 'id' => 'player_name', 'labelExpression' => '$data["player_name"]', 'urlExpression' => '"http://wot-news.com/index.php/stat/single/ru/".$data["player_name"]', 'linkHtmlOptions' => array('target' => '_blank')), 'escape_date', 'clan_role_name', 'days'), 'htmlOptions' => array('class' => 'widget-body'), 'template' => "{items}", 'hideHeader' => true));
?>
			</div>
		</div>
	</div>
	<div class="col-md-4">
		<div class="portlet">
			<div class="portlet-title">
				<div class="caption">
					<i class="fa fa-cogs"></i>Карьера
				</div>
			</div>
			<div class="portlet-body">
			<?php 
$this->widget('zii.widgets.grid.CGridView', array('itemsCssClass' => 'table table-condensed table-striped', 'dataProvider' => new CArrayDataProvider(RptReport::execute('career'), array('keyField' => 'player_name', 'pagination' => false)), 'columns' => array(array('header' => 'Имя', 'class' => 'CLinkColumn', 'id' => 'player_name', 'labelExpression' => '$data["player_name"]', 'urlExpression' => '"http://wot-news.com/index.php/stat/single/ru/".$data["player_name"]', 'linkHtmlOptions' => array('target' => '_blank')), array('name' => 'updated_at', 'header' => 'Дата'), array('name' => 'old_role', 'header' => 'Был'), array('name' => 'clan_role_name', 'header' => 'Стал')), 'htmlOptions' => array('class' => 'widget-body'), 'template' => "{items}"));
?>
			</div>
		</div>
	</div>
</div>


<?php 
/*
$this->widget('ext.jqgrid.JQGrid',
	array('options'=>array(
		'url'=> $this->createUrl('wot/jqgriddata'),
		'datatype'=>'local',
		'data'=>WotReport::report(),
		'colNames'=>array('Игрок', 'Боев', 'Танк', 'Начиная с','По','Всего боев','Побед','Процент побед'),
Esempio n. 6
0
<?php

$this->pageTitle = Yii::app()->name . ' - Активность по танкам';
$this->breadcrumbs = array('Активность по танкам');
?>

<div class="row-fluid">
	<div class="span4">
	<table id="jqgrid"></table>
<?php 
$cellAttr = <<<FUNC
js:function(rowId, val, rawObject, cm, rdata) {
\tif(rawObject.dwp>0)
\t\treturn 'style="color:green" title="'+val+' (+'+ rawObject.dwp +')"';
\telse if(rawObject.dwp<0)
\t\treturn 'style="color:red" title="'+val+' ('+ rawObject.dwp +')"';
\telse
\t\treturn 'title="'+val+'"';
}
FUNC;
$options = CJavaScript::encode(array('datatype' => 'local', 'data' => RptReport::execute('activity'), 'colNames' => array('Игрок', 'Боев', 'Побед', '% побед', 'Танк', 'Всего боев', 'Всего побед', 'Всего % побед'), 'colModel' => array(array('name' => 'player_name', 'index' => 'player_name', 'width' => 140, 'align' => 'left'), array('name' => 'b', 'index' => 'b', 'width' => 50, 'align' => 'right', 'summaryType' => 'sum', 'sorttype' => 'number'), array('name' => 'dwins', 'index' => 'dwins', 'width' => 60, 'align' => 'right', 'sorttype' => 'number'), array('name' => 'dwin_count', 'index' => 'dwin_count', 'width' => 60, 'align' => 'right', 'sorttype' => 'number', 'formatter' => 'number'), array('name' => 'tank_localized_name', 'index' => 'tank_localized_name', 'width' => 120), array('name' => 'battles', 'index' => 'battles', 'width' => 80, 'align' => 'right', 'sorttype' => 'number'), array('name' => 'wins', 'index' => 'wins', 'width' => 80, 'align' => 'right', 'sorttype' => 'number'), array('name' => 'wp', 'index' => 'wp', 'width' => 100, 'align' => 'right', 'sorttype' => 'number', 'formatter' => 'number', 'cellattr' => $cellAttr)), 'rowNum' => 1000, 'sortname' => 'b', 'sortorder' => 'desc', 'height' => 'auto', 'caption' => 'Статистика активных игроков', 'viewrecords' => true, 'grouping' => true, 'groupingView' => array('groupField' => array('player_name'), 'groupColumnShow' => array(true), 'groupText' => array('<b>{0}</b> Всего боев: {b}', '{0} Sum of totaly: {b}'), 'groupCollapse' => true, 'groupOrder' => array('asc'))));
$cs = Yii::app()->clientScript;
$cs->registerScript($this->getId() . 'jqGrid', "jQuery('#jqgrid').jqGrid({$options});", CClientScript::POS_READY);
$cs->registerPackage('jqGrid');
?>
	</div>
</div>
Esempio n. 7
0
<div class="row-fluid">
	<table id="jqgrid"></table>
<?php 
$cs = Yii::app()->clientScript;
$formatter = <<<FUNCF
function linkFormatter(cellvalue, options, rowObject)
{
\treturn '<a href="http://wot-news.com/index.php/stat/single/ru/'+cellvalue+'" target="_blank" style="text-decoration: underline;">'+cellvalue+'</a>'
}
FUNCF;
$cs->registerScript(__CLASS__ . $this->getId() . '2', $formatter, CClientScript::POS_READY);
$options = CJavaScript::encode(array('datatype' => 'local', 'data' => RptReport::execute('usefulness'), 'colNames' => array('Игрок', 'Проц. побед', 'Кол-во топов', '300 боев'), 'colModel' => array(array('name' => 'player_name', 'index' => 'player_name', 'width' => 140, 'align' => 'left', 'formatter' => 'js:linkFormatter'), array('name' => 'pp', 'index' => 'pp', 'width' => 100, 'align' => 'right', 'formatter' => 'number', 'sorttype' => 'number', 'firstsortorder' => 'desc'), array('name' => 'tops', 'index' => 'tops', 'width' => 100, 'align' => 'right', 'formatter' => 'integer', 'sorttype' => 'number', 'firstsortorder' => 'desc'), array('name' => 'usefulness', 'index' => 'usefulness', 'width' => 80, 'align' => 'right', 'formatter' => 'number', 'sorttype' => 'number', 'firstsortorder' => 'desc')), 'rowNum' => 1000, 'sortname' => 'dcnt', 'sortorder' => 'desc', 'height' => 'auto', 'caption' => 'Полезность 300 боев на топах', 'viewrecords' => true));
$cs->registerScript($this->getId() . 'jqGrid', "jQuery('#jqgrid').jqGrid({$options});", CClientScript::POS_READY);
$cs->registerPackage('jqGrid');
?>
</div>
Esempio n. 8
0
<table id="jqgrid"></table>
<?php 
$cs = Yii::app()->clientScript;
$cellAttr = <<<FUNC
function jqcCellattr(rowId, val, rawObject, cm, rdata) {
\tvar v=rawObject['d'+cm.name], val=rawObject[cm.name];
\tv=parseFloat(v).toFixed(0);
\tif(v>0)
\t\treturn 'style="color:green" title="'+val+' (+'+ v +')"';
\telse if(v<0)
\t\treturn 'style="color:red" title="'+val+' ('+ v +')"';
\telse
\t\treturn 'title="'+v+'"';
}
FUNC;
$formatter = <<<FUNCF
function jqcFormatter(cellvalue, options, rowObject)
{
\tif(cellvalue>0)
\t\tcellvalue='+'+cellvalue;
\tvar v=rowObject[options.colModel.name.substr(1)];
\treturn parseFloat(v).toFixed(0) +'('+cellvalue+')';
}
FUNCF;
$cs->registerScript(__CLASS__ . $this->getId() . '1', $cellAttr, CClientScript::POS_READY);
$cs->registerScript(__CLASS__ . $this->getId() . '2', $formatter, CClientScript::POS_READY);
$options = CJavaScript::encode(array('datatype' => 'local', 'data' => RptReport::execute('gloryPosition'), 'colNames' => array('Игрок', 'Дней в клане', 'Должность', 'Очки славы', 'Позиция'), 'colModel' => array(array('name' => 'player_name', 'index' => 'player_name', 'width' => 140, 'align' => 'left'), array('name' => 'days', 'index' => 'days', 'width' => 100, 'align' => 'right', 'sorttype' => 'number', 'firstsortorder' => 'desc'), array('name' => 'clan_role_name', 'index' => 'clan_role_name', 'width' => 150, 'align' => 'right'), array('name' => 'glory_points', 'index' => 'glory_points', 'width' => 80, 'align' => 'right', 'sorttype' => 'number', 'firstsortorder' => 'desc', 'cellattr' => 'js:jqcCellattr'), array('name' => 'glory_position', 'index' => 'glory_position', 'width' => 80, 'align' => 'right', 'sorttype' => 'js:function(cellValue){return cellValue == 0 ? 99999999 : Number(cellValue);}', 'cellattr' => 'js:jqcCellattr')), 'rowNum' => 1000, 'sortname' => 'glory_points', 'sortorder' => 'desc', 'height' => 'auto', 'caption' => 'Позиция славы', 'viewrecords' => true));
$cs->registerScript($this->getId() . 'jqGrid', "jQuery('#jqgrid').jqGrid({$options});", CClientScript::POS_READY);
$cs->registerPackage('jqGrid');
Esempio n. 9
0
<table id="jqgrid"></table>
<?php 
$cs = Yii::app()->clientScript;
$cellAttr = <<<FUNC
function jqcCellattr(rowId, val, rawObject, cm, rdata) {
\tvar title=rawObject['description'];\t
\treturn 'title="'+title+'"';
}
FUNC;
$cs->registerScript(__CLASS__ . $this->getId() . '1', $cellAttr, CClientScript::POS_READY);
$options = CJavaScript::encode(array('datatype' => 'local', 'data' => RptReport::execute('bestAchievments'), 'colNames' => array('Игрок', 'Медаль', 'Достижение'), 'colModel' => array(array('name' => 'player_name', 'index' => 'player_name', 'width' => 140, 'align' => 'left'), array('name' => 'name', 'index' => 'name', 'width' => 150, 'align' => 'right', 'cellattr' => 'js:jqcCellattr'), array('name' => 'max_cnt', 'index' => 'max_cnt', 'width' => 80, 'align' => 'right', 'sorttype' => 'number')), 'rowNum' => 1000, 'sortname' => 'player_name', 'sortorder' => 'asc', 'height' => 'auto', 'caption' => 'Достижения', 'viewrecords' => true));
$cs->registerScript($this->getId() . 'jqGrid', "jQuery('#jqgrid').jqGrid({$options});", CClientScript::POS_READY);
$cs->registerPackage('jqGrid');
Esempio n. 10
0
<?php

$this->widget('ext.jqgrid.JQGrid', array('options' => array('datatype' => 'local', 'data' => RptReport::execute('medals'), 'colNames' => array('Игрок', 'Мед. Кариуса', 'Мед. Халонена', 'invader', 'Мед. Фадина', 'armorPiercer', 'Мед. Елькинса', 'Гроза мышей', 'mechanicEngineer', 'heroesOfRassenay', 'medalKay', 'defender', 'medalLeClerc'), 'colModel' => array(array('name' => 'player_name', 'index' => 'player_name', 'width' => 140, 'align' => 'left'), array('name' => 'medalCarius', 'index' => 'medalCarius', 'width' => 80, 'align' => 'right', 'sorttype' => 'number'), array('name' => 'medalHalonen', 'index' => 'medalHalonen', 'width' => 80, 'align' => 'right', 'sorttype' => 'number'), array('name' => 'invader', 'index' => 'invader', 'width' => 80, 'align' => 'right', 'sorttype' => 'number'), array('name' => 'medalFadin', 'index' => 'medalFadin', 'width' => 80, 'align' => 'right', 'sorttype' => 'number'), array('name' => 'armorPiercer', 'index' => 'armorPiercer', 'width' => 80, 'align' => 'right', 'sorttype' => 'number'), array('name' => 'medalEkins', 'index' => 'medalEkins', 'width' => 80, 'align' => 'right', 'sorttype' => 'number'), array('name' => 'mousebane', 'index' => 'mousebane', 'width' => 80, 'align' => 'right', 'sorttype' => 'number'), array('name' => 'mechanicEngineer', 'index' => 'mechanicEngineer', 'width' => 80, 'align' => 'right', 'sorttype' => 'number'), array('name' => 'heroesOfRassenay', 'index' => 'heroesOfRassenay', 'width' => 80, 'align' => 'right', 'sorttype' => 'number'), array('name' => 'medalKay', 'index' => 'medalKay', 'width' => 80, 'align' => 'right', 'sorttype' => 'number'), array('name' => 'defender', 'index' => 'defender', 'width' => 80, 'align' => 'right', 'sorttype' => 'number'), array('name' => 'medalLeClerc', 'index' => 'medalLeClerc', 'width' => 80, 'align' => 'right', 'sorttype' => 'number')), 'rowNum' => 1000, 'sortname' => 'player_name', 'sortorder' => 'asc', 'height' => 'auto', 'caption' => 'Достижения', 'viewrecords' => true)));
Esempio n. 11
0
<div class="row-fluid">
	<div class="span4">
	<table id="jqgrid"></table>
<?php 
$options = CJavaScript::encode(array('datatype' => 'local', 'data' => RptReport::execute('players'), 'colNames' => array('Игрок', 'Начал играть', 'Боев', 'Проц. побед', 'Сред. опыт', 'Макс. опыт', 'Дамаг', 'РЭ', 'WN7', 'WN8'), 'colModel' => array(array('name' => 'player_name', 'index' => 'player_name', 'width' => 140, 'align' => 'left'), array('name' => 'created_at', 'index' => 'created_at', 'width' => 100, 'sorttype' => 'date', 'align' => 'right', 'formatter' => 'date', 'formatoptions' => array('srcformat' => 'Y-m-d H:i:s', 'newformat' => 'd.m.Y H:i')), array('name' => 'battles', 'index' => 'battles', 'width' => 80, 'align' => 'right', 'sorttype' => 'number', 'firstsortorder' => 'desc'), array('name' => 'wp', 'index' => 'wp', 'width' => 80, 'align' => 'right', 'sorttype' => 'number', 'formatter' => 'number', 'firstsortorder' => 'desc'), array('name' => 'battle_avg_xp', 'index' => 'battle_avg_xp', 'width' => 80, 'align' => 'right', 'sorttype' => 'number', 'firstsortorder' => 'desc'), array('name' => 'max_xp', 'index' => 'max_xp', 'width' => 80, 'align' => 'right', 'sorttype' => 'number', 'firstsortorder' => 'desc'), array('name' => 'damage', 'index' => 'damage', 'width' => 70, 'align' => 'right', 'sorttype' => 'number', 'firstsortorder' => 'desc', 'formatter' => 'number'), array('name' => 'effect', 'index' => 'effect', 'width' => 80, 'align' => 'right', 'sorttype' => 'number', 'formatter' => 'number', 'firstsortorder' => 'desc'), array('name' => 'wn7', 'index' => 'wn7', 'width' => 80, 'align' => 'right', 'sorttype' => 'number', 'formatter' => 'number', 'firstsortorder' => 'desc'), array('name' => 'wn8', 'index' => 'wn8', 'width' => 80, 'align' => 'right', 'sorttype' => 'number', 'formatter' => 'number', 'firstsortorder' => 'desc')), 'rowNum' => 1000, 'sortname' => 'player_name', 'sortorder' => 'asc', 'height' => 'auto', 'caption' => 'Игроки клана', 'viewrecords' => true));
$cs = Yii::app()->clientScript;
$cs->registerScript($this->getId() . 'jqGrid', "jQuery('#jqgrid').jqGrid({$options});", CClientScript::POS_READY);
$cs->registerPackage('jqGrid');
?>
	</div>
</div>
Esempio n. 12
0
 public function actionPlayertankdata($playerId, $date)
 {
     echo json_encode(RptReport::execute('playerProgressTanks', array('player_id' => $playerId, 'date' => $date)));
 }
Esempio n. 13
0
<div class="row-fluid">
	<table id="jqgrid"></table>
<?php 
$cs = Yii::app()->clientScript;
$formatter = <<<FUNCF
function linkFormatter(cellvalue, options, rowObject)
{
\treturn '<a href="http://wot-news.com/index.php/stat/single/ru/'+cellvalue+'" target="_blank" style="text-decoration: underline;">'+cellvalue+'</a>'
}
FUNCF;
$cs->registerScript(__CLASS__ . $this->getId() . '2', $formatter, CClientScript::POS_READY);
$options = CJavaScript::encode(array('datatype' => 'local', 'data' => RptReport::execute('members'), 'colNames' => array('Игрок', 'Начал играть', 'Дней в клане', 'Должность', 'Неакт. дней'), 'colModel' => array(array('name' => 'player_name', 'index' => 'player_name', 'width' => 140, 'align' => 'left', 'formatter' => 'js:linkFormatter'), array('name' => 'created_at', 'index' => 'created_at', 'width' => 100, 'sorttype' => 'date', 'align' => 'right', 'formatter' => 'date', 'formatoptions' => array('srcformat' => 'Y-m-d H:i:s', 'newformat' => 'd.m.Y')), array('name' => 'dcnt', 'index' => 'dcnt', 'width' => 100, 'align' => 'right', 'sorttype' => 'number', 'firstsortorder' => 'desc'), array('name' => 'clan_role_name', 'index' => 'clan_role_name', 'width' => 140, 'align' => 'right', 'firstsortorder' => 'desc'), array('name' => 'inactivity', 'index' => 'inactivity', 'width' => 80, 'align' => 'right', 'sorttype' => 'number', 'firstsortorder' => 'desc')), 'rowNum' => 1000, 'sortname' => 'dcnt', 'sortorder' => 'desc', 'height' => 'auto', 'caption' => 'Игроки клана', 'viewrecords' => true));
$cs = Yii::app()->clientScript;
$cs->registerScript($this->getId() . 'jqGrid', "jQuery('#jqgrid').jqGrid({$options});", CClientScript::POS_READY);
$cs->registerPackage('jqGrid');
?>

</div>