
<p></p>

<div style="color: white">

<?PHP


session_start();


require 'config.php';

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

$branch_key = $_SESSION['branch_key'];

//$database = "lawpedc3_lbs_users";

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






$background_color =$_SESSION['background_color'];
$text_color =$_SESSION['text_color'];


$notification = "Admin Dashboard";

echo '  App Code:('. $app_code = $_SESSION['app_code'];

echo '  Role:('.$privilage = $_SESSION['privilage']; 


	
	
	
	
	?>
	</div>
	
	<?php
	

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





else if($privilage != "admin" ){
	

											$SQL = "SELECT * FROM location where branch_key = '$branch_key' ";
											
											$result = mysqli_query($db_handle, $SQL);
											
											//$i =1;

											
										$db_found = mysqli_fetch_assoc($result);
	
	
	
	  $_SESSION['address'] = $db_found['address'];
		
		 $_SESSION['biz_name'] = $db_found['biz_name'];
		
		 $_SESSION['biz_nature'] = $db_found['biz_nature'];
		
		 $_SESSION['branch_key'] = $db_found['branch_key'];
	
	 $_SESSION['description'] = $db_found['description'];
	
	$_SESSION['number'] = $db_found['number'];
	
	 $_SESSION['email'] = $db_found['email'];
	
	
		
	
	if($db_found['activation_date']=="")
	{
		
		
		
		$duration = 7;
		
	echo	$activation_da =   $current_date = date("Y-m-d"); "<br>";
				//	$_SESSION['expiration_date'] = $db_found['expiration_date'];
		
		
		
		$date=date_create($activation_da);
//date_add($date,date_interval_create_from_date_string("7 days"));
						date_add($date,date_interval_create_from_date_string("$duration days"));
		
	echo	$expiration_da =  date_format($date,"Y-m-d");
		
		$db_f = new mysqli(DB_SERVER, DB_USER, DB_PASS,  $database );
		
		
		
		$SQl_update_login =" UPDATE `location` SET  `activation_date`='$activation_da', `expiration_date`='$expiration_da' WHERE branch_key = '$branch_key' ";
						
						mysqli_query($db_f,$SQl_update_login);
						
		
		
		
		
		
		
		$_SESSION['activation_date'] = $activation_da;
					$_SESSION['expiration_date'] = $expiration_da ;
		

	header ("Location: deletedac.php");	
		
	}
	
	else
	{
		
		
		
						$_SESSION['activation_date'] = $db_found['activation_date'];
					$_SESSION['expiration_date'] = $db_found['expiration_date'];

		
					header ("Location: dashboard.php");
	
	}
	
	
	
	
											
	
	
	
}

else{
	
	 $condition = "";
}



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

?>



<?php





?>


<?php
if(isset($_POST['A']))
{
	
	   $cat = $_POST['cat'];
	
	
	
	
	
	
	
	
if($cat==""){
	
 $notification ="failed|please Select Branch";
//echo	'<button ><a href = " inventory_ac.php">Ok</a></button';
	
}
	

	else{
		
		
		// echo $_SESSION['branch_key'] =  $cat;
		
	
		
		$SQL = "SELECT  * FROM location where ID = '$cat'  ";
											
											$result = mysqli_query($db_handle, $SQL);
		$db_found = mysqli_fetch_assoc($result);
		
		
		echo	 $_SESSION['address'] = $db_found['address'];
		
		 $_SESSION['biz_name'] = $db_found['biz_name'];
		
		 $_SESSION['biz_nature'] = $db_found['biz_nature'];
		
		
		
		
		 $_SESSION['email'] = $db_found['email'];
		
		 $_SESSION['number'] = $db_found['number'];
		
		 $_SESSION['description'] = $db_found['description'];
		
		 $_SESSION['photo'] = $db_found['photo'];
		
		
		
		
		
		
		
		$branch_key =   $_SESSION['branch_key'] = $db_found['branch_key']; '<br>';
		
		
		
		//echo $db_found['activation_date']; '<br>';
	
		

		
	
		
		
	if($db_found['activation_date']=="")
	{
		
		
		
		$duration = 14;
		
	$activation_da =   $current_date = date("Y-m-d"); "<br>";
				//	$_SESSION['expiration_date'] = $db_found['expiration_date'];
		
		
		
		$date=date_create($activation_da);
//date_add($date,date_interval_create_from_date_string("7 days"));
						date_add($date,date_interval_create_from_date_string("$duration days"));
		
		$expiration_da =  date_format($date,"Y-m-d");
		
		$db_f = new mysqli(DB_SERVER, DB_USER, DB_PASS,  $database );
		
		
		
		$SQl_update_login =" UPDATE `location` SET  `activation_date`='$activation_da', `expiration_date`='$expiration_da' WHERE branch_key = '$branch_key' ";
						
						mysqli_query($db_f,$SQl_update_login);
						
		
		
		
		
		
		
		$_SESSION['activation_date'] = $activation_da;
		
		$_SESSION['expiration_date'] = $expiration_da ;
		

	header ("Location: dashboard.php");	
		
	}
	
	else
	{
		
		
		
						$_SESSION['activation_date'] = $db_found['activation_date'];
					$_SESSION['expiration_date'] = $db_found['expiration_date'];

		
				header ("Location: dashboard.php");
	
	}
	
	
	
		
		
		
		
		
		

		
	}


}



