
<div class="page-content-wrapper">
    <div class="page-content">
        <div class="row clinick">
            <div class="col-md-12">
                <!-- BEGIN EXAMPLE TABLE PORTLET-->
                <div class="portlet box blue">
                    <div class="portlet-title">
                        <div class="caption">
                            <i class="fa fa-user"></i>Operation Form
                        </div>
                        <div class="actions">
                            <a href="{$hosturl}/controllers/{$controllname}.php?patientid={$patientId}" class="btn btn-default btn-sm">
                                <i class="fa fa-plus"></i> Show </a>

                        </div>
                    </div>
                    <div class="portlet-body all">
                        <input type="hidden" id="patientId" value="{$patientid}"/>
                        <input type="hidden" id="tdate" value="{$today}">
                        <input type="hidden" id="controllName" value="operativedetails"/>
                        <input type="hidden" id="opdetailsid" value="{$opid}"/>


                        <div class="row operativeDiv">
                            <input type="hidden" id="opdetails" value="1"/>

                            <div class="form-body ">

                                <div class="portlet-title tbox">
                                    <div class="caption font-blue col-md-12 txtc">
                                        <span class="caption-subject bold uppercase txtc">Operation Details</span>
                                    </div>

                                </div>

                                <div class="row">

                                    <div class="col-md-3" style=" margin-top: -6px; ">
                                        <div class="form-group">
                                            <label class="control-label ls2">operation Name</label>

                                            <select class="form-control updateOp" id="ddd" name="opname" select-tableName="operativedetails" data-tableName="operativedetails" data-maintable = "operation" data-colName="operationid" data-id="{$opid}" >
                                                <option value="">choose</option>
                                                {foreach  $operation as $data}
                                                <option value="{$data->id}" {if {$data->id} eq {$operativedetails->operationid} } selected {/if} >{$data->name}</option>
                                                {/foreach}

                                                <option value="-2" class="deleteoptincompo">Delete</option>
                                            </select>

                                        </div>
                                    </div>


                                    <div class="col-md-3">
                                        <div class="form-group form-md-line-input form-md-floating-label has-info">
                                            <input type="text" class="form-control datepicker updateElement txtc" id="date" name="date" data-tableName="operativedetails" data-colName="date" data-id="{$opid}" value="{$operativedetails->date}"/>
                                            <label for="form_control_1">Date</label>
                                        </div>
                                    </div>


                                    <div class="col-md-3">
                                        <div class="form-group form-md-line-input form-md-floating-label has-info">
                                            <input type="time" class="form-control updateElement txtc" id="timestart" name="timestart" value="{$operativedetails->timestart}" data-tableName="operativedetails" data-colName="timestart" data-id="{$opid}"/>
                                            <label for="form_control_1">Time Start</label>
                                        </div>
                                    </div>

                                    <div class="col-md-3">
                                        <div class="form-group form-md-line-input form-md-floating-label has-info">
                                            <input type="time" class="form-control updateElement txtc" id="timeend" name="timeend" value="{$operativedetails->timeend}" data-tableName="operativedetails" data-colName="timeend" data-id="{$opid}"/>
                                            <label for="form_control_1">Time End</label>
                                        </div>
                                    </div>

                                </div>
                                <div class="row">

                                    <div class="col-md-12">
                                        <div class="form-group form-md-line-input form-md-floating-label has-info">
                                            <textarea class="form-control updateElement" rows="3" id="indiction" name="indiction" data-tableName="operativedetails" data-colName="indication" data-id="{$opid}">{$operativedetails->indication}</textarea>
                                            <label for="form_control_1">Indication</label>
                                        </div>
                                    </div>

                                </div>
                                <div class="row">

                                    <div class="col-md-2">
                                        <div class="form-group">
                                            <label class="control-label col-md-2 ls2">Anasthesia</label>
                                            <div class="phregularity_div">
                                                <select class="form-control updateOp" id="anasthesaid" name="anasthesa" select-tableName="operativedetails" data-tableName="operativedetails" data-maintable = "anasthesa" data-colName="anasthesaid" data-id="{$opid}">
                                                    <option value="">choose</option>
                                                    {foreach  $anasthesa as $data}
                                                    <option value="{$data->id}" {if {$data->id} eq {$operativedetails->anasthesaid} } selected {/if} >{$data->name}</option>
                                                    {/foreach}

                                                    <option value="-2" class="deleteoptincompo">Delete</option>
                                                </select>
                                            </div>
                                        </div>
                                    </div>


                                    <div class="col-md-2">
                                        <div class="form-group">
                                            <div id="chlid_anasthesa">
                                                <br>
                                                {if $operativedetails->anasthesaid neq 0}
                                                <div class="all">
                                                    <select class="form-control updateOp" id="child" name="child"  select-tableName="operativedetails" data-tableName="operativedetails" data-maintable = "generalanasthesa" data-colName="generalid" data-id="{$opid}">
                                                        <option value="">choose</option>
                                                        {foreach  $general as $data}
                                                        <option value="{$data.id}" {if {$data.id} eq {$operativedetails->generalid} } selected {/if}>{$data.name}</option>
                                                        {/foreach}

                                                        <option value="-2" class="deleteoptincompo">Delete</option>
                                                    </select>
                                                </div>
                                                {/if}
                                            </div>
                                        </div>
                                    </div>

                                </div>
                                <div class="row">
                                    <a class="btn btn-default btn-sm" data-toggle="modal" href="#long" >
                                        <i class="fa fa-plus"></i> Select Anasthetists </a>



                                    <a class="btn btn-default btn-sm" data-toggle="modal" href="#long1" >
                                        <i class="fa fa-plus"></i> Select Assistant </a>

                                    <a class="btn btn-default btn-sm" data-toggle="modal" href="#" id="addDrug">
                                        <i class="fa fa-plus"></i> Drug Used </a>

                                </div>


                                <div class="row">

                                    <div class="col-md-12">
                                        <div class="form-group form-md-line-input form-md-floating-label has-info">
                                            <textarea class="form-control updateElement" rows="3"  id="complication" name="complication" data-tableName="operativedetails" data-colName="complication" data-id="{$opid}">{$operativedetails->complication}</textarea>
                                            <label for="form_control_1">Any Complication</label>
                                        </div>
                                    </div>
                                </div>

                                <div class="portlet-title tbox">
                                    <div class="caption font-blue col-md-12 txtc">
                                        <span class="caption-subject bold uppercase txtc">Operation Properties</span>
                                    </div>

                                </div>

                                <div class="row">

                                    <div class="col-md-2">
                                        <div class="form-group">
                                            <label class="control-label col-md-2 ls2">Incision</label>
                                            <div class="phregularity_div">
                                                <select class="form-control updateOp" id="jncisionid" name="jncision" select-tableName="operativedetails" data-tableName="operativedetails" data-maintable = "jncision" data-colName="jncisionid" data-id="{$opid}">
                                                    <option value="">choose</option>
                                                    {foreach  $jncision as $data}
                                                    <option value="{$data->id}" {if {$data->id} eq {$operativedetails->jncisionid} } selected {/if} >{$data->name}</option>
                                                    {/foreach}

                                                    <option value="-2" class="deleteoptincompo">Delete</option>
                                                </select>
                                            </div>
                                        </div>
                                    </div>

                                    <div class="col-md-2">
                                        <div class="form-group">
                                            <div id="chlid_jncision">
                                                <br>
                                                {if $operativedetails->jncisionid neq 0}
                                                <div class="all">
                                                    <select class="form-control updateOp" id="childj" name="child"  select-tableName="operativedetails" data-tableName="operativedetails" data-maintable = "midlinejncision" data-colName="midlineid" data-id="{$opid}">
                                                        <option value="">choose</option>
                                                        {foreach  $midline as $data}
                                                        <option value="{$data.id}" {if {$data.id} eq {$operativedetails->midlineid} } selected {/if}>{$data.name}</option>
                                                        {/foreach}

                                                        <option value="-2" class="deleteoptincompo">Delete</option>
                                                    </select>
                                                </div>
                                                {/if}
                                            </div>
                                        </div>
                                    </div>

                                </div>

                                <div class="row">
                                    <div class="form-group form-md-line-input">
                                        <label class="col-md-2 control-label" for="form_control_1">Peritoneal Wash</label>
                                        <div class="col-md-10">
                                            <div class="md-radio-inline">
                                                <div class="md-radio">
                                                    <input type="radio" id="radio53" name="peritonealwash" class="md-radiobtn updateElement" value="1" select-tableName="operativedetails" data-tableName="operativedetails" data-colName="peritonealwash" data-id="{$opid}" {if $operativedetails->peritonealwash eq 1}checked{/if}>
                                                    <label for="radio53">
                                                        <span></span>
                                                        <span class="check"></span>
                                                        <span class="box"></span>
                                                        Yes </label>
                                                </div>
                                                <div class="md-radio">
                                                    <input type="radio" id="radio52" name="peritonealwash" class="md-radiobtn updateElement" value="0" data-tableName="operativedetails" data-colName="peritonealwash" data-id="{$opid}" {if $operativedetails->peritonealwash eq 0}checked{/if}>
                                                    <label for="radio52">
                                                        <span></span>
                                                        <span class="check"></span>
                                                        <span class="box"></span>
                                                        No </label>
                                                </div>

                                            </div>
                                        </div>

                                    </div>
                                </div>
                                <div class="row">
                                    <div class="col-md-12">
                                        <div class="form-group form-md-line-input form-md-floating-label has-info">
                                            <textarea class="form-control updateElement" rows="3"  id="exdetails" name="exdetails" data-tableName="operativedetails" data-colName="exdetails" data-id="{$opid}">{$operativedetails->exdetails}</textarea>
                                            <label for="form_control_1">Exploration Details</label>
                                        </div>
                                    </div>
                                </div>
                                <div class="row">
                                    <div class="col-md-12">
                                        <div class="form-group form-md-line-input form-md-floating-label has-info">
                                            <textarea class="form-control updateElement" rows="3"  id="opsteps" name="opsteps" data-tableName="operativedetails" data-colName="opsteps" data-id="{$opid}">{$operativedetails->opsteps}</textarea>
                                            <label for="form_control_1">Operation Steps</label>
                                        </div>
                                    </div>
                                </div>
                                <div class="portlet-title tbox">
                                    <div class="caption font-blue col-md-12 txtc">
                                        <span class="caption-subject bold uppercase txtc">Closure</span>
                                    </div>

                                </div>


                                <div class="row">

                                    <div class="col-md-4">
                                        <div class="form-group form-md-line-input form-md-floating-label has-info">
                                            <input type="text" class="form-control updateElement txtc" id="layers" name="layers" value="{$operativedetails->layers}" data-tableName="operativedetails" data-colName="layers" data-id="{$opid}"/>
                                            <label for="form_control_1">Layers</label>
                                        </div>
                                    </div>
                                    <div class="col-md-4">
                                        <div class="form-group form-md-line-input form-md-floating-label has-info">
                                            <input type="text" class="form-control updateElement txtc" id="drains" name="drains" value="{$operativedetails->drains}" data-tableName="operativedetails" data-colName="drains" data-id="{$opid}"/>
                                            <label for="form_control_1">Drains</label>
                                        </div>
                                    </div>
                                    <div class="col-md-4">
                                        <div class="form-group form-md-line-input form-md-floating-label has-info">
                                            <input type="text" class="form-control updateElement txtc" id="suture" name="suture" value="{$operativedetails->suture}" data-tableName="operativedetails" data-colName="suture" data-id="{$opid}"/>
                                            <label for="form_control_1">Suture</label>
                                        </div>
                                    </div>
                                </div>
                                <div class="row">
                                    <div class="form-group form-md-line-input">
                                        <label class="col-md-2 control-label" for="form_control_1">Blood Transfusion</label>
                                        <div class="col-md-10">
                                            <div class="md-radio-inline">
                                                <div class="md-radio">
                                                    <input type="radio" id="radio6" name="bloodtransfusion" class="md-radiobtn updateElement" value="1" data-tableName="operativedetails" data-colName="bloodtransfusion" data-id="{$opid}"  {if $operativedetails->bloodtransfusion eq 1}checked{/if}>
                                                    <label for="radio6">
                                                        <span></span>
                                                        <span class="check"></span>
                                                        <span class="box"></span>
                                                        Yes </label>
                                                </div>
                                                <div class="md-radio">
                                                    <input type="radio" id="radio5" name="bloodtransfusion" class="md-radiobtn updateElement" value="0" data-tableName="operativedetails" data-colName="bloodtransfusion" data-id="{$opid}" {if $operativedetails->bloodtransfusion eq 0}checked{/if}>
                                                    <label for="radio5">
                                                        <span></span>
                                                        <span class="check"></span>
                                                        <span class="box"></span>
                                                        No </label>
                                                </div>

                                            </div>
                                        </div>

                                    </div>
                                </div>
                                <div class="row">

                                    <div class="col-md-12">
                                        <div class="form-group form-md-line-input form-md-floating-label has-info">
                                            <textarea class="form-control updateElement" rows="3"  id="complications" name="complications" data-tableName="operativedetails" data-colName="complications" data-id="{$opid}">{$operativedetails->complications}</textarea>
                                            <label for="form_control_1">Complications</label>
                                        </div>
                                    </div>
                                </div>
                                <div class="row">
                                    <div class="col-md-12">
                                        <div class="form-group form-md-line-input form-md-floating-label has-info">
                                            <textarea class="form-control updateElement" rows="3"   id="recommendation" name="recommendation" data-tableName="operativedetails" data-colName="recommendation" data-id="{$opid}">{$operativedetails->recommendation}</textarea>
                                            <label for="form_control_1">Recommendation</label>
                                        </div>
                                    </div>

                                </div>
                                <div class="row">
                                    <a class="btn btn-default btn-sm" data-toggle="modal" href="#long2" >
                                        <i class="fa fa-print"></i> Select Staff </a>



                                    <a class="btn btn-default btn-sm" data-toggle="modal" href="#long3" >
                                        <i class="fa fa-print"></i> Select Assistant </a>
                                </div>

                                <input type="hidden" name="id" value="{$operativedetails->id}">

                            </div>



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

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

