<?PHP
session_start();

if (!(isset($_SESSION['login']) && $_SESSION['login'] != '')) {
	header ("Location: ../login.php");
}

//echo 'WELCOME'.'    '.$_SESSION['name'].'   '.'<A HREF = logout.php>Log out</A>';

?>

<?php

$privilage = $_SESSION['privilage']; 

//$ID = $_SESSION['ID']; 
//echo "<br>";


$app_name = $_SESSION['app_name'];
//echo "<br>";
 $status = $_SESSION['status'];

//echo "<br>";
/*
if($status == "inactive"){
//echo "it works";
	
	header ("Location: payments_page.php");
	
						 }
*/
?>






<?php
require 'config.php';

$db_handle = mysqli_connect(DB_SERVER, DB_USER, DB_PASS);
//$database = $_SESSION['database'];



$database = "lawpedc2_lbs_users";

$db_found = mysqli_select_db($db_handle, $database);


?>


<?php
if(isset($_POST['A'])){
	 
    $product = $_POST['product'];
	$amount = $_POST['amount'] ;

	$uname =$product;
    $pword = $amount;

	$db_found = new mysqli(DB_SERVER, DB_USER, DB_PASS, $database );
					
					/*	
			$SQL = $db_found->prepare("INSERT INTO txn_table (product_name, amount, user_id) VALUES (?,?,?)");
			$SQL->bind_param('sss', $uname, $pword,  $_SESSION['user_id']  );
			$SQL->execute();
			header ("Location: dashboard.php");
	*/
	
	 $date = date("Y-m-d");
	
	//$time = date("h-m-d");

	
	$SQL = $db_found->prepare("INSERT INTO txn_table (product_name, amount, user_id,date) VALUES (?,?,?,?)");
			$SQL->bind_param('ssss', $uname, $pword,  $_SESSION['user_id'], $date );
			$SQL->execute();
			header ("Location: dashboard.php");
		
						

	
	
	
		echo $notification = "operation successfull";




}







else if(isset($_POST['B'])){
	
	echo 'B';

}

else if(isset($_POST['C'])){
	
	echo 'C';

}


else if(isset($_POST['refresh'])){
	
echo 'it refeshes';


}


else{
	
}
?>


<!DOCTYPE html>
<html lang="en">
<head>
	<title>Lawped</title>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	 <link rel="apple-touch-icon" sizes="76x76" href="./assets/img/apple-icon.png">
  <link rel="icon" type="image/png" href="assets/img/favicon.png">
	
	
	  <!--manifest file for pwa ap-->
	 <link href="manifest.json"  rel = "manifest">
	   <!--manifest file for pwa ap-->
	  
	  <!--ios support-->
	   <link href="img/icons/icon-96.png"  rel = "apple-touch-icon">
	  <meta name="apple-mobile-web-app-status-bar" content="#00695c">
	  <meta name="theme-color" content="#00695c">
	  <!--ios suppoer-->
	
	  <script src="app.js"></script>
	
	
<!--===============================================================================================-->	
		
	
 <script src="https://kit.fontawesome.com/42d5adcbca.js" crossorigin="anonymous"></script>
  <!-- Material Icons -->
  <link href="https://fonts.googleapis.com/icon?family=Material+Icons+Round" rel="stylesheet">
  <!-- CSS Files -->
  <link id="pagestyle" href="assets/css/material-dashboard.css" rel="stylesheet" />
	
	 <link href="css/bootstrap-4.4.1.css" rel="stylesheet">
<!--===============================================================================================-->
	
</head>
	
	 <script src="js/main.js"></script>
	
	
	
	<style>


		
		
				.loader {
  border: 16px solid #f3f3f3;
  border-radius: 50%;
  border-top: 16px solid blue;
  border-right: 16px solid green;
  border-bottom: 16px solid red;
  border-left: 16px solid pink;
  width: 120px;
  height: 120px;
  -webkit-animation: spin 2s linear infinite;
  animation: spin 1s linear infinite;
}

