This project does not seem to handle request data directly as such no vulnerable execution paths were found.
include
, or for example
via PHP's auto-loading mechanism.
These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
2 | |||
3 | /** |
||
4 | * @var \yii\web\View |
||
5 | * @var $model \hipanel\modules\finance\forms\ServerTariffForm |
||
6 | */ |
||
7 | use hipanel\helpers\Url; |
||
8 | use hipanel\widgets\Box; |
||
9 | use hipanel\widgets\Pjax; |
||
10 | use yii\bootstrap\ActiveForm; |
||
11 | use yii\helpers\Html; |
||
12 | |||
13 | ?> |
||
14 | |||
15 | <?php |
||
16 | Pjax::begin(['id' => 'tariff-pjax-container']); |
||
17 | $form = ActiveForm::begin([ |
||
18 | 'id' => 'tariff-create-form', |
||
19 | 'action' => $action, |
||
20 | ]); |
||
21 | $i = 0; |
||
22 | ?> |
||
23 | |||
24 | <?php Box::begin(['options' => ['class' => 'box-solid']]) ?> |
||
25 | <div class="row"> |
||
26 | <div class="col-md-12 no"> |
||
27 | <?= Html::submitButton(Yii::t('hipanel', 'Save'), ['class' => 'btn btn-success']) ?> |
||
28 | <?= Html::button(Yii::t('hipanel', 'Cancel'), ['class' => 'btn btn-default', 'onclick' => 'history.go(-1)']) ?> |
||
29 | </div> |
||
30 | </div> |
||
31 | <?php Box::end() ?> |
||
32 | |||
33 | <?php Box::begin() ?> |
||
34 | <div class="row"> |
||
35 | <div class="col-md-12"> |
||
36 | <?= Html::activeHiddenInput($model, 'id') ?> |
||
37 | <?= Html::activeHiddenInput($model, 'parent_id') ?> |
||
38 | <?= $form->field($model, 'parent_id')->widget(\hipanel\modules\finance\widgets\TariffCombo::class, [ |
||
39 | 'tariffType' => $model->getTariff()->type, |
||
0 ignored issues
–
show
|
|||
40 | 'inputOptions' => [ |
||
41 | 'id' => 'tariff-parent_id', |
||
42 | 'data-url' => Url::current(['parent_id' => null]), |
||
43 | 'readonly' => isset($model->id), |
||
44 | ], |
||
45 | ]); ?> |
||
46 | <?= $form->field($model, 'name') ?> |
||
47 | <?= $form->field($model, 'note') ?> |
||
48 | <?= $form->field($model, 'label') ?> |
||
49 | </div> |
||
50 | </div> |
||
51 | <?php Box::end() ?> |
||
52 | |||
53 | <?php if (isset($model->parentTariff)): ?> |
||
54 | <div class="row"> |
||
55 | <?php if (!empty($model->getHardwareResources())) : ?> |
||
56 | <div class="col-md-4"> |
||
57 | <?php Box::begin(['title' => Yii::t('hipanel:finance:tariff', 'Hardware')]) ?> |
||
58 | <table class="table table-condensed"> |
||
59 | <thead> |
||
60 | <tr> |
||
61 | <th><?= Yii::t('hipanel:finance:tariff', 'Resource') ?></th> |
||
62 | <th><?= Yii::t('hipanel:finance:tariff', 'Model') ?></th> |
||
63 | <th><?= Yii::t('hipanel:finance:tariff', 'Price per period') ?></th> |
||
64 | </tr> |
||
65 | </thead> |
||
66 | <tbody> |
||
67 | View Code Duplication | <?php foreach ($model->getHardwareResources() as $resource) : ?> |
|
68 | <tr> |
||
69 | <td><?= $resource->decorator()->displayTitle() ?></td> |
||
70 | <td><?= $resource->decorator()->displayPrepaidAmount() ?></td> |
||
71 | <td> |
||
72 | <?= Html::activeHiddenInput($resource, "[$i]object_id", [ |
||
73 | 'value' => $resource->realObjectId(), |
||
74 | ]) ?> |
||
75 | <?= Html::activeHiddenInput($resource, "[$i]type") ?> |
||
76 | <?= \hipanel\modules\finance\widgets\ResourcePriceInput::widget([ |
||
77 | 'basePrice' => $model->getParentHardwareResource($resource->object_id)->fee, |
||
78 | 'activeField' => $form->field($resource, "[$i]fee"), |
||
79 | ]) ?> |
||
80 | </td> |
||
81 | </tr> |
||
82 | <?php ++$i; ?> |
||
83 | <?php endforeach ?> |
||
84 | </tbody> |
||
85 | </table> |
||
86 | <?php Box::end() ?> |
||
87 | </div> |
||
88 | <?php endif ?> |
||
89 | <div class="col-md-8"> |
||
90 | <?php Box::begin(['title' => Yii::t('hipanel:finance:tariff', 'Resources')]) ?> |
||
91 | <table class="table table-condensed"> |
||
92 | <thead> |
||
93 | <tr> |
||
94 | <th><?= Yii::t('hipanel:finance:tariff', 'Resource') ?></th> |
||
95 | <th><?= Yii::t('hipanel:finance:tariff', 'Unit') ?></th> |
||
96 | <th><?= Yii::t('hipanel:finance:tariff', 'Price per period') ?></th> |
||
97 | <th><?= Yii::t('hipanel:finance:tariff', 'Prepaid amount') ?></th> |
||
98 | <th><?= Yii::t('hipanel:finance:tariff', 'Overuse price') ?></th> |
||
99 | </tr> |
||
100 | </thead> |
||
101 | <tbody> |
||
102 | <?php foreach ($model->getOrFakeOveruseResources() as $resource) : ?> |
||
103 | <tr> |
||
104 | <?php $baseResource = $model->getParentOveruseResource($resource->type_id) ?> |
||
105 | <td><?= $resource->decorator()->displayTitle() ?></td> |
||
106 | <td> |
||
107 | <?= \hipanel\modules\finance\widgets\ResourceUnitWidget::widget([ |
||
108 | 'activeField' => $form->field($resource, "[$i]unit")->label(false), |
||
109 | 'resource' => $resource, |
||
110 | ]) ?> |
||
111 | </td> |
||
112 | <td style="width: 20%"> |
||
113 | <?= Html::activeHiddenInput($resource, "[$i]object_id") ?> |
||
114 | <?= Html::activeHiddenInput($resource, "[$i]type") ?> |
||
115 | <?= \hipanel\modules\finance\widgets\ResourcePriceInput::widget([ |
||
116 | 'basePrice' => floatval($baseResource->fee), |
||
117 | 'activeField' => $form->field($resource, "[$i]fee"), |
||
118 | ]) ?> |
||
119 | </td> |
||
120 | <td> |
||
121 | <div class="row"> |
||
122 | <div class="col-md-6"> |
||
123 | <?php |
||
124 | $activeField = $form->field($resource, "[$i]quantity")->label(false); |
||
125 | |||
126 | echo \hipanel\modules\finance\widgets\PrepaidAmountWidget::widget([ |
||
127 | 'activeField' => $activeField, |
||
128 | 'resource' => $resource, |
||
129 | ]); ?> |
||
130 | </div> |
||
131 | <div class="col-md-6"> |
||
132 | <?= Html::tag('span', '', [ |
||
133 | 'class' => 'base-price text-bold', |
||
134 | 'data-original-price' => 0, //$baseResource->decorator()->getPrepaidQuantity(), |
||
135 | ]); ?> |
||
136 | </div> |
||
137 | </div> |
||
138 | <?php |
||
139 | ?> |
||
140 | </td> |
||
141 | <td> |
||
142 | <?= \hipanel\modules\finance\widgets\ResourcePriceInput::widget([ |
||
143 | 'basePrice' => $baseResource->price, |
||
144 | 'activeField' => $form->field($resource, "[$i]price"), |
||
145 | ]) ?> |
||
146 | </td> |
||
147 | </tr> |
||
148 | <?php ++$i; ?> |
||
149 | <?php endforeach; ?> |
||
150 | </tbody> |
||
151 | </table> |
||
152 | |||
153 | <?php Box::end() ?> |
||
154 | </div> |
||
155 | </div> |
||
156 | <?php endif ?> |
||
157 | |||
158 | <?php ActiveForm::end(); ?> |
||
159 | |||
160 | <?php |
||
161 | $this->registerJs(<<<'JS' |
||
162 | $('#tariff-parent_id').on('change', function () { |
||
163 | var fakeInput = $('<input>').attr({'name': 'parent_id', 'value': $(this).val()}); |
||
164 | var formAction = $(this).closest('select').attr('data-url'); |
||
165 | var fakeForm = $('<form>').attr({'method': 'get', 'action': formAction}).html(fakeInput).on('submit', function(event) { |
||
166 | $.pjax.submit(event, '#tariff-pjax-container'); |
||
167 | event.preventDefault(); |
||
168 | }).trigger('submit'); |
||
169 | }); |
||
170 | JS |
||
171 | ); |
||
172 | |||
173 | Pjax::end(); |
||
174 | ?> |
||
175 |
Since your code implements the magic getter
_get
, this function will be called for any read access on an undefined variable. You can add the@property
annotation to your class or interface to document the existence of this variable.If the property has read access only, you can use the @property-read annotation instead.
Of course, you may also just have mistyped another name, in which case you should fix the error.
See also the PhpDoc documentation for @property.