<?php /* Smarty version Smarty-3.1.11, created on 2025-01-06 23:40:54
         compiled from "../views/obgy/antenalvisit/newrowdrugedit.html" */ ?>
<?php /*%%SmartyHeaderCode:1028048501677c4de635aa29-17599244%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_valid = $_smarty_tpl->decodeProperties(array (
  'file_dependency' => 
  array (
    '4be0e6a9f3bb92b2bcb13a9b86fca6b6265a3eef' => 
    array (
      0 => '../views/obgy/antenalvisit/newrowdrugedit.html',
      1 => 1477475466,
      2 => 'file',
    ),
  ),
  'nocache_hash' => '1028048501677c4de635aa29-17599244',
  'function' => 
  array (
  ),
  'variables' => 
  array (
    'type' => 0,
    'preItr' => 0,
    'PatientPresByDate' => 0,
    'itr' => 0,
    'pre' => 0,
    'allDrugcats' => 0,
    'cat' => 0,
    'drugs' => 0,
    'drug' => 0,
    'ProgramesettingData' => 0,
    'allDrugTypes' => 0,
    'allDrugDoses' => 0,
    'dos' => 0,
  ),
  'has_nocache_code' => false,
  'version' => 'Smarty-3.1.11',
  'unifunc' => 'content_677c4de6498ab7_76037582',
),false); /*/%%SmartyHeaderCode%%*/?>
<?php if ($_valid && !is_callable('content_677c4de6498ab7_76037582')) {function content_677c4de6498ab7_76037582($_smarty_tpl) {?>
<!----------------------------------------------------------------------------------------------------------------------------------------------------->
<?php if ($_smarty_tpl->tpl_vars['type']->value=="drugedit"){?>
<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="mainantenentaldrugs" 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="mainantenentaldrugs" 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="mainantenentaldrugs" 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="antenalvisit" 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 } ?>
<!----------------------------------------------------------------------------------------------------------------------------------------------------->
<?php }?>






<script type="text/javascript" >
    var preItr = $('#drugItr').val();
    for (var itr = 1; itr <= preItr; itr++)
    {
        if ($().select2)
        {
            $('#dcat' + itr).select2({placeholder: "Select", allowClear: true});
            $('#dname' + itr).select2({placeholder: "Select", allowClear: true});
            $('#dtype' + itr).select2({placeholder: "Select", allowClear: true});
            $('#ddos' + itr).select2({placeholder: "Select", allowClear: true});
        }

    }
</script>

<?php }} ?>