<?php
$currency='GHC';
$query_claim="select * from requisition_order_details where purchase_order_no='$purchase_id' order by id desc;";
$rsclaim=mysql_query($query_claim, $courier) or die(mysql_error());
$row_rsclaim = mysql_fetch_assoc($rsclaim);
$totalRows_rsclaim = mysql_num_rows($rsclaim);
    ?> 

<form name="form">
<div class="col-lg-12 col-md-12 col-xs-12 col-sm-12">
        <div class="portlet light ">
            <div class="portlet-title">
                <div class="caption">
                    <span class="caption-subject bold uppercase font-dark"> LIST OF ITEMS </span>
                </div>
                <div class="actions">
                   <input type="hidden" name="purchase_order_id" id="purchase_order_id" value="<?php echo $purchase_id; ?>">
                </div>
            </div>
            <div class="portlet-body form">
                <div class="row"  >
                    <div class="col-lg-12 col-md-12 col-xs-12 col-sm-12">
                        <table width="100%" border="0" align="center" cellpadding="1" cellspacing="1" class="table table-bordered">
                                                <thead>
                                                    <tr>
                                                    <th class="count">Item</th>
                                                    <th style="text-align: right">Quantity Requested</th>
                                                    <th style="text-align: right"> Quantity Supplied </th>
                                                    <th style="text-align: right"> Quantity Available </th>
                                                    </tr>
                                                </thead>
                                                <tbody>
                                                <?php if ($totalRows_rsclaim> 0) { ?>   
                                                    <?php
                                                    do {
                                                        $i = $i + 1;
                                                        ?>
                                                        <tr>
                                                            <td><?php echo strtoupper($row_rsclaim['item']); ?></td>
                    <td style="text-align: right"><?php echo $row_rsclaim['qty_expected']; ?></td>
                    <td style="text-align: right"><input type="number" id="itemqty<?php echo $row_rsclaim['id']; ?>" name="itemqty<?php echo $row_rsclaim['id']; ?>" style="width:50px;" min="1" value="<?php echo $row_rsclaim['qty_received']; ?>" onChange="searchItemsName('updateqty_requisition_order_details_actual','#view_items_response_wrapper_2',<?php echo $row_rsclaim['id']; ?>,'no_field',this.value);"></td>
                    <td style="text-align: right;color: green;font-weight: bold;"><?php echo quantityAvailable($row_rsclaim['item_id']); ?></td>
                    </tr>
                  <?php }  while ($row_rsclaim = mysql_fetch_assoc($rsclaim)); ?>
                  <?php }else{echo '<tr><td colspan="10" style="color:red;"><div class="none">No Items Found. Search Items to Add</div></td></tr>';}?>
                  </tbody>
                </table> 
                    </div>
                </div>
            </div>
        </div>
    </div>
</form>