else if(isset($_POST['category']))
{
	
	   $cat = $_POST['cat'];
	 $date = date("Y-m-d");
	 $app_code = $_SESSION['app_code'];

	
	$biz_name =  $_POST['biz_name'];
	 $biz_nature = $_POST['biz_nature'];
	
	
	$branch_key = rand(1,100000);
    
	if($cat =="")
	{
		$notification = "error|blank field";
	}
	
	else {
	
		
		
	
	// $time = date("h-i-s");
	//$bundle_q = $_POST['bundle_q'] ;
	//$bundle_p = $_POST['bundle_p'] ;

	

	$db_found = new mysqli(DB_SERVER, DB_USER, DB_PASS, $database );
	
	echo $database;
	
echo	$cat,$branch_key,$biz_name,$biz_nature, $app_code,$date;

		/*
			$SQL = $db_found->prepare("INSERT INTO product_table (product_name, unit_q, unit_p,bundle_q,bundle_p,user_id) VALUES (?,?,?,?,?,?)");
			$SQL->bind_param('ssssss', $product_name, $unit_q,$unit_p,$bundle_q,$bundle_p,$_SESSION['user_id'] );
			$SQL->execute();
			header ("Location: inventory_ac.php");
			
				*/

	$SQL = $db_found->prepare("INSERT INTO location (address,branch_key,biz_name,biz_nature,app_code,date) VALUES (?,?,?,?,?,?)");
			$SQL->bind_param('ssssss', $cat,$branch_key,$biz_name,$biz_nature, $app_code,$date );
		
		
		
		$SQL->execute();
	
			
	
		
		
		
		//query to add value to the cash cell....... cash
		$cash = 'Cash';
		$automanage= 'disabled';
		$service= 'cash';
		
		$expirydate = '2090-09-13';
		
		$unit_q = '0';
		
		
		
	$db_found = new mysqli(DB_SERVER, DB_USER, DB_PASS, $database );


	$SQL = $db_found->prepare("INSERT INTO product_table (product_name, auto_manage, unit_q,date,branch_key,app_code,service,expiry_date) VALUES (?,?,?,?,?,?,?,?)");
			$SQL->bind_param('ssssssss',  $cash,$automanage,$unit_q, $date,$branch_key,$app_code,$service,$expirydate );
			$SQL->execute();
	
		
		
		//==================== services
		$unit_q = '10000000';
		$product_name = 'services';
		$cat = 'Micelenous';
		//$automanage= 'disabled';
		$service= 'service';
		
		$expirydate = '2090-09-13';
		
		//$unit_q = '0';
		
		
		
		
		$SQL = $db_found->prepare("INSERT INTO product_table (product_name, cat, auto_manage, unit_q,date,branch_key,app_code,service,expiry_date) VALUES (?,?,?,?,?,?,?,?,?)");
			$SQL->bind_param('sssssssss', $product_name, $cat,$automanage,$unit_q, $date,$branch_key,$app_code,$service,$expirydate );
			$SQL->execute();
	
		
		
		// to add value to the product
		//==================== GOODS
		$product_name = 'Goods';
		$cat = 'Micelenous';
		$automanage= 'disabled';
		$service= 'product';
		
		//$expirydate = '2090-09-13';

		
		$unit_q = '1000000';
		
		
		
		
		$SQL = $db_found->prepare("INSERT INTO product_table (product_name, cat, auto_manage, unit_q,date,branch_key,app_code,service,expiry_date) VALUES (?,?,?,?,?,?,?,?,?)");
			$SQL->bind_param('sssssssss', $product_name, $cat,$automanage,$unit_q, $date,$branch_key,$app_code,$service,$expirydate );
			$SQL->execute();
		
		
		
		
		
		
		
		
		
		
		
		
	 $notification ="success";
			//header ("Location: inventory_ac.php");
		
		
		
		
		
		
		
		
		

		
	}
	



}




else if(isset($_POST['del_category']))
{
	
	

	   $catt = $_POST['del_cat'];
	
if($catt == "")
{
	$notification = "failed|Select Category";
}
	
	else{
		
		
	$SQL = "DELETE FROM location WHERE branch_key='$catt'";
   mysqli_query($db_handle, $SQL);
		
		$SQL = "DELETE FROM txn_table  WHERE branch_key='$catt'";
   mysqli_query($db_handle, $SQL);

		$SQL = "DELETE FROM product_table  WHERE branch_key='$catt'";
   mysqli_query($db_handle, $SQL);

		$SQL = "DELETE FROM product_cat  WHERE branch_key='$catt'";
   mysqli_query($db_handle, $SQL);

		
		$SQL = "DELETE FROM fixed_cost  WHERE branch_key='$catt'";
   mysqli_query($db_handle, $SQL);
		
		
		$SQL = "DELETE FROM expens_tb  WHERE branch_key='$catt'";
   mysqli_query($db_handle, $SQL);
		
		$SQL = "DELETE FROM customers_table  WHERE branch_key='$catt'";
   mysqli_query($db_handle, $SQL);

		$SQL = "DELETE FROM bmhistory  WHERE branch_key='$catt'";
   mysqli_query($db_handle, $SQL);
		
		
	
	  $notification ="success";
	}
	//header ("Location: inventory_ac.php");
	

	
    
}



else{
	
}
?>


<!DOCTYPE html>
<html lang="en">
<head>
	<title>Lawped</title>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	
	  <!--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>
	 <link href="css/popup.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:#8A8686 ;
}

	
		
	
            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: #494747;
                width: 100%;
                height: 310px;
                //overflow-x: hidden;
                //overflow-y: auto;
				overflow: auto;
                text-align:justify;
            }
		
		
		div.scroll_body {
                margin:4px, 4px;
               // padding:4px;
                //background-color: green;
                width: 100%;
                height: 400px;
                overflow-x: hidden;
                overflow-y: auto;
				//overflow: auto;
                text-align:justify;
            }
		
		

	</style>
	
