
<div class="page-content-wrapper">
    <div class="page-content all">
        <form action="{$hosturl}/controllers/{$controllname}.php?ac=updateit" method="post" enctype="multipart/form-data">
            <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> Investigation Offer
                            </div>
                            <div class="actions">
                                <a class="btn default btn-xs blue tooltips" href="{$hosturl}/controllers/{$controllname}.php?ac=index" data-container="body" data-placement="top" data-original-title="Show">
                                    Show items
                                </a>
                                <button type="submit" id="saveOffer" class="btn default" style="float: right;">
                                    Save Offer
                                </button>
                            </div>
                        </div>
                        <div class="portlet-body" >
                            <div class="form-body">
                                <div class="form-body">

                                    <input type="hidden"  name="inv_itr" id="inv_itr"   value="{$itr}"/>
                                    <input type="hidden"  name="invoffer" id="invoffer"   value="{$invoffer->id}"/>

                                    <table class="table table-striped table-hover table-bordered">
                                        <tbody>
                                            <tr>
                                                <td class="wds15">  Offer Name  </td>
                                                <td>    <input type="text" class="form-control"  name="name"  value="{$invoffer->name}" required/> </td>
                                                <td class="wds15">    Offer Total Price     </td>
                                                <td class="wds20">
                                                    <input type="text" class="form-control" name="totalPrice" id="totalPrice"  
                                                           readonly  value="{$totalPrice}" />
                                                </td>
                                            </tr>
                                        </tbody>
                                    </table>

                                    <div id="invoffers"  >
                                        {assign var=i value=1}
                                        {foreach $invofferdetails as $data}
                                        <div class="col-md-4">
                                            <table class="table table-striped table-hover table-bordered"  id="tb_{$data->inv_id}"  
                                                   style="    margin-bottom: 0;"> 
                                                <tr>
                                                    <th class="wds65"> {$data->name} </th>
                                                    <td>
                                                        <input type="text" class="form-control positivefloat calcoffer" name="price{$i}"
                                                               id="price{$i}"   value="{$data->price}" />   
                                                        <input type="hidden"  name="invId{$i}"   value="{$data->inv_id}"/>
                                                    </td>
                                                    <td  class="wds8">
                                                        <a class="btn grey-cascade btn-xs removeRow" data-id="{$data->inv_id}" href="#">
                                                            <i class="fa fa-close"></i>
                                                        </a>
                                                    </td>
                                                </tr> 
                                            </table>
                                        </div>
                                        {capture assign=i}{$i+1}{/capture}
                                        {/foreach}
                                    </div>


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

                                    <div class="row" style="margin-top : 20px !important ;">
                                        <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> Investigations
                                                    </div>
                                                </div>
                                                <div class="portlet-body" >
                                                    <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-body">

                                                                        <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=" checkOfferInvGroup">
                                                                                    </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}" {if in_array($inv->id, $invArr)} checked {/if}>
                                                                                        </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=" checkOfferInvGroup">
                                                                                    </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}" {if in_array($inv->id, $invArr)} checked {/if}>
                                                                                        </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=" checkOfferInvGroup">
                                                                                    </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}" {if in_array($inv->id, $invArr)} checked {/if}>
                                                                                        </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=" checkOfferInvGroup">
                                                                                    </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}" {if in_array($inv->id, $invArr)} checked {/if}>
                                                                                        </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=" checkOfferInvGroup">
                                                                                    </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}" {if in_array($inv->id, $invArr)} checked {/if}>
                                                                                        </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=" checkOfferInvGroup">
                                                                                    </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}" {if in_array($inv->id, $invArr)} checked {/if}>
                                                                                        </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 class="form-body">

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

<input type="hidden" id="controllName" value="invoffers"/>
<input type="hidden" id="invOffers" value="1"/>