<div id="long" class="modal fade modal-scroll" tabindex="-1" data-replace="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close hidden-print" data-dismiss="modal" aria-hidden="true"></button>
                <h4 class="modal-title"></h4>
            </div>
            <div class="modal-body printtable" id="prin2">
                <center><h4 class="modal-title">Anasthetists Doctors</h4></center>
                <table class="table table-hover portlet light bg-inverse" >
                    <thead>
                        <tr>
                            <th width="1%">No.</th>
                            <th width="30%">
                                Doctor Name
                            </th>

                        </tr>
                    </thead>
                    <tbody>
                        {assign var="i" value="1"}
                        {foreach $anasthesaNames as $data}
                        <tr class="odd gradeX">

                            <td>
                                <div class="col-md-9">
                                    <div class="md-checkbox-inline">
                                        <div class="md-checkbox">
                                            <input type="checkbox" class="md-check checkdocrole" id="anasthetstsid{$i}" value="{$data.user_id}" name="anasthetsts" data-tableName="operativedetails" data-colName="anasthetstsid" data-id="{$opid}" data-val="{$data.user_id}" {foreach $outroleid as $newdata} {if $newdata  eq {$data.user_id}} checked {/if} {/foreach}/>
                                                   <label for="anasthetstsid{$i}">
                                                <span></span>
                                                <span class="check"></span>
                                                <span class="box"></span>
                                        </div>


                                    </div>
                                </div>


                            </td>

                            <td>
                                {$data.name}
                            </td>

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

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



