<?php 
use yii\helpers\Arrayhelper;
use modules\custom\models\Contacts;
$name1 = ArrayHelper::map(Contacts::find()
		->where(['not', ['is', '_id', null]] )
		->andfilterwhere(['accountid' => $model->company])
		->andfilterWhere(['=','contacttype','Primary Contact'])
		->orderby('firstname ASC')->all(),'_id', 'fullname');
?>
<table class="table table-condensed table-bordered">
    <thead>
        <tr>
            <th class="font-weight-bold">Contact Name</th>
            <th class="font-weight-bold">Contact Number</th>
            <th class="font-weight-bold">Contact E-mail</th>
        </tr>
    </thead>
    <tr>
        <td> <?= $form->field($model, 'contact')->dropdownlist($name1, ['id' => 'contact1', 'prompt' => 'Please Select'])->label(false);?>
        </td>

        <td><?= $form->field($model, 'contactno')->textInput(['id' => 'contactno'])->label(false) ?></td>
        <td><?= $form->field($model, 'contactemail')->textInput(['id' => 'contactemail'])->label(false) ?></td>
    </tr>
    <tr>
        <td> <?= $form->field($model, 'contact2')->dropdownlist($name1, ['id' => 'contact2', 'prompt' => 'Please Select'])->label(false);?>
        </td>

        <td><?= $form->field($model, 'contactno2')->textInput(['id' => 'contactno2'])->label(false) ?></td>
        <td><?= $form->field($model, 'contactemail2')->textInput(['id' => 'contactemail2'])->label(false) ?>
        </td>
    </tr>
    <tr>
        <td> <?= $form->field($model, 'contact3')->dropdownlist($name1, ['id' => 'contact3', 'prompt' => 'Please Select'])->label(false);?>
        </td>
        <td><?= $form->field($model, 'contactno3')->textInput(['id' => 'contactno3'])->label(false) ?></td>
        <td><?= $form->field($model, 'contactemail3')->textInput(['id' => 'contactemail3'])->label(false) ?>
        </td>
    </tr>
    <tr>
        <td> <?= $form->field($model, 'contact4')->dropdownlist($name1, ['id' => 'contact4', 'prompt' => 'Please Select'])->label(false);?>
        </td>
        <td><?= $form->field($model, 'contactno4')->textInput(['id' => 'contactno4'])->label(false) ?></td>
        <td><?= $form->field($model, 'contactemail4')->textInput(['id' => 'contactemail4'])->label(false) ?>
        </td>
    </tr>
    <tr>
        <td> <?= $form->field($model, 'contact5')->dropdownlist($name1, ['id' => 'contact5', 'prompt' => 'Please Select'])->label(false);?>
        </td>
        <td><?= $form->field($model, 'contactno5')->textInput(['id' => 'contactno5'])->label(false) ?></td>
        <td><?= $form->field($model, 'contactemail5')->textInput(['id' => 'contactemail5'])->label(false) ?>
        </td>
    </tr>
    <tr>
        <td> <?= $form->field($model, 'contact6')->dropdownlist($name1, ['id' => 'contact6', 'prompt' => 'Please Select'])->label(false);?>
        </td>
        <td><?= $form->field($model, 'contactno6')->textInput(['id' => 'contactno6'])->label(false) ?></td>
        <td><?= $form->field($model, 'contactemail6')->textInput(['id' => 'contactemail6'])->label(false) ?>
        </td>
    </tr>
    <tr>
        <td> <?= $form->field($model, 'contact7')->dropdownlist($name1, ['id' => 'contact7', 'prompt' => 'Please Select'])->label(false);?>
        </td>
        <td><?= $form->field($model, 'contactno7')->textInput(['id' => 'contactno7'])->label(false) ?></td>
        <td><?= $form->field($model, 'contactemail7')->textInput(['id' => 'contactemail7'])->label(false) ?>
        </td>
    </tr>
    <tr>
        <td> <?= $form->field($model, 'contact8')->dropdownlist($name1, ['id' => 'contact8', 'prompt' => 'Please Select'])->label(false);?>
        </td>
        <td><?= $form->field($model, 'contactno8')->textInput(['id' => 'contactno8'])->label(false) ?></td>
        <td><?= $form->field($model, 'contactemail8')->textInput(['id' => 'contactemail8'])->label(false) ?>
        </td>
    </tr>
    <tr>
        <td> <?= $form->field($model, 'contact9')->dropdownlist($name1, ['id' => 'contact9', 'prompt' => 'Please Select'])->label(false);?>
        </td>
        <td><?= $form->field($model, 'contactno9')->textInput(['id' => 'contactno9'])->label(false) ?></td>
        <td><?= $form->field($model, 'contactemail9')->textInput(['id' => 'contactemail9'])->label(false) ?>
        </td>
    </tr>
    <tr>
        <td> <?= $form->field($model, 'contact10')->dropdownlist($name1, ['id' => 'contact10', 'prompt' => 'Please Select'])->label(false);?>
        </td>
        <td><?= $form->field($model, 'contactno10')->textInput(['id' => 'contactno10'])->label(false) ?></td>
        <td><?= $form->field($model, 'contactemail10')->textInput(['id' => 'contactemail10'])->label(false) ?>
        </td>
    </tr>

</table>