<div class="my-account">
	<div class="heading" style="margin-bottom:0;">
        <dl class="acctip">
            <dt>My Ticket</dt>
        </dl>
    </div>
    <div class="ticketBox">
        <fieldset>
            <legend>Recent Support History</legend>
            <div class="addTicket">
                <a class="addnewemailbtn" title="Add Email Address" href="/index.php?controller=my_tickets&action=add_ticket_email">Add Email Address</a>
                <a class="createnewticketbtn" title="Create New Ticket" href="/index.php?controller=my_tickets&action=create_ticket">Create New Ticket</a>
            </div>
            <table id="suppor" width="100%">
                <tbody>
                    <tr class="thbak">
                            <th class="revimg"></th>
                            <th class="ticket-id">Ticket ID</th>
                            <th class="revject">Subject</th>
                            <th class="hidden-xs">Last Responder</th>
                            <th class="rigimg" style="text-align:center;">Status</th>
                    </tr>

                    <?php foreach($ticket_data as $v){?>
                        <tr class="tdbak <?php if(is_numeric($v)&($v&1)=='true') echo 'one';else echo 'two';?>">
                            <td class="magglass borderLeft"></td>
                            <td><a href="/index.php?controller=my_tickets&action=detail_ticket&ticket_id=<?php echo $v['ticket_id']?>"><?php echo $v['ticket_no']?></a></td>
                            <td><?php echo $v['subject']?></td>
                            <td class="hidden-xs" align="left"><?php echo $v['staff']?></td>
                            <td class="borderRight status"><img src="<?php echo $v['status_image']?>"> <span><?php echo $v['status_value']==1?'Seller has replied':'Wait for seller reply'?></span></td>
                        </tr>
                   <?php }?>

                </tbody>
            </table>  <br />
           <div class="toolbar clearfix row">
          <div class="sorter_bottom">
               <div class="col-sm-8 left"><?php echo $text_results;?></div>
               <div class="col-sm-16 right">
                    <a href="<?php echo $action . '&page=' . (($page>1)?($page-1):$page); ?>"><?php echo 'Previous'?></a>
                    <?php foreach ($pages as $f_page) { ?>
                    <?php if ( $f_page['value'] < ($page - 2) ) {continue; } ?>
                    <?php if ( $f_page['value'] > ($page + 4) ) {continue; } ?>
                    <?php if ($f_page['value'] == $page) { ?>
                    <b class="selected"><?php $x = explode(" ",$f_page['text']);echo $x[0]; ?></b>
                    <?php } else { ?>
                      <a class="page_btn" href="<?php echo $action . '&page=' . $f_page['value']; ?>"><?php $x = explode(" ",$f_page['text']);echo $x[0]; ?></a></td>
                    <?php } ?>
                    <?php } ?>
                    <a class="page_btn" href="<?php echo $action . '&page=' . (($page<count($pages))?($page+1):$page); ?>"><?php echo 'Next'?></a>
                    <label>Go to Page</label>
                    <select onchange="return SelectPage(this.value)" style="width:50px;">
                        <?php foreach ($pages as $f_page){?>
                        <option value="<?php echo $f_page['value']?>" <?php if ($f_page['value'] == $page){echo 'selected';}?>><?php echo $f_page['value']?></option>
                        <?php };?>
                    </select>
                    <script type="text/javascript">
						function SelectPage(page) {
							window.location.href="<?php echo $action; ?>&page=" + page;
						}
					</script>
             </div>
          </div>
     </div>
        </fieldset>
    </div>
</div>
