<?php use yii\helpers\Html; use kartik\widgets\ActiveForm; /* @var $this yii\web\View */ /* @var $form yii\bootstrap\ActiveForm */ /* @var $model common\models\CheckoutForm */ /* @var $info: an array with the cart information */ ?> <style> .box { float: left; width: 100%; box-sizing: border-box; padding: 20px; } .box:last-child { margin-right: 0; } .child{ float: left; width: 50%; padding: 10px; box-sizing: border-box; } .child2{ float: left; width: 30%; padding: 10px; box-sizing: border-box; } .logo{ float: left; width: 20%; padding: 10px; box-sizing: border-box; } .form-control{ width: 280px; } h2{ margin-top: 5px; margin-bottom: 5px; } </style> <div class="site-overview"> <div class="jumbotron"><h2>Your basket</h2></div><div class="container"> <?php $form = ActiveForm::begin(['validationUrl'=> ['cart/thankyou']]); foreach($info as $key=>$value){ echo ('<div class ="box">'); echo("<h2>".$key."</h2>"); echo('<div class ="child" id="ta">'); echo "<table id='myTableUser' width='100%'>"; echo "<thead>"; echo "<tr> <th >Scientific Name</th> <th >Record No.</th> <th >Type</th> </tr></thead>"; echo "<tbody>"; foreach ( $value as $item ) { echo "<tr>"; echo "<td style=\"word-wrap: break-word\">".$item['fullScientificName']."</td>"; echo "<td style=\"word-wrap: break-word\">".$item['unitID']."</td>"; echo "<td style=\"word-wrap: break-word\">".$item['sampletype']."</td>"; echo "</tr>"; } echo"</tbody></table>"; echo ('</div>'); echo ('<div class ="child2" id="comment');?> <?= $form->field($model, "comments[".$key."]",['showLabels'=>false])->textarea(['placeholder'=>'addComment', 'form-control'=>['heigth'=>'80px']])?> <?php echo('<div class="logo">'); try{ ?> <?= Html::img($value[0]['logo'], ['width'=>'100px']);?> <?php }catch(Exception $e){ echo ""; } echo ('</div></div>'); } ?> <div class="form-group" align="right" > <?= Html::submitButton('Place request', ['class' => ' btn btn-success'])?> <br/><br/> </div> <?php ActiveForm::end(); ?> </div> </div>