
<div class="page-content-wrapper">
    <div class="page-content all">
        <div class="row">
            <div class="col-md-12">
                <div class="portlet box blue">
                    <div class="portlet-title" style="height: 5px">
                        <div class="caption">
                            <i class="fa fa-edit"></i>  Category Investigations
                        </div>
                        <div class="actions">

                            <a href="javascript:;" class="btn btn-default btn-sm" id="invest_addAll" data-type="all">
                                <i class="fa fa-plus"></i> Add New  </a>

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

                    </div>
                    <div class="portlet-body" >
                       
                         <div class="form-body">
                            <div class="row">
                               <input type="hidden" id="catId" value="{$cat->id}"/>
                                <table class="table table-bordered  table-hover wds99" style="margin: 9px;">
                                    <tr>
                                        <th  class="wds17"> Category Name ( En )  </th>
                                        <td>
                                            <input type="text" class="form-control updateElement"  data-id="{$cat->id}"   data-colName="name" 
                                             data-tableName="investcats"  value="{$cat->name}"
                                             style="height: 26px;"/>
                                        </td>
                                    </tr>
                                    
                                                <tr>
                                        <th  class="wds17"> Category Name ( Ar )  </th>
                                        <td>
                                            <input type="text" class="form-control updateElement"  data-id="{$cat->id}"   data-colName="name_ar" 
                                             data-tableName="investcats"  value="{$cat->name_ar}"
                                             style="height: 26px;"/>
                                        </td>
                                    </tr>
                                </table>
                            </div>
                        </div>
                       
                       
                       
                       
                       
                       
                        <table class="table table-striped table-hover table-bordered" id="invCat">
                            <thead>
                                      <tr>
                                                <th>  Investigations ( En ) </th>
                                                <th>  Investigations  ( Ar ) </th>
                                                    <th class="wds15">   Category </th>
                                                    <th class="wds6">   Price  </th>
                                                    <th class="wds6">    Lab Price </th>
                                                    <th class="wds8"> Online </th>
                                                <th class="wds8"> </th>
                                                </tr>
                            </thead>
                            <tbody  id="invests">

<tr style="display: none;"> 
    <td colspan="11"><input type="hidden"   value="{$invest_itr}"  id="invest_itr"></td></tr>
{assign var="i" value="1"}
{foreach $invests as $one}
<tr  {if  $one->deleted == 1 } style="background-color: darkgray;"  {/if}>
    <td>
        <input type="text" class="form-control updateElement" id="inv{$one->id}" data-id="{$one->id}"   data-colName="name" 
               data-tableName="invests"  value="{$one->name}"
               style="height: 26px;"/>
    </td>
    
    
        <td>
        <input type="text" class="form-control updateElement" id="inv{$one->id}" data-id="{$one->id}"   data-colName="name_ar" 
               data-tableName="invests"  value="{$one->name_ar}"
               style="height: 26px;"/>
    </td>

    <td>
        <select class="form-control  updateElement"   data-id="{$one->id}"  data-itr="{$i}"    
                name="investcatid"   id="investcatid{$one->id}" data-colName="investcatid" data-tableName="invests">
            <option value=""></option>
            {foreach $allCats as $data}
            <option value="{$data->id}" {if $one->investcatid eq  $data->id}selected{/if}>{$data->name}</option>
            {/foreach}
        </select>
    </td>


    <td>
        <input type="text" class="form-control updateElement" id="price{$one->id}" data-id="{$one->id}"   data-colName="price" data-tableName="invests"  
               value="{$one->price}"
               style="height: 26px;"/>
    </td>

    <td>
        <input type="text" class="form-control updateElement" id="lab_to_lab_price{$one->id}" data-id="{$one->id}"   data-colName="lab_to_lab_price" 
               data-tableName="invests"  value="{$one->lab_to_lab_price}"
               style="height: 26px;"/>
    </td>

    <td>
        <div class="md-checkbox" id="active_onlineCheck{$one->id}" >
            <input type="checkbox" id="active_online{$one->id}" data-id="{$one->id}"  data-tableName="invests"    value="1"                              
                   data-colName="active_online"    class="md-check updateElementCheck" {if $one->active_online == 1}checked{/if}>
            <label for="active_online{$one->id}">
                <span></span>
                <span class="check"></span>
                <span class="box"></span>
            </label>
        </div>
    </td>


    <td>
        {if  $one->deleted == 1 }
        <a class="btn default btn-xs disableBtn" data-id="{$one->id}"   id="deleteInv{$one->id}"  data-colName="deleted"
           href="#" data-link="addinvestigation" data-fn="disableIt" data-tableName="invests" data-val="0"> EN
        </a>
        {else}
        <a class="btn red btn-xs disableBtn" data-id="{$one->id}"   id="deleteInv{$one->id}"  data-colName="deleted"
           href="#" data-link="addinvestigation" data-fn="disableIt" data-tableName="invests" data-val="1"> Dis
        </a>
        {/if}
    </td>
</tr> 

{assign var="i" value={$i+1}}
{/foreach}


                            </tbody>
                        </table>



                    </div>
                </div>
            </div>
        </div>
    </div>

</div>

<input type="hidden" id="controllName" value="addinvestigation"/>





<!----#########################################################################  model ##############################################################################################################--->


<div id="invPreview"></div>
<div id="invCustomDiv"></div>
<div id="invPrint"></div>