<?php

include_once '../db_connect/db.php';
//get current session
 $user_id = $_SESSION['student_id'];
 //$session = get_current_session($id = 1);
 $session = 6;

 ?>
    <div style="height:20px; displat:block;"></div>

    <ul class="breadcrumb">

        <li><a href="dashboard.php?sms=payment&qlk=<?php echo md5(2); ?>">Payments</a> <span class="divider"></span> </li>
        <li class="active" >Hostel fee payments<span class="divider"></span> </li>
    </ul>

<div class="well">

    <!-- in the future version check if the current invoice has expired den show but if nt exired dont show -->
    <?php
	if(!has_paid_hostel_app_fee($user_id, $session ))
	{ ?>

    	<a href="dashboard.php?sms=generate_invoice&for=hfff&invoice_to=<?php echo md5(get_user_id());?>&qlk=<?php echo md5(2); ?>"  class="pull-right"><img src="images/add_icon.png" data-toggle="tooltip" data-placement="top"  title="Click here to generate invoice to PAY" />Click here to pay</a> <br/><br/>

    <?php
  }else {
    echo '<a target="_blank" href="create_payment_slip.php?qlk=<?php echo md5(8);?>&me='.$user_id.'" class="btn btn-info" data-toggle="tooltip" data-placement="top" title="Click here to Print / Download Payment Receipt"><i class="glyphicon glyphicon-print"> </i> Print / Download Receipt</a>';
  }
	?>
	 <div style="height:20px; displat:block;"></div>




     <!--First accordion panel container tat accomodates all other payments -->

    <div class="panel panel-success">
        <div class="panel-heading">
            <p class="panel-title">
                <a id="3" data-toggle="collapse" data-parent="#accordion" href="#collapse3"> <span class="glyphicon glyphicon-plus"></span>&nbsp;&nbsp;PAYMENT HISTORY </a>
                 <span class="label label-primary" style="font-size:15px;float:right;"></span>
            </p>
        </div>
                <div id="collapse3" class="panel-collapse collapse in ">
                    <div class="panel-body">
                        <ul class="list-group">





                                     <!-- accordion for history starts here ###############################################################-->

                                      <div id="accordion" class="panel-group">

                                           <div class="col-lg-12 col-xs-6">

            <h3 class="help-block">My Invoices  <a class="btn btn-danger btn-sm" href="#" data-toggle="modal" data-target="#myModallTLOG2"> Re-query Transaction Status</a> </h3>
            <p class="help-block">Your invoice history with us </p>
                                        <?php echo view_invoices($user_id, $invoice_type = 55, $session); //user id, invoice type 2 for returning student ?>


                                                            </div><!-- panel --info-->

                                                            <!-- accordion for history ends here #########################################-->




                    </ul><!-- end of list group --->

                </div><!-- end o panel body -->
    </div>
    <!--First accordion panel container Ends here -->


    </div>
    <!-- payment history -->




</div><!-- /well -->