<body onLoad= "<?php echo "customAlert.alert('$notification','$_SESSION[biz_name]<BR>$_SESSION[app_code]')"; ?>,bulk_ac(),crude_ac(),unit_ac(), view_ac(),spinner()">


	
		<div class="jumbotron-fluid" style="background-color: #030CAB; 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>

	 <input type="button" value='Create Account ' onClick="unit_ac(),crude_ac()" class="" style= " " name = "A"  >		

		  
	 <input type="button" value='App Info' onClick="spinner(),document.location='app_info.php'" class="" style= "5" name = "A"  >	
	
	 <input type="button" value='users' onClick="view_ac()" class="" style= "5" name = "A"  >	

		
	
		<div class="jumbotron" style="background-color:">

			<div style="color: white;  "><h5><b><marquee behavior="alternate">ADMIN DASHBOARD </marquee></b></h5></div>
				
  <div class="row" style="font-size:20; ">	
	  
	  
	
	  <div class="col-md-6" >
	  
		
			  
	 <input type="button" value='Visit Account' onClick="unit_ac()" class="" style= "width: 100%; height:55; background-color:;color: " name = "A"  >	
	
		  	

	  </div>
	  
	  
	  
	  
	  
	  
	    <div class="col-md-6" >
	  
	
	  </div>
	
	
	
	<!-- <input type="submit" value='Audit AC' onClick="window.alert('inactive(function under-review)')" class="" style= "width: inherit; height: " name = "A"  >	-->

	
	<!-- <input type="submit" value='Generate Report' onClick="window.alert('inactive(function under-review)')" class="" style= "width: inherit; height: " name = "A"  >	-->

	
	
	 
	</div>
	
	
			
			
			
		
	
	<div class="row">
		<DIV class="col-md-12" id="">
			<table style="margin: auto; width: auto" >
		
	<tr>
			
 	
				</tr>
			</table>
		</DIV>
	
    </div>
			
			
				<div class="row">
			<table style="margin: auto" >

			</table>
		
		
			</div>
	
		</div>
	
	
	<!--script to show recent inserted record-->
	
	
		<?php
			  //==================================================================================
			 //script to show recent inserted record
			//==================================================================================
	
	
	
	// echo $db_found_recent['amount'];
	
	  //===================================================================================
	  		?>
	
	

	
<div class="loader" id="spin" style="margin: auto"></div>		
	
	<div class="container-fluid" style="" >
		
		
		
		<div class="jumbotron-fluid" style="background-color: ">
		
		
				<div class="row" style="">
				
										<div class="col-md-3" style="padding-top: 8px;background-color:" id="unit_ac" >
							
											
													<div id="">
											
										
														<form METHOD ="POST" ACTION = "location.php" style="width: 100%">
											<table width="100%">
				<tr>
					
									<td>  
											<div class="input-group mb-3">
  
</div>
										
										
										
										
										
										
										
										<div class="input-group mb-3">
 
 <select class="custom-select"  style="background-color:"   name="cat" id="product" onchange="showUser(this.value) " >
										
											<option value="" selected>Select Business Branch Account</option>
		
											<?php
	
	

											
											$SQL = "SELECT  DISTINCT address, ID, branch_key FROM location where app_code = '$app_code'  ORDER BY ID ASC ";
											
											$result = mysqli_query($db_handle, $SQL);
											
											//$i =1;

											
											while ( $db_found = mysqli_fetch_assoc($result) ) {
											
												/*echo'<option value="'. $db_found['product_name'].'">'. $db_found['product_name'].'(Qty'. $db_found['unit_q'].', Amt '. $db_found['unit_p'].')</option>'; */
												
												echo'<option value="'. $db_found['ID'].'">'. $db_found['address'].'  (Branch IP   '. $db_found['branch_key'].')</option>'; 
																									  }
		
											?>
											
											</select> 
