<?php include("homeheader.php");?>
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <!-- Meta, title, CSS, favicons, etc. -->
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <!-- Bootstrap -->
    <link href="../vendors/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet">
    <!-- Font Awesome -->
    <link href="../vendors/font-awesome/css/font-awesome.min.css" rel="stylesheet">
    <!-- iCheck -->
    <link href="../vendors/iCheck/skins/flat/green.css" rel="stylesheet">
    <!-- Datatables -->
    <link href="../vendors/datatables.net-bs/css/dataTables.bootstrap.min.css" rel="stylesheet">
    <link href="../vendors/datatables.net-buttons-bs/css/buttons.bootstrap.min.css" rel="stylesheet">
    <link href="../vendors/datatables.net-fixedheader-bs/css/fixedHeader.bootstrap.min.css" rel="stylesheet">
    <link href="../vendors/datatables.net-responsive-bs/css/responsive.bootstrap.min.css" rel="stylesheet">
    <link href="../vendors/datatables.net-scroller-bs/css/scroller.bootstrap.min.css" rel="stylesheet">

    <!-- Custom Theme Style -->
    <link href="../css/custom.css" rel="stylesheet">
  </head>
  <body>

  <body class="nav-md">
    <div class="container body">
      <div class="main_container">
        <div class="col-md-3 left_col">
          <div class="left_col scroll-view">
            <!--div class="navbar nav_title" style="border: 0;">
              <a href="index.html" class="site_title">
			    <div class="profile_pic" style="margin-top:-10px;">
			  <img src="../images/mlogo.png" alt="" class="img-circle profile_img" />
			    </div>
			   <span>Instant Airtime </span>
            </div>

            <div class="clearfix"></div-->

			
            <!-- menu profile quick info -->
            <div class="profile">
              <div class="profile_pic">
			     <?php 
			  if($img == ""){
				  ?>
				   <img src="../profileimages/noimage.gif" alt="..." class="img-circle profile_img">
				  <?php
			  }else{
				?>
				 <img src="<?php echo $photo ?>" alt="..." class="img-circle profile_img" width="40px;" height="60px;">
            <?php				
			  }
			  ?>
              </div>
             <div class="profile_info">

                <span>Admin </span>
				<h2> <?php $fname = $dat['fname']; $lname = $dat['lname']; echo $fname." ".$lname ?> </h2>
             <!--   <h2>John Doe</h2> -->
              </div>
            </div>
            <!-- /menu profile quick info -->

            <br />

            <!-- sidebar menu -->
          <div id="sidebar-menu" class="main_menu_side hidden-print main_menu">
              <div class="menu_section">
			  
                <h3>General</h3>
                <ul class="nav side-menu">
                  <li ><a  href="adminpage.php" ><i class="fa fa-home"></i>  Home <span class="fa fa-chevron-right"></span></a> </li>
                   <li><a href="#">  Users <span class="fa fa-chevron-down"></span></a> 
				  <ul class="nav child_menu">
					    <li><a  href="adduser.php" ><i class="fa fa-bug"></i>Create User<span class="fa fa-chevron-right"></span></a> </li>
						<li class="active"><a  href="viewuser.php" ><i class="fa fa-edit"></i>View Users<span class="fa fa-chevron-down"></span></a> </li>
					   </ul>
				  </li>
                  <li  ><a href="contacts.php">  View Contacts <span class="fa fa-chevron-right"></span> </a> </li>
                  <li ><a href="groups.php"> View Groups  <span class="fa fa-chevron-right"></span> </a>   </li>
				   <!--li><a href="requests.php">Topup Requests  <span class="fa fa-chevron-right"></span> </a>   </li>
                   <li><a href="topupaccount.php">Topup My account <span class="fa fa-chevron-right"></span> </a>   </li-->
				   <li class="active"><a href="#"> Reports <span class="fa fa-chevron-down"></span></a>  
				      <!--  <ul class="nav side-menu"> -->
					   <ul class="nav child_menu">
					    <li><a  href="buyinghistory.php" > Credit Purchase History <span class="fa fa-chevron-right"></span> </a> </li>
						<li><a  href="sendinghistory.php" > Credit Sending History <span class="fa fa-chevron-right"></span> </a></li>
					   </ul>
				   </li>
                </ul>
              </div>

            </div>
			 </div>
        </div>
		
		<?php
        include("topmenubar.php");

         ?>
		 
		 
		 <!-- page content -->
        <div class="right_col" role="main">
		  <!-- /top navigation -->
		     <div class="row">
          <!-- top tiles -->
          <div class="row tile_count">
            <div class="col-md-2 col-sm-4 col-xs-6 tile_stats_count">
              <p>Airtime Portal </p>
            </div>
            
          </div>
		  </div>
          <!-- /top tiles -->
		 
		 <div class="row">
		 
		 
		 	 <!-- contacts table -->
		 
		       <div class="col-md-12 col-sm-12 col-xs-12">
                <div class="x_panel">
                  <div class="x_title">
                    <h2>Airtime Purchase History List  </h2>
                    <div class="clearfix"></div>
                  </div>
                  <div class="x_content">
	
                      <table id="datatable" class="table table-striped table-bordered">
                      <thead>
                        <tr>
						  <th>Amount Requested</th>
						  <th>Date Requested</th>
						  <th>Amount Awarded</th>
						  <th>Date Awarded</th>
						   <th>Status</th>
                          <th>Delete</th>
                        </tr>
                      </thead>
                      <tbody>
                      <?php
					  $frm  = $dat['company'];
					  $us = mysql_query("select * from airtime_accounts where account_id='$session_id'  ");
					   while($rws = mysql_fetch_assoc($us)){
							    $id=  $rws['id']; 
						         $amnt=  $rws['amount_requested'];
						         $sts=  $rws['status'];
						         $rdte=  $rws['date_requested'];
								  
								    echo "<tr>";
									echo '<td>' ."Ksh. ". $amnt . '</td>';
									echo '<td>' . $rdte . '</td>';
									echo '<td>' ."Ksh. ".$rws['amount_awarded'].'</td>';
									echo '<td>' .$rws['date_awarded'].'</td>';
									echo '<td>' . $sts.'</td>';
									?>
									<td>
										<a rel="tooltip" title="Delete Record" id="<?php echo $id ?>" href="#deletetopuprecord<?php echo $id ?>" data-toggle="modal">
								       <i class='fa fa-trash'></i></a>
									    <?php include('delete_this_record.php'); ?>	
										</td>
									<?php		
						   }
						   
							  
                       echo "</table>";
					  
					  ?>  
                       
                      </tbody>
                    </table>
                  
                       
                       
                        
                    
                  </div>
                </div>
              </div>
		 

		 <!-- end contacts table -->
		 	 
		  </div>
		  
		  </div>
		  
		  
		          <!-- /page content. End of main -->

     <?php include("footerlinks.php"); ?>
	 
	   <!-- jQuery -->
    <script src="../vendors/jquery/dist/jquery.min.js"></script>
    <!-- Bootstrap -->
    <script src="../vendors/bootstrap/dist/js/bootstrap.min.js"></script>
    <!-- FastClick -->
    <script src="../vendors/fastclick/lib/fastclick.js"></script>
    <!-- NProgress -->
    <script src="../vendors/nprogress/nprogress.js"></script>
    <!-- Datatables -->
    <script src="../vendors/datatables.net/js/jquery.dataTables.min.js"></script>
    <script src="../vendors/datatables.net-bs/js/dataTables.bootstrap.min.js"></script>
    <script src="../vendors/datatables.net-buttons/js/dataTables.buttons.min.js"></script>
    <script src="../vendors/datatables.net-buttons-bs/js/buttons.bootstrap.min.js"></script>
    <script src="../vendors/datatables.net-buttons/js/buttons.flash.min.js"></script>
    <script src="../vendors/datatables.net-buttons/js/buttons.html5.min.js"></script>
    <script src="../vendors/datatables.net-buttons/js/buttons.print.min.js"></script>
    <script src="../vendors/datatables.net-fixedheader/js/dataTables.fixedHeader.min.js"></script>
    <script src="../vendors/datatables.net-keytable/js/dataTables.keyTable.min.js"></script>
    <script src="../vendors/datatables.net-responsive/js/dataTables.responsive.min.js"></script>
    <script src="../vendors/datatables.net-responsive-bs/js/responsive.bootstrap.js"></script>
    <script src="../vendors/datatables.net-scroller/js/datatables.scroller.min.js"></script>
    <script src="../vendors/jszip/dist/jszip.min.js"></script>
    <script src="../vendors/pdfmake/build/pdfmake.min.js"></script>
    <script src="../vendors/pdfmake/build/vfs_fonts.js"></script>

    <!-- Custom Theme Scripts -->
    <script src="../js/custom.js"></script>

    <!-- Datatables -->
    <script>
      $(document).ready(function() {
        var handleDataTableButtons = function() {
          if ($("#datatable-buttons").length) {
            $("#datatable-buttons").DataTable({
              dom: "Bfrtip",
              buttons: [
                {
                  extend: "copy",
                  className: "btn-sm"
                },
                {
                  extend: "csv",
                  className: "btn-sm"
                },
                {
                  extend: "excel",
                  className: "btn-sm"
                },
                {
                  extend: "pdfHtml5",
                  className: "btn-sm"
                },
                {
                  extend: "print",
                  className: "btn-sm"
                },
              ],
              responsive: true
            });
          }
        };

        TableManageButtons = function() {
          "use strict";
          return {
            init: function() {
              handleDataTableButtons();
            }
          };
        }();

        $('#datatable').dataTable();
        $('#datatable-keytable').DataTable({
          keys: true
        });

        $('#datatable-responsive').DataTable();

        $('#datatable-scroller').DataTable({
          ajax: "js/datatables/json/scroller-demo.json",
          deferRender: true,
          scrollY: 380,
          scrollCollapse: true,
          scroller: true
        });

        var table = $('#datatable-fixed-header').DataTable({
          fixedHeader: true
        });

        TableManageButtons.init();
      });
    </script>
    <!-- /Datatables -->
  </body>
</html>