<?php
$rsclaim=mysql_query("select * from claims_details where process_claim_no='$process_claim_no' AND mode_of_payment='frame reserve' order by id desc;", $courier) or die(mysql_error());
$row_rsclaim = mysql_fetch_assoc($rsclaim);
$totalRows_rsclaim = mysql_num_rows($rsclaim);
?>

<div class="portlet-body">
                            
                            <div id="claimsno_diagnostic" class="slimScrollDiv" style="height: 305px;overflow-y: scroll;overflow-x: hidden;">
                                <div id="claim_response">
                                   
                                     <table class="table table-bordered">
                                         <thead>
                                             <tr>
                                                 <th style="">Reserve Date</th>
                                                 <th style="">Expiry Date</th>
                                                 <th style="">Item</th>
                                                 <th style="text-align:right">Qty</th>
                                                 <th style="text-align:right">Price</th>
                                                 <th style="text-align:right">Total</th>
                                                 <th style="">Action</th>
                                             </tr>
                                         </thead>
                                                <tbody>
                                                <?php if ($totalRows_rsclaim> 0) { 
                                                    do {$i = $i + 1; ?>
                                                        <tr>
                                                          <td><?php echo date('jS F,Y',strtotime($row_rsclaim['date_added'])); ?></td>
                                                          <td><?php echo date('jS F,Y',strtotime($row_rsclaim['date_added'].'+ 7 days')); ?></td>
                                                          <td><?php echo strtoupper($row_rsclaim['item']); ?></td>
                                                        <td style="text-align:right">
                                                              <?php if($row_rsclaim['payment_status'] == 'Owing'&&$row_rsclaim['mode_of_payment'] == 'cash'&&$row_rsclaim['discount_applied']=='not applied'){ ?>
                                                              <input type="hidden" type="hidden" multiple="" name="item_trans_id[]" value="<?php echo $row_rsclaim['id'];?>">
                                                              <input type="hidden" type="hidden" multiple="" name="item_trans_amount[]" value="<?php echo ($row_rsclaim['qty']*$row_rsclaim['unit_price']);?>">
                                                            <?php } ?>
                                                            <?php if($row_rsclaim['payment_status']=='Approved'||$row_rsclaim['payment_status']=='Approved-Paid'||$row_rsclaim['payment_status']=='Paid-Cancelled'|| ($row_rsclaim['payment_status']=='Paid' && $row_rsclaim['mode_of_payment']=='cash') || $row_rsclaim['submitted_status']=='submitted'){echo $row_rsclaim['qty'];}else{ ?>
                                                            <input type="number" id="itemqty<?php echo $row_rsclaim['id']; ?>" name="itemqty<?php echo $row_rsclaim['id']; ?>" style="width:40px;" min="1" value="<?php echo $row_rsclaim['qty']; ?>" onChange="searchItemsName('update_claim_details_administrative','#view_items_response_wrapper_2','<?php echo $row_rsclaim['id']; ?>','qty',this.value);">
                                                           <?php } ?>
                                                        </td>
                                                        <td style="text-align:right"> <?php echo number_format($row_rsclaim['unit_price'],2); ?></td>
                                                        <td style="text-align:right"><?php echo number_format($row_rsclaim['qty']*$row_rsclaim['unit_price'],2);?></td>
                                                        <td style="text-align:center;">
                                                          <?php if($row_rsclaim['action_status']!='Sent to Claims'){?>
                                                          <span style="font-weight:bold;"> 
                     <?php if($row_rsclaim['payment_status']=='Approved'||$row_rsclaim['payment_status']=='Approved-Paid'|| ($row_rsclaim['payment_status']=='Paid' && $row_rsclaim['mode_of_payment']=='cash') || $row_rsclaim['submitted_status']=='submitted'){ ?>
                         <label class="mt-checkbox mt-checkbox-outline swap_cancel_items">
                             <input onchange="BoxesforSwapCancel();" value="<?php echo $row_rsclaim['id']; ?>" name="item_ids_[]" multiple="" class="item_check_box" type="checkbox">
                             <span></span>
                         </label> 
                           <!--<i style="color:red;" class="fa fa-refresh"></i>-->
                     <?php }else{ ?>
                                                              <a style="color:red;" href="#" onclick="delInformtion('del_claim_details_administrative_administrative', '#view_items_response_wrapper_2', '<?php echo $row_rsclaim['id']; ?>', '<?php echo strtoupper($row_rsclaim['item']); ?> ?', 'You are about to Delete <?php echo strtoupper($row_rsclaim['item']); ?> from this Patient.', '<?php echo strtoupper($row_rsclaim['item']); ?> Deleted Successfully !');"> <i id="trash_<?php echo $row_rsclaim['id']; ?>" class="icon-trash"></i> <i style="display: none;" id="spin_refresh_<?php echo $row_rsclaim['id']; ?>" class="fa fa-refresh fa-spin fa-fw"></i>  </a>
                    <?php } ?>
                    
                    </span>
                    <?php }?>
                    </td>
                    </tr>
                  <?php }  while ($row_rsclaim = mysql_fetch_assoc($rsclaim)); ?>
                  <?php }else{echo '<tr><td colspan="9"><div class="none">No Billed Items Found. Search Items to Add to Bill.</div></td></tr>';}?>
                                                </tbody>
                </table> 

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