</div>
										
										
										
										
										
										
									
															
									
										
									    
		
					</td>
					
	
											 
							
											 
							</tr>
			</table>
			 <input type="submit" value="PROCEED" class="btn-dark" style= "width: 100%" name = "A" onClick = "spinner()">
											
											</form>
											</div>	
											
											
											
										</div>
										
					
										<div class="col-md-6" style="padding-top: 8px" id="bulk_ac">
						
										</div>
					
										
								
				<div class="col-md-3" style="padding-top: 8px; background-color:" id="crude_ac"  >
					
 <form METHOD ="POST" ACTION = "location.php" style="width: 100%">
											<table width="100%">
												
												<tr>
												<td>
													
													
													<select class="custom-select"  style="background-color:#454242;color: white"  name = "del_cat"  >
										
											<option value="" selected>Select to Remove Branch Account</option>
		
											<?php
											
											//$SQL = "SELECT  DISTINCT address, branch_key FROM location where app_code = '$app_code'  ORDER BY ID ASC ";
											
											$result = mysqli_query($db_handle, $SQL);
											
											//$i =1;

											
											while ( $db_found = mysqli_fetch_assoc($result) ) {
											
												/*echo'<option value="'. $db_found['product_name'].'">'. $db_found['product_name'].'(Qty'. $db_found['unit_q'].', Amt '. $db_found['unit_p'].')</option>'; */
												
												echo'<option value="'. $db_found['branch_key'].'">'. $db_found['address'].'</option>'; 
																									  }
		
											?>
											
											</select> 	
													
												</td>
												
															<td>
					
				 <input type="submit" value="Remove" class="ustom-select btn-dark"  <?php echo $condition   ?>   style= "width: 100%" onClick="spinner()" name = "del_category" >
					
																			</td>
												
												</tr>
												<p></p>
				
												<tr>
						</form>						
					
	  <form METHOD ="POST" ACTION = "inventory_ac.php" style="width: 100%" >
					
					<td>  
					
						
						
						
						
						<input type="text"  class="" style="width: 100%"  value="" name="biz_name" placeholder="Company Name" aria-label="Recipient's username" aria-describedby="basic-addon2">
						
					</td>
			
		  
		  
		  
		 
		  
		  
		  
		  							</tr>
	 
	 
	 <tr>
	 <td> 
		 
		 
		 <select class=""  style="width:100%"  placeholder="Company Name"  id="inputGroupSelect03" name="biz_nature">
										
											<option value="" selected>Select Business nature </option>
											<option value="printing press">printing press</option>
											<option value="bookshop">bookshop</option>
											<option value="phamarcy">Phamarcy</option>
											<option value=" ">Cement Store</option>
											<option value="supermark">Supermarket</option>
											<option value="electronics">Electronics shop</option>
											<option value="salon">saloon</option>
											<option value="warehouse">ware house</option>
											<option value="retailshop">Retail shop</option>
											<option value="drinks">drinks shop</option>
											<option value="gas">gas Station</option>
											<option value="coldroom">Cold room</option>
			 								<option value="others">others</option>
											
											
											</select> 
		 
		 

		 
		 
		 
		 
		
		 
					</td>
		 
		 
		 
	
		 
		 
	 
								</tr>	
	 
	 
	  	<tr>
		 
	 
	 
	 <td>  
					
		 
		  <textarea cols="50" rows = "3" style="width:100%"  id="note"  placeholder="Business Address" class="form-control" aria-label="Amount (to the nearest dollar)" name="cat"></textarea>
		 
					</td>
	 
	 
	 
	 </tr>
	 
	 
	 
	 
	 
	 
	 
	 	<tr>
		 
			
			<td > 
			
			
				<input type="file"  class="" style="width: 100%"  value="" placeholder=""  disabled >
			
			</td>
			
			
	
			
			
		 
		 </tr>
		 
		 			

	 
	 
	 
	 
	 
												<tr>
														<td>
					
				
					 <input type="submit" value="Creat Account" <?php echo $condition   ?>   class="btn-dark" style= "width: 100%"  onClick="spinner()" name = "category" >
																			</td>
												
												</tr>
												
												
			</table>
			
											
											</form>
				</div>


				</div>
		
		
		</div>
		
		
		
		
	  <div class="row" style="font-size:20; ">	
	  
	  
		<div class = "col-md-12 " style="background-color: #494747" id = "view_ac">
				  	
						<strong ><span style="color:#FAF7FF;padding: 4px"><br>STAFF RECORDS
					    
							</span> </strong>
				
						 
						<div class="jumbotron-fluid scroll_history" style="font-size:12; ">
				  
				  <!--<strong ><span style="color:#260B4D;background-color: #FBFBFC;padding: 4px">TRANSACTION HISTORY
					     </span></strong>-->
				  
	  
							<table class="table  table-hover" style="font-size:12; width:100%  " >
  
								<tbody>
    
									<tr  style="background-color:darkblue; text-align:; color: white ">
      
										<th scope="col">S/N</th>
	
										<th scope="col">IDN </th>
										
										<th scope="col">NAME</th>
      
										<th scope="col">PASSWORD</th>
										
										<th scope="col">BRANCH IP</th>
		 
		<!-- <th scope="col">DESCRIPTION</th>-->
	
		   
										<th scope="col">PHONE</th>
										<th scope="col">EMAIL</th>
										<th scope="col">PRIVILAGE</th>
		
										
		 
										<th scope="col">STATUS</th>
										
										<th scope="col">DATE</th>
										
		
     
    
									</tr>
 			
		



									<?PHP

