Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Alto
/
rkn
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit ef9ee814
authored
2021-06-07 16:44:08 +0300
by
san58
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Статистика по TIX
1 parent
f695cd54
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
69 additions
and
12 deletions
controllers/SiteController.php
views/site/index.php
controllers/SiteController.php
View file @
ef9ee81
...
...
@@ -67,17 +67,22 @@ class SiteController extends Controller
{
//var_dump(Yii::$app->user->isGuest);
//var_dump(Yii::$app->user->identity);
$statistics
=
[
'csv_date'
=>
''
];
$statistics
[
'
c
_status'
]
=
(
new
yii\db\Query
())
$statistics
=
[
'csv_date'
=>
''
,
'whois_status'
=>
[],
'itx_status'
=>
[]
];
$statistics
[
'
whois
_status'
]
=
(
new
yii\db\Query
())
->
select
([
'COUNT(*) AS cnt'
,
'wis_status'
,
'status'
])
->
from
(
'{{%host}}'
)
->
groupBy
([
'wis_status'
,
'status'
])
->
all
();
$statistics
[
'itx_status'
]
=
(
new
yii\db\Query
())
->
select
([
'COUNT(*) AS cnt'
,
'tix_status'
,
'status'
])
->
from
(
'{{%host}}'
)
->
groupBy
([
'tix_status'
,
'status'
])
->
all
();
$csv
=
Host
::
find
()
->
select
([
'csv_date'
])
->
orderBy
(
'csv_date ASC'
)
->
one
();
if
(
$csv
)
{
if
(
$csv
)
$statistics
[
'csv_date'
]
=
$csv
[
'csv_date'
];
}
return
$this
->
render
(
'index'
,
[
'statistics'
=>
$statistics
]);
}
...
...
views/site/index.php
View file @
ef9ee81
...
...
@@ -10,20 +10,24 @@ MainAsset::register($this);
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_NONE
=>
[
0
,
0
],
Host
::
STATUS_WIS_FREE
=>
[
0
,
0
],
Host
::
STATUS_WIS_BUSY
=>
[
0
,
0
]
];
foreach
(
$statistics
[
'
c
_status'
]
as
$st_value
)
foreach
(
$statistics
[
'
whois
_status'
]
as
$st_value
)
$domain_count
[
$st_value
[
'wis_status'
]][(
int
)
$st_value
[
'status'
]]
=
(
int
)
$st_value
[
'cnt'
];
unset
(
$st_value
);
?>
<h3>
Statistics
</h3>
<dl
class=
"dl-horizontal"
>
<dt>
Datatime of CSV-file
</dt>
<dd>
<?php
echo
$statistics
[
'csv_date'
];
?>
</dd>
</dl>
<h2>
WHO IS
</h2>
<div
class=
"table-responsive"
>
<table
class=
"table table-bordered table-hover table-striped"
>
<tr>
...
...
@@ -54,7 +58,55 @@ unset($st_value);
<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>
<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>
\ No newline at end of file
Write
Preview
Styling with
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment