<!-- 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 box grey-cascade">

                    <div class="well well-sm">
                        <input type="hidden" id="receiptCaching" name="receiptCaching" value="1" />
                        <div class="col-md-3">
                            <div class="form-group form-md-line-input has-success">
                                <input type="text" class="form-control" id="form_control_1" value="{$allreceipt->doctorname}" disabled="disabled" readonly="readonly" placeholder="Doctor Name" name="docname" required>
                                <label for="form_control_1">Doctor Name</label>
                            </div>
                        </div>
                        <div class="col-md-3">
                            <div class="form-group form-md-line-input has-success">
                                <input type="text" class="form-control" id="form_control_1" value="{$allreceipt->patientname}" disabled="disabled" readonly="readonly" placeholder="Patient Name" name="invoicenumber" required>
                                <label for="form_control_1">Patient Name</label>
                            </div>
                        </div>

                        <div class="col-md-3">
                            <div class="form-group form-md-line-input has-success">
                                <input type="text" class="form-control" value="{$allreceipt->receiptdate}" disabled="disabled" readonly="readonly">
                                <label for="form_control_1">Recepit Date</label>
                            </div>
                        </div>

                        <div class="col-md-3">
                            <div class="form-group form-md-line-input has-success">
                                <input type="text" class="form-control" value="{$allreceipt->storeName}" disabled="disabled" readonly="readonly">
                                <label for="form_control_1">Store</label>
                            </div>
                        </div>

                        <div class="clearfix"></div>
                    </div>
                </div>
            </div>

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

            <div class="col-md-12">
                <!-- BEGIN SAMPLE TABLE PORTLET-->

                <form action="#" id="returnedDrugForm" method="post">
                    <div class="portlet box green">
                        <div class="portlet-title">
                            <div class="caption">
                                <i class="fa fa-comments"></i>Prescription Drugs  
                            </div>
                            <div class="tools">
                                <a href="javascript:;" class="collapse">
                                </a>
                            </div>
                        </div>
                        <div class="portlet-body">
                            <div class="table-scrollable">
                                <table class="table table-striped table-hover" >
                                    <thead>
                                        <tr>
                                            <th>
                                                #
                                            </th>
                                            <th>
                                                Drug Name
                                            </th>
                                            <th>
                                                Drug Type
                                            </th>
                                            <th>
                                                Valid To
                                            </th>
                                            <th>
                                                Amount cached
                                            </th>
                                            <th>
                                                Amount returned
                                            </th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                        {assign var=i value=1}
                                        {foreach $receiptdrugs as $data}
                                        <tr>
                                            <td>
                                                {$i}
                                            </td>
                                            <td>
                                                {$data->drugname}
                                            </td>
                                            <td>
                                                {$data->drugtype}
                                            </td>
                                            <td>
                                                {$data->validateto}
                                            </td>
                                            <td>
                                                {$data->amount}
                                            </td>
                                            <td>
                                                <input type = "number" class = "form-control returned" style = "text-align: center;" id = "returned{$i}"  name= "returned{$data->id}"  data-id = "{$data->id}" data-itr = "{$i}"   data-amount = "{$data->amount}" value="0"  />
                                                <span id = "returnedError{$i}" style="color: red; display: none;"> Not accepted </span>
                                                <span id = "returnedAccept{$i}" style="color: green; display: none;"> Not accepted </span>
                                            </td>
                                        </tr>
                                        {capture assign=i}{$i+1}{/capture}
                                        {/foreach}

                                    <input type="hidden" id="itr" name="itr" value="{$itr}" />
                                    <input type="hidden" id="type" name="type" value="return" />
                                    <input type="hidden" id="recepitTmpId" name="recepitTmpId" value="{$allreceipt->id}" />
                                    </tbody>
                                </table>
                            </div>
                            <div class="form-actions">
                                <div class="row">
                                    <div class="col-md-12 pull-right" style="text-align: right;" >
                                        <a href="javascript:;" class="btn green" id="returnDrugs">Return 
                                        </a>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </form>
                <!-- END SAMPLE TABLE PORTLET-->
            </div>

        </div>
    </div>
</div>
<!-- END CONTENT -->