@-webkit-keyframes spin {
  0% { -webkit-transform: rotate(0deg); }
  100% { -webkit-transform: rotate(360deg); }
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
		
		






	body, html {
background-color: #E1E1DB;
}

	
		
	
            div.scroll {
                //margin:4px, 4px;
               // padding:4px;
               // background-color: #494747;
                width: 100%;
                height: 110px;
               // overflow-x: hidden;
               // overflow-y: auto;
				overflow: auto;
                text-align:justify;
            }
		
		div.scroll_history {
                /margin:4px, 4px;
               // padding:4px;
               // background-color: #132FD0;
                width: 100%;
                height: 310px;
               //overflow-x: hidden;
               //overflow-y: auto;
				//overflow: auto;
                text-align:justify;
            }
		
		
		div.scroll_bod {
                margin:4px, 4px;
               // padding:4px;
                //background-color: green;
                width: 100%;
                height: 300px;
               // overflow-x: hidden;
                //overflow-y: auto;
				//overflow: auto;
                text-align:justify;
            }
		
		

	</style>
	
<body onLoad= "unit_ac(),bulk_ac(),crude_ac(),spinner()">


	
	
	<!--newheader-->
	
	
	
	
	<!--new headeer-->
	
	
		<div class="jumbotron-fluid" style="background-color: #D5F51C">
	
				
<?php 
		
	echo $_SESSION['name'].'   '.' (IDN '. $_SESSION['user_id'].' ) ';
			

		?>
			<div class="" style="float: right"><A HREF = "logout.php" onClick="spinner()">Log out</A></div>
			<!--<button onclick="myFunction()">Click Me</button>-->
			

			
		</div>
	
	
			

	
	
		<div class="jumbotron" style="background-color: #030303;">
			
			<div style="color: #FDFDF9;  "><h4><b><marquee behavior="alternate"><span style="color: #F9F0F1">EXHUSTED SUBSCRIBTION</span></marquee></b></h4></div>
			
			
	
	<div class="row">
		<DIV class="col-md-12" id="">
			<table style="margin: auto; width: auto" >
		
	<tr>
				<td>
					
					 <input type="submit" value='RECORD' onClick= "window.alert('inactive APP')" class="btn btn-info" style= "width: inherit; height: 70px" name = "A"  >
					
					
				</td>
	<td>
		 <input type="button"  value="REPORT" class="btn btn-info" style= "width: ; height: 70px" name = "A" onClick= "window.alert('inactive APP')">
				</td>
	<td>
		 <input type="submit" value="APP INFO"   onClick="view_ac()"  class="btn btn-info" style= "width: inherit; height: 70px" name = "A" onClick="" >
				</td>
	
	
	
				</tr>
			</table>
		</DIV>
	
    </div>
			
			
				<div class="row">
			<table style="margin: auto;width: auto" >
		
	<tr>
				<td>
					
					 <input type="submit"  onClick= "window.alert('inactive APP')"  value="ACCOUNT" class="btn btn-danger" style= "width: inherit; height: 70px" name = "A" >
					
					
				</td>
	<td>
		<input type="submit" value="Inventory" class="btn btn-danger" style= "width: inherit; height: 70px" name = "A"  onClick= "window.alert('inactive APP')">
				</td>
	<td>
		 <input type="submit" value="Add users" class="btn btn-danger" style= "width: inherit; height: 70px" name = "A" onClick= "window.alert('inactive APP')" >
				</td>
	
	
	</tr>
			
			</table>
		
		
			</div>
				
	<div class="row">
			<table style="margin: auto; width: auto"  >
		
	<tr>
				<td>
					
					 <a href="expired_sub.php"><input type="button" value="Refresh" class="btn btn-danger" style= "width: inherit; height: 70px"  ></a>
					
					
				</td>
	<td>
		 <input type="button" value="Saved Receipts" class="btn btn-danger" style= "width: inherit; height: 70px" name = "A" onClick="window.alert('in Active APP: Contact us (Alaye David 09055158742, head of iCT LAWPED GROUP,www.lawped.com.ng)')" >
				</td>
	<td>
		 <input type="submit" value="Chart" class="btn btn-danger" style= "width:inherit; height: 70px" name = "A" onClick= "window.alert('Inactive APP. Contact us (Alaye David 09055158742, head of iCT LAWPED GROUP,www.lawped.com.ng')" >
				</td>
	
	
	
			</tr>
			</table>
		
		
			</div>
			
		</div>
	
	
	<!--script to show recent inserted record-->
	
	
		<?php
			  //==================================================================================
			 //script to show recent inserted record
			//==================================================================================
	
	
	// echo $db_found_recent['amount'];
	
	  //===================================================================================
	  		?>

	<!--script to show recent inserted record-->
	
	
		<div class="scroll_body" style="background-color: whit" id=""  >
	
	<div class="container-fluid" style="" >
		
		
		
		<div class="jumbotron-fluid" style="background-color: ">
		
		
				<div class="row">
				
										<div class="col-md-4" style="padding-top: 8px" id="unit_ac">
											<div id="">
											
											<form METHOD ="POST" ACTION = "dashboard.php" style="width: 100%">
											<table width="100%">
				<tr>
				
					
					
					<td>  <select class="custom-select"  style="width:"  id="inputGroupSelect03" name="product">
																			<option selected>Select Product</option>
		
																	  </select> 
					</td>
					
						 
						 													<td>
						 	  <input type= "text" style="width:100%" placeholder="Amount" class="form-control" aria-label="Amount (to the nearest dollar)" name="amount">
						 													
						 													</td>
						 
						 
							</tr>
			</table>
			 <input type="submit" value="SAVE" class="btn-dark" style= "width: 100%" name = "A" >
											
											</form>
											</div>	
											
										</div>
										
					
										<div class="col-md-4" style="padding-top: 8px" id="bulk_ac">
 <form METHOD ="POST" ACTION = "dashboard.php" style="width: 100%">
											<table width="100%">
				<tr>
				
					
					
					<td>  
					<input type="text" class="form-control" name="product" placeholder="Job Description" aria-label="Amount" aria-describedby="basic-addon2">
					</td>
					<td>
					<input type="text" class="form-control" name="amount" placeholder="Amount" aria-label="Recipient's username" aria-describedby="basic-addon2">
				
					
																			</td>
						 
												
						 												
						 
							</tr>
			</table>
			 <input type="submit" value="SAVE" class="btn-info" style= "width: 100%" name = "A" >
											
											</form>
										</div>
					
										
								
				<div class="col-md-4" style="padding-top: 8px; background-color:" id="crude_ac"  >
					
 <form METHOD ="POST" ACTION = "dashboard.php" style="width: 100%">
											<table width="100%">
				<tr>
				
					
					
					<td>  
					<input type="text" class="form-control" name="amount" placeholder="Amount" aria-label="Recipient's username" aria-describedby="basic-addon2">
					</td>
					<td>
					
				
					 <input type="submit" value="SAVE" class="btn-dark" style= "width: 100%" name = "A" >
																			</td>
						 
												
						 												
						 
							</tr>
			</table>
			
											
											</form>
				</div>

					

				</div>
		
		
		</div>
		
		
		
		
		<?php
		
		
		
		
//$dat = date("h:i") ;
		
		 $date = date("Y-m-d");
			  //==================================================================================
			 //this junk of code is to sum up daily transaction
			//==================================================================================
	  $SQL = "SELECT  * FROM login   where ID= $ID   ORDER BY ID DESC";
	
	
	  $result = mysqli_query($db_handle, $SQL);

$db_found = mysqli_fetch_assoc($result) ;
	   
	  //===================================================================================
		
		
	  		?>
		
	<div class="loader" id="spin" style="margin: auto"></div>
		
		<div class="jumbotron-fluid" style="background-color: " id="view_ac">
		




					<div class="row " style="margin-top: 1px; background-color:">
		
			<div class = "col-md-6 " style="background-color:;padding: 10px">
				 <strong ><span style="color:#260B4D;color: #086310;padding: "> <br> APP information
					     </span></strong>
			
			  <div class="jumbotron-fluid scroll" style="font-size:12; ">
				  
				 
				  
	  <table class="table table-dange table-hover" style="font-size:12; width:100%  " >
  <tbody>
    
		
     
    </tr>
 			
		<tr>
	 	
		
			
			<td>
			Status
			</td>
			
			<td>
			<?php echo $db_found['status'];?>
			</td>
			
			
	  	</tr>
	  <tr>
	 	
		
			
			<td>
			APP ID
			</td>
			
			<td>
			<?php echo $db_found['app_code'];?>
			</td>
			
			
	  	</tr>
	  	<tr>
	 	
		
			
			<td>
			APP Owner
			</td>
			
			<td>
			<?php echo $db_found['name'];?>
			</td>
			
			
	  	</tr>
	  	<tr>
	 	
		
			
			<td>
			Profile Code
			</td>
			
			<td>
			IDN<?php echo $db_found['ID'];?>
			</td>
			
			
	  	</tr>
	  	<tr>
	 	
		
			
			<td>
			Database
			</td>
			
			<td>
			<?php echo $db_found['d_b'];?>
			</td>
			
			
	  	</tr>
	  
	  <tr>
	 	
		
			
			<td>
			Privilage
			</td>
			
			<td>
			<?php echo $db_found['privilage'];?>
			</td>
			
			
	  	</tr>
	  
	  <tr>
	 	
		
			
			<td>
			Business Name
			</td>
			
			<td>
			<?php echo $db_found['biz_name'];?>
			</td>
			
			
	  	</tr>
	    <tr>
	 	
		
			<td>
			Nature of Business 
			</td>
			
			<td>
			<?php echo $db_found['biz_nature'];?>
			</td>
			
			
	  	</tr>
	  <tr>
	 	
		
			<td>
			Nationality
			</td>
			
			<td>
			<?php echo $db_found['nation'];?>
			</td>
			
			
	  	</tr>
	  
	  	<tr>
	 	
		
			
			<td>
			Email
			</td>
			
			<td>
			<?php echo $db_found['email'];?>
			</td>
			
			
	  	</tr>

<tr>
	 	
		
			<td>
			City
			</td>
			
			<td>
			<?php echo $db_found['city'];?>
			</td>
			
			
	  	</tr>
	  <tr>
	 	
		
			<td>
			Phone Number
			</td>
			
			<td>
			<?php echo $db_found['fone'];?>
			</td>
			
			
	  	</tr>
	  	<tr>
	 	
		
			
			<td>
			Login Detail
			</td>
			
			<td>
			<?php echo $db_found['L1'];?>
			</td>
			
			
	  	</tr>
	   <tr>
	 	
		
			<td>
			Application Date
			</td>
			
			<td>
			<?php echo $db_found['date'];?>
			</td>
			
			
	  	</tr>
	  
	  <tr>
	 	
		
			<td>
			Activation Date
			</td>
			
			<td>
			<?php echo $db_found['activation_date'];?>
			</td>
			
			
	  	</tr>

	  <tr>
	 	
		
			<td>
			Experation Date
			</td>
			
			<td>
			<?php echo $db_found['expiration_date'];?>
			</td>
			
			
	  	</tr>
	  
	 
	
	
  </tbody>
</table>
						
	
	
	</div>

					</div>
						
			<div class = "col-md-4 " style="background-color:">
				
							 
	
				
						 <div class="jumbotron-fluid scroll_history" style="font-size:12; ">
				  
	<span style="color:#859609;padding: 4px"><br><strong ><p></p>How to Activate APP: </strong></span> <p></p> Make payment of 12dollars(N5000).<p></p> Account-Details:Alaye.V.David,Access-Bank(1431944079). <p></p> After Payment, email  your APP ID and payment Details to lbs@lawped.com.ng or watzap it to 090-551-587-42.<p></p> Inless than 24hrs your APP will be Activated <br> Contact: 090-551-587-42.			  
	
	
	</div>
			</div>
			
		</div>
		
		</div>
		
		
	
		
	
</div>
	
	</div>


</body>
</html>




	<script>
		
		
function view_ac() {
  var x = document.getElementById("view_ac");
	
	 var unit_ac = document.getElementById("unit_ac");
	 var bulk_ac = document.getElementById("bulk_ac");
	 var crude_ac = document.getElementById("crude_ac");
	
  if (x.style.display === "none") {
    x.style.display = "block";
	  
	   
	  unit_ac.style.display="none";
	  crude_ac.style.display="none";
	  bulk_ac.style.display="none";
	  
  }
	else {
    x.style.display = "none";
  }
	
	
}
		
		
	
function unit_ac() {
	var x = document.getElementById("unit_ac");
	 var unit_ac = document.getElementById("bulk_ac");
	 var crude_ac = document.getElementById("crude_ac");
	var view_ac = document.getElementById("view_ac");
	
  if (x.style.display === "none") {
   
	   x.style.display = "block";
	  
	  unit_ac.style.display="none";
	  crude_ac.style.display="none";
	  view_ac.style.display="none";
	  
	  
  } 
	else {
    x.style.display = "none";
		
		
		
  }
	
	
}		
		
		
function bulk_ac() {
  var x = document.getElementById("bulk_ac");
	
	 var unit_ac = document.getElementById("unit_ac");
	 var crude_ac = document.getElementById("crude_ac");
	var view_ac = document.getElementById("view_ac");
	
  if (x.style.display === "none") {
    x.style.display = "block";
	  
	   unit_ac.style.display="none";
	  crude_ac.style.display="none";
	   view_ac.style.display="none";
  } 
	else {
    x.style.display = "none";
  }
}		
		
			
function crude_ac() {
  var x = document.getElementById("crude_ac");
	
	var unit_ac = document.getElementById("unit_ac");
	 var bulk_ac = document.getElementById("bulk_ac");
	var view_ac = document.getElementById("view_ac");
	
  if (x.style.display === "none") {
    x.style.display = "block";
	  unit_ac.style.display="none";
	  bulk_ac.style.display="none";
	  view_ac.style.display="none";
  } 
	else {
    x.style.display = "none";
  }
}		
		
			
		

		


</script>			
			




 <!--   Core JS Files   -->
  <script src="assets/js/core/popper.min.js"></script>
  <script src="assets/js/core/bootstrap.min.js"></script>
 
  <script>
    var win = navigator.platform.indexOf('Win') > -1;
    if (win && document.querySelector('#sidenav-scrollbar')) {
      var options = {
        damping: '0.5'
      }
      Scrollbar.init(document.querySelector('#sidenav-scrollbar'), options);
    }
  </script>
  <!-- Github buttons -->
  <script async defer src="https://buttons.github.io/buttons.js"></script>
  <!-- Control Center for Material Dashboard: parallax effects, scripts for the example pages etc -->





<script>


		function spinner() {
  
			var x = document.getElementById("spin");
	
	
	
  if (x.style.display === "none") {
    x.style.display = "block ";
	  
	  
  }
	else {
    x.style.display = "none";
  }
	
	
}
	
		



</script>