<div class="row">
<div class="panel panel-default">
<div class="panel-heading"><h4><i class="glyphicon glyphicon-envelope"></i>Pickup Points</h4></div>
<div class="panel-body">
<?php DynamicFormWidget::begin([
'widgetContainer' => 'dynamicform_wrapper', // required: only alphanumeric characters plus "_" [A-Za-z0-9_]
'widgetBody' => '.container-items', // required: css class selector
'widgetItem' => '.item', // required: css class
'limit' => 5, // the maximum times, an element can be cloned (default 999)
'min' => 1, // 0 or 1 (default 1)
'insertButton' => '.add-item', // css class
'deleteButton' => '.remove-item', // css class
'model' => $modelsChild[0],
'formId' => 'dynamic-form',
'formFields' => [
'pickup_Name',
'Pickup_Address',
'pickup_lat',
'pickup_long',
'pickup_Datetime',
'pickup_Mobileno',
],
]); ?>
<div class="container-items"><!-- widgetContainer -->
<?php foreach ($modelsChild as $i => $modelChild): ?>
<div class="item panel panel-default"><!-- widgetBody -->
<div class="panel-heading">
<h3 class="panel-title pull-left">Pickup Points</h3>
<div class="pull-right">
<button type="button" class="add-item btn btn-success btn-xs"><i class="glyphicon glyphicon-plus"></i></button>
<button type="button" class="remove-item btn btn-danger btn-xs"><i class="glyphicon glyphicon-minus"></i></button>
</div>
<div class="clearfix"></div>
</div>
<div class="panel-body">
<?php
// necessary for update action.
if (! $modelChild->isNewRecord) {
echo Html::activeHiddenInput($modelChild, "[{$i}]Load_ID");
}
?>
<div class="row">
<div class="col-sm-12">
<?= $form->field($modelChild, "[{$i}]pickup_Name")->textInput(['maxlength' => true]) ?>
</div>
</div>
<div class="row">
<div class="col-sm-6">
<?= $form->field($modelChild, "[{$i}]Pickup_Address")->textInput(['maxlength' => true]) ?>
</div>
<div class="col-sm-6">
<?= $form->field($modelChild, "[{$i}]pickup_lat")->textInput(['maxlength' => true]) ?>
</div>
</div>
<div class="row">
<div class="col-sm-6">
<?= $form->field($modelChild, "[{$i}]pickup_long")->textInput(['maxlength' => true]) ?>
</div>
<div class="col-sm-6">
<?php
echo $form->field($modelChild, "[{$i}]pickup_Datetime")->widget(DatePicker::classname(), [
'options' => ['placeholder' => 'Please enter employment end date'],
'pluginOptions' => [
'autoclose'=>true,
'format' => 'dd/mm/yyyy'
]
]);
?>
<?php $form->field($modelChild, "[{$i}]pickup_Datetime")->textInput(['maxlength' => true]) ?>
</div>
</div>
<div class="row">
<div class="col-sm-6">
<?= $form->field($modelChild, "[{$i}]pickup_Mobileno")->textInput(['maxlength' => true]) ?>
</div>
</div>
</div>
</div>
<?php endforeach; ?>
</div>
<?php DynamicFormWidget::end(); ?>
</div>
</div>
</div>