<style>
    table {
        font-family: arial, sans-serif;
        border-collapse: collapse;
        width: 100%;
        table-layout: fixed
    }

    td,
    th {
        border: 1px solid #000000;
        text-align: center;
        padding: 2px;
    }

    tr:nth-child(even) {
        background-color: #dddddd;
    }
</style>
<div class="page-content-wrapper">
    <div class="page-content">
        <div class="row">
            <div class="col-md-12 clinick invz" id="gprinModel">
                <!-- BEGIN EXAMPLE TABLE PORTLET-->
                <div class="portlet box blue">
                    <div class="portlet-title">
                        <div class="caption">
                            <i class="fa fa-user"></i>Analysis Device
                        </div>
                        <div class="actions">
                            {if isset($is_add)}
                            <a href="{$hosturl}/controllers/{$controllname}.php?ac=complete_one&&show={$show}&&id={$device->id}&&tname={$tableName}"
                               class="btn btn-default btn-sm pull-left" style="margin-right: 5px;">
                                save </a>
                            {/if}

                            <a href="javascript:;" class="btn default btn-sm" id="addDeviceInv">
                                <i class="fa fa-plus"></i> Choose Investigations  </a>

                            <a href="{$hosturl}/controllers/{$controllname}.php?ac={$show}"
                               class="btn btn-default btn-sm">
                                Show </a>

                        </div>
                    </div>
                    <div class="portlet-body all">

                        <!---======================================================== tab1============================================================================================ ----->

                        <div class="row">
                            <div id="ultrasoundgynaDiv">
                                <div class="row">
                                    <div class="portlet-body form">
                                        <form>
                                            <div class="form-body">
                                                <table>
                                                    <thead>
                                                        <tr>
                                                            <th class="wds25"> Device Name  : </th>
                                                            <td>
                                                                <input type="text"  class="form-control   updateElement"
                                                                       data-tableName="lab_devices" data-colName="name" 
                                                                       data-id="{$device->id}"   value="{$device->name}"   />
                                                            </td>
                                                        </tr>
                                                    </thead>
                                                </table>

                                                <div class="clearfix"></div>
                                                <hr>

                                                <div class="caption font-green-haze col-md-6">
                                                    <span class="caption-subject bold"> Device Investigations :
                                                    </span>
                                                </div>

                                                <div class="clearfix"></div>

                                                <table id="deviceInvTable">
                                                    <thead>
                                                        <tr>
                                                            <th> Category </th>
                                                            <th> Test Name </th>
                                                            <th class="wds10">Element </th>
                                                            <th class="wds9"> Sending Code </th>
                                                            <th class="wds9"> Receiving  Code </th>
                                                            <th class="wds12"> Range </th>
                                                            <th class="wds5"> Range L  </th>
                                                            <th class="wds5"> Range H  </th>
                                                            <th class="wds8"> Unit </th>
                                                            <th class="wds5"> Age From </th>
                                                            <th class="wds5"> Age To </th>
                                                            <th class="wds5"> Age Unit  </th>
                                                            <th class="wds5"> G </th>
                                                            <th class="wds3">  </th>
                                                        </tr>
                                                    </thead>
                                                    <tbody id="investigationsContainer">
                                                        {assign var=i value=1}
                                                        {foreach $deviceInvests as $data}
                                                        <tr>
                                                            <td>{$data.catName}</td>
                                                            <td>{$data.invName}</td>
                                                            <td>{$data.invest_child}</td>
                                                            <td>
                                                                <input type="text"  class="form-control   updateElement positivefloat"
                                                                       data-tableName="lab_devices_ranges" data-colName="send_code" 
                                                                       data-id="{$data.id}"   value="{$data.send_code}"   />
                                                            </td>
                                                            <td>
                                                                <input type="text"  class="form-control   updateElement positivefloat"
                                                                       data-tableName="lab_devices_ranges" data-colName="receive_code" 
                                                                       data-id="{$data.id}"   value="{$data.receive_code}"   />
                                                            </td>
                                                            <td>
                                                                <textarea  id="range_txt" class="form-control  updateElement"  
                                                                           data-tableName="lab_devices_ranges" data-colName="range_txt" 
                                                                           data-id="{$data.id}"   style="overflow-y: scroll;">
                                                                    {$data.range_txt}
                                                                </textarea>
                                                            </td>
                                                            <td>
                                                                <input type="text"  class="form-control   updateElement positivefloat"
                                                                       data-tableName="lab_devices_ranges" data-colName="range_low" 
                                                                       data-id="{$data.id}"   value="{$data.range_low}"   />
                                                            </td>
                                                            <td>
                                                                <input type="text"  class="form-control   updateElement positivefloat"
                                                                       data-tableName="lab_devices_ranges" data-colName="range_high" 
                                                                       data-id="{$data.id}"   value="{$data.range_high}"   />
                                                            </td>
                                                            <td>
                                                                <input type="text"  class="form-control   updateElement positivefloat"
                                                                       data-tableName="lab_devices_ranges" data-colName="invest_units" 
                                                                       data-id="{$data.id}"   value="{$data.invest_units}"   />
                                                            </td>
                                                            <td>
                                                                <input type="text"  class="form-control   updateElement positivefloat"
                                                                       data-tableName="lab_devices_ranges" data-colName="agefrom" 
                                                                       data-id="{$data.id}"   value="{$data.agefrom}"   />
                                                            </td>
                                                            <td>
                                                                <input type="text"  class="form-control   updateElement positivefloat"
                                                                       data-tableName="lab_devices_ranges" data-colName="ageto" 
                                                                       data-id="{$data.id}"   value="{$data.ageto}"   />
                                                            </td>
                                                            <td>
                                                                <select class="form-control updateElement"   id="age_units" 
                                                                        data-tableName="lab_devices_ranges" data-colName="age_units" 
                                                                        data-id="{$data.id}">
                                                                    <option value=""></option>
                                                                    <option value="1"  {if $data.age_units == 1 }  selected  {/if}>Year</option>
                                                                    <option value="2" {if $data.age_units == 2 }  selected  {/if}>Month</option>
                                                                    <option value="3" {if $data.age_units == 3 }  selected  {/if}>Day</option>
                                                                    <option value="4" {if $data.age_units == 4 }  selected  {/if}>Hour</option>
                                                                    <option value="5" {if $data.age_units == 5 }  selected  {/if}>Minute</option>
                                                                    <option value="6" {if $data.age_units == 6 }  selected  {/if}>Second</option>
                                                                </select>
                                                            </td>
                                                            <td>
                                                                <select class="form-control updateElement"   id="gender" 
                                                                        data-tableName="lab_devices_ranges" data-colName="gender" 
                                                                        data-id="{$data.id}">
                                                                    <option value=""></option>
                                                                    <option value="-1"  {if $data.gender == -1 }  selected  {/if}>All</option>
                                                                    <option value="0" {if $data.gender == 0 }  selected  {/if}>F</option>
                                                                    <option value="1" {if $data.gender == 1 }  selected  {/if}>M</option>
                                                                </select>
                                                            </td>
                                                            <td>
                                                                <a class="btn grey-cascade btn-xs deletemsgEX" data-id="{$data.id}" 
                                                                   style=" float: left;" href="#" data-link="{$controllname}" 
                                                                   data-fn="del" data-tableName="lab_devices_ranges">
                                                                    <i class="fa fa-close"></i>
                                                                </a>
                                                            </td>
                                                        </tr> 
                                                        {capture assign=i}{$i+1}{/capture}
                                                        {/foreach}
                                                    </tbody>
                                                </table>


                                            </div>
                                        </form>
                                    </div>
                                </div>
                                <div class="clearfix"></div>
                            </div>
                        </div>
                        <div class="clearfix"></div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>



