Ejemplo n.º 1
0
?>
<div class="place-create">

    <h1><?php 
echo Html::encode($this->title);
?>
</h1>

    <div class="place-form">

        <?php 
$form = ActiveForm::begin();
?>
        
        <?php 
$items = ArrayHelper::map(app\models\Region::find()->all(), 'id', 'name');
echo $form->field($model, 'location_id')->dropDownList($items, ['prompt' => 'seleccione categoria']);
?>
        
        <div class="form-group">
            <?php 
echo Html::submitButton($model->isNewRecord ? 'Create' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']);
?>
        </div>

        <?php 
ActiveForm::end();
?>

    </div>
Ejemplo n.º 2
0
echo Html::activeDropDownList($model, 'country', ArrayHelper::map(app\models\Region::find()->where(['parent_id' => 0])->all(), 'id', 'name'), ['prompt' => Yii::t('app', 'Please Select'), 'onchange' => '
                            $.post( "' . Yii::$app->urlManager->createUrl('region/ajax-list-child?id=') . '"+$(this).val(), function( data ) {
                              $( "select#address-province" ).html( data );
                            });']);
echo '&nbsp;&nbsp;&nbsp;&nbsp;';
echo Html::activeDropDownList($model, 'province', $model->province ? ArrayHelper::map(app\models\Region::find()->where(['parent_id' => $model->country])->all(), 'id', 'name') : ['' => Yii::t('app', 'Please Select')], ['onchange' => '
                            $.post( "' . Yii::$app->urlManager->createUrl('region/ajax-list-child?id=') . '"+$(this).val(), function( data ) {
                              $( "select#address-city" ).html( data );
                            });']);
echo '&nbsp;&nbsp;&nbsp;&nbsp;';
echo Html::activeDropDownList($model, 'city', $model->city ? ArrayHelper::map(app\models\Region::find()->where(['parent_id' => $model->province])->all(), 'id', 'name') : ['' => Yii::t('app', 'Please Select')], ['onchange' => '
                            $.post( "' . Yii::$app->urlManager->createUrl('region/ajax-list-child?id=') . '"+$(this).val(), function( data ) {
                              $( "select#address-district" ).html( data );
                            });']);
echo '&nbsp;&nbsp;&nbsp;&nbsp;';
echo Html::activeDropDownList($model, 'district', $model->district ? ArrayHelper::map(app\models\Region::find()->where(['parent_id' => $model->city])->all(), 'id', 'name') : ['' => Yii::t('app', 'Please Select')]);
?>
                <li>
                    <label>街道地址:</label>
                    <?php 
echo Html::activeTextInput($model, 'address', ['class' => 'txt']);
?>
                </li>
                <li>
                    <label>邮编:</label>
                    <?php 
echo Html::activeTextInput($model, 'zipcode', ['class' => 'txt']);
?>
                </li>
                <li>
                    <label>联系电话:</label>
Ejemplo n.º 3
0
<?php

use yii\helpers\Html;
use yii\bootstrap\ActiveForm;
use yii\helpers\ArrayHelper;
/* @var $this yii\web\View */
$this->registerCssFile('@web/css/global.css', ['depends' => app\assets\AppAsset::className()]);
$this->registerCssFile('@web/css/checkout.css', ['depends' => app\assets\AppAsset::className()]);
$allRegion = ArrayHelper::map(app\models\Region::find()->asArray()->all(), 'id', 'name');
$totalProduct = 0;
$totalPrice = 0;
foreach ($products as $product) {
    $totalProduct += $product->number;
    $totalPrice += $product->number * $product->price;
}
$i = 0;
?>

<div id="main">
    <!-- 已登录状态 开始 -->
    <div class="user-tip cle">
        <div class="fl">Hi,<?php 
echo Yii::$app->user->identity->username;
?>
,请确认订单信息</div>
        <div class="fr"> <a class="graybtn" href="<?php 
echo Yii::$app->urlManager->createUrl(['/cart']);
?>
">返回购物车修改</a> </div>
    </div>
    <div class="form_main">