<div id="long1" class="modal fade modal-scroll" tabindex="-1" data-replace="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close hidden-print" data-dismiss="modal" aria-hidden="true"></button>
                <h4 class="modal-title"></h4>
            </div>
            <div class="modal-body printtable" id="prin2">
                <center><h4 class="modal-title">Assistant Doctors</h4></center>
                <table class="table table-hover portlet light bg-inverse" >
                    <thead>
                        <tr>
                            <th width="1%">No.</th>
                            <th width="30%">
                                Doctor Assistant Name
                            </th>

                        </tr>
                    </thead>
                    <tbody>
                        {assign var="i" value="1"}
                        {foreach $assistantNames as $data}
                        <tr class="odd gradeX">

                            <td>
                                <div class="col-md-9">
                                    <div class="md-checkbox-inline">
                                        <div class="md-checkbox">
                                            <input type="checkbox" class="md-check checkoutrole" id="assistantid{$i}" name="assistant" value="{$data.user_id}" data-tableName="operativedetails" data-colName="assistantid" data-id="{$opid}" data-val="{$data.user_id}" {foreach $outroleasisid as $newdata} {if $newdata  eq {$data.user_id}} checked {/if} {/foreach} />
                                                   <label for="assistantid{$i}">
                                                <span></span>
                                                <span class="check"></span>
                                                <span class="box"></span>
                                        </div>


                                    </div>
                                </div>


                            </td>

                            <td>
                                {$data.name}
                            </td>

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

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


