<?php
if($id_pkwt == "null") {
    if($data->parameter != '') {
        $temp = json_decode($data->parameter, true);
        foreach($temp as $key => $value) {
?>
        <div class="row form-group">
            <div class="col-md-4"><?= $key ?> <span class="text-danger">*</span></div>
            <div class="col-md-8 input-group">
                <div class="input-group-prepend"><span class="input-group-text" style="width: 80px;"><?= $value ?></span></div>
                <input type="text" name="param_<?= $key ?>" class="form-control<?= $value == 'nominal' ? ' nominal' : '' ?>">
            </div>
        </div>
<?php        
        }
    } else {
        echo '-';
    }
} else {
    $value = json_decode($data->draft_pkwt_value, 1);
    foreach(json_decode($data->draft_pkwt_parameter, 1) as $key => $tipe) {
?>
        <div class="row form-group">
            <div class="col-md-4"><?= $key ?> <span class="text-danger">*</span></div>
            <div class="col-md-8 input-group">
                <div class="input-group-prepend"><span class="input-group-text" style="width: 80px;"><?= $tipe ?></span></div>
                <input type="text" name="param_<?= $key ?>" class="form-control<?= $tipe == 'nominal' ? ' nominal' : '' ?>" value="<?= $value[$key] ?>">
            </div>
        </div>
<?php
    }
}
?>
<script>
    $('.nominal').inputmask("numeric", {groupSeparator: ".", radixPoint: ","});
</script>