
<div class="page-content-wrapper">
    <div class="page-content all">
        <div class="row">
            <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> Monitoring sheet
                        </div>
                        <div class="actions">
                            <a href="{$hosturl}/controllers/monitoring.php?ac=trials&patientid={$patientid}" class="btn btn-default btn-sm">
                                Previous ART trials
                            </a>
                        </div>

                    </div>
                    <div class="portlet-body">
                        <table class="table table-striped table-hover table-bordered">
                            <thead>
                                <tr>
                                    <th class="col-md-2 wds5">
                                        Date
                                    </th>
                                    <td>
                                        <input type="text" class="form-control  datepicker updateElement visitdateAll" id="startDate" data-id="{$monitorSheet->id}" data-colName="monitordate" id="monitordate" data-tableName="mointoringsheet" value="{$monitorSheet->monitordate}" />
                                    </td>
                                    <th class="col-md-2 wds5">
                                        LMP
                                    </th>
                                    <td>
                                        <input type="text" class="form-control  datepicker updateElement" data-id="{$monitorSheet->id}" data-colName="lmp" id="lmp" data-tableName="mointoringsheet" value="{if $monitorSheet->lmp eq '1970/01/01'}{$smarty.now|date_format:"%Y/%m/%d"}{else}{$monitorSheet->lmp}{/if}" />
                                    </td>
                                    <th class="col-md-2">
                                        Attemp No.
                                    </th>
                                    <td>
                                        <input type="text" class="form-control positiveNo updateElement" data-id="{$monitorSheet->id}" data-colName="attempno" id="attempno" data-tableName="mointoringsheet" value="{$monitorSheet->attempno}" />
                                    </td>

                                </tr>
                            </thead>

                        </table>

                        <table class="table table-striped table-hover table-bordered">
                            <thead>
                                <tr>
                                    <th rowspan="2">
                                        procedure
                                    </th>
                                    <th colspan="4">
                                        Sem. source
                                    </th>
                                </tr>
                                <tr>
                                    <th>
                                        Ejac
                                    </th>
                                    <th>
                                        PESA
                                    </th>
                                    <th>
                                        TESE
                                    </th>
                                    <th>
                                        Cryo
                                    </th>
                                </tr>
                                <tr>
                                    <td>
                                        <select class="form-control  deleteoption  updateElement" id="procedure" data-val="{$monitorSheet->procedure}"
                                                name="procedure" select-tablename="mointoringsheetprocedure" select-colname="name"
                                                data-id="{$monitorSheet->id}" data-tablename="mointoringsheet"  data-colname="procedure" >
                                            <option value="">choose</option>
                                            {foreach  $procedures as $data}
                                            <option value="{$data->id}" {if {$data->id} eq {$monitorSheet->procedure} } selected {/if}>{$data->name} </option>
                                            {/foreach}
                                            <option value="-2" class="deleteoptincompo">Delete</option>
                                        </select>
                                    </td>
                                    <td>
                                        <select class="form-control  deleteoption  updateElement" id="ejac" data-val="{$monitorSheet->ejac}"
                                                name="ejac" select-tablename="mointoringsheetejac" select-colname="name"
                                                data-id="{$monitorSheet->id}" data-tablename="mointoringsheet"  data-colname="ejac" >
                                            <option value="">choose</option>
                                            {foreach  $ejacs as $data}
                                            <option value="{$data->id}" {if {$data->id} eq {$monitorSheet->ejac} } selected {/if}>{$data->name} </option>
                                            {/foreach}
                                            <option value="-2" class="deleteoptincompo">Delete</option>
                                        </select>
                                    </td>
                                    <td>
                                        <select class="form-control  deleteoption  updateElement" id="pesa" data-val="{$monitorSheet->pesa}"
                                                name="pesa" select-tablename="mointoringsheetpesa" select-colname="name"
                                                data-id="{$monitorSheet->id}" data-tablename="mointoringsheet"  data-colname="pesa" >
                                            <option value="">choose</option>
                                            {foreach  $pesas as $data}
                                            <option value="{$data->id}" {if {$data->id} eq {$monitorSheet->pesa} } selected {/if}>{$data->name} </option>
                                            {/foreach}
                                            <option value="-2" class="deleteoptincompo">Delete</option>
                                        </select>
                                    </td>
                                    <td>
                                        <select class="form-control  deleteoption  updateElement" id="tese" data-val="{$monitorSheet->tese}"
                                                name="tese" select-tablename="mointoringsheettese" select-colname="name"
                                                data-id="{$monitorSheet->id}" data-tablename="mointoringsheet"  data-colname="tese" >
                                            <option value="">choose</option>
                                            {foreach  $teses as $data}
                                            <option value="{$data->id}" {if {$data->id} eq {$monitorSheet->tese} } selected {/if}>{$data->name} </option>
                                            {/foreach}
                                            <option value="-2" class="deleteoptincompo">Delete</option>
                                        </select>
                                    </td>
                                    <td>
                                        <select class="form-control  deleteoption  updateElement" id="sryo" data-val="{$monitorSheet->sryo}"
                                                name="sryo" select-tablename="mointoringsheetsryo" select-colname="name"
                                                data-id="{$monitorSheet->id}" data-tablename="mointoringsheet"  data-colname="sryo" >
                                            <option value="">choose</option>
                                            {foreach  $sryos as $data}
                                            <option value="{$data->id}" {if {$data->id} eq {$monitorSheet->sryo} } selected {/if}>{$data->name} </option>
                                            {/foreach}
                                            <option value="-2" class="deleteoptincompo">Delete</option>
                                        </select>
                                    </td>
                                </tr>
                                <tr>
                                    <th>
                                        Protocol
                                    </th>
                                    <th colspan="2">
                                        HMG Name
                                    </th>
                                    <th colspan="2">
                                        Agonist / Antagonist
                                    </th>
                                </tr>
                                <tr>
                                    <td>
                                        <select class="form-control  deleteoption  updateElement" id="protocol" data-val="{$monitorSheet->protocol}"
                                                name="protocol" select-tablename="mointoringsheetprotocol" select-colname="name"
                                                data-id="{$monitorSheet->id}" data-tablename="mointoringsheet"  data-colname="protocol" >
                                            <option value="">choose</option>
                                            {foreach  $protocols as $data}
                                            <option value="{$data->id}" {if {$data->id} eq {$monitorSheet->protocol} } selected {/if}>{$data->name} </option>
                                            {/foreach}
                                            <option value="-2" class="deleteoptincompo">Delete</option>
                                        </select>
                                    </td>
                                    <td colspan="2">
                                        <select class="form-control  deleteoption  updateElement" id="hmg" data-val="{$monitorSheet->hmg}"
                                                name="hmg" select-tablename="mointoringsheethmg" select-colname="name"
                                                data-id="{$monitorSheet->id}" data-tablename="mointoringsheet"  data-colname="hmg" >
                                            <option value="">choose</option>
                                            {foreach  $hmgs as $data}
                                            <option value="{$data->id}" {if {$data->id} eq {$monitorSheet->hmg} } selected {/if}>{$data->name} </option>
                                            {/foreach}
                                            <option value="-2" class="deleteoptincompo">Delete</option>
                                        </select>
                                    </td>
                                    <td colspan="2">
                                        <select class="form-control  deleteoption  updateElement" id="agonist" data-val="{$monitorSheet->agonist}"
                                                name="agonist" select-tablename="mointoringsheetagonist" select-colname="name"
                                                data-id="{$monitorSheet->id}" data-tablename="mointoringsheet"  data-colname="agonist" >
                                            <option value="">choose</option>
                                            {foreach  $agonists as $data}
                                            <option value="{$data->id}" {if {$data->id} eq {$monitorSheet->agonist} } selected {/if}>{$data->name} </option>
                                            {/foreach}
                                            <option value="-2" class="deleteoptincompo">Delete</option>
                                        </select>
                                    </td>
                                </tr>
                            </thead>
                            <tbody>

                            </tbody>


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


        <div class="row">
            <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> All visits
                        </div>

                        <div class="actions">
                            <a href="javascript:;" class="btn btn-default btn-sm" id="monitorAadd">
                                Add New</a>
                        </div>

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

                        <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="monitoring">
                                            Show </a>
                                    </li>
                                </ul>
                            </div>
                        </div>
                    </div>

                    <div class="portlet-body check_heigt_and_make_new_class" id="justfordrugs" >

                        <table class="table table-striped table-hover table-bordered">
                            <thead>
                                <tr>
                                    <th rowspan="2">
                                        Date
                                    </th>
                                    <th rowspan="2">
                                        Cycle day
                                    </th>
                                    <th rowspan="2">
                                        HMG dose / day
                                    </th>
                                    <th rowspan="2">
                                        Endo
                                    </th>
                                    <th colspan="2">
                                        Folliculometry
                                    </th>
                                    <th rowspan="2">
                                        E2
                                    </th>
                                    <th rowspan="2">
                                        Delete
                                    </th>
                                </tr>
                                <tr>
                                    <th>
                                        Rt.
                                    </th>
                                    <th>
                                        Lt.
                                    </th>
                                </tr>
                            </thead>
                            <tbody id="monitorAaddDiv">
                                {foreach $visits as $data}
                                <tr>
                                    <td id="visitdate{$data->id}">
                                        <input type="text" class="form-control updateElement  datepicker visitdate" data-id="{$data->id}" data-colName="visitdate" data-tableName="mointoringsheetvisits" value="{$data->visitdate}" />
                                    </td>
                                    <td id="visitdateCycle{$data->id}">
                                        {$data->cycleday}
                                    </td>
                                    <td>
                                        <input type="text" class="form-control updateElement" data-id="{$data->id}" data-colName="hmg" data-tableName="mointoringsheetvisits" value="{$data->hmg}" data-toggle="popover" data-trigger="hover" data-placement="bottom" data-content="{$data->hmg}" />
                                    </td>
                                    <td>
                                        <input type="text" class="form-control updateElement" data-id="{$data->id}" data-colName="endo" data-tableName="mointoringsheetvisits" value="{$data->endo}" data-toggle="popover" data-trigger="hover" data-placement="bottom" data-content="{$data->endo}" />
                                    </td>
                                    <td>
                                        <textarea class="form-control txtc updateElement" rows="1" data-id="{$data->id}" data-colName="follicright" data-tableName="mointoringsheetvisits" placeholder="Enter more text" data-toggle="popover" data-trigger="hover" data-placement="bottom" data-content="{$data->follicright}" >{$data->follicright}</textarea>
                                    </td>
                                    <td>
                                        <textarea class="form-control txtc updateElement" rows="1" data-id="{$data->id}" data-colName="follicleft" data-tableName="mointoringsheetvisits" placeholder="Enter more text" data-toggle="popover" data-trigger="hover" data-placement="bottom" data-content="{$data->follicleft}" >{$data->follicleft}</textarea>
                                    </td>
                                    <td>
                                        <input type="text" class="form-control updateElement" data-id="{$data->id}" data-colName="e2" data-tableName="mointoringsheetvisits" value="{$data->e2}" data-toggle="popover" data-trigger="hover" data-placement="bottom" data-content="{$data->e2}" />
                                    </td>
                                    <td>
                                        <a class="btn grey-cascade btn-xs deletemsgEX" data-id="{$data->id}" style=" float: left;" href="#" data-link="monitoring" data-fn="del" data-tableName="mointoringsheetvisits">
                                            <i class="fa fa-close"></i>
                                        </a>
                                    </td>
                                </tr>

                                {/foreach}


                            </tbody>
                        </table>


                        <button id="remarkSheet" class="btn blue col-md-5">
                            Remarks
                        </button>

                        <button id="trigMonitorSheet" class="btn red col-md-3">
                            Trig
                        </button>




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

    </div>

