COVID-19 Live Statistics

xF2 Add-on COVID-19 Live Statistics 2.0.1

No permission to download
E

ESXFBOT

Guest
DareDevil submitted a new resource:

COVID-19 Live Statistics 2.0.0 - Displays COVID-19 virus information.

View attachment 15057
COVID-19 Live Statistics. It was about self-isolation. Therefore, the plugin for xenforo is connected with this very topic.
Live statistics tracking the number of confirmed cases that recovered and died across the country or the world in connection with COVID-19.

Widgets : Screenshots : If you want to thank the author :
View attachment 15058
View attachment 15059

Read more about this resource...
 

lagrace

Member
Registered
Joined
Feb 21, 2020
Messages
9
Points
3

Reputation:

hello error
La
Code:
XF\Db\Exception: MySQL query error [1264]: Out of range value for column 'active' at row 1 in src\XF\Db\AbstractStatement.php at line 228
XF\Db\AbstractStatement->getException() in src\XF\Db\Mysqli\Statement.php at line 196
XF\Db\Mysqli\Statement->getException() in src\XF\Db\Mysqli\Statement.php at line 77
XF\Db\Mysqli\Statement->execute() in src\XF\Db\AbstractAdapter.php at line 94
XF\Db\AbstractAdapter->query() in src\XF\Db\AbstractAdapter.php at line 218
XF\Db\AbstractAdapter->insert() in src\XF\Mvc\Entity\Entity.php at line 1463
XF\Mvc\Entity\Entity->_saveToSource() in src\XF\Mvc\Entity\Entity.php at line 1195
XF\Mvc\Entity\Entity->save() in src\addons\Groot\Covid19\Repository\Covid19Countries.php at line 64
Groot\Covid19\Repository\Covid19Countries->fetchCountriesData() in src\addons\Groot\Covid19\Setup.php at line 26
Groot\Covid19\Setup->install() in src\XF\Admin\Controller\AddOn.php at line 398
XF\Admin\Controller\AddOn->actionInstall() in src\XF\Mvc\Dispatcher.php at line 350
XF\Mvc\Dispatcher->dispatchClass() in src\XF\Mvc\Dispatcher.php at line 257
XF\Mvc\Dispatcher->dispatchFromMatch() in src\XF\Mvc\Dispatcher.php at line 113
XF\Mvc\Dispatcher->dispatchLoop() in src\XF\Mvc\Dispatcher.php at line 55
XF\Mvc\Dispatcher->run() in src\XF\App.php at line 2190
XF\App->run() in src\XF.php at line 391
XF::runApp() in admin.php at line 13
 

Mr.FLo

Collaborate
Collaborate
Registered
Joined
Sep 3, 2019
Messages
3
Points
3

Reputation:

I can't fix it yet. I will be without a PC for a couple of days. You can manually change the 'active' column in the DB from int to float
 

Rooted

New member
Registered
Joined
May 10, 2020
Messages
2
Points
3

Reputation:

@thomsa It works.
Edit this file \src\addons\Groot\Covid19\setup.php
Replace with this:
PHP:
<?php

namespace Groot\Covid19;

use Groot\Covid19\Repository\{Covid19, Covid19Countries};
use XF\AddOn\AbstractSetup;
use XF\Db\Schema\Alter;
use XF\Db\Schema\Create;

class Setup extends AbstractSetup
{
    public function install(array $stepParams = [])
    {
        $sm = $this->schemaManager();

        foreach ($this->getTables() AS $tableName => $closure) {
            $sm->createTable($tableName, $closure);
        }

        /** @var Covid19 $globalCovid19Repo */
        $globalCovid19Repo = $this->app->repository('Groot\Covid19:Covid19');
        $globalCovid19Repo->fetchGlobalData();

        /** @var Covid19Countries $countriesCovid19Repo */
        $countriesCovid19Repo = $this->app->repository('Groot\Covid19:Covid19Countries');
        $countriesCovid19Repo->fetchCountriesData();

    }

    public function upgrade(array $stepParams = [])
    {
        $sm = $this->schemaManager();

        $sm->alterTable('groot_covid19_global', function (Alter $table)
        {
            $table->changeColumn('active')->resetDefinition()->type('float');
        });

        $sm->alterTable('groot_covid19_countries', function (Alter $table)
        {
            $table->changeColumn('active')->resetDefinition()->type('float');
        });
    }

    public function uninstall(array $stepParams = [])
    {
        $sm = $this->schemaManager();

        foreach (array_keys($this->getTables()) AS $tableName) {
            $sm->dropTable($tableName);
        }
    }

    // ############################# TABLE / DATA DEFINITIONS ##############################

    protected function getTables()
    {
        $tables = [];

        $tables['groot_covid19_global'] = function(Create $table)
        {
            $table->addColumn('id', 'mediumint')->autoIncrement();
            $table->addColumn('cases','int')->setDefault(0);
            $table->addColumn('todayCases','int')->setDefault(0);
            $table->addColumn('deaths','int')->setDefault(0);
            $table->addColumn('todayDeaths','int')->setDefault(0);
            $table->addColumn('recovered','int')->setDefault(0);
            $table->addColumn('active','float')->setDefault(0);
            $table->addColumn('critical','int')->setDefault(0);
            $table->addColumn('casesPerOneMillion','int')->setDefault(0);
            $table->addColumn('deathsPerOneMillion','int')->setDefault(0);
            $table->addColumn('tests','int')->setDefault(0);
            $table->addColumn('testsPerOneMillion','int')->setDefault(0);
            $table->addColumn('affectedCountries','int')->setDefault(0);
            $table->addColumn('updated','int')->setDefault(0);
        };

        $tables['groot_covid19_countries'] = function(Create $table)
        {
            $table->addColumn('id', 'mediumint')->autoIncrement();
            $table->addColumn('country','varchar', 70);
            $table->addColumn('iso2','varchar', 10);
            $table->addColumn('iso3','varchar', 10);
            $table->addColumn('flag','varchar', 100);
            $table->addColumn('cases','int')->setDefault(0);
            $table->addColumn('todayCases','int')->setDefault(0);
            $table->addColumn('deaths','int')->setDefault(0);
            $table->addColumn('todayDeaths','int')->setDefault(0);
            $table->addColumn('recovered','int')->setDefault(0);
            $table->addColumn('active','float')->setDefault(0);
            $table->addColumn('critical','int')->setDefault(0);
            $table->addColumn('casesPerOneMillion','int')->setDefault(0);
            $table->addColumn('deathsPerOneMillion','int')->setDefault(0);
            $table->addColumn('tests','int')->setDefault(0);
            $table->addColumn('testsPerOneMillion','int')->setDefault(0);
            $table->addColumn('continent','varchar', 25)->setDefault(0);
            $table->addColumn('updated','int')->setDefault(0);
            $table->addPrimaryKey('id');
        };
        return $tables;
    }
}
 
Top