<input type="hidden" id="controllName" value="{$controllname}">
<input type="hidden" id="labDevice" value="1"/>




<!--------------------------------------------------------------------------- add Investigation Model-------------------------------------------------------------------------------------->
<div class="modal fade" tabindex="-1" role="dialog" aria-hidden="false" data-backdrop="static" data-keyboard="false"  
     id="addPatientInvestigation" style="min-width:1000px;">
    <div class="modal-dialog  modal-lg wds95" style="max-width: 90%;">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button>
                <h4 class="modal-title">  </h4>
            </div>
            <div class="modal-body">
                <div class="portlet-body form">
                    <form class="form-horizontal" role="form" action="" method="post" id="gynaInvest" enctype="multipart/form-data">
                        <div class="row">
                            <div class="col-md-12">
                                <div class="portlet blue-hoki box">
                                    <div class="portlet-title">
                                        <div class="actions">
                                            <button type="button" class="btn green chooseDeviceInv"> Choose </button>
                                            <button type="button" class="btn default" id="closemodel" data-dismiss="modal"> Close</button>
                                        </div>
                                    </div>
                                    <div class="portlet-body">

                                        <input type="hidden"  id="deviceId"   name="deviceId"     value="{$device->id}"   />


                                        <div class="row" style="padding-left: 9px;padding-top:5px;overflow-y: scroll;">
                                            <div class="wds20 fleft">
                                                {assign var=i value=1}
                                                {foreach $group1 as $cat}

                                                <label style="font-weight:bold; text-decoration:underline" for="form_control_1"> {$cat->name}
                                                    <span>
                                                        <input type="checkbox" data-gClass="{$cat->id}_Check" 
                                                               class=" checkDeviceInvGroup">
                                                    </span>
                                                </label>
                                                <div class="checkbox-list">
                                                    {assign var=j value=1}
                                                    {foreach $cat->invests as $inv}
                                                    <label>
                                                        <span>
                                                            <input type="checkbox" class=" {$cat->id}_Check  catInv" id="inv_{$inv->id}" 
                                                                   value="{$inv->id}"   name="invCheck[]"  data-name="{$inv->name}" 
                                                                   data-price="{$inv->price}">
                                                        </span> {$inv->name} ( {$inv->price} )
                                                    </label>

                                                    {capture assign=j}{$j+1}{/capture}
                                                    {/foreach}
                                                </div>
                                                {capture assign=i}{$i+1}{/capture}
                                                {/foreach}
                                            </div>

                                            <div class="wds20 fleft">
                                                {assign var=i value=1}
                                                {foreach $group2 as $cat}

                                                <label style="font-weight:bold; text-decoration:underline" for="form_control_1"> {$cat->name}
                                                    <span>
                                                        <input type="checkbox" data-gClass="{$cat->id}_Check" 
                                                               class=" checkDeviceInvGroup">
                                                    </span>
                                                </label>
                                                <div class="checkbox-list">
                                                    {assign var=j value=1}
                                                    {foreach $cat->invests as $inv}
                                                    <label>
                                                        <span>
                                                            <input type="checkbox" class=" {$cat->id}_Check  catInv" id="inv_{$inv->id}" 
                                                                   value="{$inv->id}"   name="invCheck[]"  data-name="{$inv->name}" 
                                                                   data-price="{$inv->price}">
                                                        </span> {$inv->name} ( {$inv->price} )
                                                    </label>

                                                    {capture assign=j}{$j+1}{/capture}
                                                    {/foreach}
                                                </div>
                                                {capture assign=i}{$i+1}{/capture}
                                                {/foreach}
                                            </div>

                                            <div class="wds20 fleft">
                                                {assign var=i value=1}
                                                {foreach $group3 as $cat}

                                                <label style="font-weight:bold; text-decoration:underline" for="form_control_1"> {$cat->name}
                                                    <span>
                                                        <input type="checkbox" data-gClass="{$cat->id}_Check" 
                                                               class=" checkDeviceInvGroup">
                                                    </span>
                                                </label>
                                                <div class="checkbox-list">
                                                    {assign var=j value=1}
                                                    {foreach $cat->invests as $inv}
                                                    <label>
                                                        <span>
                                                            <input type="checkbox" class=" {$cat->id}_Check  catInv" id="inv_{$inv->id}" 
                                                                   value="{$inv->id}"   name="invCheck[]"  data-name="{$inv->name}" 
                                                                   data-price="{$inv->price}">
                                                        </span> {$inv->name} ( {$inv->price} )
                                                    </label>

                                                    {capture assign=j}{$j+1}{/capture}
                                                    {/foreach}
                                                </div>
                                                {capture assign=i}{$i+1}{/capture}
                                                {/foreach}


                                            </div>

                                            <div class="wds20 fleft">
                                                {assign var=i value=1}
                                                {foreach $group4 as $cat}

                                                <label style="font-weight:bold; text-decoration:underline" for="form_control_1"> {$cat->name}
                                                    <span>
                                                        <input type="checkbox" data-gClass="{$cat->id}_Check" 
                                                               class=" checkDeviceInvGroup">
                                                    </span>
                                                </label>
                                                <div class="checkbox-list">
                                                    {assign var=j value=1}
                                                    {foreach $cat->invests as $inv}
                                                    <label>
                                                        <span>
                                                            <input type="checkbox" class=" {$cat->id}_Check  catInv" id="inv_{$inv->id}" 
                                                                   value="{$inv->id}"   name="invCheck[]"  data-name="{$inv->name}" 
                                                                   data-price="{$inv->price}">
                                                        </span> {$inv->name} ( {$inv->price} )
                                                    </label>

                                                    {capture assign=j}{$j+1}{/capture}
                                                    {/foreach}
                                                </div>
                                                {capture assign=i}{$i+1}{/capture}
                                                {/foreach}


                                            </div>

                                            <div class="wds20 fleft">

                                                {assign var=i value=1}
                                                {foreach $group5 as $cat}

                                                <label style="font-weight:bold; text-decoration:underline" for="form_control_1"> {$cat->name}
                                                    <span>
                                                        <input type="checkbox" data-gClass="{$cat->id}_Check" 
                                                               class=" checkDeviceInvGroup">
                                                    </span>
                                                </label>
                                                <div class="checkbox-list">
                                                    {assign var=j value=1}
                                                    {foreach $cat->invests as $inv}
                                                    <label>
                                                        <span>
                                                            <input type="checkbox" class=" {$cat->id}_Check  catInv" id="inv_{$inv->id}" 
                                                                   value="{$inv->id}"   name="invCheck[]"  data-name="{$inv->name}" 
                                                                   data-price="{$inv->price}">
                                                        </span> {$inv->name} ( {$inv->price} )
                                                    </label>

                                                    {capture assign=j}{$j+1}{/capture}
                                                    {/foreach}
                                                </div>
                                                {capture assign=i}{$i+1}{/capture}
                                                {/foreach}

                                                {assign var=i value=1}
                                                {foreach $others  as $cat}

                                                <label style="font-weight:bold; text-decoration:underline" for="form_control_1"> {$cat->name}
                                                    <span>
                                                        <input type="checkbox" data-gClass="{$cat->id}_Check" 
                                                               class=" checkDeviceInvGroup">
                                                    </span>
                                                </label>
                                                <div class="checkbox-list">
                                                    {assign var=j value=1}
                                                    {foreach $cat->invests as $inv}
                                                    <label>
                                                        <span>
                                                            <input type="checkbox" class=" {$cat->id}_Check  catInv" id="inv_{$inv->id}" 
                                                                   value="{$inv->id}"   name="invCheck[]"  data-name="{$inv->name}" 
                                                                   data-price="{$inv->price}">
                                                        </span> {$inv->name} ( {$inv->price} )
                                                    </label>

                                                    {capture assign=j}{$j+1}{/capture}
                                                    {/foreach}
                                                </div>
                                                {capture assign=i}{$i+1}{/capture}
                                                {/foreach}
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>




