

<div class="modal fade" tabindex="-1" role="dialog" aria-hidden="false" data-backdrop="static" data-keyboard="false"  
     id="preparedTTTModal" 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"> TTT </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-body  scroll_y showNum isheight">

                                        <table class="table table-striped table-hover table-bordered" style="margin: 2%; width: 96%;">
                                            <tbody>
                                                <tr>
                                                    <th class="col-md-1">Doctor</th>
                                                    <td class="col-md-3">
                                                        <select class="form-control "  id="docIdPre" data-placeholder="Select..." data-controller="{$preController}" >
                                                            <option></option>
                                                            {foreach  $doctors as $data}
                                                            <option value="{$data.user_id}" >{$data.name}</option>
                                                            {/foreach}
                                                        </select>
                                                    </td>

                                                    <th class="col-md-1">
                                                        <a href="javascript:;" class="btn btn-primary btn-sm" id="addPreTTT" data-controller="{$preController}">
                                                            <i class="fa fa-plus"></i> Add New </a>
                                                    </th>
                                                </tr>
                                        </table>
                                        <div > 
                                            <table class="table table-striped table-hover table-bordered" style="margin: 2%; width: 96%;">
                                                <thead>
                                                    <tr>
                                                        <th width="7%">No</th>
                                                        <th>Name</th>
                                                        <th width="15%">Add To Patient</th>
                                                        <th width="5%">Edit</th>
                                                        <th width="5%">Delete</th>
                                                    </tr>
                                                </thead>
                                                <tbody id="instPreDiv">

                                                </tbody>
                                            </table>
                                        </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 class="modal fade" tabindex="-1" role="dialog" aria-hidden="false" data-backdrop="static" 
     data-keyboard="false"   id="addNewPreTTTModel" style="min-width:1000px; ">
    <div class="modal-dialog  modal-lg wds90" >
        <div class="modal-content" style="height: 700px;">
            <div class="modal-header">
                <button type="button" class="close closeDrug" data-dismiss="modal" aria-hidden="true"></button>
                <h4 class="modal-title"> TTT </h4>
            </div>
            <div class="modal-body">
                <div class="portlet-body form">
                    <form class="form-horizontal" role="form" action="" method="post" id="addPreTTTForm" enctype="multipart/form-data">

                        <div class="row">
                            <div class="col-md-12">
                                <div class="portlet blue-hoki box" style="margin-bottom: 0px;">

                                    <div class="portlet-body  scroll_y showNum isheight580">
                                        <div id="preEditContent">
                                            <table class="table table-striped table-hover table-bordered" style="margin: 2%; width: 96%;">
                                                <tbody>
                                                    <tr>
                                                        <th class="col-md-1">Title </th>
                                                        <td colspan="2" class="col-md-11">
                                                            <input type="text" class="form-control" placeholder="Enter Name" 
                                                                   id="preTitle" name="preTitle" >
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <th class="col-md-1">Doctor</th>
                                                        <td class="col-md-10">
                                                            <select class="form-control  "  id="docAddIdPre"  name="docAddIdPre" data-placeholder="Select..." >
                                                                <option></option>
                                                                {foreach  $doctorsAll as $data}
                                                                <option value="{$data.user_id}" >{$data.name}</option>
                                                                {/foreach}
                                                            </select>
                                                        </td>

                                                        <th class="col-md-1">
                                                            <a href="javascript:;" class="btn btn-primary btn-sm" id="addNewPreDrugRow">
                                                                <i class="fa fa-plus"></i> Add Drug </a>
                                                        </th>
                                                    </tr>
                                            </table>


                                            <input type="hidden" id="drugPreItr" value="0" name="drugPreItr"/>
                                            <table class="table table-striped table-hover table-bordered" id="prePresTable" >
                                                <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>
                                                        {if $ProgramesettingData->presquantity eq 1}
                                                        <th >
                                                            Q
                                                        </th>
                                                        {/if}

                                                        <th >
                                                            Delete
                                                        </th>
                                                    </tr>
                                                </thead>
                                                <tbody id="drugPreContent">

                                                </tbody>
                                            </table>

                                        </div>
                                    </div>

                                </div>
                            </div>

                        </div>

                        <input type="hidden" id="preEditMode" value="0" name="preEditMode"/>
                    </form>
                </div>
            </div>

            <div class="modal-footer">

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

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




<div id="editPreDiv"></div>
<div id="addPreLoading" 
     style="z-index: 3000;position: absolute;top: 7%;right: 2%;left: 6%;display:none; height: 65%; background-color: rgba(0, 0, 0,0.27); padding-top: 10%;" align="center">
    <img src="{$hosturl}/../upload/loading.gif">
</div>


{literal}
<script type="text/javascript" >
    $('#docAddId').select2();
    $('#docId').select2();
    $('#instId').select2();
</script>
{/literal}



