Files
arkham_calc/views/site/index.php
T

41 lines
1.3 KiB
PHP

<?php
use yii\bootstrap5\ActiveForm;
use yii\helpers\Html;
$this->title = 'Карточный ужас Аркхэма. Калькулятор вероятностей.';
?>
<div class="site-index">
<div class="body-content">
<div class="row">
<div class="col-md-6">
<h3>Параметры колоды</h3>
<?php $form = ActiveForm::begin([
'layout' => 'horizontal' ,
'class' => 'form-horizontal' ,
]); ?>
<?= $form->field($deck_form, 'size')->textInput(); ?>
<?= $form->field($deck_form, 'weapons_items')->textInput(); ?>
<?= $form->field($deck_form, 'weapons_spells')->textInput(); ?>
<?= $form->field($deck_form, 'card_prepared_to_worst')->textInput(); ?>
<?= $form->field($deck_form, 'card_backpack_0')->textInput(); ?>
<?= $form->field($deck_form, 'card_backpack_2')->textInput(); ?>
<?= $form->field($deck_form, 'card_initiate')->textInput(); ?>
<?= Html::submitButton(); ?>
<?php $form->end(); ?>
</div>
</div>
<div class="row">
<div class="col-md-6">
<ul>
<?php for ($i = 0; $i < count($result->probabilities); $i++): ?>
<li>Ход <?= ($i + 1); ?>: <?= sprintf("%.3f", $result->probabilities[$i] * 100); ?>%</li>
<?php endfor; ?>
</ul>
</div>
</div>
</div>
</div>