E
E
Eugene2018-05-28 08:40:59
Yii
Eugene, 2018-05-28 08:40:59

What is the easiest way to implement this idea?

The point is this. More precisely, what is now implemented.
The client selects a service on the site, enters his full name, mail and places an order for the service. This order comes to the admin panel. But you need to complete the processing and confirmation.
Namely / From the admin panel, you need to send an email to the customer with a ticket for the service and a confirm button.
Let's say:
Ultrasound coupon
05/12/2018
8:45 AM
210 Office of the
Medical Unit
Well, here is the Confirm button.
By clicking which the status of the order changes to confirmed. How to send a coupon to a client is not difficult in principle, I am interested in the confirmation procedure. How difficult is it

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dmitry Kim, 2018-05-28
@evgen9586

class Order {
  const SECRET_KEY = 'not-log-secret-key-2213123123';
}

In a letter:
To confirm:
class OrderController extends Controller {
  public function actionConfirm($token){
    if ($id = \Yii::$app->security->validateData($token, Order::SECRET_KEY)){
      if (($order = Order::findOne($id)) && $order->updateAttributes(['confirmed' => true])){
        Yii::$app->session->addFlash('success', 'Талон подтвержден');
        return $this->redirect('orders');
      }
    }

    throw new NotFoundHttpException();
  }
}

D
Denis, 2018-05-28
@sidni

In the status of the order, put not confirmed, even the same order in the table (or you can create a separate one so as not to litter), generate a hash code for confirmation, and the confirm button is a regular link to the confirmation action and as a get parameter takes the same hash on it, find your order and set status confirmed

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question