
<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> Edit 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>
                        </div>

                        <div class="actions">
                            <a href="javascript:;" class="btn default btn-sm" id="addInv">
                                <i class="fa fa-plus"></i> Choose Investigations  </a>
                        </div>
                    </div>
                    <div class="portlet-body" >
                        <div class="table-toolbar">

                        </div>

                        <form action="{$hosturl}/controllers/{$controllname}.php?ac=updateit" method="post" enctype="multipart/form-data">
                            <div class="form-body">



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

                                <div id="invoffers">

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


                                    <table class="table table-striped table-hover table-bordered" >
                                        <thead>
                                            <tr>
                                                <th>
                                                    Investigation Name
                                                </th>
                                                <th class="col-md-5">
                                                    Price 
                                                </th>
                                                <th class="col-md-1">
                                                    Remove
                                                </th>
                                            </tr>
                                        </thead>
                                        <tbody >
                                            {assign var=i value=1}
                                            {foreach $invofferdetails as $data}
                                            <tr>
                                                <td>
                                                    {$data->name}
                                                </td>
                                                <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>
                                                    <a class="btn grey-cascade btn-xs removeRow" style=" float: left; width: 100%;" href="#">
                                                        <i class="fa fa-close"></i>
                                                    </a>
                                                </td>
                                            </tr> 
                                            {capture assign=i}{$i+1}{/capture}
                                            {/foreach}

                                        </tbody>
                                    </table>


                                    <table class="table table-striped table-hover table-bordered">
                                        <thead>
                                            <tr>
                                                <td>
                                                    Offer Total Price 
                                                </td>
                                                <td>
                                                    <input type="text" class="form-control" name="totalPrice" id="totalPrice"  readonly  value=" {$totalPrice}" />
                                                </td>
                                            </tr>
                                        </thead>
                                    </table>
                                </div>

                                <button type="submit" id="saveOffer" class="btn default" style="float: right;">
                                    Save Offer
                                </button>


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

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



<!--------------------------------------------------------------------------- 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 chooseInv"> 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="pId1" value="" name="patientId"/>
                                        <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="iiin checkGroup">
                                                    </span>
                                                </label>
                                                <div class="checkbox-list">
                                                    {assign var=j value=1}
                                                    {foreach $cat->invests as $inv}
                                                    <label>
                                                        <span>
                                                            <input type="checkbox" class="iiin {$cat->id}Check" 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="iiin checkGroup">
                                                    </span>
                                                </label>
                                                <div class="checkbox-list">
                                                    {assign var=j value=1}
                                                    {foreach $cat->invests as $inv}
                                                    <label>
                                                        <span>
                                                            <input type="checkbox" class="iiin {$cat->id}Check" 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="iiin checkGroup">
                                                    </span>
                                                </label>
                                                <div class="checkbox-list">
                                                    {assign var=j value=1}
                                                    {foreach $cat->invests as $inv}
                                                    <label>
                                                        <span>
                                                            <input type="checkbox" class="iiin {$cat->id}Check" 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="iiin checkGroup">
                                                    </span>
                                                </label>
                                                <div class="checkbox-list">
                                                    {assign var=j value=1}
                                                    {foreach $cat->invests as $inv}
                                                    <label>
                                                        <span>
                                                            <input type="checkbox" id="" class="iiin {if $cat->name == 'Male(Husband)'}husbandCheck{/if} {$cat->id}Check" 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="iiin checkGroup">
                                                    </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 iiin" 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">
                                                <label style="font-weight:bold; text-decoration:underline" for="form_control_1">  Favorites
                                                    <span>
                                                        <input type="checkbox" data-gClass="favoriteCheck" class="iiin checkGroup">
                                                    </span>

                                                </label>
                                                <div class="checkbox-list">
                                                    {assign var=j value=1}
                                                    {foreach $favorites as $inv}
                                                    <label>
                                                        <span>
                                                            <input type="checkbox" class="favoriteCheck iiin" 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>




                                            </div>
                                        </div>

                                        <div  id="inv_div">

                                        </div>



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

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


    </div>
</div>


