1. Go to this page and download the library: Download d3yii2/yii2-d3acc library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
d3yii2 / yii2-d3acc example snippets
use \d3acc\models\AcRecAcc;
use Yii;
/**
* Description of acc
*
* @author Dealer
*/
class acc
{
const MONTH_PERIOD = 1;
const PLAYER_ACC = 4;
const EXPENSES = 10;
const FOND_PLAYGROUND = 7;
acc::CODE_CRD_PLAYGROUND = 'CreditPlaygound';
/**
* get player account
* @param int $personId
* @return AcRecAcc
*/
public static function player($personId)
{
return AcRecAcc::getAcc(self::PLAYER_ACC, ['person' => $personId]);
}
/**
* get expenses account
* @return AcRecAcc
*/
public static function expenses()
{
return AcRecAcc::getAcc(self::EXPENSES);
}
/**
* get for player playground account
* @param int $personId
* @param int $playgroundId
* @return AcRecAcc
*/
public static function fondPlayground($personId, $playgroundId)
{
return AcRecAcc::getAcc(self::FOND_PLAYGROUND,
['person' => $personId, 'playground' => $playgroundId]);
}
}
use d3acc\models\AcPeriod;
$acPeriod = AcPeriod::getActivePeriod(acc::MONTH_PERIOD))
//close period
\d3acc\components\PeriodMonth::close(acc::MONTH_PERIOD);