'urlManager' => [
'ruleConfig' => ['class'=>'backend\components\MyUrlManager'],
...
$pathInfo = $request->getPathInfo();
$pathInfo = rtrim(strtolower($pathInfo),'/');
<?= Html::activeLabel($model, 'password') ?>
<?= Html::activePasswordInput($model, 'password') ?>
<?= Html::error($model, 'password') ?>
or
<?= Html::activeLabel($model, 'username', ['label' => 'name']) ?>
<?= Html::activeTextInput($model, 'username') ?>
<div class="hint-block">Please enter your name</div>
<?= Html::error($model, 'username') ?>
<?php $form = ActiveForm::begin(['id' => 'contact_form']); ?>
<div class="clearfix">
<div class="form-col form-marg small fl-left">
<?= Html::activeLabel($model, 'name') ?>
<div class="field"><?= Html::activeTextInput($model, 'name', ['class'=>'form-item req']) ?></div>
<?= Html::error($model, 'name') ?>
<div class="hint-block"></div>
</div>
<div class="form-col form-marg small fl-left">
<?= Html::activeLabel($model, 'email') ?>
<div class="field"><?= Html::activeTextInput($model, 'email', ['class'=>'form-item req']) ?><div class="hint-block"></div></div>
<?= Html::error($model, 'email') ?>
<div class="hint-block"></div>
</div>
</div>
<div class="form-col">
<?= Html::activeLabel($model, 'body') ?>
<?= Html::activeTextarea($model, 'body', ['class'=>'form-item req']) ?>
<?= Html::error($model, 'body') ?>
<div class="hint-block"></div>
</div>
<div class="clearfix">
<div class="form-col form-marg small fl-left">
<?= $form->field($model, 'verifyCode')->widget(Captcha::className(), [
'captchaAction' => '/site/default/captcha',
'options' => ['class' => 'form-item req'],
'template' => '<div class="row"><div class="col-lg-3">{image}</div><div class="col-lg-9"><div class="field">{input}</div></div></div>',
]) ?>
</div>
</div>
<div class="form-btn">
<div class="field"><?= Html::submitButton(Yii::t('app', 'Отправить'), ['class' => 'btn btn-primary']) ?></div>
</div>
<?php ActiveForm::end(); ?>
server {
listen 80;
server_name 192.168.1.121;
charset utf8;
error_log /game/nginx/log/error.log;
access_log /game/nginx/log/access.log main;
#root /game/public;
location /deberc {
root /game/public;
index index.html index.htm;
}
location / {
root /game/public;
index index.html index.htm;
}
error_page 404 /404.html;
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /game/public;
}
}
user www-data;
worker_processes 4;
pid /var/run/nginx.pid;
events {
worker_connections 768;
# multi_accept on;
}
http {
##
# Basic Settings
##
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
# server_tokens off;
# server_names_hash_bucket_size 64;
# server_name_in_redirect off;
include /etc/nginx/mime.types;
default_type application/octet-stream;
##
# Logging Settings
##
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
##
# Gzip Settings
##
gzip on;
gzip_disable "msie6";
# gzip_vary on;
# gzip_proxied any;
# gzip_comp_level 6;
# gzip_buffers 16 8k;
# gzip_http_version 1.1;
# gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;
##
# nginx-naxsi config
##
# Uncomment it if you installed nginx-naxsi
##
#include /etc/nginx/naxsi_core.rules;
##
# nginx-passenger config
##
# Uncomment it if you installed nginx-passenger
##
#passenger_root /usr;
#passenger_ruby /usr/bin/ruby;
##
# Virtual Host Configs
##
include /etc/nginx/conf.d/*.conf;
#include /etc/nginx/sites-enabled/*;
}
server {
listen 80;
server_name localhost;
location /itest {
proxy_pass http://192.168.1.121;
}
location /qtest {
proxy_pass http://192.168.1.122;
}
location /ztest {
proxy_pass http://192.168.1.123;
}
}
public function relations()
{
return array(
//'rule' => array(self::HAS_MANY, 'GamesRuleModel', '', 'on'=>'t.game_id=rule.game_id'),
'proposal' => array(self::HAS_MANY, 'GameProposalModel', '', 'on'=>'t.game_id=proposal.game_id'),
'waiting' => array(self::HAS_MANY, 'GameWaitingModel', '', 'on'=>'proposal.proposal_id=waiting.proposal_id'),
);
}
$criteria->with = array(
'proposal' => array('joinType'=>'LEFT OUTER JOIN'),
'waiting.proposal',
);
$game_id = 1;
$criteria = new CDbCriteria;
$criteria->select = 't.game_id, t.game_name, t.alter_name';
$criteria->condition = "t.game_id=:game_id AND proposal.status=-1";
$criteria->params = array(':game_id'=>$game_id);
$criteria->together = true;
$criteria->with = array(
'proposal' => array('joinType'=>'LEFT OUTER JOIN'),
'waiting',
);
$data = GamesModel::model()->find($criteria);
echo '<pre>';
print_r($data);
echo '</pre>';
GamesModel Object
(
[_new:CActiveRecord:private] =>
[_attributes:CActiveRecord:private] => Array
(
[game_id] => 1
[game_name] => Клабор (Деберц)
[alter_name] => deberc
)
[_related:CActiveRecord:private] => Array
(
[proposal] => Array
(
[0] => GameProposalModel Object
(
[user_rules] =>
[waiting_rules] =>
[_new:CActiveRecord:private] =>
[_attributes:CActiveRecord:private] => Array
(
[proposal_id] => 114
[game_id] => 1
[user_id] => 234
[date] => 2014-01-13 17:10:28
[status] => -1
[rules] => [{"rule_id":"1","param":"30"},{"rule_id":"2","param":"0"},{"rule_id":"3","param":"4"},{"rule_id":"4","param":"301"},{"rule_id":"5","param":"0"}]
[hash] => 61fe96c3d7291c7c04c6fcb71b8b49de
[count_player] => 4
)
[_related:CActiveRecord:private] => Array
(
)
[_c:CActiveRecord:private] =>
[_pk:CActiveRecord:private] => 114
[_alias:CActiveRecord:private] => t
[_errors:CModel:private] => Array
(
)
[_validators:CModel:private] =>
[_scenario:CModel:private] => update
[_e:CComponent:private] =>
[_m:CComponent:private] =>
)
[1] => GameProposalModel Object
(
[user_rules] =>
[waiting_rules] =>
[_new:CActiveRecord:private] =>
[_attributes:CActiveRecord:private] => Array
(
[proposal_id] => 113
[game_id] => 1
[user_id] => 500
[date] => 2014-01-13 17:07:26
[status] => -1
[rules] => [{"rule_id":"1","param":"60"},{"rule_id":"2","param":"1"},{"rule_id":"3","param":"4"},{"rule_id":"4","param":"501"},{"rule_id":"5","param":"0"}]
[hash] => 750da4a838006f676f0e0808ded1ac74
[count_player] => 4
)
[_related:CActiveRecord:private] => Array
(
)
[_c:CActiveRecord:private] =>
[_pk:CActiveRecord:private] => 113
[_alias:CActiveRecord:private] => t
[_errors:CModel:private] => Array
(
)
[_validators:CModel:private] =>
[_scenario:CModel:private] => update
[_e:CComponent:private] =>
[_m:CComponent:private] =>
)
[2] => GameProposalModel Object
(
[user_rules] =>
[waiting_rules] =>
[_new:CActiveRecord:private] =>
[_attributes:CActiveRecord:private] => Array
(
[proposal_id] => 112
[game_id] => 1
[user_id] => 234
[date] => 2014-01-13 08:03:36
[status] => -1
[rules] => [{"rule_id":"1","param":"30"},{"rule_id":"2","param":"0"},{"rule_id":"3","param":"2"},{"rule_id":"4","param":"301"},{"rule_id":"5","param":"0"}]
[hash] => b0105dc5a8908f82cb858987ea0cac50
[count_player] => 2
)
[_related:CActiveRecord:private] => Array
(
)
[_c:CActiveRecord:private] =>
[_pk:CActiveRecord:private] => 112
[_alias:CActiveRecord:private] => t
[_errors:CModel:private] => Array
(
)
[_validators:CModel:private] =>
[_scenario:CModel:private] => update
[_e:CComponent:private] =>
[_m:CComponent:private] =>
)
)
[waiting] => Array
(
[0] => GameWaitingModel Object
(
[_new:CActiveRecord:private] =>
[_attributes:CActiveRecord:private] => Array
(
[waiting_id] => 182
[proposal_id] => 114
[user_id] => 234
[sort] => 0
[root] => 1
[hash] => 61f7b277d2cb69b7af12bc0ab90dd814
)
[_related:CActiveRecord:private] => Array
(
)
[_c:CActiveRecord:private] =>
[_pk:CActiveRecord:private] => 182
[_alias:CActiveRecord:private] => t
[_errors:CModel:private] => Array
(
)
[_validators:CModel:private] =>
[_scenario:CModel:private] => update
[_e:CComponent:private] =>
[_m:CComponent:private] =>
)
[1] => GameWaitingModel Object
(
[_new:CActiveRecord:private] =>
[_attributes:CActiveRecord:private] => Array
(
[waiting_id] => 183
[proposal_id] => 113
[user_id] => 231
[sort] => 0
[root] => 1
[hash] => 61f7b277d2cb69b7af12bc0ab90dd814
)
[_related:CActiveRecord:private] => Array
(
)
[_c:CActiveRecord:private] =>
[_pk:CActiveRecord:private] => 183
[_alias:CActiveRecord:private] => t
[_errors:CModel:private] => Array
(
)
[_validators:CModel:private] =>
[_scenario:CModel:private] => update
[_e:CComponent:private] =>
[_m:CComponent:private] =>
)
[2] => GameWaitingModel Object
(
[_new:CActiveRecord:private] =>
[_attributes:CActiveRecord:private] => Array
(
[waiting_id] => 184
[proposal_id] => 112
[user_id] => 232
[sort] => 0
[root] => 1
[hash] => 61f7b277d2cb69b7af12bc0ab90dd814
)
[_related:CActiveRecord:private] => Array
(
)
[_c:CActiveRecord:private] =>
[_pk:CActiveRecord:private] => 184
[_alias:CActiveRecord:private] => t
[_errors:CModel:private] => Array
(
)
[_validators:CModel:private] =>
[_scenario:CModel:private] => update
[_e:CComponent:private] =>
[_m:CComponent:private] =>
)
)
)
[_c:CActiveRecord:private] =>
[_pk:CActiveRecord:private] => 1
[_alias:CActiveRecord:private] => t
[_errors:CModel:private] => Array
(
)
[_validators:CModel:private] =>
[_scenario:CModel:private] => update
[_e:CComponent:private] =>
[_m:CComponent:private] =>
)
// транзакция
$data['game'] = .... findByPK($game_id);
if($data['game'])
{
$data['proposal'] = ... findByAttibutes(array(...)) ;
$data['waiting'] = ... findByAttibutes(array(...));
}
$transaction->commit();
$ik_data = array();
$ik_data['ik_co_id'] = 'мой номер кассы';
$ik_data['ik_am'] = '0.01'; // сумма платежа
$ik_data['ik_inv_st'] = 'process';
$ik_data['ik_sing'] = '';
$ik_data['ik_int'] = 'json';
$get_string = http_build_query($ik_data, '', '&');
$interkassa_contents = file_get_contents("https://sci.interkassa.com/?{$get_string}");
$interkassa_contents = json_decode($interkassa_contents, true);
print_r($interkassa_contents);
[resultCode] => 107
[resultMsg] => Parameter "ik_pm_no" is empty
$ik_data = array();
$ik_data['ik_co_id'] = 'мой номер кассы';
$ik_data['ik_pm_no'] = '81';
$ik_data['ik_am'] = '0.01'; // сумма платежа
$ik_data['ik_pw_via'] = 'visa_liqpay_merchant_eur';
$ik_data['ik_desc'] = '';
$ik_data['ik_cur'] = 'eur';
$ik_data['ik_act'] = 'process';
$ik_data['ik_act'] = 'process';
$ik_data['ik_int'] = 'json';
foreach ($_POST as $key => $value) {
if (!preg_match('/ik_/', $key)) {
continue;
}
$data[$key] = $value;
}
...