<div class="inner_rightpanel">
    <div class="bread_crumb">

        <div class="clear"></div>
    </div>
    <div class="comm_div">
        <div class="comm_content_block">
            <h3>Payment History</h3>
            <div class="comm_content_block_items">

                <div class="btm-padding">
                    <form name="frmsearch" method="post" action="<?php echo ConfigUrl::base(); ?>index/PaymentHistory" >
                        <span class="label-stl">Search</span>
                        <input type="text" value="<?php echo ($_POST['txtSearch']) ? $_POST['txtSearch'] : $this->txtSearch ?>" class="txt_area_2 txt_bx" name="txtSearch" >&nbsp;<input class="btn_styles butnstl" type="submit" name="btnSearch" value="Search">
                    </form>
                    <div class="clear"></div>
                </div>
                <div class="content_area_div">

                    <div class="content_area">



                        <!-- Details Comment Section End -->

                        <table border="0" width="100%" class="list_table" cellpadding="0" cellspacing="1">

                            <?php
                            if (is_array($this->listData)) {
                                if (count($this->listData) > 0) {
                                    ?>

                                    <tr >
                                        <th align="left">
                                            <?php
                                            $sortOrder = ($this->order == '') ? 'DESC' :  ($this->order == 'ASC' ? 'DESC' : 'ASC');                                            
                                            ?>
                                            <a href="<?php echo ConfigUrl::base() ?>index/PaymentHistory/1/nPaymentId/<?php echo $sortOrder; ?>">
                                                Payment ID
                                            </a>
                                        </th>
                                        <!--<th align="center"><a href="<?php echo ConfigUrl::base() ?>index/PaymentHistory/1/nListId/<?php echo $this->order == 'ASC' ? 'DESC' : 'ASC' ?>">Listing ID</a></th>-->
                                        <th align="left"><a href="<?php echo ConfigUrl::base() ?>index/PaymentHistory/1/vUserFirstName/<?php echo $this->order == 'ASC' ? 'DESC' : 'ASC' ?>">First Name</a></th>
                                        <th align="left"><a href="<?php echo ConfigUrl::base() ?>index/PaymentHistory/1/vUserLastName/<?php echo $this->order == 'ASC' ? 'DESC' : 'ASC' ?>">Last Name</a></th>
                                        <th align="left"><a href="<?php echo ConfigUrl::base() ?>index/PaymentHistory/1/vAmount/<?php echo $this->order == 'ASC' ? 'DESC' : 'ASC' ?>">Amount&nbsp;(<?php echo CURRENCY ?>)</a></th>
                                        <th align="left"><a href="<?php echo ConfigUrl::base() ?>index/PaymentHistory/1/vProductName/<?php echo $this->order == 'ASC' ? 'DESC' : 'ASC' ?>">Ad Title</a></th>
                                        <th align="left"><a href="<?php echo ConfigUrl::base() ?>index/PaymentHistory/1/vPaymentType/<?php echo $this->order == 'ASC' ? 'DESC' : 'ASC' ?>">Payment Type</a></th>
                                        <th align="left"><a href="<?php echo ConfigUrl::base() ?>index/PaymentHistory/1/vTransactionId/<?php echo $this->order == 'ASC' ? 'DESC' : 'ASC' ?>">Transaction Id</a></th>
                                        <th align="center"><a href="<?php echo ConfigUrl::base() ?>index/PaymentHistory/1/dDate/<?php echo $this->order == 'ASC' ? 'DESC' : 'ASC' ?>">Date</a></th>
                                    </tr>


                                    <tr class="row_color1">
        <?php
        $i = 1;
        foreach ($this->listData as $key => $val) {
            ?>


                                        <tr class="row_color1">
                                            <td align="left"><?php echo $val->nPaymentId; ?></td>
                                                 <!--<td align="center"><?php //echo $val->nListId;?></td>-->
                                            <td align="left"><?php echo $val->vUserFirstName; ?></td>
                                            <td align="left"><?php echo $val->vUserLastName; ?></td>
                                            <td align="left"><?php echo number_format($val->vAmount, 2); ?></td>
                                            <td align="left"><a href="<?php echo ConfigUrl::base(); ?>index/viewlisting/<?php echo $val->nListId; ?>/  " target='_blank' style="color:#666;"><?php echo $val->vProductName; ?></a></td>
                                            <td align="left"><?php if ($val->vPaymentType == 'F') {
                                    echo 'Featured';
                                } elseif ($val->vPaymentType == 'L') {
                                    echo 'Listing';
                                } elseif ($val->vPaymentType == 'R') {
                                    echo 'Renewal';
                                }; ?></td>
                                            <td align="left"><?php echo $val->vTransactionId; ?></td>
                                            <td align="center"><?php echo date("m/d/Y", strtotime($val->dDate)); ?></td>
                                        </tr>

            <?php
        }
    } else {
        echo '<br /><center><b>No Records !!!</center></b>';
    }
} else {
    echo '<br /><center><b>No Records !!!</center></b>';
}
?>

                        </table>
                        <div class="clear"></div>

                    </div>
                </div>
            </div>
           <div class="clear"></div></div>
    </div>


<div class="clear"></div>
</div>


<?php if($this->pageCount > 1){  ?>

         <div class="pagination">
           <ul>
               <?php
                if($this->page != 1){?>
                   <li><a href="<?php echo ConfigUrl::base()?>index/PaymentHistory/1/<?php echo $this->sortfield.'/'.$this->order .'/'. $this->txtSearch?>" class="page_first" >First</a></li>
                   <li><a class="page_prev" href="<?php echo ConfigUrl::base()?>index/PaymentHistory/<?php if($this->page != 1) echo $this->page - 1; else echo $this->page; ?>/<?php echo $this->sortfield.'/'.$this->order .'/'. $this->txtSearch?>" >Previous</a></li>
               <?php
                }?>
            <li class="pageinfo"><div id="page-info">Page <strong><?php echo $this->page; ?></strong> / <?php echo $this->pageCount; ?></div></li>
            <?php if($this->pageCount != $this->page){?>
                <li><a class="page_next" href="<?php echo ConfigUrl::base()?>index/PaymentHistory/<?php if($this->pageCount != $this->page) echo  $this->page + 1; else echo $this->pageCount; ?>/<?php echo $this->sortfield.'/'.$this->order .'/'. $this->txtSearch?>" >Next</a></li>
                <li><a class="page_last" href="<?php echo ConfigUrl::base()?>index/PaymentHistory/<?php echo $this->pageCount; ?>/<?php echo $this->sortfield.'/'.$this->order .'/'. $this->txtSearch?>" >Last</a></li>
            <?php
            }?>
            </ul>
        <div class="clear"></div>
        </div>
        <?php
        }
        else
            echo "";
       ?>