public function actionLogin()
{
if (!Yii::$app->user->isGuest) return $this->goHome();
$model = new LoginForm();
return ($model->load(Yii::$app->request->post()) && $model->login()) ?
$this->redirect(['/zakaz/index',]) :
$this->render('login', ['model' => $model,]);
}
public function actionIndex()
{
$searchModel = new ZakazSearch();
$dataProvider = $searchModel->search(Yii::$app->request->queryParams);
return $this->render('index', [
'searchModel' => $searchModel,
'dataProvider' => $dataProvider,
'id_user' => (!Yii::$app->user->isGuest)?Yii::$app->user->identity->id:0;
]);
}
$options = [
'login' => 'log',
'password' => 'pas',
'trace' => 1,
];
$client = new SoapClient('https://exaple/', $options);
$ap_param = array('transaction' => '1', 'data' => ['amount' => 10000, 'card_number' => '4276520014752410']);
$info = $client->__soapCall('pay', json_encode($ap_param));
$lave = array("a", "b","c", "d", "e", "f");
for($i = 0; $i < count($lave) + 1; $i++) {
if($i < count($lave)) {
echo $lave[$i] . "<br />";
}
else {
echo $i;
}
}
protected function guessColumns()
{
$models = $this->dataProvider->getModels();
$model = reset($models);
if (is_array($model) || is_object($model)) {
foreach ($model as $name => $value) {
if ($value === null || is_scalar($value) || is_callable([$value, '__toString'])) {
$this->columns[] = (string) $name;
}
}
}
}
class Zakaz extends ActiveRecord
{
public function getOtdel()
{
return $this->hasOne(Otdel::className(), ['id_sotrud' => 'id']);
}
}
class Otdel extends ActiveRecord
{
public function getOrders()
{
return $this->hasMany(Zakaz::className(), ['id' => 'id_sotrud']);
}
}
$('#signupform-region').change(function(){
if ($("select[id=signupform-city] option").size() != 0) {
$('#signupform-city').prop('disabled',false);
} else {
$('#signupform-city').prop('disabled','disabled');
}
});