
<style type="text/css">
    .yellow{
        background: yellow;
    }
    .red{
        background: #d40404;
        color: #fff
    }
    h2{
        text-align: center;
    }
    hr{
        margin: 10px 40%;
        border: 1px solid;
    }
    .toggle{
        font-weight: 800;max-width: 130px;
    }
    .rowtoggle{
        padding-bottom: 10px;
    }
    .thhead{
        background: #fff !important;
        color: red !important
    }
    .addappend{
        color: red;
    }
    .colorred{
        color: red;
        font-size: 14px
    }
    .hr{
        margin: 20px 17%;
        border: 1px dotted;
    }
    .tdcolor{
        background: #aaa; border: 1px solid #000 !important;
    }
    td,th{
        border: 1px solid #000 !important;text-align: center !important; vertical-align: none !important; 
    }
    input{
        border: none !important;
    }
    table{
        width: 100% !important;
        padding: 0px 20px;
    }
    .hidetable{
        display: none;
    }
</style>
<div class="form-body">
    <input type="hidden" id="patientId" value="{$patientid}"/>

    <div class="page-content-wrapper">
        <div class="page-content all">
            <div class="row ">
                <table class="table table-striped table-bordered table-hover nopdngtbl">
                    <tbody><tr class="odd gradeX" style="background: #dfece2">
                    <input type="hidden"    id="infertilitysheetid" value="{$infertilitysheetid}" >
                    <td class="bold">
                        <a data-link="{$hosturl}/controllers/patienthistory.php?ac=show&amp;patientid=1" class="blue gothislinkagnew" data-go="#tab_2_6">    Obst History  </a>
                    </td>
                    <td class="txtl "> <label class="bold " style="color:  #3598DC;">G : <span style="color: #000" id="obstg">
                                {$infertilitysheet->obstg}</span > </label> 
                    </td>
                    <td class="txtl "> <label class="bold " style="color:  #3598DC;">P : <span style="color: #000" id="obstp">{$infertilitysheet->obstp} </span ></label> 
                    </td>
                    <td class="txtl "> <label class="bold " style="color:  #3598DC;">FT : <span style="color: #000" id="obstft">{$infertilitysheet->obstft} </span ></label> 
                    </td>
                    <td class="txtl "> <label class="bold " style="color:  #3598DC;">PT : <span style="color: #000" id="obstpt">{$infertilitysheet->obstpt}</span > </label> 
                    </td>
                    <td class="txtl "> <label class="bold " style="color:  #3598DC;">EPC : <span style="color: #000" id="obstepc">{$infertilitysheet->obstepc}</span > </label> 
                    </td>
                    <td class="txtl "> <label class="bold " style="color:  #3598DC;">LIVING : <span style="color: #000" id="obstliving">{$infertilitysheet->obstliving}</span > </label> 
                    </td>

                    </tr>

                    </tbody>
                </table>
            </div>


            <div class="col-md-12" style="padding-right: 0px; padding-left: 0px;">
                <div class="portlet box blue">
                    <div class="portlet-title" style="height: 5px">
                        <div class="caption">
                            <i class="fa fa-edit"></i> ANC Sheet
                        </div>
                        <div class="actions">
                        </div>
                    </div>
                    <div class="portlet-title" style="text-align: center;">
                        <input class="form-control"  type="text"   name="importantnote" data-id="{$ancsheet->id}" data-table="ancsheet"  value="{$ancsheet->importantnote}" placeholder="Critical Data" >
                        <div style="font-size: 15px">{$ancsheet->importantnotes}</div>
                    </div>
                    <div class="portlet-body form">
                        <form   class="form-horizontal  emptyform" >
                            <input type="hidden" id="id" name="id" value="{$id}" />
                            <input type="hidden" id="controllname" name="id" value="{$controllname}" />
                            <input type="hidden" id="controllName" name="controllName" value="{$controllname}" />
                            <input type="hidden" id="mainAntenatalId" value="{$id}"/>
                            <!-- <input type="hidden" id="tablep"  value="infertilitysheet" /> -->
                            <div class="form-body">

                                <h2 > ANC Sheet</h2>

                                <hr>
                                <a style="float: right;" href="{$hosturl}/controllers/ancsheet.php?ac=archive&amp;patientid={$patientid}" class="btn btn-default btn-sm">
                                    Archive pregnancy
                                </a>
                                <table class="table table-bordered">
                                    <tbody>
                                        <tr>
                                            <th  colspan="1">
                                                <a class="resetdate" >
                                                    LMP
                                                </a></th>
                                            <th  colspan="1">EDD</th>
                                            <th  colspan="1">G</th>
                                            <th  colspan="1">P</th>
                                            <th  colspan="1">EPC</th>
                                            <th  colspan="1">Last Hb</th>
                                            <th  colspan="1">Placenta</th>
                                            <th  colspan="1">Notes</th>
                                        </tr>
                                        <tr>
                                            <td width="7%"><input class="form-control datepicker eedlmp"  type="text"    value="{$ancsheet->sheetlmp}" id="lmp" name="sheetlmp" data-id="{$id}" data-table="ancsheet"  ></td>
                                            <td width="7%"><input class="form-control datepicker eedlmp"  type="text"   value="{$ancsheet->sheetedd}" id="edd" name="sheetedd" data-id="{$id}" data-table="ancsheet"   ></td>
                                            <td  width="7%" id="obstgv">
                                                {$infertilitysheet->obstg}  
                                            </td>
                                            <td  width="7%" id="obstpv">
                                                {$infertilitysheet->obstp}
                                            </td>
                                            <td  width="7%" id="obstepcv">
                                                {$infertilitysheet->obstepc}
                                            </td>
                                            <td width="7%"><input class="form-control"  type="text" value="{$ancsheet->sheetlast}" name="sheetlast" data-id="{$id}" data-table="ancsheet"  ></td>
                                            <td  width="15%">
                                                <select  class="form-control getselectajax placenta" name="placenta" data-id="{$id}"  data-table="ancsheet"  data-celtable="placenta" id="placenta{$id}" data-selid="{$id}" >
                                                </select>
                                            </td>
                                            <td width="18%"><input class="form-control"  type="text"    value="{$ancsheet->sheetnte}" name="sheetnte" data-id="{$id}" data-table="ancsheet"  ></td>
                                        </tr>
                                    </tbody>
                                </table>
                                <div class="row rowtoggle"  id="historyshow">
                                    <a class="btn grey-cascade btn-xs toggle" data-show="history2" >History</a>

                                </div>

                                <table class="table table-bordered hidetable history2" >
                                    <tbody>
                                        <tr>
                                            <td  colspan="1" width="10%" class="tdcolor">Menstrual History</td>
                                            <td  colspan="2" width="30%" class="tdcolor"> Medical History</td>
                                            <td  colspan="2" width="30%" class="tdcolor">Surgical History </td>
                                            <td  colspan="2" width="30%" class="tdcolor">Family History</td>
                                        </tr>
                                        <tr>
                                            <td  colspan="1" width="10%"> <input type="text" data-id="{$infertilitysheetid}" value="{$infertilitysheet->menstrualh}" name="menstrualh" data-table="infertilitysheet" class="form-control" /></td>

                                            <td  colspan="1">
                                                <select multiple="" class="form-control getselectajax medicalhistory" name="medicalhistory" data-id="{$infertilitysheetid}"  data-table="infertilitysheet"  data-celtable="medicalhistory" id="medicalhistory{$infertilitysheetid}" data-selid="{$infertilitysheetid}" >
                                                </select>
                                            </td>
                                            <td  colspan="1" width="10%"> <input type="text" data-id="{$infertilitysheetid}" value="{$infertilitysheet->w2medical}" name="w2medical" data-table="infertilitysheet" class="form-control" /></td>
                                            <td  colspan="1">
                                                <select multiple="" class="form-control getselectajax surgicalhistory" name="surgicalhistory" data-id="{$infertilitysheetid}"  data-table="infertilitysheet"  data-celtable="surgicalhistory" id="surgicalhistory{$infertilitysheetid}" data-selid="{$infertilitysheetid}" >
                                                </select>
                                            </td>
                                            <td  colspan="1" width="10%"> <input type="text" data-id="{$infertilitysheetid}" value="{$infertilitysheet->wsurgical}" name="wsurgical" data-table="infertilitysheet" class="form-control" /></td>
                                            <td  colspan="1">
                                                <select multiple="" class="form-control getselectajax familyhistory" name="familyhistory" data-id="{$infertilitysheetid}"  data-table="infertilitysheet"  data-celtable="familyhistory" id="familyhistory{$infertilitysheetid}" data-selid="{$infertilitysheetid}" >
                                                </select>
                                            </td>
                                            <td  colspan="1" width="10%"> <input type="text" data-id="{$infertilitysheetid}" value="{$infertilitysheet->wfamily}" name="wfamily" data-table="infertilitysheet" class="form-control" /></td>
                                        </tr>
                                    </tbody>
                                </table>

                                <table class="table table-bordered  hidetable history2" >
                                    <tbody id="awifep">
                                        <tr>
                                            <th scope="row" class="thhead" colspan="12">
                                                <a class="addappend" data-add="awifep" data-id="{$infertilitysheetid}"  data-table="infertilitysheetid" id="awifeplocal">(Obst History) p</a>
                                            </th>
                                        </tr>
                                        <tr>
                                            <td colspan="1" width="10%">Sex</td>
                                            <td colspan="1" width="5%">Name</td>
                                            <td colspan="1" width="10%">Date of D</td>
                                            <td colspan="1" width="5%">Age</td>
                                            <td colspan="1" width="10%">Mode of D</td>
                                            <td colspan="1" width="10%">Type of D</td>
                                            <td colspan="1" width="5%">W</td>
                                            <td colspan="1" width="5%">L</td>
                                            <td colspan="1" width="10%">Obst</td>
                                            <td colspan="1" width="25%" style="padding: 0px">
                                                <table style="width: 100%;margin-bottom: 0px;">
                                                    <tr>
                                                        <td colspan="3">CO</td>
                                                    </tr>
                                                    <tr>
                                                        <td colspan="1" width="33%">Method</td>
                                                        <td colspan="1" width="33%">Duration</td>
                                                        <td colspan="1" width="33%">Stopped</td>
                                                    </tr>
                                                </table>
                                            </td>
                                            <td  colspan="1" width="5%">Comment</td>
                                            <td colspan="1" width="5%"></td>
                                        </tr>
                                        {foreach $awifep as $single}
                                        <tr class="rowawifep{$single->id}">   
                                            <td  width="10%">
                                                <select   class="form-control getselectajax wifesex" name="wifesex" data-id="{$single->id}"  data-table="awifep"  data-celtable="wifesex" id="wifesex{$single->id}" data-selid="{$single->id}" >
                                                </select>
                                            </td>
                                            <td width="5%"><input type="text" name="name" value="{$single->name}"  data-id="{$single->id}"  data-table="awifep"  class="form-control" /></td>
                                            <td width="10%"><input class="form-control datepicker getymt"  type="text"    name="date" value="{$single->date}"  data-id="{$single->id}"  data-table="awifep"   ></td>
                                            <td width="5%" id="awifepmonth_{$single->id}">{$single->wifeage}</td>
                                            <td  width="10%">
                                                <select  class="form-control getselectajax wifemodeofd" name="wifemodeofd" data-id="{$single->id}"  data-table="awifep"  data-celtable="wifemodeofd" id="wifemodeofd{$single->id}" data-selid="{$single->id}" >
                                                </select>
                                            </td>
                                            <td   width="10%">
                                                <select   class="form-control getselectajax wifetypeofd" name="wifetypeofd" data-id="{$single->id}"  data-table="awifep"  data-celtable="wifetypeofd" id="wifetypeofd{$single->id}" data-selid="{$single->id}" >
                                                </select>
                                            </td>
                                            <td  width="5%" >
                                                <input type="text" name="wifew" value="{$single->wifew}"  data-id="{$single->id}"  data-table="awifep"  class="form-control " />
                                            </td>
                                            <td  width="5%" >
                                                <input type="checkbox"  name="wifel" value="1"
                                                       data-id="{$single->id}"  data-table="awifep"  class="form-control checkbox" {if $single->wifel == 1} checked {/if}>
                                            </td>
                                            <td  width="10%" style="width: 30px">
                                                <select  multiple="" class="form-control getselectajax wifeobst" name="wifeobst" data-id="{$single->id}"  data-table="awifep"  data-celtable="wifeobst" id="wifeobst{$single->id}" data-selid="{$single->id}" >
                                                </select>
                                            </td>
                                            <td width="25%" style="padding: 0px">
                                                <table style="width: 100%;margin-bottom: 0px;">
                                                    <tr>
                                                        <td  width="33%" style="max-width: 33px">
                                                            <select  multiple="" class="form-control getselectajax awifeppmethod" name="awifepmethod" data-id="{$single->id}"  data-table="awifep"  data-celtable="awifepmethod" id="awifepmethod{$single->id}" data-selid="{$single->id}" >
                                                            </select>
                                                        </td>
                                                        <td width="33%"><input type="text" name="duration" value="{$single->duration}"  data-id="{$single->id}"  data-table="awifep"  class="form-control" /></td>
                                                        <td width="33%"><input type="text" name="stopped" value="{$single->stopped}"  data-id="{$single->id}"  data-table="awifep"  class="form-control" /></td>
                                                    </tr>
                                                </table>
                                            </td>
                                            <td width="5%"><input type="text" name="comment" value="{$single->comment}"  data-id="{$single->id}"  data-table="awifep"  class="form-control" /></td>
                                            <td width="5%">
                                                <a class="btn grey-cascade btn-xs  chekdeleterow" data-id="{$single->id}"  data-table="awifep">
                                                    <i class="fa fa-close"></i>
                                                </a>
                                            </td>
                                        </tr>
                                        {/foreach}
                                    </tbody>
                                </table>
                                <table class="table table-bordered hidetable history2">
                                    <tbody id="wifeepc">
                                        <tr>
                                            <td colspan="7" style="background:#fff"  width="80%" class="tdcolor">
                                                <a class="addappend" data-add="wifeepc" style="color: red" data-id="{$infertilitysheetid}"  data-table="infertilitysheetid" id="awifepclocal" >EPC</a></td>
                                            <td colspan="3" style="background:#fff" class="tdcolor">Last</td>
                                        </tr>
                                        <tr>
                                            <td >date</td>
                                            <td >Type</td>
                                            <td >W</td>
                                            <td >TTT</td>
                                            <td >Obst</td>
                                            <td >Histopath</td>
                                            <td >Cost</td>
                                            <td >D</td>
                                            <td >A</td>
                                            <td ></td>
                                        </tr>
                                        {foreach $wifeepc as $single}
                                        <tr class="rowwifeepc{$single->id}">  
                                            <td width="10%"><input type="text" name="wifeepcdate" value="{$single->wifeepcdate}"  data-id="{$single->id}"  data-table="wifeepc" class="form-control datepicker" /></td>         
                                            <td width="18%">
                                                <select  class="form-control getselectajax wifeepctype" name="wifeepctype" data-id="{$single->id}"  data-table="wifeepc"  data-celtable="wifeepctype" id="wifeepctype{$single->id}" data-selid="{$single->id}" >
                                                </select>
                                            </td>
                                            <td width="5%"><input type="text" name="wifeepcw" value="{$single->wifeepcw}"  data-id="{$single->id}"  data-table="wifeepc" class="form-control" /></td>
                                            <td width="20%">
                                                <select  class="form-control getselectajax wifeepcttt" name="wifeepcttt" data-id="{$single->id}"  data-table="wifeepc"  data-celtable="wifeepcttt" id="wifeepcttt{$single->id}" data-selid="{$single->id}" >
                                                </select>
                                            </td>
                                            <td width="18%">
                                                <select   class="form-control getselectajax wifeepcobst" name="wifeepcobst" data-id="{$single->id}"  data-table="wifeepc"  data-celtable="wifeepcobst" id="wifeepcobst{$single->id}" data-selid="{$single->id}" >
                                                </select>
                                            </td>
                                            <td width="15%"><input class="form-control"  type="text"  name="histopath" value="{$single->histopath}"  data-id="{$single->id}"  data-table="wifeepc" ></td>
                                            <td width="5%"><input type="text" name="coast" value="{$single->coast}"  data-id="{$single->id}"  data-table="wifeepc" class="form-control " /></td> 
                                            <td width="5%"><input type="text" name="wifeepcp" value="{$single->wifeepcp}"  data-id="{$single->id}"  data-table="wifeepc" class="form-control" /></td>
                                            <td width="5%"><input type="text" name="wifeepcepc" value="{$single->wifeepcepc}"  data-id="{$single->id}"  data-table="wifeepc" class="form-control" /></td>
                                            <td width="5%">
                                                <a class="btn grey-cascade btn-xs  chekdeleterow" data-id="{$single->id}"  data-table="wifeepc">
                                                    <i class="fa fa-close"></i>
                                                </a>
                                            </td>
                                        </tr>
                                        <tr class="rowwifeepc{$single->id}">  
                                        <td colspan="10"><input type="text" name="wifeepnots" value="{$single->wifeepnots}"  data-id="{$single->id}"  data-table="wifeepc" class="form-control "  placeholder="Note" /></td>
                                    </tr>
                                        {/foreach}
                                    </tbody>
                                </table>



                                <table class="table table-bordered">
                                    <tbody id="investigations">
                                        <tr>
                                            <th scope="row" style="color: #fff;background:red" colspan="11">
                                                <a class="addappend" style="color: #fff;" data-add="investigations"  data-id="{$id}"  data-table="ancsheetid">  Investigations</a>
                                            </th>
                                        </tr>
                                        <tr>
                                            <td width="10%"></td>
                                            <td  width="10%" class="colorred">Hb</td>
                                            <td width="10%"class="colorred">Plat</td>
                                            <td width="10%"class="colorred">FBS</td>
                                            <td width="10%"class="colorred">OGTT</td>
                                            <td width="10%"class="colorred">HBs Ag</td>
                                            <td width="10%"class="colorred"> HCV Ab</td>
                                            <td width="10%"class="colorred">CUA</td>
                                            <td width="10%"class="colorred">Ferritin</td>
                                            <td width="10%"class="colorred">Lab</td>
                                            <td width="10%"class="colorred"></td>
                                        </tr>
                                        {foreach $investigations as $single}
                                        <tr class="rowinvestigations{$single->id}"> 
                                            <th  >Date</th>
                                            <td ><input class="form-control datepicker"  type="text"  name="invesdhb" data-id="{$single->id}"  data-table="investigations" value="{$single->invesdhb}"  ></td>
                                            <td ><input class="form-control datepicker"  type="text" name="invesdplat" data-id="{$single->id}"  data-table="investigations" value="{$single->invesdplat}" 
                                                        ></td>
                                            <td ><input class="form-control datepicker"  type="text"  name="invesdfbs" data-id="{$single->id}"  data-table="investigations" value="{$single->invesdfbs}" ></td>
                                            <td ><input class="form-control datepicker"  type="text"  name="invesdogtt2" data-id="{$single->id}"  data-table="investigations" value="{$single->invesdogtt2}" ></td>
                                            <td ><input class="form-control datepicker"  type="text"   name="invesdhbs" data-id="{$single->id}"  data-table="investigations" value="{$single->invesdhbs}" ></td>
                                            <td ><input class="form-control datepicker"  type="text"  name="invesdhcv" data-id="{$single->id}"  data-table="investigations" value="{$single->invesdhcv}"  ></td>
                                            <td ><input class="form-control datepicker"  type="text"   name="invesdcua" data-id="{$single->id}"  data-table="investigations" value="{$single->invesdcua}"  ></td>
                                            <td ><input class="form-control datepicker"  type="text"  name="invesdferr" data-id="{$single->id}"  data-table="investigations" value="{$single->invesdferr}" ></td>
                                            <td ><div class="actions">
                                                    <div class="btn-group">
                                                        <a class="btn btn-default btn-sm" href="javascript:;" data-toggle="dropdown">
                                                            Lab <i class="fa fa-angle-down"></i>
                                                        </a>
                                                        <ul class="dropdown-menu pull-right">
                                                            <li>
                                                                <a href="javascript:;" id="addInv">
                                                                    Add </a>
                                                            </li>
                                                            <li>
                                                                <a href="javascript:;" id="showInv" data-controller="ancsheet">
                                                                    Show </a>
                                                            </li>
                                                        </ul>
                                                    </div>
                                                </div></td>
                                            <td width="5%">
                                                <a class="btn grey-cascade btn-xs deleterow" data-id="{$single->id}"  data-table="investigations">
                                                    <i class="fa fa-close"></i>
                                                </a>
                                            </td>
                                        </tr>
                                        <tr class="rowinvestigations{$single->id}"> 
                                            <th  >Result</th>
                                            <td ><input class="form-control "  type="text"  name="investhb" data-id="{$single->id}"  data-table="investigations" value="{$single->investhb}"  ></td>
                                            <td ><input class="form-control "  type="text" name="investplat" data-id="{$single->id}"  data-table="investigations" value="{$single->investplat}" 
                                                        ></td>
                                            <td ><input class="form-control "  type="text"  name="investfbs" data-id="{$single->id}"  data-table="investigations" value="{$single->investfbs}" ></td>
                                            <td ><input class="form-control "  type="text"  name="invesdogtt" data-id="{$single->id}"  data-table="investigations" value="{$single->invesdogtt}" ></td>
                                            <td ><input class="form-control"  type="text"   name="investhbs" data-id="{$single->id}"  data-table="investigations" value="{$single->investhbs}" ></td>
                                            <td ><input class="form-control "  type="text"  name="investhcv" data-id="{$single->id}"  data-table="investigations" value="{$single->investhcv}"  ></td>
                                            <td ><input class="form-control "  type="text"   name="investcua" data-id="{$single->id}"  data-table="investigations" value="{$single->investcua}"  ></td>
                                            <td ><input class="form-control "  type="text"  name="investferr" data-id="{$single->id}"  data-table="investigations" value="{$single->investferr}" ></td>
                                            <td ></td>
                                            <td></td>
                                        </tr>
                                        {/foreach}
                                    </tbody>
                                </table>
                                  <table class="table table-bordered " >
                                <tbody id="infertilityother">
                                    <tr>
                                        <th scope="row" class="thhead" colspan="14">
                                            <a class="addappend" data-add="infertilityother" data-id="{$infertilitysheetid}"  data-table="infertilitysheetid">  Other</a>
                                        </th>
                                    </tr>
                                    <tr>
                                        <th  colspan="1">Name </th>
                                        <th  colspan="1">Date</th>
                                        <th  colspan="1">Details</th>
                                        <th  colspan=""></th>
                                    </tr>
                                    {foreach $infertilityother as $single}
                                    <tr class="rowinfertilityother{$single->id}">
                                        <td width="15%"><input class="form-control "  type="text"    name="othername" value="{$single->othername}"  data-id="{$single->id}"  data-table="infertilityother"  ></td>
                                        <td width="10%"><input class="form-control datepicker"  type="text"    name="otherdate" value="{$single->otherdate}"  data-id="{$single->id}"  data-table="infertilityother"  ></td>
                                        <td width="67%"><input class="form-control "  type="text"    name="otherdetail" value="{$single->otherdetail}"  data-id="{$single->id}"  data-table="infertilityother"  ></td>
                                        <td width="7%">
                                            <a class="btn grey-cascade btn-xs deleterow" data-id="{$single->id}"  data-table="infertilityother">
                                                <i class="fa fa-close"></i>
                                            </a>
                                        </td>
                                    </tr>
                                    
                                    {/foreach}
                                </tbody>
                            </table>
                                <table class="table table-bordered">
                                    <tbody>
                                        <tr>
                                            <th scope="row" style="color: #fff;background:red" colspan="10">
                                                4D
                                            </th>
                                        </tr>
                                        <tr>
                                            <td width="10%"></td>
                                            <td  class="colorred" width="40%">T1 Scan</td>
                                            <td class="colorred">T2 Scan</td>
                                        </tr>
                                        <tr>
                                            <th  >Date</th>
                                            <td ><input class="form-control datepicker"  type="text"     value="{$ancsheet->tscandate}" name="tscandate" data-id="{$id}" data-table="ancsheet"  ></td>
                                            <td ><input class="form-control datepicker"  type="text"      value="{$ancsheet->ttscandate}" name="ttscandate" data-id="{$id}" data-table="ancsheet"  ></td>
                                        </tr>
                                        <tr>
                                            <th  >W</th>
                                            <td ><input type="text"   value="{$ancsheet->tscanw}" name="tscanw" data-id="{$id}" data-table="ancsheet" class="form-control" /></td>
                                            <td ><input type="text"   value="{$ancsheet->ttscanw}" name="ttscanw" data-id="{$id}" data-table="ancsheet" class="form-control" /></td>
                                        </tr>
                                        <tr>
                                            <th  >Result</th>
                                            <td ><input type="text"   value="{$ancsheet->tscanresult}" name="tscanresult" data-id="{$id}" data-table="ancsheet" class="form-control" /></td>
                                            <td ><input type="text"   value="{$ancsheet->ttscanresult}" name="ttscanresult" data-id="{$id}" data-table="ancsheet" class="form-control" /></td>
                                        </tr>
                                        <tr>
                                            <th  >Report</th>
                                            <td ><input type="text"   value="{$ancsheet->tscanreport}" name="tscanreport" data-id="{$id}" data-table="ancsheet" class="form-control" /></td>
                                            <td ><input type="text"   value="{$ancsheet->ttscanreport}" name="ttscanreport" data-id="{$id}" data-table="ancsheet" class="form-control" /></td>
                                        </tr>
                                    </tbody>
                                </table>
                                <table class="table table-bordered  ttt" >
                                    <tbody id="operations">
                                        <tr>
                                            <th scope="row" class="thhead" colspan="14">
                                                <a class="addappend" data-add="operations" data-id="{$infertilitysheetid}"  data-table="infertilitysheetid">  operations  </a>
                                            </th>
                                        </tr>
                                        <tr>
                                            <th  colspan="1"></th>
                                            <th  colspan="1">operation</th>
                                            <th  colspan="1">Date</th>
                                            <th  colspan="1">place</th>
                                            <th  colspan="1">histopath</th>
                                            <th  colspan="1">Cost</th>
                                            <th  colspan="1">notes</th>
                                            <th  colspan="1"></th>
                                        </tr>
                                        {assign var="i" value="1"}
                                        {foreach $operations as $single}
                                        <tr class="rowoperations{$single->id}">
                                            <td width="7%">{$i}</td>
                                            <td  width="14%" style="max-width: 33px">
                                                <select   multiple="" class="form-control getselectajax operation" name="operation" data-id="{$single->id}"  data-table="operations"  data-celtable="operation" id="operation{$single->id}" data-selid="{$single->id}" >
                                                </select>
                                            </td>
                                            <td  width="5%" >
                                                <input class="form-control datepicker"  type="text"     name="date" value="{$single->date}" id="date_{$single->id}" data-id="{$single->id}"  data-table="operations"   >
                                            </td>
                                            <td width="13%"><select   class="form-control getselectajax place" name="place" data-id="{$single->id}"  data-table="operations"  data-celtable="place" id="place{$single->id}" data-selid="{$single->id}" >
                                                </select>
                                            </td>
                                            <td  width="14%" style="max-width: 33px">
                                                <select   multiple="" class="form-control getselectajax histopath" name="histopath" data-id="{$single->id}"  data-table="operations"  data-celtable="histopath" id="histopath{$single->id}" data-selid="{$single->id}" >
                                                </select>
                                            </td>
                                            <td width="7%"><input class="form-control "  type="text"     name="cost" value="{$single->cost}"  data-id="{$single->id}"  data-table="operations"   ></td>
                                            <td width="7%"><input class="form-control"  type="text"      name="note" value="{$single->note}"  data-id="{$single->id}"  data-table="operations"   ></td>
                                            <td width="5%">
                                                <a class="btn grey-cascade btn-xs deleterow" data-id="{$single->id}"  data-table="operations">
                                                    <i class="fa fa-close"></i>
                                                </a>
                                            </td>
                                        </tr>
                                        {assign var="i" value=$i+1}
                                        {/foreach}
                                    </tbody>
                                </table>
                                <table class="table table-bordered">
                                    <tbody id="ancnewvisit">
                                        <tr>
                                            <th style="color: #fff;background:#19ae19" colspan="7"> 
                                                <a style="color: #fff"class="addappend" data-add="ancnewvisit" data-id="{$id}"  data-table="ancsheetid">New Visit</a>
                                            </th>
                                        </tr>
                                        {foreach $ancnewvisit as $single}
                                        <tr class="rowancnewvisit{$single->id}"> 
                                             <th width="10%" >Date</th>
                                             <th width="11%" >W</th>
                                             <th width="12%" >Bw</th>
                                             <th width="7%" >BP</th>
                                             <th  width="50%" >Notes</th>
                                             <th  width="20%" colspan="2">TTT (Button)</th>
                                        </tr>
                                        <tr class="rowancnewvisit{$single->id}"> 
                                            <td ><input class="form-control datepicker vdate2 "  type="text"  name="newvisitdate" data-id="{$single->id}" data-table="ancnewvisit"   value="{$single->newvisitdate}"></td>
                                            <td ><label data-id="{$single->id}" {if $single->newvisitdate < $ancsheet->sheetlmp}style="color: red;font-size: 12px;" {else} style="color: maroon; font-weight : bolder; font-size: 12px;" {/if}>{$single->newvisitw}</label>
                                                <input class="form-control"  type="hidden"   name="newvisitw" data-id="{$single->id}" id="newvisitw_{$single->id}" data-table="ancnewvisit"  value="{$single->newvisitw}" ></td>
                                            <td ><input class="form-control"  type="text"    name="newvisitbw" data-id="{$single->id}" data-table="ancnewvisit"  value="{$single->newvisitbw}"></td>
                                             <td ><input class="form-control bp_mask"  type="text"   name="newvisitbp" data-id="{$single->id}" data-table="ancnewvisit" value="{$single->newvisitbp}" ></td>


                                           <!--  <td ><input class="form-control"  type="text"   name="newvisitnote2" data-id="{$single->id}" data-table="ancnewvisit"  value="{$single->newvisitnote2}" ></td> -->
                                            
                                            <td ><input class="form-control"  type="text"   name="newvisitnote" data-id="{$single->id}" data-table="ancnewvisit"  value="{$single->newvisitnote}"></td>
                                            

                                            <td  > 
                                                <div class="actions">
                                                    <div class="btn-group">
                                                        <a class="btn btn-default btn-sm" href="javascript:;" data-toggle="dropdown">
                                                            TTT <i class="fa fa-angle-down"></i>
                                                        </a>
                                                        <ul class="dropdown-menu pull-right">
                                                            <li>
                                                                <a href="javascript:;" id="addDrug"  data-date="{$presDate}" data-controller="ancsheet">
                                                                    Add </a>
                                                            </li>
                                                            <li>
                                                                <a href="javascript:;" id="showDrugs" data-controller="ancsheet">
                                                                    Show </a>
                                                            </li>
                                                        </ul>
                                                    </div>
                                                </div>

                                            </td>
                                            <td>
                                                <a class="btn grey-cascade btn-xs deleterow" data-id="{$single->id}"  data-table="ancnewvisit">
                                                    <i class="fa fa-close"></i>
                                                </a>
                                            </td>
                                        </tr>


                                        <tr class="rowancnewvisit{$single->id}"> 
                                            <th width="10%" >N</th>
                                            <th width="11%" >EFW</th>
                                            <th width="23%" colspan="2">Placenta</th>
                                            <th width="50%"  >Biom - FHR</th>
                                            <th  width="10%" colspan="2">AF</th>
                                            
                                        </tr>
                                        <tr class="rowancnewvisit{$single->id}"> 
                                            <td  >
                                                <select  class="form-control getselectajax usn" name="usn" data-id="{$single->id}"  data-table="ancnewvisit"  data-celtable="usn" id="usn{$single->id}" data-selid="{$single->id}" >
                                                </select>
                                            </td>

                                            <td ><input class="form-control "  type="text"   name="usefw" data-id="{$single->id}" data-table="ancnewvisit"  value="{$single->usefw}"  ></td>
                                             <td  colspan="2">
                                                <select  class="form-control getselectajax usplace" name="usplace" data-id="{$single->id}"  data-table="ancnewvisit"  data-celtable="usplace" id="usplace{$single->id}" data-selid="{$single->id}" >
                                                </select>
                                            </td>
                                            <td ><input class="form-control"  type="text"    name="usbiom" data-id="{$single->id}" data-table="ancnewvisit"  value="{$single->usbiom}" ></td>
                                           
                                            <td  colspan="2">
                                                <select  class="form-control getselectajax usaf" name="usaf" data-id="{$single->id}"  data-table="ancnewvisit"  data-celtable="usaf" id="usaf{$single->id}" data-selid="{$single->id}" >
                                                </select>
                                            </td>
                                           

                                        </tr>
                                        <tr class="rowancnewvisit{$single->id}">

                                            <td colspan="7"><input class="form-control"  type="text"   name="plan" data-id="{$single->id}" data-table="ancnewvisit"  value="{$single->plan}" placeholder="plan"></td>

                                        </tr> 
                                        {/foreach}
                                    </tbody>
                                </table>

                                <div class="actions">
                                    <a href="{$hosturl}/controllers/ancsheet.php?ac=archive&amp;patientid={$patientid}" class="btn btn-default btn-sm">
                                        Archive pregnancy
                                    </a>
                                    <button id="historys" data-kind="no" class="btn red historys">
                                        End Pregnancy
                                    </button>
                                </div>
                                <table class="table table-bordered  ttt" >
                                    <tbody id="registeration">
                                        <tr>
                                            <th scope="row" class="thhead" colspan="16">
                                                <a class="addappend" data-add="registeration" data-id="{$id}"  data-table="ancsheetid">  registeration  </a>
                                            </th>
                                        </tr>
                                        <tr>
                                            <th  colspan="1"></th>
                                            <th  colspan="1">(Obst History) P</th>
                                            <th  colspan="1">D - place</th>
                                            <th  colspan="1">origin</th>
                                            <!-- <th  colspan="1">D - place</th> -->
                                            <th  colspan="1">R - place</th>
                                            <th  colspan="1">type</th>
                                            <th  colspan="1">Cost</th>
                                            <th  colspan="1"></th> 
                                        </tr>
                                        {assign var="i" value="1"}
                                        {foreach $registeration as $single}
                                        <tr class="rowregisteration{$single->id}">
                                            <td width="7%">{$i}</td>
                                            <td width="7%"><select   class="form-control select2me awifep" name="awifep" data-id="{$single->id}"  data-table="registeration"  data-celtable="awifep" id="awifep{$single->id}" data-selid="{$single->id}" >
                                                    <option value="">choose</option>
                                                    {foreach $awifep as $comp}
                                                    <option value="{$comp->id}" {if $comp->id eq $single->awifep}selected="selected"{/if}>{$comp->name}</option>
                                                    {/foreach}
                                                </select>
                                            </td>
                                            <td width="7%"><select   class="form-control getselectajax place2" name="place2" data-id="{$single->id}"  data-table="registeration"  data-celtable="place2" id="place2{$single->id}" data-selid="{$single->id}" >
                                                </select>
                                            </td>
                                            <td width="7%"><select   class="form-control getselectajax origin" name="origin" data-id="{$single->id}"  data-table="registeration"  data-celtable="origin" id="origin{$single->id}" data-selid="{$single->id}" >
                                                </select>
                                            </td>
                                            <!-- td width="7%"><input class="form-control"  type="text"   name="dplace" data-id="{$single->id}" data-table="registeration"  value="{$single->dplace}" ></td> -->
                                            <!-- <td width="7%"><input class="form-control"  type="text"   name="rplace" data-id="{$single->id}" data-table="registeration"  value="{$single->rplace}" ></td> -->

                                            <td width="7%"><select   class="form-control getselectajax rplacer" name="rplace" data-id="{$single->id}"  data-table="registeration"  data-celtable="rplacer" id="rplacer{$single->id}" data-selid="{$single->id}" >
                                                </select>
                                            </td>

                                            <td width="7%"><select   class="form-control getselectajax type" name="type" data-id="{$single->id}"  data-table="registeration"  data-celtable="type" id="type{$single->id}" data-selid="{$single->id}" >
                                                </select>
                                            </td>
                                            <td width="7%"><input class="form-control"  type="text"   name="coast" data-id="{$single->id}" data-table="registeration"  value="{$single->coast}" ></td>
                                            <td width="5%">
                                                <a class="btn grey-cascade btn-xs deleterow" data-id="{$single->id}"  data-table="registeration">
                                                    <i class="fa fa-close"></i>
                                                </a>
                                            </td>
                                        </tr>

                                        {assign var="i" value=$i+1}
                                        {/foreach}
                                    </tbody>
                                </table>

                                <div class="form-group">
                                    <div class="col-md-1"></div>
                                    <div class="col-md-8">
                                    </div>
                                </div>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>



