<?php
/**
 * Configuration Controller – GForce Module
 *
 * @category    PortalPeople
 * @package     GForce
 * @author      Portal People Development Team
 * @copyright   Copyright (c) 2026 Portal People (https://portalpeople.co.uk)
 */

namespace PortalPeople\gforce\controllers;

use Yii;
use yii\web\Controller;
use yii\web\Response;
use yii\filters\VerbFilter;
use yii\filters\AccessControl;
use PortalPeople\gforce\models\ConfigForm;

/**
 * AdminController
 *
 * Provides a web UI for managing GForce module settings and testing
 * the API connection.
 */
class AdminController extends Controller
{

    public function actionDispatched() {
        $cart = \PortalPeople\gforce\models\Cart::find()->where(['id' => Yii::$app->request->get('id')])->one();
        $cart->Dispatched($cart, Yii::$app->request->get('date', date('Y/m/d H:i:s')));
    }
    public function actionArrived() {
        $cart = \PortalPeople\gforce\models\Cart::find()->where(['id' => Yii::$app->request->get('id')])->one();
        $cart->MarkDelivered($cart, Yii::$app->request->get('date', date('Y/m/d H:i:s')));
    }

}
