<!-- 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">

                        <div class="col-md-4">
                            <div class="form-group form-md-line-input has-success">
                                <input type="text" class="form-control" id="form_control_1" value="{$allreceipt->namedoc}" disabled="disabled" readonly="readonly" placeholder="Doctor Name" name="docname" required>
                                <label for="form_control_1">Doctor Name</label>
                            </div>
                        </div>
                        <div class="col-md-4">
                            <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-4">
                            <div class="form-group form-md-line-input has-success">
                                <input type="text" class="form-control" value="{$allreceipt->rect_date}" disabled="disabled" readonly="readonly">
                                <label for="form_control_1">Recepit Date</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="{$hosturl}/controllers/{$controllname}.php?ac=updatereceipt" 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>
                                <a href="#portlet-config" data-toggle="modal" class="config">
                                </a>
                                <a href="javascript:;" class="reload">
                                </a>
                                <a href="javascript:;" class="remove">
                                </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 style="width: 11%;">
                                                Amount
                                            </th>
                                            <th>
                                                Notes
                                            </th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                        {assign var=i value=1}
                                        {foreach $durgs as $datafetch}
                                        <tr>
                                            <td>
                                                {$i}
                                            </td>
                                            <td>
                                                {$datafetch->name}
                                            </td>
                                            {if  $datafetch->currentbalance lt  $datafetch->amount}
                                            <td>
                                                <input type="text" class="form-control updateAmount" style="text-align: center;" data-id="{$datafetch->id}" data-colName="amount" data-tableName="receiptdrugs" value="{$datafetch->amount}" />
                                            </td>
                                            <td>
                                            </strong>the amount <strong><em>NOT</em></strong> enough to cash the current balance is <strong style="color:red;">{$datafetch->currentbalance}</strong>
                                    </td>
                                    {else}
                                    <td>
                                     
                                        <input type="text" class="form-control updateAmount" style="text-align: center;"  data-id="{$datafetch->id}" data-colName="amount" data-tableName="receiptdrugs" value="{$datafetch->amount}" />
                                    </td>
                                    <td>
                                        the current balance is <strong style="color: green;">{$datafetch->currentbalance}</strong>
                                    </td>
                                    {/if}
                                </tr>
                                {capture assign=i}{$i+1}{/capture}
                                {/foreach}
                            </tbody>
                        </table>

                        <input type="hidden" id="id" name="id" value="{$allreceipt->id}" />
                        <input type="hidden" id="status" name="status" value="1" />
                    </div>
                    <div class="form-actions">

                        {if $datachecked eq true}
                        <div class="row">
                            <div class="col-md-6 pull-right">
                                <p class="btn green">Sorry , you can't cashing this Prescription Now</p>
                            </div>
                        </div>
                        {else}
                        <div class="row">
                            <div class="col-md-4 pull-right">
                                <button class="btn green btn-block btn-lg presscashing">Cashing</button>
                            </div>
                        </div>
                        {/if}

                    </div>
                </div>
            </div>
        </form>
        <!-- END SAMPLE TABLE PORTLET-->
    </div>

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