<div id="long2" class="modal fade modal-scroll" tabindex="-1" data-replace="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close hidden-print" data-dismiss="modal" aria-hidden="true"></button>
                <h4 class="modal-title"></h4>
            </div>
            <div class="modal-body printtable" id="prin2">
                <center><h4 class="modal-title"> Doctors</h4></center>
                <table class="table table-hover portlet light bg-inverse" >
                    <thead>
                        <tr>
                            <th width="1%">No.</th>
                            <th width="30%">
                                Doctor Name
                            </th>

                        </tr>
                    </thead>
                    <tbody>
                        {assign var="i" value="1"}
                        {foreach $anasthesaNames1 as $data}
                        <tr class="odd gradeX">

                            <td>
                                <div class="col-md-9">
                                    <div class="md-checkbox-inline">
                                        <div class="md-checkbox">
                                            <input type="checkbox" class="md-check checkdocrole1" id="anasthetstsid1{$i}"  value="{$data.user_id}" name="anasthetsts1" data-tableName="operativedetails" data-colName="anasthetsts2id" data-id="{$opid}" data-val="{$data.user_id}" {foreach $outroleanasid as $newdata} {if $newdata  eq {$data.user_id}} checked {/if} {/foreach}/>
                                                   <label for="anasthetstsid1{$i}">
                                                <span></span>
                                                <span class="check"></span>
                                                <span class="box"></span>
                                        </div>


                                    </div>
                                </div>


                            </td>

                            <td>
                                {$data.name}
                            </td>

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

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