//if ($db_found) {

//$SQL = "SELECT * FROM product_table ORDER BY product_id ASC ";

	  
	  
//$SQL = "SELECT * FROM txn_table where date= current_date ORDER BY product_id DESC   ";

						
$db_handle = mysqli_connect(DB_SERVER, DB_USER, DB_PASS);

//$database = $_SESSION['database'];
$database = "lawpedco_lawpedc3_lbs_users";


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

									
								
					
								
									$SQL = "SELECT  ID,name,L1, branch_key,fone,email,privilage,date,status FROM login   where app_code = '$app_code' and privilage != 'admin'  ORDER BY name ASC";

	  
									
									$result = mysqli_query($db_handle, $SQL);

									$i =1;
	  		
									while ( $db_found = mysqli_fetch_assoc($result) ) {
	   
	
										echo'<tr style="text-align: center; color:blue; background-color:white"  >';

	
	
										echo '<td>'.$i++.'</td>';
		
										echo '<td>'.$db_found['ID'].'</td>';
										
										echo '<td>'.$db_found['name'].'</td>';
		 
										echo '<td>'.$db_found['L1'].'</td>';
										
										echo '<td>'.$db_found['branch_key'].'</td>';
		
										echo '<td>'.$db_found['fone'].'</td>';
									
		
	
										echo '<td>'.$db_found['email'].'</td>';
	
	 
										echo '<td>'.$db_found['privilage'].'</td>';
										
										
	
										echo '<td>'.$db_found['status'].'</td>';
										
										echo '<td>'.$db_found['date'].'</td>';
										
										
										
	//echo '<td>'.$db_found['SUM(amount)'].'</td>';
	
	//echo $db_found_sum['SUM(amount)']; 
	 
	 
	
									?>
<!--	  
  <td><a href="construction.php?txnId=Receipt">
    <input type="button" value="Issue Receipt"></a></td>
	  
	  <td><a href="construction.php?txnId=Modify Account">
    <input type="button" value="Modify"></a></td>-->
	  
	  
	  
										
	  
									<?php
	
										echo '</tr>';

	
	

									}

									//mysqli_close($db_handle);
	  
							
									?>
	

								</tbody>

							</table>
						
	<p></p>
	
						</div>
			
			
			<p></p>
			
					</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>			
			

<script>


		function spinner() {
  
			var x = document.getElementById("spin");
	
	
	
  if (x.style.display === "none") {
    x.style.display = "block ";
	  
	  
  }
	else {
    x.style.display = "none";
  }
	
	
}
	
		
	
	
	
function CustomAlert(){
  this.alert = function(message,title){
    document.body.innerHTML = document.body.innerHTML + '<div id="dialogoverlay"></div><div id="dialogbox" class="slit-in-vertical"><div><div id="dialogboxhead"></div><div id="dialogboxbody"></div><div id="dialogboxfoot"></div></div></div>';

    let dialogoverlay = document.getElementById('dialogoverlay');
    let dialogbox = document.getElementById('dialogbox');
    
    let winH = window.innerHeight;
    dialogoverlay.style.height = winH+"px";
    
    dialogbox.style.top = "100px";

    dialogoverlay.style.display = "block";
    dialogbox.style.display = "block";
    
    document.getElementById('dialogboxhead').style.display = 'block';

    if(typeof title === 'undefined') {
      document.getElementById('dialogboxhead').style.display = 'none';
    } else {
      document.getElementById('dialogboxhead').innerHTML = '<i class="fa fa-exclamation-circle" aria-hidden="true"></i> '+ title;
    }
    document.getElementById('dialogboxbody').innerHTML = message;
    document.getElementById('dialogboxfoot').innerHTML = '<button class="pure-material-button-contained active" onclick="customAlert.ok()">OK</button>';
  }
  
  this.ok = function(){
    document.getElementById('dialogbox').style.display = "none";
    document.getElementById('dialogoverlay').style.display = "none";
  }
}

let customAlert = new CustomAlert();
	
		



</script>