@if($accesschild['is_add'] == '1' && $accesschild['is_edit'] == '1' )
    <hr/>
    <div class="clr clear"></div>
    <div class="sbox st-cb-table">
        <h5 style="font-size: 20px; font-weight: 500; color: #333;"> Comment </h5>
        <div class="table-responsive">
            <table class="table table-striped " style="width: 100vw;">
                <thead>
                    <tr>
                        <th>Comment</th>
                        <th>Commented By</th>
                        <th>Created At</th>
                        <th>Attachments</th>
                        <th></th>
                    </tr>
                </thead>

                <tbody>
                @foreach ($subform['rowData'] as $row)
                    <?php $row = (array)$row;  $curTime = rand(1, 444); ?>
                    <tr class="dataRow originalRow">
                        <?php if (!isset($row['id'])) $row['id'] = null; ?>
                        <input type='hidden' name='bulk_id[{{$row['id']}}]' id='id' value='{{$row['id']}}'/>

                        <?php if (!isset($row['claim_id'])) $row['claim_id'] = null; ?>
                        <input type='hidden' name='bulk_claim_id[{{$row['id']}}]' id='claim_id' value='{{$row['claim_id']}}'/>

                        <td>
							<?php if (!isset($row['comment'])) $row['comment'] = null;   ?>
                            <textarea name='bulk_comment[{{$row['id']}}]' rows='5' id='comment' class='form-control input-sm' required>{{ $row['comment'] }}</textarea>
                        </td>

                        <td>
							<?php if (strlen($row['commented_by']) < 1) $row['commented_by'] = 'admin'; ?>
                            <?php $commented_by = explode(',', $row['commented_by']); $commented_by_opt = array('admin' => 'Admin', 'user' => 'User'); ?>
                            <select name='bulk_commented_by[{{$row['id']}}]' rows='5' placeholder='Select Commented By' data-placeholder='Select Commented By' class='select2'>
                                <?php
                                foreach ($commented_by_opt as $key => $val) {
                                    echo "<option  value ='$key' " . ($row['commented_by'] == $key ? " selected='selected' " : '') . ">$val</option>";
                                }
                                ?>
							</select>
						</td>

                        <td>
							<?php if (strlen($row['created_at']) < 1) $row['created_at'] = date("Y-m-d H:i:s"); ?>
                            <div class="input-group m-b" style="width:150px !important;">
                                <input type='text' name='bulk_created_at[{{$row['id']}}]' id='created_at'
                                       value='{{ $row['created_at'] }}'
                                       readonly
                                       class='form-control input-sm @if(trim(' readonly ')!='readonly') datetime @endif '/>
                                <span class="input-group-addon calwrap"><i class="fa fa-calendar"></i></span>
                            </div>
                        </td>

                        <td>
                            @if ($row['attachments'])
                                @foreach($row['attachments'] as $attachment)
                                    <a href="{{ $attachment }}" target="_blank" class="d-inline-block mx-2">
                                        <img src="{{ $attachment }}" alt="" class="img-thumbnail" width="100" height="100">
                                    </a>
                                @endforeach
                            @endif
                        </td>

                        <td>
                            <a onclick="removeClone(this)" href="javascript:void(0);"
                               class="remove btn btn-xs btn-danger"><i class="fa fa-minus" aria-hidden="true"></i></a>
                            <input type="hidden" name="counter[]">
                        </td>
                    </tr>
                @endforeach

                <tr id="addChildRows" class="hidden"></tr>
                </tbody>
            </table>
            <input type="hidden" name="enable-masterdetail" id="enable-masterdetail" value="true">
            <input type="hidden" name="masterdetail_delete" id="masterdetail_delete">
        </div>
    </div>
    <br/><br/>

    <a href="javascript:void(0);" class="addC btn btn-xs btn-success" rel=".clone#masterClone"><i class="fa fa-plus"></i> New Item </a>
    <hr/>
@endif