
<?php 
 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();
    }
    $i=1;
 
    if($rncnt > 0){
    foreach($data as $result2){    
?>

<tr>
    <td align="center" valign="top"><input class="form-check-input" type="checkbox" value="1" id="TreatChk<?php echo e($i); ?>"
            name="TreatChk<?php echo e($i); ?>" onclick="treatcheck('TreatChk<?php echo e($i); ?>',<?php echo e($result2->id); ?>,<?php echo e($i); ?>)" checked>
    </td>
    <td>
        <select class="form-control" name="TreatType<?php echo e($i); ?>" id="TreatType<?php echo e($i); ?>" style="height:35px;">

            <option value="" selected>...</option>
            <?php
foreach($json_data['JsonData']['TreatType'] as $result) {?>
            <option value="<?php echo $result['Values']; ?>" <?php if($result2->TreatType1 == $result['Values']){?>
                selected <?php } ?>>
                <?php echo e($result['Values']); ?></option>
            <?php } ?>
        </select>

    </td>
    <td>
    <input type="text" value="<?php echo $result2->TreatName1; ?>" name="TreatName<?php echo e($i); ?>" id="TreatName<?php echo e($i); ?>" class="form-control input-lg"
        oninput="get_drug_name(<?php echo e($i); ?>)"  style="height:35px;"/>
        <div id="DrugLists<?php echo e($i); ?>">
        </div>
       
    </td>
    <td>
        <select class="form-control" name="TreatDose<?php echo e($i); ?>" id="TreatDose<?php echo e($i); ?>" style="height:35px;">

            <option value="" selected>...</option>
            <?php
foreach($json_data['JsonData']['TreatDose'] as $result) {?>
            <option value="<?php echo $result['Values']; ?>" <?php if($result2->TreatDose1 == $result['Values']){?>
                selected <?php } ?>>
                <?php echo e($result['Values']); ?></option>
            <?php } ?>
        </select>

    </td>
    <td>
        <select class="form-control" name="TreatFreq<?php echo e($i); ?>" id="TreatFreq<?php echo e($i); ?>" style="height:35px;">

            <option value="" selected>...</option>
            <?php
foreach($json_data['JsonData']['TreatFreq'] as $result) {?>
            <option value="<?php echo $result['Values']; ?>" <?php if($result2->TreatFreq1 == $result['Values']){?>
                selected <?php } ?>>
                <?php echo e($result['Values']); ?></option>
            <?php } ?>
        </select>

    </td>
    <td>
        <select class="form-control" name="TreatDur<?php echo e($i); ?>" id="TreatDur<?php echo e($i); ?>" style="height:35px;">

            <option value="" selected>...</option>
            <?php
foreach($json_data['JsonData']['TreatDur'] as $result) {?>
            <option value="<?php echo $result['Values']; ?>" <?php if($result2->TreatDur1 == $result['Values']){?>
                selected <?php } ?>>
                <?php echo e($result['Values']); ?></option>
            <?php } ?>
        </select>

    </td>
    <td>
        <select class="form-control" name="TreatEye<?php echo e($i); ?>" id="TreatEye<?php echo e($i); ?>" style="height:35px;">

            <option value="" selected>...</option>
            <?php
foreach($json_data['JsonData']['TreatEye'] as $result) {?>
            <option value="<?php echo $result['Values']; ?>" <?php if($result2->TreatEye1 == $result['Values']){?>
                selected <?php } ?>>
                <?php echo e($result['Values']); ?></option>
            <?php } ?>
        </select>

    </td>
</tr>
<?php $i++;}} 
for($i2=$rncnt+1;$i2<=8;$i2++){
?>
<tr>
    <td align="center" valign="top"><input class="form-check-input" type="checkbox" value="1" id="TreatChk<?php echo e($i2); ?>"
            name="TreatChk<?php echo e($i2); ?>" onclick="treatcheck('TreatChk<?php echo e($i2); ?>',0,<?php echo e($i2); ?>)">
    </td>
    <td>
        <select class="form-control" name="TreatType<?php echo e($i2); ?>" id="TreatType<?php echo e($i2); ?>" style="height:35px;">

            <option value="" selected>...</option>
            <?php
foreach($json_data['JsonData']['TreatType'] as $result) {?>
            <option value="<?php echo $result['Values']; ?>">
                <?php echo e($result['Values']); ?></option>
            <?php } ?>
        </select>

    </td>
    <td>
        <input type="text" value="" name="TreatName<?php echo e($i2); ?>" id="TreatName<?php echo e($i2); ?>" class="form-control input-lg"
        oninput="get_drug_name(<?php echo e($i2); ?>)" style="height:35px;"/>
        <div id="DrugLists<?php echo e($i2); ?>">
        </div>
        
    </td>
    <td>
        <select class="form-control" name="TreatDose<?php echo e($i2); ?>" id="TreatDose<?php echo e($i2); ?>" style="height:35px;">

            <option value="" selected>...</option>
            <?php
foreach($json_data['JsonData']['TreatDose'] as $result) {?>
            <option value="<?php echo $result['Values']; ?>">
                <?php echo e($result['Values']); ?></option>
            <?php } ?>
        </select>

    </td>
    <td>
        <select class="form-control" name="TreatFreq<?php echo e($i2); ?>" id="TreatFreq<?php echo e($i2); ?>" style="height:35px;">

            <option value="" selected>...</option>
            <?php
foreach($json_data['JsonData']['TreatFreq'] as $result) {?>
            <option value="<?php echo $result['Values']; ?>">
                <?php echo e($result['Values']); ?></option>
            <?php } ?>
        </select>

    </td>
    <td>
        <select class="form-control" name="TreatDur<?php echo e($i2); ?>" id="TreatDur<?php echo e($i2); ?>" style="height:35px;">

            <option value="" selected>...</option>
            <?php
foreach($json_data['JsonData']['TreatDur'] as $result) {?>
            <option value="<?php echo $result['Values']; ?>">
                <?php echo e($result['Values']); ?></option>
            <?php } ?>
        </select>

    </td>
    <td>
        <select class="form-control" name="TreatEye<?php echo e($i2); ?>" id="TreatEye<?php echo e($i2); ?>" style="height:35px;">

            <option value="" selected>...</option>
            <?php
foreach($json_data['JsonData']['TreatEye'] as $result) {?>
            <option value="<?php echo $result['Values']; ?>">
                <?php echo e($result['Values']); ?></option>
            <?php } ?>
        </select>

    </td>
</tr>
<?php }  ?><?php /**PATH C:\deshmukh_hosp\resources\views/masters/treatmentlist.blade.php ENDPATH**/ ?>