</div>

<input type="hidden" id="patientId" value="{$patientid}"/>
<input type="hidden" id="monitorSheetId" value="{$monitorSheet->id}"/>
<input type="hidden" id="controllName" value="monitoring"/>
<!----#########################################################################  model ##############################################################################################################--->
<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="monitoring"  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="mointoringsheetdrugs">
                                                    <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="monitoring"></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="monitoring"  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="mointoringsheetdrugs" 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="mointoringsheetdrugs" 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="mointoringsheetdrugs" 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="monitoring" data-fn="addprescription">
                                                                <i class="fa fa-close"></i>
                                                            </a>
                                                        </td>
                                                    </tr>
                                                    {capture assign=itr}{$itr+1}{/capture}
                                                    {/foreach}

                                                </tbody>
                                            </table>


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

<div class="bootbox modal fade bootbox-alert in" tabindex="-1" role="dialog" aria-hidden="false"  id="remarkModel">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button>
                <h4 class="modal-title"> Remarks </h4>
            </div>
            <div class="modal-body">
                <div class="portlet-body form">
                    <form action="" id="" method="post" class="form-horizontal  emptyform" >
                        <div class="form-body all" >
                            <!------===========================================------->
                            <div class="form-group">
                                <label class="col-md-1 control-label"> </label>
                                <div class="col-md-10">
                                    <div class="" >
                                        <table class="table table-striped table-hover table-bordered">
                                            <thead>
                                                <tr>
                                                    <th>
                                                        Remarks.
                                                    </th>
                                                    <td>
                                                        <textarea class="form-control txtc updateElement" id="remarks" rows="5" data-id="{$monitorSheet->id}" data-colName="remarks" data-tableName="mointoringsheet" placeholder="Enter more text" data-toggle="popover" data-trigger="hover" data-placement="bottom" data-content="{$monitorSheet->remarks}" >{$monitorSheet->remarks}</textarea>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <th>
                                                        HCG.
                                                    </th>
                                                    <td>
                                                        <select class="form-control  deleteoption  updateElement" id="hcg" data-val="{$monitorSheet->hcg}"
                                                                name="hcg" select-tablename="mointoringsheethcg" select-colname="name"
                                                                data-id="{$monitorSheet->id}" data-tablename="mointoringsheet"  data-colname="hcg" >
                                                            <option value="">choose</option>
                                                            {foreach  $hcgs as $data}
                                                            <option value="{$data->id}" {if {$data->id} eq {$monitorSheet->hcg} } selected {/if}>{$data->name} </option>
                                                            {/foreach}
                                                            <option value="-2" class="deleteoptincompo">Delete</option>
                                                        </select>
                                                    </td>
                                                </tr>
                                            </thead>
                                        </table>
                                    </div>
                                </div>
                                <label class="col-md-1 control-label"> </label>
                            </div>

                            <!------===========================================------->

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

                                <button type="button" id="amountcloseinput"   class="btn default" data-dismiss="modal">Close</button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
            <!-- /.modal-content -->
        </div>
    </div>
</div>


<div class="bootbox modal fade bootbox-alert in" tabindex="-1" role="dialog" aria-hidden="false"  id="edit_model">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button>
                <h4 class="modal-title"> Edit </h4>
            </div>
            <div class="modal-body">
                <div class="portlet-body form">
                    <form action="" id="" method="post" class="form-horizontal  emptyform" >
                        <div class="form-body all" >
                            <!------===========================================------->
                            <div class="form-group">
                                <label class="col-md-1 control-label"> </label>
                                <div class="col-md-10">
                                    <div id="alldatadiv" class="" > </div>
                                </div>
                                <label class="col-md-1 control-label"> </label>
                            </div>

                            <!------===========================================------->

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

                                <button type="button" id="amountcloseinput"   class="btn default" data-dismiss="modal">Close</button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
            <!-- /.modal-content -->
        </div>
    </div>
</div>

<!------------------##############################-------------------- End of Models -----------------------#########################################-------------->


