    <?php
    include('accesscheck2.php');
require_once('Connections/courier.php');
require_once 'functions/functions.php';
    $change_cost_price = getMenuPermission('Change Cost Price');
    if (empty($promo_id)) {
     $promo_id = $_POST['id'];
    }else{
      $promo_id;
    } 

    ?>
    
    <div class="row">
       <?php
       $query_claim = "SELECT * FROM promotion_order_details WHERE promo_id = '$promo_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);


       // $query_claim_total = "SELECT sum(qty_expected*cost_price_before_tax) as totalprice from promotion_order_details where promo_id = '$promo_id'";
       // $rsclaim_total = mysql_query($query_claim_total, $courier) or die(mysql_error());
       // $row_rsclaim_total = mysql_fetch_assoc($rsclaim_total);
       // $totalRows_rsclaim_total = mysql_num_rows($rsclaim_total);
       ?>


       <div class="portlet light">
        <div class="portlet-title">
            <div class="caption">
                <span class="caption-subject bold uppercase font-dark"> LIST OF PROMOTION ITEMS </span>
            </div>
            <div class="actions uppercase bold" style="color: blue;">
                
            </div>
        </div>
        <div class="portlet-body form">
            <div class="row" style="height: 315px;overflow-y: scroll;overflow-x: hidden;">
                <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>Service Type</th>
                                <th> Action </th>
                            </tr>
                        </thead>
                        <tbody>
                            <?php if ($totalRows_rsclaim > 0) { ?>   
                                <?php
                                do {
                                    $i = $i + 1;
                                    ?>
                                    <tr>
                                      <td valign="top" style="cursor: pointer;" onclick=""><?php echo strtoupper($row_rsclaim['item_name']); ?></td>
                                      <td valign="top" style="cursor: pointer;" onclick=""><?php echo strtoupper($row_rsclaim['service_type']); ?></td>
                                   
                                   <td>
                                    <span style="font-weight:bold;"> 
                            
                             <a style="color:red;" href="#" onclick="delInformtion('del_promo', '#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 Purchase Order.', '<?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>
                        </span>
                    </td>
                        </tr>
                    <?php } while ($row_rsclaim = mysql_fetch_assoc($rsclaim)); ?>
                <?php } else {
                    echo '<tr><td colspan="7" style="background: linen"><div class="none">No Items Found. Search Items to Add to Purchase Order.</div></td></tr>';
                } ?>
            </tbody>
        </table> 
    </div>
</div>
</div>
</div>
</div>