<?PHP
session_start();
$background_color =$_SESSION['background_color'];
$text_color =$_SESSION['text_color'];



$privilage = $_SESSION['privilage']; 
if (!(isset($_SESSION['login']) && $_SESSION['login'] != '')) {
	header ("Location: ../login.php");
}
else if($privilage == "Priviledge" or $privilage == "Sales Rep" or $privilage == "Sales Rep" or $privilage == "Receptionist" or $privilage == "Inventory Manager" or $privilage == "Secetary"or $privilage == "Manager")
{
	
	header ("Location: not_authorized.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 = "lawpedc3_lbs_users";

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


?>

<!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: 310px;
               // 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: #757672; color: #F0ECEC">
	
				
<?php 
		
	echo $_SESSION['name'].'   '.' (IDN '. $_SESSION['user_id'].' ) ';
			
			

		?>
			<div class="" style="float: right; color: #ED0307;"><a HREF = "logout.php" onClick="spinner()"><span style="color: #F9F833">Log out</span></a></div>
			<!--<button onclick="myFunction()">Click Me</button>-->
			

			
		</div>

	
			

	
	
		<div class="jumbotron" style="background-color: <?php echo $background_color; ?>;">
			
			
	 <input type="submit" value='Back' onClick="spinner(),document.location='location.php'" class="" style= "width: inherit; height: " name = "A"  >	

			
			
			
			<div style="color: #FDFDF9;  "><h4><b><marquee behavior="alternate"><span style="color: <?php echo $text_color; ?>"> <i> <?php echo 'Business Manager is an intellectual property owned by Lawped Limited, Dept of iCT.' ?> </i>  </span></marquee></b></h4></div>
			
			
	
	<div class="row">
		<DIV class="col-md-12" id="">
			
		</DIV>
	
    </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="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 Admin
			</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>
		Registration Date
			</td>
			
			<td>
			<?php echo $db_found['date'];?>
			</td>
			
			
	  	</tr>
	  
	
	
	  
	 
	
	
  </tbody>
</table>
						
	
	
	</div>

					</div>
						
			<div class = "col-md-4 " style="background-color:">
				
							 
	
				
						
			</div>
			
		</div>
		
		</div>
		
		
	
<div class="loader" id="spin" style="margin: auto"></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>