<div id="long3" class="modal fade modal-scroll" tabindex="-1" data-replace="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close hidden-print" data-dismiss="modal" aria-hidden="true"></button>
                <h4 class="modal-title"></h4>
            </div>
            <div class="modal-body printtable" id="prin2">
                <center><h4 class="modal-title">Assistant Doctors</h4></center>
                <table class="table table-hover portlet light bg-inverse" >
                    <thead>
                        <tr>
                            <th width="1%">No.</th>
                            <th width="30%">
                                Doctor Assistant Name
                            </th>

                        </tr>
                    </thead>
                    <tbody>
                        {assign var="i" value="1"}
                        {foreach $assistantNames1 as $data}
                        <tr class="odd gradeX">

                            <td>
                                <div class="col-md-9">
                                    <div class="md-checkbox-inline">
                                        <div class="md-checkbox">
                                            <input type="checkbox" class="md-check checkoutrole1" id="assistantid1{$i}" name="assistant1" value="{$data.user_id}" data-tableName="operativedetails" data-colName="assistant2id" data-id="{$opid}" data-val="{$data.user_id}" {foreach $outroleasis2id as $newdata} {if $newdata  eq {$data.user_id}} checked {/if} {/foreach}/>
                                                   <label for="assistantid1{$i}">
                                                <span></span>
                                                <span class="check"></span>
                                                <span class="box"></span>
                                        </div>


                                    </div>
                                </div>




                            </td>

                            <td>
                                {$data.name}
                            </td>

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

        </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">
                            <!------===========================================------->
                            <div>
                                <div id="alldatadiv" class=""> </div>
                            </div>

                            <!------===========================================------->
                            <!--                            <div class="form-group">
                                                            <label class="col-md-3 control-label"> Name</label>
                                                            <div class="col-md-8">
                                                                <input type="hidden" class="form-control"  id="newitem_id" name="newamount_id" >
                                                                <input type="text" class="form-control"  id="newitem_name" name="newamount_name" style="text-align:left;" >
                                                                <div id="divsucess1" style="color:red; display:none;"></div>
                                                            </div>
                                                        </div>-->
                            <!------===========================================------->
                            <div class="modal-footer">
                                <!--                                <button type="button" class="btn green" id="editmodel_submit"> Update </button>-->
                                <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="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" 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"> Prescription </div>
                                            <div class="actions">
                                                <a href="javascript:;" class="btn btn-default btn-sm" id="newDrug">
                                                    <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>

                                        <div class="portlet-body">

                                            <table class="table table-striped table-hover table-bordered" id="pre_table" >
                                                <thead>
                                                    <tr>
                                                        <th style="width: 24%">
                                                            Group
                                                        </th>
                                                        <th style="width: 24%">
                                                            Drug
                                                        </th>
                                                        <th style="width: 24%">
                                                            Form
                                                        </th>
                                                        <th style="width: 27%">
                                                            Dos
                                                        </th>

                                                        <th >
                                                            Delete
                                                        </th>
                                                    </tr>
                                                </thead>
                                                <tbody id="drugContent">
                                                    {if $operativeDrugsCount > 0}
                                                    {assign var=i value=1}
                                                    {foreach $operativeDrugs as $oDrug}
                                                    <tr>
                                                        <td>
                                                            <select class="form-control xx dcat select2me" id="dcat{$i}"  data-placeholder="Select..."  data-itr="{$i}" >
                                                                <option value="">Choose Category</option>
                                                                {foreach $allDrugcats as $cat}
                                                                <option value="{$cat['drugcat']}" {if $oDrug->drugcat == $cat['drugcat'] } selected {/if} >{$cat['drugcat']}</option>
                                                                {/foreach}
                                                            </select>
                                                        </td>
                                                        <td>
                                                            <select class="form-control xx dname select2me updateElement" {if $new == 1 } data-createNew="0" {/if} id="dname{$i}" data-itr="{$i}"   data-id="{$oDrug->id}" data-colName="drugid" data-tableName="operativedetailsdrugs"  data-placeholder="Select..."  >
                                                                <option value="">Choose Drug</option>
                                                                {foreach $drugs as $drug}
                                                                <option value="{$drug['id']}" {if $oDrug->drugid == $drug['id'] } selected {/if} >{$drug['drugname']}</option>
                                                                {/foreach}
                                                            </select>
                                                        </td>
                                                        <td>
                                                            <select class="form-control xx dtype select2me updateElement" id="dtype{$i}"  data-itr="{$i}"   data-id="{$oDrug->id}" data-colName="drugtype" data-tableName="operativedetailsdrugs"  data-placeholder="Select..."  >
                                                                <option value="">Choose Form</option>
                                                                {foreach $allDrugTypes as $type}
                                                                <option value="{$type['drugtype']}" {if $oDrug->drugtype == $type['drugtype'] } selected {/if} >{$type['drugtype']}</option>
                                                                {/foreach}
                                                            </select>
                                                        </td>
                                                        
                                                        <td>
                                                            <select class="form-control xx  select2me updateElement" id="ddos{$i}" data-itr="{$i}"   data-id="{$oDrug->id}" data-colName="drugdos" data-tableName="operativedetailsdrugs" data-placeholder="Select..."  >
                                                                <option value="">choose dose </option>
                                                                {foreach $allDrugDoses as $dos}
                                                                <option value="{$dos['drugdos']}"  {if $oDrug->drugdos == $dos['drugdos'] } selected {/if} >{$dos['drugdos']}</option>
                                                                {/foreach}
                                                            </select>
                                                        </td>
                                                        
                                                        

                                                        <td>
                                                            <a class="btn grey-cascade btn-xs deletemsgEX" data-id="{$oDrug->id}" style=" float: left;" href="#" data-link="operativedetails" data-fn="delodrug">
                                                                <i class="fa fa-close"></i>
                                                            </a>
                                                        </td>
                                                    </tr>

                                                    {capture assign=i}{$i+1}{/capture}
                                                    {/foreach}

                                                    {/if}

                                                </tbody>
                                            </table>

                                            <input type="hidden" id="drugItr" value="{$operativeDrugsCount}" name="drugItr"/>

                                            <div id="drugPrint">

                                            </div>
                                        </div>

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

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


</div>

<div id="newDrugTableDiv"></div>

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



