public function actionFinish()
 {
     $cart = $this->module->getCart();
     $finisher = new CartFinisher(['cart' => $cart]);
     $finisher->run();
     $client = Client::findOne(['id' => Yii::$app->user->identity->id]);
     return $this->render('finish', ['balance' => $client->balance, 'success' => $finisher->getSuccess(), 'error' => $finisher->getError(), 'pending' => $finisher->getPending(), 'remarks' => (array) Yii::$app->getView()->params['remarks']]);
 }
Ejemplo n.º 2
0
<?php

use hipanel\modules\client\models\Client;
use yii\helpers\Url;
$client = Client::findOne(Yii::$app->user->identity->id);
if ($client->balance > 0) {
    $balanceColor = 'text-success';
} elseif ($client->balance < 0) {
    $balanceColor = 'text-danger';
} else {
    $balanceColor = 'text-muted';
}
?>

<!-- Left side column. contains the sidebar -->
<aside class="main-sidebar">
    <section class="sidebar">
        <!-- Sidebar user panel -->
        <div class="user-panel">
            <div class="pull-left image">
                <?php 
echo $this->render('//layouts/gravatar', ['size' => 45]);
?>
            </div>
            <div class="pull-left info">
                <a href="<?php 
echo Yii::$app->user->can('deposit') ? Url::to('@pay/deposit') : '#';
?>
">
                    <i class="fa fa-circle <?php 
echo $balanceColor;