<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: baseline !important; 
    }
    input{
        border: none !important;
    }
    table{
        width: 100% !important;
        padding: 0px 20px;
    }
    .hidetable{
        display: none;
    }
</style>
<div class="page-content-wrapper">
    <div class="page-content all">

        <input type="hidden" id="patientId" value="{$patientid}"/>

        <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="{$id}" >
                <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> Gyna 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="{$gynasheetid}" data-table="gynasheet"  value="{$gynasheet->importantnote}"  placeholder="Critical Data">
                    <div style="font-size: 15px">{$gynasheet->importantnote}</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="tablep"  value="infertilitysheet" />
                        <div class="form-body">
                            <h2 > Gyna Sheet</h2>
                            <hr>
                            <div class="row rowtoggle" >
                                <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="5" width="80%" class="tdcolor">Menstrual History</td>
                                        <td colspan="1" class="tdcolor">Sexual History</td>
                                    </tr>
                                    <tr>
                                        <td colspan="5"  style="padding: 0px;">
                                            <table style="width: 100%;margin-bottom: 0px;">
                                                <tr>
                                                    <td >Reg</td>
                                                    <td >C/D</td>
                                                    <td >Amount</td>
                                                    <td >Dysm</td>
                                                    <td >LMP</td>
                                                </tr>
                                                <tr>
                                                    <td >
                                                        <select class="form-control getselectajax menstrualreg" name="menstrualreg" data-id="{$id}"  data-table="infertilitysheet"  data-celtable="menstrualreg" id="menstrualreg{$id}" data-selid="{$id}" >
                                                        </select>
                                                    </td>
                                                    <td width="15%"><input class="form-control bp_mask"  type="text"     data-id="{$id}" value="{$infertilitysheet->wmenstrualcd}" name="wmenstrualcd" data-table="infertilitysheet"  ></td>
                                                    <td >
                                                        <select  class="form-control getselectajax menstrualamount" name="menstrualamount" data-id="{$id}"  data-table="infertilitysheet"  data-celtable="menstrualamount" id="menstrualamount{$id}" data-selid="{$id}" >
                                                        </select>
                                                    </td>
                                                    <td >
                                                        <select  class="form-control getselectajax menstrualdysm" name="menstrualdysm" data-id="{$id}"  data-table="infertilitysheet"  data-celtable="menstrualdysm" id="menstrualdysm{$id}" data-selid="{$id}" >
                                                        </select>
                                                    </td>
                                                    <td width="10%"><input class="form-control datepicker"  type="text"     data-id="{$id}" value="{$infertilitysheet->wmenstruallmp}" name="wmenstruallmp" data-table="infertilitysheet"  ></td>
                                                </tr>
                                            </table>
                                        </td>
                                        <td colspan="1"><input type="text"  data-id="{$id}" value="{$infertilitysheet->wsexual}" name="wsexual" data-table="infertilitysheet"  class="form-control" /></td>
                                    </tr>
                                </tbody>
                            </table>
                            <table class="table table-bordered hidetable history2" >
                                <tbody>
                                    <tr>
                                        <td  colspan="2" class="tdcolor"> Medical History</td>
                                        <td  colspan="2" class="tdcolor">Surgical History </td>
                                        <td  colspan="2" class="tdcolor">Family History</td>
                                    </tr>
                                    <tr>
                                        <td  colspan="1" style="max-width: 30px">
                                            <select multiple="" class="form-control getselectajax medicalhistory" name="medicalhistory" data-id="{$id}"  data-table="infertilitysheet"  data-celtable="medicalhistory" id="medicalhistory{$id}" data-selid="{$id}" >
                                            </select>
                                        </td>
                                        <td  colspan="1" width="10%"> <input type="text" data-id="{$id}" value="{$infertilitysheet->w2medical}" name="w2medical" data-table="infertilitysheet" class="form-control" /></td>
                                        <td  colspan="1" style="max-width: 30px">
                                            <select multiple="" class="form-control getselectajax surgicalhistory" name="surgicalhistory" data-id="{$id}"  data-table="infertilitysheet"  data-celtable="surgicalhistory" id="surgicalhistory{$id}" data-selid="{$id}" >
                                            </select>
                                        </td>
                                        <td  colspan="1" width="10%"> <input type="text" data-id="{$id}" value="{$infertilitysheet->wsurgical}" name="wsurgical" data-table="infertilitysheet" class="form-control" /></td>
                                        <td  colspan="1" style="max-width: 30px">
                                            <select multiple="" class="form-control getselectajax familyhistory" name="familyhistory" data-id="{$id}"  data-table="infertilitysheet"  data-celtable="familyhistory" id="familyhistory{$id}" data-selid="{$id}" >
                                            </select>
                                        </td>
                                        <td  colspan="1" width="10%"> <input type="text" data-id="{$id}" value="{$infertilitysheet->wfamily}" name="wfamily" data-table="infertilitysheet" class="form-control" /></td>
                                    </tr>
                                </tbody>
                            </table>

                            <div id="hysteroscopy2"></div>
                            <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="{$id}"  data-table="infertilitysheetid">(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 digitsOnly" />
                                        </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="{$id}"  data-table="infertilitysheetid" >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 >
                                            <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="10%"><input type="text" name="wifeepcw" value="{$single->wifeepcw}"  data-id="{$single->id}"  data-table="wifeepc" class="form-control" /></td>
                                        <td >
                                            <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 >
                                            <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="10%"><input class="form-control"  type="text"  name="histopath" value="{$single->histopath}"  data-id="{$single->id}"  data-table="wifeepc" ></td>
                                        <td width="10%"><input type="text" name="coast" value="{$single->coast}"  data-id="{$single->id}"  data-table="wifeepc" class="form-control digitsOnly" /></td>

                                        <td ><input type="text" name="wifeepcp" value="{$single->wifeepcp}"  data-id="{$single->id}"  data-table="wifeepc" class="form-control" /></td>
                                        <td ><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>
                                    {/foreach}
                                </tbody>
                            </table>

                            <div class="row rowtoggle" >
                                <a class="btn grey-cascade btn-xs toggle" data-show="Examination2" >Examination</a>
                            </div>
                            <table class="table table-bordered hidetable Examination2">
                                <tbody>
                                    <tr>
                                        <td  colspan="2" class="tdcolor">  General </td>
                                        <td  colspan="2" class="tdcolor"> Local </td>
                                    </tr>
                                    <tr>
                                        <td  colspan="1" width="10%"> BW</td>
                                        <td  colspan="1"> <input type="text" value="{$infertilitysheet->generalbw}" name="generalbw" data-id="{$id}" data-table="infertilitysheet" class="form-control" /></td>
                                        <td  colspan="1" width="10%">Vulva</td>
                                        <td  colspan="1" style="max-width: 33px">
                                            <select multiple="" class="form-control getselectajax localvulva" name="localvulva" data-id="{$id}"  data-table="infertilitysheet"  data-celtable="localvulva" id="localvulva{$id}" data-selid="{$id}" >
                                            </select>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td  colspan="1" width="10%">BMI </td>
                                        <td  colspan="1"> <input type="text" value="{$infertilitysheet->generalbmi}" name="generalbmi" data-id="{$id}" data-table="infertilitysheet" class="form-control" /></td>
                                        <td  colspan="1" width="10%">Vagina</td>
                                        <td  colspan="1" style="max-width: 33px">
                                            <select multiple="" class="form-control getselectajax localvagina" name="localvagina" data-id="{$id}"  data-table="infertilitysheet"  data-celtable="localvagina" id="localvagina{$id}" data-selid="{$id}" >
                                            </select>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td  colspan="1" width="10%"> Breast</td>
                                        <td  colspan="1">
                                            <select  class="form-control getselectajax generalbreast" multiple name="generalbreast" data-id="{$id}"  data-table="infertilitysheet"  data-celtable="generalbreast" id="generalbreast{$id}" data-selid="{$id}" >
                                            </select>
                                        </td>
                                        <td  colspan="1" width="10%">CX</td>
                                        <td  colspan="1" style="max-width: 33px">
                                            <select multiple="" class="form-control getselectajax localcx" name="localcx" data-id="{$id}"  data-table="infertilitysheet"  data-celtable="localcx" id="localcx{$id}" data-selid="{$id}" >
                                            </select>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td  colspan="1" width="10%">Hirsutism </td>
                                        <td  colspan="1">
                                            <select  class="form-control getselectajax generalhirsutism" name="generalhirsutism" data-id="{$id}"  data-table="infertilitysheet"  data-celtable="generalhirsutism" id="generalhirsutism{$id}" data-selid="{$id}" >
                                            </select>
                                        </td>
                                        <td  colspan="1" width="10%">Other</td>
                                        <td  colspan="1"> <input type="text" value="{$infertilitysheet->localother}" name="localother" data-id="{$id}" data-table="infertilitysheet" class="form-control" /></td>
                                    </tr>
                                    <tr>
                                        <td  colspan="1" width="10%"> Thyroid</td>
                                        <td  colspan="1">
                                            <select  class="form-control getselectajax generalthyroid" name="generalthyroid" data-id="{$id}"  data-table="infertilitysheet"  data-celtable="generalthyroid" id="generalthyroid{$id}" data-selid="{$id}" >
                                            </select>
                                        </td>
                                        <td  colspan="1" width="10%">Other</td>
                                        <td  colspan="1"> <input type="text" value="{$infertilitysheet->localother1}" name="localother1" data-id="{$id}" data-table="infertilitysheet" class="form-control" /></td>
                                    </tr>
                                </tbody>
                            </table>
                            <div class="row rowtoggle" >
                                <a class="btn grey-cascade btn-xs toggle " data-show="investigations2" >Investigations</a>
                            </div>
                            <table class="table table-bordered hidetable investigations2" >
                                <tbody id="hormonalprofile2">
                                    <tr>
                                        <th scope="row" class="thhead" colspan="15">
                                            <a class="addappend" data-add="hormonalprofile2" data-id="{$id}"  data-table="infertilitysheetid">Hormonal Profile  </a>
                                        </th>
                                    </tr>
                                    <tr>
                                        <td ></td>
                                        <td class="colorred">AMH</td>
                                        <td class="colorred">TSH</td>
                                        <td class="colorred">PRL</td>
                                        <td class="colorred">FSH</td>
                                        <td class="colorred">LH</td>
                                        <td class="colorred">E2</td>
                                        <td class="colorred">P4</td>
                                        <td class="colorred">Other</td>
                                        <td class="colorred"></td>
                                    </tr>
                                    {foreach $hormonalprofile2 as $single}
                                    <tr class="rowhormonalprofile2{$single->id}">
                                        <th scope="row" >Date</th>
                                        <td ><input class="form-control datepicker"  type="text" name="dateamh" value="{$single->dateamh}"  data-id="{$single->id}"  data-table="hormonalprofile2"  ></td>
                                        <td ><input class="form-control datepicker"  type="text"   name="datetsh" value="{$single->datetsh}"  data-id="{$single->id}"  data-table="hormonalprofile2"  ></td>
                                        <td ><input class="form-control datepicker"  type="text"    name="dateprl" value="{$single->dateprl}"  data-id="{$single->id}"  data-table="hormonalprofile2"  ></td>
                                        <td ><input class="form-control datepicker"  type="text"    name="datefsh" value="{$single->datefsh}"  data-id="{$single->id}"  data-table="hormonalprofile2"  ></td>
                                        <td ><input class="form-control datepicker"  type="text"    name="datelh" value="{$single->datelh}"  data-id="{$single->id}"  data-table="hormonalprofile2"  ></td>
                                        <td ><input class="form-control datepicker"  type="text"    name="datee2" value="{$single->datee2}"  data-id="{$single->id}"  data-table="hormonalprofile2"  ></td>
                                        <td ><input class="form-control datepicker"  type="text"    name="datep4" value="{$single->datep4}"  data-id="{$single->id}"  data-table="hormonalprofile2"  ></td>
                                        <td ><input class="form-control datepicker"  type="text"    name="dateother" value="{$single->dateother}"  data-id="{$single->id}"  data-table="hormonalprofile2"  ></td>
                                        <td>
                                            <a class="btn grey-cascade btn-xs deleterow" data-id="{$single->id}"  data-table="hormonalprofile2">
                                                <i class="fa fa-close"></i>
                                            </a>
                                        </td>
                                    </tr>
                                    <tr class="rowhormonalprofile2{$single->id}">
                                        <th scope="row" >Result</th>
                                        <td ><input type="text" name="resultamh" value="{$single->resultamh}"  data-id="{$single->id}"  data-table="hormonalprofile2" class="form-control" /></td>
                                        <td ><input type="text" name="resulttsh" value="{$single->resulttsh}"  data-id="{$single->id}"  data-table="hormonalprofile2" class="form-control" /></td>
                                        <td ><input type="text" name="resultprl" value="{$single->resultprl}"  data-id="{$single->id}"  data-table="hormonalprofile2" class="form-control" /></td>
                                        <td ><input type="text" name="resultfsh" value="{$single->resultfsh}"  data-id="{$single->id}"  data-table="hormonalprofile2" class="form-control" /></td>
                                        <td ><input type="text" name="resultlh" value="{$single->resultlh}"  data-id="{$single->id}"  data-table="hormonalprofile2" class="form-control" /></td>
                                        <td ><input type="text" name="resulte2" value="{$single->resulte2}"  data-id="{$single->id}"  data-table="hormonalprofile2" class="form-control" /></td>
                                        <td ><input type="text" name="resultp4" value="{$single->resultp4}"  data-id="{$single->id}"  data-table="hormonalprofile2" class="form-control" /></td>
                                        <td ><input type="text" name="resultother" value="{$single->resultother}"  data-id="{$single->id}"  data-table="hormonalprofile2" class="form-control" /></td>
                                        <td></td>
                                    </tr>
                                    {/foreach}
                                </tbody>
                            </table>
                            <table class="table table-bordered hidetable investigations2" >
                                <tbody id="tvs">
                                    <tr>
                                        <th scope="row" class="thhead" colspan="14">
                                            <a class="addappend" data-add="tvs" data-id="{$id}"  data-table="infertilitysheetid">TVS</a>
                                        </th>
                                    </tr>
                                    {foreach $tvs as $single}
                                    <tr class="rowtvs{$single->id}">   
                                        <th width="15%" >Date</th>
                                        <td ><input class="form-control datepicker"  type="text"    name="comment" value="{$single->comment}"  data-id="{$single->id}"  data-table="tvs"  ></td>
                                        <td width="5%">
                                            <a class="btn grey-cascade btn-xs deleterow" data-id="{$single->id}"  data-table="tvs">
                                                <i class="fa fa-close"></i>
                                            </a>
                                        </td>
                                    </tr>
                                    <tr class="rowtvs{$single->id}"> 
                                        <th width="15%" >UT</th>
                                        <td >
                                            <select  multiple="" class="form-control getselectajax tvsut" name="tvsut" data-id="{$single->id}"  data-table="tvs"  data-celtable="tvsut" id="tvsut{$single->id}" data-selid="{$single->id}" >
                                            </select>
                                        </td>
                                        <td></td>
                                    </tr>
                                    <tr class="rowtvs{$single->id}"> 
                                        <th width="15%" >CX</th>
                                        <td >
                                            <select  multiple="" class="form-control getselectajax tvscx" name="tvscx" data-id="{$single->id}"  data-table="tvs"  data-celtable="tvscx" id="tvscx{$single->id}" data-selid="{$single->id}" >
                                            </select>
                                        </td>
                                        <td></td>
                                    </tr>
                                    <tr class="rowtvs{$single->id}"> 
                                        <th width="15%" >RO</th>
                                        <td >
                                            <select  multiple="" class="form-control getselectajax tvsro" name="tvsro" data-id="{$single->id}"  data-table="tvs"  data-celtable="tvsro" id="tvsro{$single->id}" data-selid="{$single->id}" >
                                            </select>
                                        </td>
                                        <td></td>
                                    </tr>
                                    <tr class="rowtvs{$single->id}"> 
                                        <th width="15%" >LO</th>
                                        <td >
                                            <select  multiple="" class="form-control getselectajax tvslo" name="tvslo" data-id="{$single->id}"  data-table="tvs"  data-celtable="tvslo" id="tvslo{$single->id}" data-selid="{$single->id}" >
                                            </select>
                                        </td>
                                        <td></td>
                                    </tr>
                                    <tr class="rowtvs{$single->id}"> 
                                        <th width="15%" >Pelvis</th>
                                        <td >
                                            <select  multiple="" class="form-control getselectajax tvspelvis" name="tvspelvis" data-id="{$single->id}"  data-table="tvs"  data-celtable="tvspelvis" id="tvspelvis{$single->id}" data-selid="{$single->id}" >
                                            </select>
                                        </td>
                                        <td></td>
                                    </tr>
                                    {/foreach}
                                </tbody>
                            </table>

                            <table class="table table-bordered hidetable investigations2" >
                                <tbody id="hysteroscopy">
                                    <tr>
                                        <th scope="row" class="thhead" colspan="14">
                                            <a class="addappend" data-add="hysteroscopyinfertility" data-id="{$id}"  data-table="infertilitysheetid">  Hysteroscopy</a>
                                        </th>
                                    </tr>
                                    <tr>
                                        <th  colspan="1">Date</th>
                                        <th  colspan="1">PLace</th>
                                        <th  colspan="1">Dil</th>
                                        <th  colspan="1">Introd</th>
                                        <th  colspan="1">CX</th>
                                        <th  colspan="1">Cavity - Fundus</th>
                                        <th  colspan="1">R-Ostium</th>
                                        <th  colspan="1">L-Ostium</th>
                                        <th  colspan="1"></th>
                                    </tr>
                                    {foreach $hysteroscopy as $single}
                                    <tr class="rowhysteroscopy{$single->id}">
                                        <td width="6%"><input class="form-control datepicker"  type="text" name="date" value="{$single->date}"  data-id="{$single->id}"  data-table="hysteroscopyinfertility"  ></td>
                                        <td  width="11%">
                                            <select   class="form-control getselectajax copyplace" name="copyplace" data-id="{$single->id}"  data-table="hysteroscopyinfertility"  data-celtable="copyplace" id="copyplace{$single->id}" data-selid="{$single->id}" >
                                            </select>
                                        </td>
                                        <td  width="9%">
                                            <select   class="form-control getselectajax copydil" name="copydil" data-id="{$single->id}"  data-table="hysteroscopyinfertility"  data-celtable="copydil" id="copydil{$single->id}" data-selid="{$single->id}" >
                                            </select>
                                        </td>
                                        <td  width="9%">
                                            <select   class="form-control getselectajax copyintrod" name="copyintrod" data-id="{$single->id}"  data-table="hysteroscopyinfertility"  data-celtable="copyintrod" id="copyintrod{$single->id}" data-selid="{$single->id}" >
                                            </select>
                                        </td>
                                        <td  width="9%" style="max-width: 33px">
                                            <select    class="form-control getselectajax copycx" multiple="" name="copycx" data-id="{$single->id}"  data-table="hysteroscopyinfertility"  data-celtable="copycx" id="copycx{$single->id}" data-selid="{$single->id}" >
                                            </select>
                                        </td>
                                        <td  width="20%" style="max-width: 33px">
                                            <select    class="form-control getselectajax copycavity" multiple="" name="copycavity" data-id="{$single->id}"  data-table="hysteroscopyinfertility"  data-celtable="copycavity" id="copycavity{$single->id}" data-selid="{$single->id}" >
                                            </select>
                                        </td>
                                        <td  width="14%">
                                            <select   class="form-control getselectajax copyrostium" name="copyrostium" data-id="{$single->id}"  data-table="hysteroscopyinfertility"  data-celtable="copyrostium" id="copyrostium{$single->id}" data-selid="{$single->id}" >
                                            </select>
                                        </td>
                                        <td  width="14%">
                                            <select   class="form-control getselectajax copylostium" name="copylostium" data-id="{$single->id}"  data-table="hysteroscopyinfertility"  data-celtable="copylostium" id="copylostium{$single->id}" data-selid="{$single->id}" >
                                            </select>
                                        </td>
                                        <td width="6%">
                                            <a class="btn grey-cascade btn-xs deleterow" data-id="{$single->id}"  data-table="hysteroscopyinfertility">
                                                <i class="fa fa-close"></i>
                                            </a>
                                        </td>
                                    </tr>
                                    <tr class="rowhysteroscopy{$single->id}">
                                        <th width="6%">Intervention</th>
                                        <td  colspan="3"><input class="form-control"  type="text" name="hysintervention" value="{$single->hysintervention}"  data-id="{$single->id}"  data-table="hysteroscopyinfertility"  >
                                        </td>
                                        <td  width="9%" style="max-width: 33px">
                                            <select   multiple="" class="form-control getselectajax copymcx" name="copymcx" data-id="{$single->id}"  data-table="hysteroscopyinfertility"  data-celtable="copymcx" id="copymcx{$single->id}" data-selid="{$single->id}" >
                                            </select>
                                        </td>
                                        <td  width="20%" style="max-width: 33px">
                                            <select     multiple="" class="form-control getselectajax copymcavity" name="copymcavity" data-id="{$single->id}"  data-table="hysteroscopyinfertility"  data-celtable="copymcavity" id="copymcavity{$single->id}" data-selid="{$single->id}" >
                                            </select>
                                        </td>
                                        <td  width="14%" style="max-width: 33px">
                                            <select   multiple="" class="form-control getselectajax copymrostium" name="copymrostium" data-id="{$single->id}"  data-table="hysteroscopyinfertility"  data-celtable="copymrostium" id="copymrostium{$single->id}" data-selid="{$single->id}" >
                                            </select>
                                        </td>
                                        <td  width="14%" style="max-width: 33px">
                                            <select   multiple="" class="form-control getselectajax copymlostium" name="copymlostium" data-id="{$single->id}"  data-table="hysteroscopyinfertility"  data-celtable="copymlostium" id="copymlostium{$single->id}" data-selid="{$single->id}" >
                                            </select>
                                        </td>
                                        <td width="6%"><input class="form-control digitsOnly"  type="text" name="coast" value="{$single->coast}"  data-id="{$single->id}"  data-table="hysteroscopyinfertility" placeholder="Cost" ></td>
                                    </tr>
                                    {/foreach}
                                </tbody>
                            </table>
                            <table class="table table-bordered hidetable investigations2" >
                                <tbody id="laparoscopy">
                                    <tr>
                                        <th scope="row" class="thhead" colspan="14">
                                            <a class="addappend" data-add="laparoscopyinfertility" data-id="{$id}"  data-table="infertilitysheetid">  Laparoscopy</a>
                                        </th>
                                    </tr>
                                    <tr>
                                        <th  colspan="1">Date</th>
                                        <th  colspan="1">PLace</th>
                                        <th  colspan="1">UT</th>
                                        <th  colspan="1">RT</th>
                                        <th  colspan="1">LT</th>
                                        <th  colspan="1">RO</th>
                                        <th  colspan="1">LO</th>
                                        <th  colspan="1">Pelvis</th>
                                        <th  colspan=""></th>
                                    </tr>
                                    {foreach $laparoscopy as $single}
                                    <tr class="rowlaparoscopy{$single->id}">
                                        <td width="6%"><input class="form-control datepicker"  type="text"    name="date" value="{$single->date}"  data-id="{$single->id}"  data-table="laparoscopyinfertility"  ></td>
                                        <td width="9%"><select   class="form-control getselectajax laparplace" name="laparplace" data-id="{$single->id}"  data-table="laparoscopyinfertility"  data-celtable="laparplace" id="laparplace{$single->id}" data-selid="{$single->id}" >
                                            </select>
                                        </td>
                                        <td  width="9%" style="max-width: 33px">
                                            <select   multiple="" class="form-control getselectajax laparul" name="laparul" data-id="{$single->id}"  data-table="laparoscopyinfertility"  data-celtable="laparul" id="laparul{$single->id}" data-selid="{$single->id}" >
                                            </select>
                                        </td>
                                        <td  width="9%" style="max-width: 33px">
                                            <select   multiple="" class="form-control getselectajax laparrt" name="laparrt" data-id="{$single->id}"  data-table="laparoscopyinfertility"  data-celtable="laparrt" id="laparrt{$single->id}" data-selid="{$single->id}" >
                                            </select>
                                        </td>
                                        <td  width="9%" style="max-width: 33px">
                                            <select   multiple="" class="form-control getselectajax laparlt" name="laparlt" data-id="{$single->id}"  data-table="laparoscopyinfertility"  data-celtable="laparlt" id="laparlt{$single->id}" data-selid="{$single->id}" >
                                            </select>
                                        </td>
                                        <td  width="20%" style="max-width: 33px">
                                            <select   multiple="" class="form-control getselectajax laparro" name="laparro" data-id="{$single->id}"  data-table="laparoscopyinfertility"  data-celtable="laparro" id="laparro{$single->id}" data-selid="{$single->id}" >
                                            </select>
                                        </td>
                                        <td  width="14%" style="max-width: 33px">
                                            <select   multiple="" class="form-control getselectajax laparlo" name="laparlo" data-id="{$single->id}"  data-table="laparoscopyinfertility"  data-celtable="laparlo" id="laparlo{$single->id}" data-selid="{$single->id}" >
                                            </select>
                                        </td>
                                        <td  width="14%" style="max-width: 33px">
                                            <select   multiple="" class="form-control getselectajax laparpelvis" name="laparpelvis" data-id="{$single->id}"  data-table="laparoscopyinfertility"  data-celtable="laparpelvis" id="laparpelvis{$single->id}" data-selid="{$single->id}" >
                                            </select>
                                        </td>
                                        <td width="6%">
                                            <a class="btn grey-cascade btn-xs deleterow" data-id="{$single->id}"  data-table="laparoscopyinfertility">
                                                <i class="fa fa-close"></i>
                                            </a>
                                        </td>
                                    </tr>
                                    <tr class="rowlaparoscopy{$single->id}">
                                        <th width="6%">Intervention</th>
                                        <td  width="9%"> <input class="form-control"  type="text" name="lapintervention" value="{$single->lapintervention}"  data-id="{$single->id}"  data-table="laparoscopyinfertility"  ></td>
                                        <td  width="9%" style="max-width: 33px">
                                            <select   multiple="" class="form-control getselectajax laparmut" name="laparmut" data-id="{$single->id}"  data-table="laparoscopyinfertility"  data-celtable="laparmut" id="laparmut{$single->id}" data-selid="{$single->id}" >
                                            </select>
                                        </td>
                                        <td  width="9%" style="max-width: 33px">
                                            <select   multiple="" class="form-control getselectajax laparmrt" name="laparmrt" data-id="{$single->id}"  data-table="laparoscopyinfertility"  data-celtable="laparmrt" id="laparmrt{$single->id}" data-selid="{$single->id}" >
                                            </select>
                                        </td>
                                        <td  width="9%" style="max-width: 33px">
                                            <select   multiple="" class="form-control getselectajax laparmlt" name="laparmlt" data-id="{$single->id}"  data-table="laparoscopyinfertility"  data-celtable="laparmlt" id="laparmlt{$single->id}" data-selid="{$single->id}" >
                                            </select>
                                        </td>
                                        <td  width="20%" style="max-width: 33px">
                                            <select   multiple="" class="form-control getselectajax laparmro" name="laparmro" data-id="{$single->id}"  data-table="laparoscopyinfertility"  data-celtable="laparmro" id="laparmro{$single->id}" data-selid="{$single->id}" >
                                            </select>
                                        </td>
                                        <td  width="14%" style="max-width: 33px">
                                            <select   multiple="" class="form-control getselectajax laparmlo" name="laparmlo" data-id="{$single->id}"  data-table="laparoscopyinfertility"  data-celtable="laparmlo" id="laparmlo{$single->id}" data-selid="{$single->id}" >
                                            </select>
                                        </td>
                                        <td  width="14%" style="max-width: 33px">
                                            <select   multiple="" class="form-control getselectajax laparmpelvis" name="laparmpelvis" data-id="{$single->id}"  data-table="laparoscopyinfertility"  data-celtable="laparmpelvis" id="laparmpelvis{$single->id}" data-selid="{$single->id}" >
                                            </select>
                                        </td>
                                        <td width="6%"><input class="form-control digitsOnly"  type="text" name="coast" value="{$single->coast}"  data-id="{$single->id}"  data-table="laparoscopyinfertility" placeholder="Cost" ></td>
                                    </tr>
                                    {/foreach}
                                </tbody>
                            </table>
                            <table class="table table-bordered hidetable investigations2" >
                                <tbody>
                                    <tr>
                                        <td class="colorred">Other</td>
                                        <td  ><input type="text"  data-id="{$id}" name="sheetother" value="{$infertilitysheet->sheetother}" data-table="infertilitysheet" class="form-control" /></td>
                                    </tr>
                                </tbody>
                            </table>
                            <table class="table table-bordered hidetable investigations2" >
                                <tbody>
                                    <tr>
                                        <td class="colorred">Lab </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="gynasheet">
                                                                Show </a>
                                                        </li>
                                                    </ul>
                                                </div>
                                            </div></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="{$id}"  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">nots</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="7%" >
                                            <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="7%"><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 digitsOnly"  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="newvisitg">
                                    <tr>
                                        <th style="background:#19ae19" colspan="14"> 
                                            <a class="addappend" data-add="newvisitg" data-id="{$gynasheetid}"  data-table="gynasheetid" style="color: #fff" > New Visit </a> </th>
                                    </tr>
                                    {foreach $newvisitg as $single}
                                    <tr class="rownewvisitg{$single->id}">
                                        <th width="10%" >Date</th>
                                        <th width="10%" >Cycles</th>
                                        <th width="10%" >LMP</th>
                                        <th width="10%" >BW</th>
                                        <th width="35%" style="padding: 0px">
                                            <table style="width: 100%;margin-bottom: 0px;">
                                                <tr>
                                                    <th colspan="3" >
                                                        <label class="mt-radio{$single->id}">
                                                            <input type="radio" name="usvsdtv{$single->id}" value="1" 
                                                                   data-id="{$single->id}" class="usvsdtv" data-table="newvisitg"
                                                                   {if $single->usvsdtv eq 1} checked {/if} >US
                                                            <span></span></label>
                                                        <label class="mt-radio{$single->id}">
                                                            <input type="radio" name="usvsdtv{$single->id}" value="2"
                                                                   data-id="{$single->id}" class="usvsdtv" data-table="newvisitg"
                                                                   {if $single->usvsdtv eq 2} checked {/if}  >TVS 
                                                            <span></span></label>
                                                        <label class="mt-radio{$single->id}">
                                                            <input type="radio" name="usvsdtv{$single->id}" value="3" 
                                                                   data-id="{$single->id}" class="usvsdtv" data-table="newvisitg"
                                                                   {if $single->usvsdtv eq 3} checked {/if} >3D TVS 
                                                            <span></span></label>
                                                        </td>
                                                </tr>
                                                <tr>
                                                    <th >UT</th>
                                                    <th >OV</th>
                                                </tr>
                                            </table>
                                        </th>
                                        <th  width="35%" >   Notes
                                        </th>
                                        <th  width="5%" >   
                                        </th>
                                    </tr>
                                    <tr class="rownewvisitg{$single->id}"> 
                                        <td width="7%"><input class="form-control datepicker"  type="text"    name="date" value="{$single->date}"  data-id="{$single->id}"  data-table="newvisitg"  ></td>
                                        <td  width="15%">
                                            <select    class="form-control getselectajax newvisitcycles" name="newvisitcycles" data-id="{$single->id}"  data-table="newvisitg"  data-celtable="newvisitcycles" id="newvisitcycles{$single->id}" data-selid="{$single->id}" >
                                            </select>
                                        </td>
                                        <td width="7%"><input class="form-control datepicker"  type="text"    name="lmp" value="{$single->lmp}"  data-id="{$single->id}"  data-table="newvisitg"  ></td>
                                        <td width="10%"><input class="form-control"  type="text"     name="bw" value="{$single->bw}"  data-id="{$single->id}"  data-table="newvisitg" ></td>
                                        <td  style="padding: 0px">
                                            <table style="width: 100%;margin-bottom: 0px;">
                                                <tr>
                                                    <td width="10%"><input class="form-control"  type="text"    name="ut" value="{$single->ut}"  data-id="{$single->id}"  data-table="newvisitg"   ></td>
                                                    <td width="10%"><input class="form-control"  type="text"   name="ov" value="{$single->ov}"  data-id="{$single->id}"  data-table="newvisitg"   ></td>
                                                </tr>
                                            </table>
                                        </td>
                                        <td  >
                                            <input class="form-control"  type="text"     name="noteg" value="{$single->noteg}"  data-id="{$single->id}"  data-table="newvisitg" >
                                        </td>
                                        <td width="5%">
                                            <a class="btn grey-cascade btn-xs deleterow" data-id="{$single->id}"  data-table="newvisitg">
                                                <i class="fa fa-close"></i>
                                            </a>
                                        </td>
                                    </tr>
                                    <tr class="rownewvisitg{$single->id}">
                                        <th colspan="4">C/O</th>
                                        <th colspan="1">Diagnosis</th>
                                        <th colspan="2">TTT (Button)</th>
                                    </tr>
                                    <tr class="rownewvisitg{$single->id}">
                                        <td  colspan="4">
                                            <select   multiple="" class="form-control getselectajax newvisitgco" name="newvisitgco" data-id="{$single->id}"  data-table="newvisitg"  data-celtable="newvisitgco" id="newvisitgco{$single->id}" data-selid="{$single->id}" >
                                            </select>
                                        </td>
                                        <td  colspan="1">
                                            <select   multiple="" class="form-control getselectajax newvisitgdiag" name="newvisitgdiag" data-id="{$single->id}"  data-table="newvisitg"  data-celtable="newvisitgdiag" id="newvisitgdiag{$single->id}" data-selid="{$single->id}" >
                                            </select>
                                        </td>
                                        <td colspan="4"> <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="gynasheet">
                                                            Add </a>
                                                    </li>
                                                    <li>
                                                        <a href="javascript:;" id="showDrugs" data-controller="gynasheet">
                                                            Show </a>
                                                    </li>
                                                </ul>
                                            </div>
                                            </div> </td>
                                    </tr>
                                    <tr class="rownewvisitg{$single->id}">
                                        <td colspan="7"><input class="form-control "  type="text"    name="plan" value="{$single->plan}"  data-id="{$single->id}"  data-table="newvisitg" placeholder="plan" ></td>

                                    </tr>


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





                        </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 " id="presDate" name="presDate" value="{$presDate}" data-controller="gynasheet"  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="gynasheetdrugs">
                                                    <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="gynasheet"></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="antenalvisit"  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="gynasheetdrugs" 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="gynasheetdrugs" 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="gynasheetdrugs" 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="gynasheet" data-fn="addprescription">
                                                                <i class="fa fa-close"></i>
                                                            </a>
                                                        </td>
                                                    </tr>
                                                    {capture assign=itr}{$itr+1}{/capture}
                                                    {/foreach}

                                                </tbody>
                                            </table>
                                            <!--<div class="md-checkbox" id="husbandFor">
                                                <input type="checkbox" id="forHusband" name="forHusband"  class="md-check" value="1" data-controller="gynasheet">
                                                <label for="forHusband" class="bold">
                                                    <span></span>
                                                    <span class="check"></span>
                                                    <span class="box"></span>
                                                    Make this for Husband </label>
                                            </div>-->

                                            <input type="hidden" id="pId" value="" name="patientId"/>
                                            <input type="hidden" id="preType" value="" name="preType"/>
                                            <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="gynasheet"> 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="gynasheet"> Save </button>
                                                <button type="button" class="btn default printInvestigation" data-print ="1" data-controller="gynasheet"> 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="antenalvisit"  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"/>
                                            <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 wds80">
            <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 all">
                                        <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>