<?php /* Smarty version Smarty-3.1.11, created on 2024-10-03 09:03:39
         compiled from "../views/obgy/infertility/add.html" */ ?>
<?php /*%%SmartyHeaderCode:205557633666fec05b56bab6-07126785%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_valid = $_smarty_tpl->decodeProperties(array (
  'file_dependency' => 
  array (
    '1053a9422d0f59a73fe710ef17ce781a11adb32c' => 
    array (
      0 => '../views/obgy/infertility/add.html',
      1 => 1542464114,
      2 => 'file',
    ),
  ),
  'nocache_hash' => '205557633666fec05b56bab6-07126785',
  'function' => 
  array (
  ),
  'variables' => 
  array (
    'presDate' => 0,
    'diagnosis' => 0,
    'record' => 0,
    'infertility' => 0,
    'gyna' => 0,
    'notes' => 0,
    'invest' => 0,
    'lmp' => 0,
    'patientId' => 0,
    'preItr' => 0,
    'PatientPresByDate' => 0,
    'itr' => 0,
    'pre' => 0,
    'allDrugcats' => 0,
    'cat' => 0,
    'drugs' => 0,
    'drug' => 0,
    'ProgramesettingData' => 0,
    'allDrugTypes' => 0,
    'type' => 0,
    'allDrugDoses' => 0,
    'dos' => 0,
  ),
  'has_nocache_code' => false,
  'version' => 'Smarty-3.1.11',
  'unifunc' => 'content_66fec05b6b8cd2_36423382',
),false); /*/%%SmartyHeaderCode%%*/?>
<?php if ($_valid && !is_callable('content_66fec05b6b8cd2_36423382')) {function content_66fec05b6b8cd2_36423382($_smarty_tpl) {?>
<div class="page-content-wrapper">
    <div class="page-content all">
        <div class="row ">
    <div class="col-md-9" style="margin-right: 12px; width: 87%; ">
        <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> Infertility Sheet
                        </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="<?php echo $_smarty_tpl->tpl_vars['presDate']->value;?>
" data-controller="infertility">
                                            Add </a>
                                    </li>
                                    <li>
                                        <a href="javascript:;" id="showDrugs" data-controller="infertility">
                                            Show </a>
                                    </li>
                                </ul>
                            </div>
                        </div>

                    </div>
                    <div class="portlet-body" id="justfordrugs" >
                        <table class="table table-striped table-hover table-bordered">
                            <thead>

                                <tr>
                                    <th style="width: 12%;">
                                        Date
                                        <button type="button" class="btn btn-xs blue" id="addDiagnosis"><i class="fa fa-plus"></i></button>
                                    </th>
                                    <th>
                                        Wife Diagnosis
                                    </th>
                                    <th>
                                        Husband Diagnosis
                                    </th>
                                    <th style="width: 1%;">
                                        Delete
                                    </th>
                                </tr>
                            </thead>
                            <tbody id="diagnosisBody">
                                <?php if ($_smarty_tpl->tpl_vars['diagnosis']->value){?>
                                <?php  $_smarty_tpl->tpl_vars['record'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['record']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['diagnosis']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['record']->key => $_smarty_tpl->tpl_vars['record']->value){
$_smarty_tpl->tpl_vars['record']->_loop = true;
?>
                                <tr>
                                    <td>
                                        <input type="text" class="form-control datepicker updateElement" data-id="<?php echo $_smarty_tpl->tpl_vars['record']->value->id;?>
" data-colName="date" data-tableName="infertilitydiagnosis" value="<?php echo $_smarty_tpl->tpl_vars['record']->value->date;?>
" readonly/>
                                    </td>
                                    <td>
                                        <textarea class="form-control updateElement" rows="2" data-id="<?php echo $_smarty_tpl->tpl_vars['record']->value->id;?>
" data-colName="diagnosiswife" data-tableName="infertilitydiagnosis" placeholder="Enter more text"><?php echo $_smarty_tpl->tpl_vars['record']->value->diagnosiswife;?>
</textarea>
                                    </td>
                                    <td>
                                        <textarea class="form-control updateElement" rows="2" data-id="<?php echo $_smarty_tpl->tpl_vars['record']->value->id;?>
" data-colName="diagnosishusband" data-tableName="infertilitydiagnosis" placeholder="Enter more text"><?php echo $_smarty_tpl->tpl_vars['record']->value->diagnosishusband;?>
</textarea>
                                    </td>

                                    <td>
                                        <a class="btn grey-cascade btn-xs deletemsgEX" data-id="<?php echo $_smarty_tpl->tpl_vars['record']->value->id;?>
" style=" float: left;" href="#" data-link="infertility" data-tableName="infertilitydiagnosis" data-fn="del">
                                            <i class="fa fa-close"></i>
                                        </a>
                                    </td>
                                </tr>
                                <?php } ?>
                                <?php }?>
                            </tbody>
                        </table>
                        
                        <table class="table table-striped table-hover table-bordered">
                            <thead>

                                <tr>
                                    <th colspan="4">
                                        History
                                    </th>
                                </tr>
                            </thead>
                            <tbody>

                                <tr>
                                    <td>
                                        Marriage
                                    </td>
                                    <td>
                                <input type="text" class="form-control updateElement" value="<?php echo $_smarty_tpl->tpl_vars['infertility']->value->marriage;?>
"   data-tableName="infertility" data-colName="marriage" data-id="<?php echo $_smarty_tpl->tpl_vars['infertility']->value->id;?>
"/>  
                                    </td>
                                    <td>
                                        Menstr
                                    </td>
                                    <td>
                                <input type="text" class="form-control updateElement" value="<?php echo $_smarty_tpl->tpl_vars['infertility']->value->menstr;?>
"   data-tableName="infertility" data-colName="menstr" data-id="<?php echo $_smarty_tpl->tpl_vars['infertility']->value->id;?>
"/>  
                                    </td>
                                </tr>
                                <tr>
                                    <td style="width: 13%;">
                                        Operations or Dis
                                    </td>
                                    <td>
                                <input type="text" class="form-control updateElement" value="<?php echo $_smarty_tpl->tpl_vars['infertility']->value->operations;?>
"   data-tableName="infertility" data-colName="operations" data-id="<?php echo $_smarty_tpl->tpl_vars['infertility']->value->id;?>
"/>  
                                    </td>
                                    <td style="width: 11%;"> 
                                        Sexual History
                                    </td>
                                    <td>
                                <input type="text" class="form-control updateElement"  value="<?php echo $_smarty_tpl->tpl_vars['infertility']->value->sexualhistory;?>
"   data-tableName="infertility" data-colName="sexualhistory" data-id="<?php echo $_smarty_tpl->tpl_vars['infertility']->value->id;?>
"/>  
                                    </td>
                                </tr>
                             
                            </tbody>
                        </table>

                        <table class="table table-striped table-hover table-bordered">
                            <thead>

                                <tr>
                                    <th colspan="4">
                                        General Exam
                                    </th>
                                </tr>
                            </thead>
                            <tbody>

                                <tr>
                                    <td>
                                        Breast
                                    </td>
                                    <td>
                                        <input type="text" class="form-control updateElement" value="<?php echo $_smarty_tpl->tpl_vars['infertility']->value->breast;?>
"   data-tableName="infertility" data-colName="breast" data-id="<?php echo $_smarty_tpl->tpl_vars['infertility']->value->id;?>
"/>  
                                    </td>
                                    <td>
                                        Hirsuitism
                                    </td>
                                    <td>
                                <input type="text" class="form-control updateElement" value="<?php echo $_smarty_tpl->tpl_vars['infertility']->value->hirsuitism;?>
"   data-tableName="infertility" data-colName="hirsuitism" data-id="<?php echo $_smarty_tpl->tpl_vars['infertility']->value->id;?>
"/>  
                                    </td>
                                </tr>
                                <tr>
                                    <td style="width: 9%;">
                                        2ry Sex Ch
                                    </td>
                                    <td>
                                <input type="text" class="form-control updateElement"  value="<?php echo $_smarty_tpl->tpl_vars['infertility']->value->sexch;?>
"   data-tableName="infertility" data-colName="sexch" data-id="<?php echo $_smarty_tpl->tpl_vars['infertility']->value->id;?>
"/>  
                                    </td>
                                    <td style="width: 14%;">
                                        Obesity Or Malnutr
                                    </td>
                                    <td>
                                <input type="text" class="form-control updateElement" value="<?php echo $_smarty_tpl->tpl_vars['infertility']->value->obesity;?>
"    data-tableName="infertility" data-colName="obesity" data-id="<?php echo $_smarty_tpl->tpl_vars['infertility']->value->id;?>
"/>  
                                    </td>
                                </tr>
                             
                            </tbody>
                        </table>
                        <table class="table table-striped table-hover table-bordered">
                            <thead>

                                <tr>
                                    <th colspan="16">
                                        Gyna . Exam
                                        <button type="button" class="btn btn-xs blue" id="addGyna"><i class="fa fa-plus"></i></button>
                                    </th>
                                </tr>
                            </thead>

                            <tbody id="gynaBody">
                                <?php if ($_smarty_tpl->tpl_vars['gyna']->value){?>
                                <?php  $_smarty_tpl->tpl_vars['record'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['record']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['gyna']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['record']->key => $_smarty_tpl->tpl_vars['record']->value){
$_smarty_tpl->tpl_vars['record']->_loop = true;
?>

                                <tr class="gyna<?php echo $_smarty_tpl->tpl_vars['record']->value->id;?>
">
                                    <td style="width: 6%; background-color: #ddd;display: none;">
                                        Date
                                    </td>
                                    <td colspan="2" style="width: 12%; display: none;">
                                        <input type="text" class="form-control datepicker updateElement" data-id="<?php echo $_smarty_tpl->tpl_vars['record']->value->id;?>
" data-colName="date" data-tableName="infertilitygyna" value="<?php echo $_smarty_tpl->tpl_vars['record']->value->date;?>
" readonly/>
                                    </td>
                                    <td colspan="2" style="width: 8%;">
                                        Vagina
                                    </td>
                                    <td colspan="14" style="width: 92%;">
                                        <input type="text" class="form-control updateElement"   data-tableName="infertilitygyna" data-colName="vagina" data-id="<?php echo $_smarty_tpl->tpl_vars['record']->value->id;?>
" value="<?php echo $_smarty_tpl->tpl_vars['record']->value->vagina;?>
"/>  
                                    </td>
                                </tr>
                                <tr class="gyna<?php echo $_smarty_tpl->tpl_vars['record']->value->id;?>
">
                                    <td colspan="2" style="width: 8%;">
                                        Uterus
                                    </td>
                                    <td colspan="5" style="width: 39%;"> 
                                        <input type="text" class="form-control updateElement"   data-tableName="infertilitygyna" data-colName="exam" data-id="<?php echo $_smarty_tpl->tpl_vars['record']->value->id;?>
" value="<?php echo $_smarty_tpl->tpl_vars['record']->value->exam;?>
"/>  
                                    </td>
                                     <td colspan="3" style="width: 14%;">
                                         Uterus (Cervix)
                                     </td>
                                    <td colspan="6" style="width: 39%;"> 
                                        <input type="text" class="form-control updateElement"   data-tableName="infertilitygyna" data-colName="sounding" data-id="<?php echo $_smarty_tpl->tpl_vars['record']->value->id;?>
" value="<?php echo $_smarty_tpl->tpl_vars['record']->value->sounding;?>
"/>  
                                    </td>
                                </tr>
                                <tr class="gyna<?php echo $_smarty_tpl->tpl_vars['record']->value->id;?>
">
                                    <td colspan="2" style="width: 8%;">
                                        Adenxae
                                    </td>
                                    <td colspan="13" style="width: 90%;">
                                        <input type="text" class="form-control updateElement"   data-tableName="infertilitygyna" data-colName="adenxae" data-id="<?php echo $_smarty_tpl->tpl_vars['record']->value->id;?>
" value="<?php echo $_smarty_tpl->tpl_vars['record']->value->adenxae;?>
"/>  
                                    </td>
                                    <td style="width: 2%;">
                                        <a class="btn grey-cascade btn-xs deletemsgEXDiv" data-divName="gyna<?php echo $_smarty_tpl->tpl_vars['record']->value->id;?>
" data-id="<?php echo $_smarty_tpl->tpl_vars['record']->value->id;?>
" style=" float: left;" href="#" data-link="followup" data-fn="del" data-tableName="infertilitygyna">
                                            <i class="fa fa-close"></i>
                                        </a>
                                    </td>

                                </tr>
                                
                                <?php } ?>
                             <?php }?>
                            </tbody>
                        </table>

                        <table class="table table-striped table-hover table-bordered">
                            <thead>
                                <tr>
                                    <th style="width: 12%;">
                                        Date
                                    </th>
                                    <th>
                                        Note
                                        <button type="button" class="btn btn-xs blue" id="addNotes"><i class="fa fa-plus"></i></button>
                                    </th>
                                    <th style="width: 1%;">
                                        Delete
                                    </th>
                                </tr>
                            </thead>
                            <tbody id="noteBody">
                                <?php if ($_smarty_tpl->tpl_vars['notes']->value){?>
                                <?php  $_smarty_tpl->tpl_vars['record'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['record']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['notes']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['record']->key => $_smarty_tpl->tpl_vars['record']->value){
$_smarty_tpl->tpl_vars['record']->_loop = true;
?>
                                <tr>
                                    <td>
                                        <input type="text" class="form-control datepicker updateElement" data-id="<?php echo $_smarty_tpl->tpl_vars['record']->value->id;?>
" data-colName="date" data-tableName="infertilitynotes" value="<?php echo $_smarty_tpl->tpl_vars['record']->value->date;?>
" readonly/>
                                    </td>
                                    <td>
                                        <textarea class="form-control updateElement" rows="1" data-id="<?php echo $_smarty_tpl->tpl_vars['record']->value->id;?>
" data-colName="note" data-tableName="infertilitynotes" placeholder="Enter more text"><?php echo $_smarty_tpl->tpl_vars['record']->value->note;?>
</textarea>
                                    </td>

                                    <td>
                                        <a class="btn grey-cascade btn-xs deletemsgEX" data-id="<?php echo $_smarty_tpl->tpl_vars['record']->value->id;?>
" style=" float: left;" href="#" data-link="infertility" data-tableName="infertilitynotes" data-fn="del">
                                            <i class="fa fa-close"></i>
                                        </a>
                                    </td>
                                </tr>
                                <?php } ?>
                                <?php }?>
                            </tbody>
                        </table>

                        <table class="table table-striped table-hover table-bordered">
                            <thead>

                                <tr>
                                    <th colspan="16">
                                        Investigations
                                        <button type="button" class="btn btn-xs blue" id="addInvs"><i class="fa fa-plus"></i></button>
                                    </th>
                                </tr>
                            </thead>
                            <tbody id="invBody">
                                <?php if ($_smarty_tpl->tpl_vars['invest']->value){?>
                                <?php  $_smarty_tpl->tpl_vars['record'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['record']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['invest']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['record']->key => $_smarty_tpl->tpl_vars['record']->value){
$_smarty_tpl->tpl_vars['record']->_loop = true;
?>
                                <tr class="invest<?php echo $_smarty_tpl->tpl_vars['record']->value->id;?>
">
                                    <td style="width: 6%; background-color: #ddd;">
                                        Date
                                    </td>
                                    <td colspan="2" style="width: 12%;">
                                        <input type="text" class="form-control datepicker updateElement" data-id="<?php echo $_smarty_tpl->tpl_vars['record']->value->id;?>
" data-colName="date" data-tableName="infertilityinvest" value="<?php echo $_smarty_tpl->tpl_vars['record']->value->date;?>
" readonly/>
                                    </td>
                                    <td style="width: 6%;">
                                        Semen
                                    </td>
                                    <td colspan="12" style="width: 76%;">
                                        <input type="text" class="form-control updateElement"   data-tableName="infertilityinvest" data-colName="semen" data-id="<?php echo $_smarty_tpl->tpl_vars['record']->value->id;?>
" value="<?php echo $_smarty_tpl->tpl_vars['record']->value->semen;?>
"/>  
                                    </td>

                                </tr>

                                <tr class="invest<?php echo $_smarty_tpl->tpl_vars['record']->value->id;?>
">
                                    <td style="width: 6%;">
                                        FSH
                                    </td>
                                    <td colspan="7" style="width: 44%;">
                                        <input type="text" class="form-control updateElement"   data-tableName="infertilityinvest" data-colName="fsh" data-id="<?php echo $_smarty_tpl->tpl_vars['record']->value->id;?>
" value="<?php echo $_smarty_tpl->tpl_vars['record']->value->fsh;?>
"/>
                                    </td>

                                    <td style="width: 6%;">
                                        ANH
                                    </td>
                                    <td colspan="7" style="width: 44%;">
                                        <input type="text" class="form-control updateElement"   data-tableName="infertilityinvest" data-colName="pct" data-id="<?php echo $_smarty_tpl->tpl_vars['record']->value->id;?>
" value="<?php echo $_smarty_tpl->tpl_vars['record']->value->pct;?>
"/>
                                    </td>

                                </tr>

                                <tr class="invest<?php echo $_smarty_tpl->tpl_vars['record']->value->id;?>
">
                                    <td style="width: 6%;">
                                        LH
                                    </td>
                                    <td colspan="7" style="width: 44%;">
                                        <input type="text" class="form-control updateElement"   data-tableName="infertilityinvest" data-colName="lh" data-id="<?php echo $_smarty_tpl->tpl_vars['record']->value->id;?>
" value="<?php echo $_smarty_tpl->tpl_vars['record']->value->lh;?>
"/>
                                    </td>

                                    <td style="width: 6%;">
                                        F.Tests
                                    </td>
                                    <td colspan="7" style="width: 44%;">
                                        <input type="text" class="form-control updateElement"   data-tableName="infertilityinvest" data-colName="us" data-id="<?php echo $_smarty_tpl->tpl_vars['record']->value->id;?>
" value="<?php echo $_smarty_tpl->tpl_vars['record']->value->us;?>
"/>
                                    </td>


                                </tr>

                                <tr class="invest<?php echo $_smarty_tpl->tpl_vars['record']->value->id;?>
">
                                    <td style="width: 6%;">
                                        Prolact.
                                    </td>
                                    <td colspan="7" style="width: 44%;">
                                        <input type="text" class="form-control updateElement"   data-tableName="infertilityinvest" data-colName="prolactin" data-id="<?php echo $_smarty_tpl->tpl_vars['record']->value->id;?>
" value="<?php echo $_smarty_tpl->tpl_vars['record']->value->prolactin;?>
"/>
                                    </td>

                                    <td style="width: 6%;">
                                        T.Tests
                                    </td>
                                    <td colspan="7" style="width: 44%;">
                                        <input type="text" class="form-control updateElement"   data-tableName="infertilityinvest" data-colName="thyr" data-id="<?php echo $_smarty_tpl->tpl_vars['record']->value->id;?>
" value="<?php echo $_smarty_tpl->tpl_vars['record']->value->thyr;?>
"/>
                                    </td>

                                </tr>
                                <tr class="invest<?php echo $_smarty_tpl->tpl_vars['record']->value->id;?>
">
                                    <td style="width: 6%;">
                                        TSH
                                    </td>
                                    <td  colspan="7" style="width: 44%;">
                                        <input type="text" class="form-control updateElement"   data-tableName="infertilityinvest" data-colName="peg" data-id="<?php echo $_smarty_tpl->tpl_vars['record']->value->id;?>
" value="<?php echo $_smarty_tpl->tpl_vars['record']->value->peg;?>
"/>
                                    </td>
                                    <td style="width: 6%;">
                                        HSG
                                    </td>
                                    <td colspan="7" style="width: 44%;">
                                        <input type="text" class="form-control updateElement"   data-tableName="infertilityinvest" data-colName="hsg" data-id="<?php echo $_smarty_tpl->tpl_vars['record']->value->id;?>
" value="<?php echo $_smarty_tpl->tpl_vars['record']->value->hsg;?>
"/>
                                    </td>

                                </tr>

                                <tr class="invest<?php echo $_smarty_tpl->tpl_vars['record']->value->id;?>
">
                                    <td  colspan="2"style="width: 11%;">
                                        Others
                                    </td>
                                    <td colspan="14" style="width: 89%;">
                                        <input type="text" class="form-control updateElement"   data-tableName="infertilityinvest" data-colName="others" data-id="<?php echo $_smarty_tpl->tpl_vars['record']->value->id;?>
" value="<?php echo $_smarty_tpl->tpl_vars['record']->value->others;?>
"/>
                                    </td>
                                </tr>

                                <tr class="invest<?php echo $_smarty_tpl->tpl_vars['record']->value->id;?>
">
                                    <td  colspan="2"style="width: 11%;">
                                        La Paroscopy
                                    </td>
                                    <td colspan="13" style="width: 87%;">
                                        <input type="text" class="form-control updateElement"   data-tableName="infertilityinvest" data-colName="laparoscopy" data-id="<?php echo $_smarty_tpl->tpl_vars['record']->value->id;?>
" value="<?php echo $_smarty_tpl->tpl_vars['record']->value->laparoscopy;?>
"/>
                                    </td>
                                    <td style="width: 2%;">
                                        <a class="btn grey-cascade btn-xs deletemsgEXDiv" data-divName="invest<?php echo $_smarty_tpl->tpl_vars['record']->value->id;?>
" data-id="<?php echo $_smarty_tpl->tpl_vars['record']->value->id;?>
" style=" float: left;" href="#" data-link="followup" data-fn="del" data-tableName="infertilityinvest">
                                            <i class="fa fa-close"></i>
                                        </a>
                                    </td>

                                </tr>

                                
                                
                               <?php } ?>
                             <?php }?>
                            </tbody>
                        </table>
 


                
        </div>
            

                         


                    </div>
                </div>
            </div>
            
            <div class="col-md-2" style="padding-right: 0px; padding-left: 0px; width: 11%;">
                <div class="portlet box blue">
                    <div class="portlet-title" style="height: 5px">
                        <div class="caption">
                            <i class="fa fa-edit"></i> LMP
                        </div>
                        <div class="actions">
                            <button type="button" class="btn btn-xs blue fright" id="addLmp"><i class="fa fa-plus"></i></button>
                        </div>                 

                        


                    </div>
                    <div class="portlet-body" id="justfordrugs" >
                        <div class="table-toolbar">

                        </div>
                        <table class="table table-striped table-hover table-bordered" id="records">
                            <?php if ($_smarty_tpl->tpl_vars['notes']->value){?>
                            <tbody id="lmpBody">
                                <?php  $_smarty_tpl->tpl_vars['record'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['record']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['lmp']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['record']->key => $_smarty_tpl->tpl_vars['record']->value){
$_smarty_tpl->tpl_vars['record']->_loop = true;
?>
                                <tr>
                                    <td>
                                        <input type="text" class="form-control datepicker updateElement" data-id="<?php echo $_smarty_tpl->tpl_vars['record']->value->id;?>
" data-colName="date" data-tableName="infertilitylmp" value="<?php echo $_smarty_tpl->tpl_vars['record']->value->date;?>
" readonly/>
                                    </td>
                                </tr>
                                <?php } ?>
                                <?php }?>
                            </tbody>
                        </table>


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

        </div>
    </div>

</div>
<input type="hidden" id="patientId" value="<?php echo $_smarty_tpl->tpl_vars['patientId']->value;?>
"/>
<input type="hidden" id="controllName" value="infertility"/>
<input type="hidden" id="infertilityId" value="<?php echo $_smarty_tpl->tpl_vars['infertility']->value->id;?>
"/>
<!----#########################################################################  model ##############################################################################################################--->

<!---------------------------------------------------------------------------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="infertilityDrugs" 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"> Prescription <input type="text" class="form-control datepicker " id="presDate" name="presDate" value="<?php echo $_smarty_tpl->tpl_vars['presDate']->value;?>
" data-controller="infertility"  readonly="" placeholder="Date" style="display: inline; width: 65%"> </div>
                                        <div class="actions">
                                            <a href="javascript:;" class="btn btn-default btn-sm" id="addNewDrugRow" data-tableName="infertilitydrugs">
                                                <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"> <input type="checkbox" id="forHusband" name="forHusband"  value="1" data-controller="infertility"> Husband</label>
                                        </div>
                                    </div>

                                    <div class="portlet-body">

                                        <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="<?php echo $_smarty_tpl->tpl_vars['preItr']->value;?>
" name="drugItr"/></td></tr>
                                                <?php $_smarty_tpl->tpl_vars['itr'] = new Smarty_variable(1, null, 0);?>
                                                <?php  $_smarty_tpl->tpl_vars['pre'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['pre']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['PatientPresByDate']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['pre']->key => $_smarty_tpl->tpl_vars['pre']->value){
$_smarty_tpl->tpl_vars['pre']->_loop = true;
?>
                                                <tr>
                                                    <td>
                                                        <select class="form-control xx dcat select2me" id="dcat<?php echo $_smarty_tpl->tpl_vars['itr']->value;?>
" name="dcat<?php echo $_smarty_tpl->tpl_vars['itr']->value;?>
"  data-itr="<?php echo $_smarty_tpl->tpl_vars['itr']->value;?>
"  data-placeholder="Select..."  >
                                                            <option value="" <?php if ($_smarty_tpl->tpl_vars['pre']->value->drugcat==''){?>selected<?php }?>>Choose Category</option>
                                                            <?php  $_smarty_tpl->tpl_vars['cat'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['cat']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['allDrugcats']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['cat']->key => $_smarty_tpl->tpl_vars['cat']->value){
$_smarty_tpl->tpl_vars['cat']->_loop = true;
?>
                                                            <option value="<?php echo $_smarty_tpl->tpl_vars['cat']->value['drugcat'];?>
" <?php if ($_smarty_tpl->tpl_vars['pre']->value->drugcat==$_smarty_tpl->tpl_vars['cat']->value['drugcat']){?>selected<?php }?>><?php echo $_smarty_tpl->tpl_vars['cat']->value['drugcat'];?>
</option>
                                                            <?php } ?>
                                                            <option value="" <?php if ($_smarty_tpl->tpl_vars['pre']->value->drugcat==''){?>selected<?php }?>>Choose Category</option>
                                                        </select>
                                                    </td>
                                                    <td>
                                                        <select class="form-control xx dname select2me updateElement" id="dname<?php echo $_smarty_tpl->tpl_vars['itr']->value;?>
" data-id="<?php echo $_smarty_tpl->tpl_vars['pre']->value->id;?>
" data-colName="drugid" data-tableName="infertilitydrugs" data-itr="<?php echo $_smarty_tpl->tpl_vars['itr']->value;?>
" data-placeholder="Select..."  >
                                                            <option value="" <?php if ($_smarty_tpl->tpl_vars['pre']->value->drugid==''){?>selected<?php }?>>Choose Drug</option>
                                                            <?php  $_smarty_tpl->tpl_vars['drug'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['drug']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['drugs']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['drug']->key => $_smarty_tpl->tpl_vars['drug']->value){
$_smarty_tpl->tpl_vars['drug']->_loop = true;
?>
                                                            <option value="<?php echo $_smarty_tpl->tpl_vars['drug']->value['id'];?>
" <?php if ($_smarty_tpl->tpl_vars['pre']->value->drugid==$_smarty_tpl->tpl_vars['drug']->value['id']){?>selected<?php }?>><?php echo $_smarty_tpl->tpl_vars['drug']->value['drugname'];?>
 <?php if ($_smarty_tpl->tpl_vars['ProgramesettingData']->value->visitsform==3){?>(left <?php echo $_smarty_tpl->tpl_vars['drug']->value['currentbalance'];?>
)<?php }?></option>
                                                            <?php } ?>
                                                            <option value="" <?php if ($_smarty_tpl->tpl_vars['pre']->value->drugid==''){?>selected<?php }?>>Choose Drug</option>
                                                        </select>

                                                    </td>
                                                    <td>
                                                        <select class="form-control xx dtype select2me updateElement" id="dtype<?php echo $_smarty_tpl->tpl_vars['itr']->value;?>
" data-id="<?php echo $_smarty_tpl->tpl_vars['pre']->value->id;?>
" data-colName="drugtype" data-tableName="infertilitydrugs" data-itr="<?php echo $_smarty_tpl->tpl_vars['itr']->value;?>
" data-placeholder="Select..."  >
                                                            <option value="" <?php if ($_smarty_tpl->tpl_vars['pre']->value->drugtype==''){?>selected<?php }?>>Choose Form</option>
                                                            <?php  $_smarty_tpl->tpl_vars['type'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['type']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['allDrugTypes']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['type']->key => $_smarty_tpl->tpl_vars['type']->value){
$_smarty_tpl->tpl_vars['type']->_loop = true;
?>
                                                            <option value="<?php echo $_smarty_tpl->tpl_vars['type']->value['drugtype'];?>
" <?php if ($_smarty_tpl->tpl_vars['pre']->value->drugtype==$_smarty_tpl->tpl_vars['type']->value['drugtype']){?>selected<?php }?>><?php echo $_smarty_tpl->tpl_vars['type']->value['drugtype'];?>
</option>
                                                            <?php } ?>
                                                            <option value="" <?php if ($_smarty_tpl->tpl_vars['pre']->value->drugtype==''){?>selected<?php }?>>Choose Form</option>
                                                        </select>
                                                    </td>
                                                    <td>
                                                        <select class="form-control xx select2me updateElement" id="ddos<?php echo $_smarty_tpl->tpl_vars['itr']->value;?>
" data-id="<?php echo $_smarty_tpl->tpl_vars['pre']->value->id;?>
" data-colName="drugdos" data-tableName="infertilitydrugs" data-itr="<?php echo $_smarty_tpl->tpl_vars['itr']->value;?>
" data-placeholder="Select..."  >
                                                            <option value="" <?php if ($_smarty_tpl->tpl_vars['pre']->value->drugdos==''){?>selected<?php }?>>choose dose </option>
                                                            <?php  $_smarty_tpl->tpl_vars['dos'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['dos']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['allDrugDoses']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['dos']->key => $_smarty_tpl->tpl_vars['dos']->value){
$_smarty_tpl->tpl_vars['dos']->_loop = true;
?>
                                                            <option value="<?php echo $_smarty_tpl->tpl_vars['dos']->value['drugdos'];?>
" <?php if ($_smarty_tpl->tpl_vars['pre']->value->drugdos==$_smarty_tpl->tpl_vars['dos']->value['drugdos']){?>selected<?php }?>><?php echo $_smarty_tpl->tpl_vars['dos']->value['drugdos'];?>
</option>
                                                            <?php } ?>
                                                            <option value="" <?php if ($_smarty_tpl->tpl_vars['pre']->value->drugdos==''){?>selected<?php }?>>choose dose </option>
                                                        </select>
                                                    </td>

                                                    <td>
                                                        <a class="btn grey-cascade btn-xs deletemsgEX" data-id="<?php echo $_smarty_tpl->tpl_vars['pre']->value->id;?>
" style=" float: left;" href="#" data-link="infertility" data-fn="addprescription">
                                                            <i class="fa fa-close"></i>
                                                        </a>
                                                    </td>
                                                </tr>
                                                <?php $_smarty_tpl->_capture_stack[0][] = array('default', 'itr', null); ob_start(); ?><?php echo $_smarty_tpl->tpl_vars['itr']->value+1;?>
<?php list($_capture_buffer, $_capture_assign, $_capture_append) = array_pop($_smarty_tpl->_capture_stack[0]);
if (!empty($_capture_buffer)) {
 if (isset($_capture_assign)) $_smarty_tpl->assign($_capture_assign, ob_get_contents());
 if (isset( $_capture_append)) $_smarty_tpl->append( $_capture_append, ob_get_contents());
 Smarty::$_smarty_vars['capture'][$_capture_buffer]=ob_get_clean();
} else $_smarty_tpl->capture_error();?>
                                                <?php } ?>

                                            </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="infertility"> 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>
                                                    <?php if ($_smarty_tpl->tpl_vars['ProgramesettingData']->value->displaydoctorname==1){?> Doctor<?php }?>
                                                </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>


<!------------------##############################-------------------- End of Models -----------------------#########################################-------------->
<div id="newDrugTableDiv"></div>
<?php }} ?>