index.php 3.93 KB
<?php

use app\assets\MainAsset;
use app\models\Host;

$this->title = Yii::$app->name.' - Home';
MainAsset::register($this);

/*echo '<pre>';
print_r($statistics);
echo '</pre>';
*/
?>
<h2>Statistics</h2>
<dl class="dl-horizontal">
	<dt>Datatime of CSV-file </dt>
	<dd><?php echo $statistics['csv_date']; ?></dd>
</dl>

<?php
$domain_count = [
    Host::STATUS_WIS_NONE=>[0,0],
    Host::STATUS_WIS_FREE=>[0,0],
    Host::STATUS_WIS_BUSY=>[0,0]
];
foreach($statistics['whois_status'] as $st_value)
    $domain_count[$st_value['wis_status']][(int)$st_value['status']] = (int)$st_value['cnt'];
unset($st_value);
?>
<h2>WHO IS</h2>
<div class="table-responsive">
	<table class="table table-bordered table-hover table-striped">
		<tr>
			<th width="40%">Status WhoIs checked</th>
			<th width="20%">Count of Disabled</th>
			<th width="20%">Count of Enabled</th>
			<th width="20%">Count of All</th>
		</tr>
		<tr>
			<td>No checked</td>
			<td><?php echo $domain_count[Host::STATUS_WIS_NONE][0]; ?></td>
			<td><?php echo $domain_count[Host::STATUS_WIS_NONE][1]; ?></td>
			<td><?php echo $domain_count[Host::STATUS_WIS_NONE][0]+$domain_count[Host::STATUS_WIS_NONE][1]; ?></td>
		</tr>
		<tr>
			<td>Busy</td>
			<td><?php echo $domain_count[Host::STATUS_WIS_BUSY][0]; ?></td>
			<td><?php echo $domain_count[Host::STATUS_WIS_BUSY][1]; ?></td>
			<td><?php echo $domain_count[Host::STATUS_WIS_BUSY][0]+$domain_count[Host::STATUS_WIS_BUSY][1]; ?></td>
		</tr>
		<tr>
			<td>Free</td>
			<td><?php echo $domain_count[Host::STATUS_WIS_FREE][0]; ?></td>
			<td><?php echo $domain_count[Host::STATUS_WIS_FREE][1]; ?></td>
			<td><?php echo $domain_count[Host::STATUS_WIS_FREE][0]+$domain_count[Host::STATUS_WIS_FREE][1]; ?></td>
		</tr>
		<tr>
			<th class="text-right">All count</th>
			<td><?php echo $domain_count[Host::STATUS_WIS_NONE][0]+$domain_count[Host::STATUS_WIS_BUSY][0]+$domain_count[Host::STATUS_WIS_FREE][0]; ?></td>
			<td><?php echo $domain_count[Host::STATUS_WIS_NONE][1]+$domain_count[Host::STATUS_WIS_BUSY][1]+$domain_count[Host::STATUS_WIS_FREE][1]; ?></td>
			<td><?php
				echo $domain_count[Host::STATUS_WIS_NONE][0]+$domain_count[Host::STATUS_WIS_NONE][1]+
					 $domain_count[Host::STATUS_WIS_BUSY][0]+$domain_count[Host::STATUS_WIS_BUSY][1]+
					 $domain_count[Host::STATUS_WIS_FREE][0]+$domain_count[Host::STATUS_WIS_FREE][1];
				?></td>
		</tr>
	</table>
</div>


<?php
$domain_count = [
    Host::STATUS_TIX_UNCHECK=>[0,0],
    Host::STATUS_TIX_CHECK=>[0,0],
];

foreach($statistics['itx_status'] as $st_value)
    $domain_count[$st_value['tix_status']][(int)$st_value['status']] = (int)$st_value['cnt'];
unset($st_value);
?>
<h2>TIX</h2>
<div class="table-responsive">
	<table class="table table-bordered table-hover table-striped">
		<tr>
			<th width="40%">Status TIX checked</th>
			<th width="20%">Count of Disabled</th>
			<th width="20%">Count of Enabled</th>
			<th width="20%">Count of All</th>
		</tr>
		<tr>
			<td>No checked</td>
			<td><?php echo $domain_count[Host::STATUS_TIX_UNCHECK][0]; ?></td>
			<td><?php echo $domain_count[Host::STATUS_TIX_UNCHECK][1]; ?></td>
			<td><?php echo $domain_count[Host::STATUS_TIX_UNCHECK][0]+$domain_count[Host::STATUS_TIX_UNCHECK][1]; ?></td>
		</tr>
		<tr>
			<td>Checked</td>
			<td><?php echo $domain_count[Host::STATUS_TIX_CHECK][0]; ?></td>
			<td><?php echo $domain_count[Host::STATUS_TIX_CHECK][1]; ?></td>
			<td><?php echo $domain_count[Host::STATUS_TIX_CHECK][0]+$domain_count[Host::STATUS_TIX_CHECK][1]; ?></td>
		</tr>
		<tr>
			<th class="text-right">All count</th>
			<td><?php echo $domain_count[Host::STATUS_TIX_UNCHECK][0]+$domain_count[Host::STATUS_TIX_CHECK][0]; ?></td>
			<td><?php echo $domain_count[Host::STATUS_TIX_UNCHECK][1]+$domain_count[Host::STATUS_TIX_CHECK][1]; ?></td>
			<td><?php
				echo $domain_count[Host::STATUS_TIX_UNCHECK][0]+$domain_count[Host::STATUS_TIX_UNCHECK][1]+
                     $domain_count[Host::STATUS_TIX_CHECK][0]+$domain_count[Host::STATUS_TIX_CHECK][1];
				?></td>
		</tr>
	</table>
</div>