<!-- BEGIN CONTENT -->
<div class="page-content-wrapper">
    <div class="page-content">
        <!-- BEGIN PAGE HEADER-- >
        <h3 class="page-title">
            {$shcontrollname}
        </h3>
        <div class="page-bar">
            <ul class="page-breadcrumb">
                {$breadcrumbs}
            </ul>
        </div>
        <!-- END PAGE HEADER-->
        <!-- BEGIN PAGE CONTENT-->
        <div class="row">
            <div class="col-md-12">
                <div class="portlet light bg-inverse">
                    <div class="portlet-title">
                        <!--<button type="button" class="btn blue-madison pull-right myplusbtn" id="myplusbtn">Add Medicine</button>-->
                        <div class="actions" id="nestable_list_menu">
                        </div>
                    </div>
                    <div class="portlet-body form">
                        <!-- BEGIN FORM-->

                        <form class="bgwinupts" action="{$hosturl}/controllers/{$controllname}.php?ac=addnew" method="post" id="bgwinupts">
                            <div class="form-body">

                                <div class="col-md-4">
                                    <div class="form-group form-md-line-input has-success">
                                        <input type="text" required  class="form-control" id="form_control_1" placeholder="Invoice Number" name="invoicenumber" >
                                        <label for="form_control_1">Invoice Number</label>
                                    </div>
                                </div>

                                <div class="col-md-4">
                                    <div class="form-group form-md-line-input has-success">
                                        <input type="text" required class="form-control datepickertoday" id="form_control_1" data-date-format="yyyy-mm-dd" placeholder="yyyy-mm-dd" name="invoicedate">
                                        <label for="form_control_1">Invoice Date</label>
                                    </div>
                                </div>

                                <div class="col-md-4">
                                    <div class="form-group form-md-line-input has-success">
                                        <input type="text" required  class="form-control" id="form_control_1" placeholder="Supplier Name" name="suppliername">
                                        <label for="form_control_1">Supplier Name</label>
                                    </div>
                                </div>
                            </div>

                            <!-- BEGIN PAGE CONTENT-->




                            <div class="col-md-12">
                                <!-- BEGIN CONDENSED TABLE PORTLET-->
                                <div class="portlet box green">
                                    <a class="btn  pull-right" style="color: #fafcfb;" href="#" id="newDrugImportRow">
                                        <i class="fa  fa-plus"></i>
                                        Add new
                                    </a>
                                    <div class="portlet-body">
                                        <div class="table-scrollable">
                                            <table class="table table-condensed table-hover small_table">
                                                <thead>
                                                    <tr>

                                                        <th class="wds35">Drug Name</th>
                                                        <th class="wds35">Store Name</th>
                                                        <th class="wds10">Valid To</th>
                                                        <th class="wds10">Amount</th>
                                                        <th class="wds10">&nbsp;</th>

                                                    </tr>
                                                </thead>
                                                <tbody id="plusitem">
                                                    <tr>
                                                        <td>
                                                            <!--selectdrugs-->
                                                            <select id="drug1" name="drug1" required>
                                                                <option value=""></option>
                                                                {foreach $allMed as $med}
                                                                <option value="{$med->id}">{$med->drugname} ({$med->drugtype})</option>
                                                                {/foreach}
                                                            </select>
                                                        </td>

                                                        <td> 
                                                            <!--selectdrugs-->
                                                            <select id="store1"  name="store1" required>
                                                                <option value=""></option>
                                                                {foreach $stores as $data}
                                                                <option  value="{$data['id']}">{$data['name']}</option>
                                                                {/foreach}
                                                            </select>
                                                        </td>
                                                        <td>
                                                            <input type="text" class="datepicker" id="validTo1"  placeholder="yyyy-mm-dd" name="validTo1" required >
                                                        </td>
                                                        <td>
                                                            <input type="text" class="positivefloat" placeholder="Amount" name="balance1" id="balance1" required>
                                                        </td>
                                                        <td>
                                                            <button type="button" class="btn red minsprop hmt20"><i class="fa fa-close"></i></button>
                                                        </td>
                                                    </tr>
                                                </tbody>
                                            </table>
                                        </div>
                                    </div>
                                </div>
                                <!-- END CONDENSED TABLE PORTLET-->
                            </div>

                            <input type="hidden" id="itr" name="itr" value="1" />
                            <input type="hidden" id="drugImport" name="drugImport" value="1" />
                            <!-- END PAGE CONTENT -->
                            <div class="form-actions">
                                <div class="row">
                                    <div class="col-md-2 pull-right">
                                        <input type="submit" class="btn green btn-block btn-lg" name="savenew" value="Save & new">
                                    </div>
                                    <div class="col-md-2 pull-right">
                                        <input type="submit" class="btn green btn-block btn-lg" name="save" value="Save">
                                    </div>

                                </div>
                            </div>
                        </form>
                        <!-- END FORM-->
                    </div>
                </div>
            </div>
        </div>





        <!-- END PAGE CONTENT-->
    </div>
</div>
<!-- END CONTENT -->
<div id="drugsload" style="display: none;">
    <option value=""></option>
    {foreach $allMed as $med}
    <option value="{$med->id}">{$med->drugname} ({$med->drugtype})</option>
    {/foreach}
</div>

<div id="storesload" style="display: none;">
    <option value=""></option>
    {foreach $stores as $data}
    <option  value="{$data['id']}">{$data['name']}</option>
    {/foreach}
</div>



