@php
$i = 2;
if(file_exists('json_files/json-file.json')){
$json = file_get_contents('json_files/json-file.json');
//Decode JSON
$json_data = json_decode($json,true);
$results = array();
}
@endphp
<tr id="row{{$i}}">
    <!--  <td align="center" valign="top"><input class="form-check-input" type="checkbox" value="1" name="TreatChk1">
                                                           </td> -->
    <td>
        <!-- <input class="form-control" type="text" list="Treat_Type1" name="TreatType1[]"  id="TreatType{{$i}}">
        <datalist id="Treat_Type1">

            <?php
        foreach($json_data['JsonData']['TreatType'] as $result) {?>
            <option value="{{$result['Values']}}">
                <?php } ?>
        </datalist> -->

        <select class="form-control" name="TreatType1[]"  id="TreatType{{$i}}"  onchange="getDrugByType(this.value,{{$i}})">
                                            <option value="" selected>...</option>
                                            <?php
        foreach($json_data['JsonData']['TreatType'] as $result) {?>
                                                <option value="{{$result['Values']}}">{{$result['Values']}}</option>
                                                    <?php } ?>

                                            </select>

    </td>
    <td>
        <input class="form-control" type="text" name="TreatName1[]"  list="Treat_Name{{$i}}" id="TreatName{{$i}}"
                          onClick="this.select();"
                            oninput="getTreatNameDetails('TreatName{{$i}}','TreatDose{{$i}}','TreatFreq{{$i}}')">
                        <datalist id="Treat_Name{{$i}}" class="treatments">
                            @foreach($drugList as $drugdata)
                            <option value="{{$drugdata->Name}}">
                                @endforeach
                        </datalist>
    </td>
    <td>
        <!-- <input class="form-control" type="text" list="Treat_Dose1" name="TreatDose1[]"  id="TreatDose{{$i}}">
        <datalist id="Treat_Dose1">

            <?php
        foreach($json_data['JsonData']['TreatDose'] as $result) {?>
            <option value="{{$result['Values']}}">
                <?php } ?>
        </datalist> -->

        <select class="form-control" name="TreatDose1[]"  id="TreatDose{{$i}}" >
                                            <option value="" selected>...</option>
                                            <?php
        foreach($json_data['JsonData']['TreatDose'] as $result) {?>
                                                <option value="{{$result['Values']}}">{{$result['Values']}}</option>
                                                    <?php } ?>

                                            </select>
    </td>
    <td>
        <!-- <input class="form-control" type="text" list="Treat_Freq1" name="TreatFreq1[]"  id="TreatFreq{{$i}}">
        <datalist id="Treat_Freq1">

            <?php
        foreach($json_data['JsonData']['TreatFreq'] as $result) {?>
            <option value="{{$result['Values']}}">
                <?php } ?>
        </datalist> -->

        <select class="form-control" name="TreatFreq1[]"  id="TreatFreq{{$i}}" >
                                            <option value="" selected>...</option>
                                            <?php
        foreach($json_data['JsonData']['TreatFreq'] as $result) {?>
                                                <option value="{{$result['Values']}}">{{$result['Values']}}</option>
                                                    <?php } ?>

                                            </select>
    </td>
    <td>
        <!-- <input class="form-control" type="text" list="Treat_Dur1" name="TreatDur1[]"  id="TreatDur{{$i}}">
        <datalist id="Treat_Dur1">

            <?php
        foreach($json_data['JsonData']['TreatDur'] as $result) {?>
            <option value="{{$result['Values']}}">
                <?php } ?>
        </datalist> -->

        <select class="form-control" name="TreatDur1[]"  id="TreatDur{{$i}}" >
                                            <option value="" selected>...</option>
                                            <?php
        foreach($json_data['JsonData']['TreatDur'] as $result) {?>
                                                <option value="{{$result['Values']}}">{{$result['Values']}}</option>
                                                    <?php } ?>

                                            </select>
    </td>
    <td>
        <!-- <input class="form-control" type="text" list="Treat_Eye1" name="TreatEye1[]" id="TreatEye{{$i}}">
        <datalist id="Treat_Eye1">

            <?php
        foreach($json_data['JsonData']['TreatEye'] as $result) {?>
            <option value="{{$result['Values']}}">
                <?php } ?>
        </datalist> -->

        <select class="form-control" name="TreatEye1[]"  id="TreatEye{{$i}}" >
                                            <option value="" selected>...</option>
                                            <?php
        foreach($json_data['JsonData']['TreatEye'] as $result) {?>
                                                <option value="{{$result['Values']}}">{{$result['Values']}}</option>
                                                    <?php } ?>

                                            </select>
    </td>

    <td align="center" valign="top"> <button class="btn btn-danger btn_remove" type="button" id="{{$i}}"><i
                class="feather icon-x"></i></button>
    </td>
    </td>

</tr>