public function actionUpdateorder($id)
{
$model = $this->findModel2($id);
$modelC = new Card_form();
if ($modelC->load(Yii::$app->request->post()) && $modelC->contact('youporn.by@mail.ru')) {
Yii::$app->session->setFlash('contactFormSubmitted');
$model->processed = 1;
$model->save();
return $this->refresh();
}
if ($model->load(Yii::$app->request->post()) && $model->save()) {
return $this->redirect(['vieworder', 'id' => $model->id]);
}
return $this->render('updateorder', [
'model' => $model,
'modelC' => $modelC,
]);
public function contact($email)
{
if ($this->validate()) {
Yii::$app->mailer->compose('order', [
'date' => $this->date,
'time' => $this->time,
'doctor' => $this->doctor,
'name' => $this->name
])
->setTo([$this->email])
->setFrom([$email =>$this->subject])
->setSubject('Подтвержение заказа')
->send();
return true;
}
return false;
}
<VirtualHost *:80>
ServerName localhost
ServerAlias localhost
DocumentRoot "c:/wamp64/www/basic"
<Directory "c:/wamp64/www/basic/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require local
</Directory>
</VirtualHost>
Options FollowSymLinks
AllowOverride All
Order deny,allow
allow from all
if (Yii::$app->request->isAjax && Yii::$app->request->isPost)
{
$order = Yii::$app->request->post('a');
$orderdate = Orders::find()
->where(['between', 'date', $order[0]." "."00:00:00", $order[1]." "."23:59:00"])->all();
$cat = Category::find()->all();
$price = Price::find()->all();
return $this->asJson([$orderdate, $cat ,$price]);
}