Module refers to the part of the CMS "Online shop" and can be installed optionally.
The module allows the user to attach to a balance, to replenish it through payment sisetemy and spend on goods.
Module is available in the "Payment" section in the administrative part of the site.
Подключаемая часть – файл modules/balance/balance.inc.php. В нем описан класс
Balance_inc. В модуле к объекту класса можно обратиться через переменную $this->diafan->_balance
. Экземпляр класса создается при первом вызове
переменной.
float get ([integer $user_id = false]) – Возврат текущего баланса пользователя.
Example:
echo 'Your balance: $'.$this->diafan->_balance->get();
// output:
// You balance: $30
array details (integer $user_id) – Возврат информаци о плательщике.
void set (integer $user_id, float $summ, [string $type = 'summ']) – Изменение текущего баланса пользователя.
Example:
// adds the current user $300 on the balance
$this->diafan->_balance->set(0, 300, 'plus');
void pay (array $pay) – Добавление средств на баланс пользователя.
Example:
// guides the user recharge ID=4
$pay = DB::fetch_array("SELECT * FROM {payment_history} WHERE element_id=4 AND module_name='balance'");
$this->diafan->_balance->pay($pay);
View and edit user can balance the tab "Balance". Link "Add" is needed in order to add funds for the balance of the user, which is not yet on the list. Entries appear in addition to balance in the user's part.
When editing a balance of the following fields can be set.
Основные:
{balance} – Баланс пользователей
The module is located in the folder modules/balace and arranged classically.
modules/balance/admin/balance.admin.php – Редактирование баланса пользователей;
modules/balance/admin/balance.admin.config.php – Module settings;
modules/balance/balance.php – Controller;
modules/balance/balance.action.php – Processes the received data from the form;
modules/balance/balance.inc.php – Подключение модуля «Баланс пользователя»;
modules/balance/balance.install.php – Module installation;
modules/balance/balance.model.php – Модель модуля «Баланс пользователя»;
modules/balance/views/balance.view.form.php – Шаблон формы пополнения баланса пользователя;
modules/balance/views/balance.view.payment.php – Шаблон формы платежной системы;
modules/balance/views/balance.view.result.php – Шаблон подтверждения/опровержения платежа.
Methods with the same name as their class will not be constructors in a future version of PHP; Markdown_Parser has a deprecated constructor #1 include_once() called at [/var/www/diafan/data/www/diafancms.com/modules/docs/docs.model.php:499] #2 Docs_model->prepare_text( Module refers to the part of the CMS "Online shop" and can be installed optionally. The module allows the user to attach to a balance, to replenish it through payment sisetemy and spend on...) called at [/var/www/diafan/data/www/diafancms.com/modules/docs/docs.model.php:94] #3 Docs_model->show() called at [/var/www/diafan/data/www/diafancms.com/modules/docs/docs.php:29] #4 Docs->init() called at [/var/www/diafan/data/www/diafancms.com/includes/init.php:474] #5 Init->module() called at [/var/www/diafan/data/www/diafancms.com/includes/init.php:119] #6 Init->start() called at [/var/www/diafan/data/www/diafancms.com/index.php:62] | /var/www/diafan/data/www/diafancms.com/modules/docs/docs.model.php:499 |