<div class="all">   
    <!---------------------------------------------------------------------------add Drugs Model-------------------------------------------------------------------------------------->

    <div class="modal fade" tabindex="-1" role="dialog" aria-hidden="false" data-backdrop="static" data-keyboard="false"   id="addPatientDrugs" style="min-width:1000px;">
        <div class="modal-dialog  modal-lg wds90">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close closeDrug" 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="gynaDrugs" enctype="multipart/form-data">
                            <div class="row">
                                <div class="col-md-12">
                                    <div class="portlet blue-hoki box">
                                        <div class="portlet-title" >
                                            <div class="caption" style=" font-size: 16px; font-weight: 700; width: 280px; "> Today <input type="text" class="form-control datepicker " data-controller="ancsheet"  id="presDate" name="presDate" value="{$presDate}"  readonly="" placeholder="Date" style="display: inline;width: 110px;margin: 0px 10px;"> </div>
                                            <div class="actions">
                                                <a href="javascript:;" class="btn btn-default btn-sm" id="addNewDrugRow" data-tableName="ancsheetdrugs">
                                                    <i class="fa fa-plus"></i> Add </a>
                                                <a href="javascript:;" class="btn btn-default btn-sm" id="addNewDrugInTable">
                                                    <i class="fa fa-plus"></i> Add New Drug </a>
                                            </div>
                                            <div id="husbandFor">
                                                <label class="bold" style="font-size: 16px;"> Husband<input type="checkbox" id="forHusband" name="forHusband"  value="1" data-controller="ancsheet"> </label>
                                            </div>
                                            <div class="caption" style=" font-size: 16px; font-weight: 700; width: 280px; "> Print Date <input type="text" class="form-control datepicker " data-controller="ancsheet"  id="printDate" name="printDate" value="{$presDate}"  readonly="" placeholder="Date" style="display: inline;width: 110px;margin: 0px 10px;"> </div>
                                        </div>

                                        <div class="portlet-body scroll_y showNum isheight">

                                            <table class="table table-striped table-hover table-bordered" id="pre_table" >
                                                <thead>
                                                    <tr>
                                                        <th class="col-md-2">
                                                            Group
                                                        </th>
                                                        <th class="col-md-2">
                                                            Drug
                                                        </th>
                                                        <th class="col-md-2">
                                                            Form
                                                        </th>
                                                        <th class="col-md-5">
                                                            Use
                                                        </th>

                                                        <th >
                                                            Delete
                                                        </th>
                                                    </tr>
                                                </thead>
                                                <tbody id="drugContent">

                                                    <tr style="display: none"><td colspan="5" ><input type="hidden" id="drugItr" value="{$preItr}" name="drugItr"/></td></tr>
                                                    {assign var=itr value=1}
                                                    {foreach $PatientPresByDate as $pre}
                                                    <tr>
                                                        <td>
                                                            <select class="form-control xx dcat select2me" id="dcat{$itr}" name="dcat{$itr}"  data-itr="{$itr}"  data-placeholder="Select..."  >
                                                                <option value="" {if $pre->drugcat == ""}selected{/if}>Choose Category</option>
                                                                {foreach $allDrugcats as $cat}
                                                                <option value="{$cat['drugcat']}" {if $pre->drugcat == $cat['drugcat'] }selected{/if}>{$cat['drugcat']}</option>
                                                                {/foreach}
                                                                <option value="" {if $pre->drugcat == ""}selected{/if}>Choose Category</option>
                                                            </select>
                                                        </td>
                                                        <td>
                                                            <select class="form-control xx dname select2me updateElement" id="dname{$itr}" data-id="{$pre->id}" data-colName="drugid" data-tableName="ancsheetdrugs" data-itr="{$itr}" data-placeholder="Select..."  >
                                                                <option value="" {if $pre->drugid == ""}selected{/if}>Choose Drug</option>
                                                                {foreach $drugs as $drug}
                                                                <option value="{$drug['id']}" {if $pre->drugid == $drug['id'] }selected{/if}>{$drug['drugname']} {if $ProgramesettingData->visitsform eq 3}(left {$drug['currentbalance']}){/if}</option>
                                                                {/foreach}
                                                                <option value="" {if $pre->drugid == ""}selected{/if}>Choose Drug</option>
                                                            </select>

                                                        </td>
                                                        <td>
                                                            <select class="form-control xx dtype select2me updateElement" id="dtype{$itr}" data-id="{$pre->id}" data-colName="drugtype" data-tableName="ancsheetdrugs" data-itr="{$itr}" data-placeholder="Select..."  >
                                                                <option value="" {if $pre->drugtype == ""}selected{/if}>Choose Form</option>
                                                                {foreach $allDrugTypes as $type}
                                                                <option value="{$type['drugtype']}" {if $pre->drugtype == $type['drugtype'] }selected{/if}>{$type['drugtype']}</option>
                                                                {/foreach}
                                                                <option value="" {if $pre->drugtype == ""}selected{/if}>Choose Form</option>
                                                            </select>
                                                        </td>
                                                        <td>
                                                            <select class="form-control xx select2me updateElement" id="ddos{$itr}" data-id="{$pre->id}" data-colName="drugdos" data-tableName="ancsheetdrugs" data-itr="{$itr}" data-placeholder="Select..."  >
                                                                <option value="" {if $pre->drugdos == ""}selected{/if}>choose dose </option>
                                                                {foreach $allDrugDoses as $dos}
                                                                <option value="{$dos['drugdos']}" {if $pre->drugdos == $dos['drugdos'] }selected{/if}>{$dos['drugdos']}</option>
                                                                {/foreach}
                                                                <option value="" {if $pre->drugdos == ""}selected{/if}>choose dose </option>
                                                            </select>
                                                        </td>

                                                        <td>
                                                            <a class="btn grey-cascade btn-xs deletemsgEX" data-id="{$pre->id}" style=" float: left;" href="#" data-link="ancsheet" data-fn="addprescription">
                                                                <i class="fa fa-close"></i>
                                                            </a>
                                                        </td>
                                                    </tr>
                                                    {capture assign=itr}{$itr+1}{/capture}
                                                    {/foreach}

                                                </tbody>
                                            </table>



                                            <input type="hidden" id="pId" value="" name="patientId"/>
                                            <input type="hidden" id="preType" value="" name="preType"/>
                                            <input type="hidden" id="mainId" value="" name="mainId"/>
                                            <input type="hidden" id="preFor" value="" name="preFor"/>

                                            <div id="drugPrint">

                                            </div>
                                        </div>

                                    </div>
                                </div>
                                <div class="modal-footer">
                                    <button type="button" class="btn default printPre"  data-type="add" data-controller="ancsheet"> Print  </button>
                                    <button type="button" class="btn default closeDrug" id="closemodel" data-dismiss="modal"> Close</button>
                                </div>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <!---------------------------------------------------------------------------show Drugs Model-------------------------------------------------------------------------------------->
    <div class="modal fade" tabindex="-1" role="dialog" aria-hidden="false" data-backdrop="static" data-keyboard="false"   id="showPatientDrugs" style="min-width:1000px;z-index: 10049;">
        <div class="modal-dialog  modal-lg wds90">
            <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">
                        <div class="row">
                            <div class="col-md-12">
                                <div class="portlet blue-hoki box">
                                    <div class="portlet-title" >
                                        <div class="caption"> Prescriptions </div>
                                    </div>
                                    <div class="portlet-body" id="showPrescriptions">

                                        <table class="table table-striped table-hover table-bordered">
                                            <thead>
                                                <tr>
                                                    <th>
                                                        Date
                                                    </th>
                                                    <th>
                                                        Drug Name
                                                    </th>

                                                    <th>
                                                        Edit
                                                    </th>
                                                    <th>
                                                        Print
                                                    </th>
                                                    <th>
                                                        {if $ProgramesettingData->displaydoctorname eq 1}Doctor{/if}
                                                    </th>
                                                </tr>
                                            </thead>

                                        </table>

                                    </div>
                                    <div id="drugPrintShow">

                                    </div>
                                </div>
                            </div>
                            <div class="modal-footer">

                                <button type="button" class="btn default" id="closemodel" data-dismiss="modal"> Close</button>

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

    <!--------------------------------------------------------------------------- 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">
            <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="caption" style=" font-size: 16px; font-weight: 700; width: 280px; "> Today <input type="text" class="form-control datepicker " id="invDate" name="invDate" value="{$presDate}"  readonly="" placeholder="Date" style="display: inline; width: 62%"> </div>
                                            <div class="actions">
                                                <button type="button" class="btn default printInvestigation" data-print ="0" data-controller="ancsheet"> Save </button>
                                                <button type="button" class="btn default printInvestigation" data-print ="1" data-controller="ancsheet"> Save and Print  </button>
                                                <button type="button" class="btn default" id="closemodel" data-dismiss="modal"> Close</button>
                                            </div>

                                            <label class="husbandx">
                                                <span> Husband
                                                    <input type="checkbox" id="forHusbandInv" name="forHusband"  value="1" style="padding: 4px 10px;">
                                                </span>
                                            </label>
                                            <div class="caption" style=" font-size: 16px; font-weight: 700; width: 280px; "> Print Date <input type="text" class="form-control datepicker " data-controller="ancsheet"  id="printInvDate" name="printInvDate" value="{$presDate}"  readonly="" placeholder="Date" style="display: inline;width: 110px;margin: 0px 10px;"> </div>
                                        </div>

                                        <div class="portlet-body">
                                            <input type="hidden" id="pId1" value="" name="patientId"/>
                                            <input type="hidden" id="mainId1" value="" name="mainId"/>
                                            <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[]">
                                                            </span> {$inv->name}
                                                        </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[]">
                                                            </span> {$inv->name}
                                                        </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" id="" class="iiin {$cat->id}Check"  value="{$inv->id}" name="invCheck[]">
                                                            </span> {$inv->name}
                                                        </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[]">
                                                            </span> {$inv->name}
                                                        </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[]">
                                                            </span> {$inv->name}
                                                        </label>

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

                                                    {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[]">
                                                            </span> {$inv->name}
                                                        </label>

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

                                                    {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="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[]">
                                                            </span> {$inv->name}
                                                        </label>

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

                                            <div  id="inv_div">

                                            </div>




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

                            </div>


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



    <!--------------------------------------------------------------------------- show Investigation Model-------------------------------------------------------------------------------------->
    <div class="modal fade" tabindex="-1" role="dialog" aria-hidden="false" data-backdrop="static" data-keyboard="false"   id="showPatientInvestigation" style="min-width:1000px;">
        <div class="modal-dialog  modal-lg wds90">
            <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">
                        <div class="row">
                            <div class="col-md-12">
                                <div class="portlet blue-hoki box">
                                    <div class="portlet-title">
                                        <div class="caption"> Investigations  </div>
                                    </div>
                                    <div class="portlet-body">
                                        <div  id="showInvs">
                                            <table class="table table-striped table-hover table-bordered">
                                                <thead>
                                                    <tr>
                                                        <th> <div align="center">Date </div></th>
                                                        <th colspan="3"> <div align="center">Investigations </div></th>
                                                    </tr>
                                                </thead>

                                            </table>
                                        </div>
                                        <div  id="inv_divShow">

                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="modal-footer">
                                <button type="button" class="btn default" id="closemodel" data-dismiss="modal"> Close</button>

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





</div>

