<?PHP
session_start();

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

$bottom_backgroundcolor = $_SESSION['bottom_backgroundcolor'] ;
		$bottom_textcolor = $_SESSION['bottom_textcolor'] ;

$branch_key = $_SESSION['branch_key'];


$app_code = $_SESSION['app_code'];

$address = $_SESSION['address'];




if($address === ""){

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





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

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

?>



<?php
require 'config.php';

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

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


?>


<?php
if(isset($_POST['A'])){
	 
    $name = $_POST['name'];
	    $type = $_POST['type'];
	
	
	$phone = $_POST['phone'] ;
	$address = $_POST['address'] ;
	//$bundle_q = $_POST['bundle_q'] ;
	//$bundle_p = $_POST['bundle_p'] ;
	
	
	 $date = date("Y-m-d");
	$time = date("h-i-s");

	

	$db_found = new mysqli(DB_SERVER, DB_USER, DB_PASS, $database );

		/*
			$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 customers_table (name,type,phone,address,time,date,branch_key,app_code) VALUES (?,?,?,?,?,?,?,?)");
			$SQL->bind_param('ssssssss', $name,$type,$phone,$address,$time,$date,$branch_key,$app_code);
			$SQL->execute();
			header ("Location: customers.php");
		echo  "Successfull Added";




}







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/bootstrap-4.4.1.css" rel="stylesheet">
	
<!--===============================================================================================-->
	
</head>
	
	 <script src="js/main.js"></script>
	
	
	
	<style>


	.loader {
  border: 5px solid #f3f3f3;
  border-radius: 50%;
  border-top: 5px solid blue;
  border-right: 5px solid green;
  border-ottom: 5px solid red;
  border-left: 5px solid pink;
  width: 120px;
  height: 120px;
  -webkit-animation: spin 1s linear infinite;
  animation: spin 0.8s 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: <?php echo $bottom_backgroundcolor?>;
}

	
		
	
            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= "unit_ac(),bulk_ac(),crude_ac(),view_ac(), spinner()">


	
		<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; ?>">
			
			<div style="color: <?php echo $text_color; ?>;  "><h5><b><marquee behavior="alternate">
			Client Management System
			</marquee></b></h5></div>
	
	<div class="row">
		<DIV class="col-md-12" id="">
			<table style="margin: auto; width: auto" >
		
	<tr>
				<td>
					
					 <input type="submit" value='Add Clients ' onClick="unit_ac()" class="" style= "width: inherit; height: " name = "A"  >
					
					
				</td>
	<td>
		 <input type="submit" onClick="window.alert('inactive')" value=""  disabled class="" style= "width: inherit; height: " name = "A" >
				</td>
	
	
	
				</tr>
			</table>
		</DIV>
	
    </div>
			
			
				<div class="row">
			<table style="margin: auto" >
		
	<tr>
				<td>
					
					 <input type="button" onClick="view_ac()" value="Account" class="" style= "width: inherit; height: " name = "A" >
					
					
				</td>
	<td>
		  <a href="customers.php"><input type="button"   onClick = "spinner()"   value="Refresh" class="" style= "width: inherit; height: "  ></a>
				</td>
	<td>
		 <a href="dashboard.php"><input type="button"  onClick = "spinner()"  value="BACK" class="" style= "width: inherit; height: "  ></a>
				</td>
	
	
	</tr>
			
			</table>
		
		
			</div>
	
		</div>
	
	
	<!--script to show recent inserted record-->
	
	
		<?php
			  //==================================================================================
			 //script to show recent inserted record
			//==================================================================================
	
	
	  $SQL_recent = "SELECT * FROM customers_table where branch_key = '$branch_key' ORDER BY id DESC LIMIT 1 ";
	  $recent_record = mysqli_query($db_handle, $SQL_recent);
	  $db_found_recent = mysqli_fetch_array($recent_record) ;
	// echo $db_found_recent['amount'];
	
	  //===================================================================================
	  		?>
	
	<div style="text-align:  center;background-color: <?php echo $bottom_backgroundcolor?>; width: inherit; color:  <?php echo $bottom_textcolor?> ">
		
		<h6>  <?php  echo $db_found_recent['name']." was ".'Added as @ '.$db_found_recent['time']." ". ' ('.$db_found_recent['date'].')'; ?> </h6>
	
	</div>
	<!--script to show recent inserted record-->
	
	
<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:<?php echo $background_color;   ?>" id="unit_ac" >
											
											<!--start-->
											
													<div id="">
											
											<form METHOD ="POST" ACTION = "customers.php" style="width: 100%">
											<table width="100%">
				<tr>
									<td>  
									
					
								
										
											
										
										<table>
											<tr>
														
														<td>
														  <div class="input-group mb-3">
  <div class="input-group-prepend">
    <span class="input-group-text" id="basic-addon1">Name</span>
  </div>
  <input type="text" class="form-control" placeholder="Name" aria-label="Username" aria-describedby="basic-addon1" name="name">
</div>	
														</td>
											</tr>
											
											<tr>
													<td>
														  <div class="input-group mb-3">
  <div class="input-group-prepend">
    <span class="input-group-text" id="basic-addon1">Phone </span>
  </div>
  <input type="number" class="form-control" placeholder="07076363748" aria-label="Username" aria-describedby="basic-addon1" name="phone">
</div>	
														</td>
											</tr>
											
											<tr>
													<td>
														  <div class="input-group mb-3">
  <div class="input-group-prepend">
    <span class="input-group-text" id="basic-addon1">Address</span>
  </div>
  <input type="text" class="form-control" placeholder="07076363748" aria-label="Username" aria-describedby="basic-addon1" name="address">
</div>	
														</td>
												
												<td>
												
				
													
													
												</td>
												
												
											</tr>
										</table>
										
									    
					</td>
					
	
											 
							
											 
							</tr>
												
												
			</table>
												
																					
 <!-- <p style=" color:<?php echo $bottom_textcolor; ?>">Payment Method<br>-->
  <input type="radio" id="html" name="type" value="Customer" checked>
  <label for="html" style=" color:white">Buyer</label>
  <!--<input type="radio" id="css" name="fav_language" value="CSS">
  <label for="css">POS</label>-->
  <input type="radio" id="javascript" name="type" value="Supplier">
  <label for="javascript" style=" color:white">Supplier</label>

												
			 <input type="submit" value="ENTER" 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">
											
 <form METHOD ="POST" ACTION = "dashboard.php" style="width: 100%">
											<table width="100%">
				<tr>
									<td>  
										<div class="input-group mb-3">
  <div class="input-group-prepend">
    <span class="input-group-text" id="basic-addon1">Product Name</span>
  </div>
  <input type="text" class="form-control" placeholder="eg.book,rice,doors etc" aria-label="Username" aria-describedby="basic-addon1" name="product">
</div>
					
											<div class="input-group mb-3">
  <div class="input-group-prepend">
    <span class="input-group-text" id="basic-addon1">Quantity(Unit)</span>
  </div>
  <input type="text" class="form-control" placeholder="Volume of Goods" aria-label="Username" aria-describedby="basic-addon1" name="product">
</div>
										
											<div class="input-group mb-3">
  <div class="input-group-prepend">
    <span class="input-group-text" id="basic-addon1">Cost Price</span>
  </div>
  <input type="text" class="form-control" placeholder="Per Goods" aria-label="Username" aria-describedby="basic-addon1" name="product">
</div>
										
											<div class="input-group mb-3">
  <div class="input-group-prepend">
    <span class="input-group-text" id="basic-addon1">Quantity(bundle)</span>
  </div>
  <input type="text" class="form-control" placeholder="Dozen/Carton/Basket" aria-label="Username" aria-describedby="basic-addon1" name="product">
</div>
											<div class="input-group mb-3">
  <div class="input-group-prepend">
    <span class="input-group-text" id="basic-addon1">Cost Price</span>
  </div>
  <input type="text" class="form-control" placeholder=" Carton/Dozen/Basket etc" aria-label="Username" aria-describedby="basic-addon1" name="product">
</div>
										
										
					</td>
					
	<td>  
										<div class="input-group mb-3">
  <div class="input-group-prepend">
    <span class="input-group-text" id="basic-addon1">Product Name</span>
  </div>
  <input type="text" class="form-control" placeholder="eg.book,rice,doors etc" aria-label="Username" aria-describedby="basic-addon1" name="product">
</div>
					
											<div class="input-group mb-3">
  <div class="input-group-prepend">
    <span class="input-group-text" id="basic-addon1">Quantity(Unit)</span>
  </div>
  <input type="text" class="form-control" placeholder="Volume of Goods" aria-label="Username" aria-describedby="basic-addon1" name="product">
</div>
										
											<div class="input-group mb-3">
  <div class="input-group-prepend">
    <span class="input-group-text" id="basic-addon1">Cost Price</span>
  </div>
  <input type="text" class="form-control" placeholder="Per Goods" aria-label="Username" aria-describedby="basic-addon1" name="product">
</div>
										
											<div class="input-group mb-3">
  <div class="input-group-prepend">
    <span class="input-group-text" id="basic-addon1">Quantity(bundle)</span>
  </div>
  <input type="text" class="form-control" placeholder="Dozen/Carton/Basket" aria-label="Username" aria-describedby="basic-addon1" name="product">
</div>
											<div class="input-group mb-3">
  <div class="input-group-prepend">
    <span class="input-group-text" id="basic-addon1">Cost Price</span>
  </div>
  <input type="text" class="form-control" placeholder=" Carton/Dozen/Basket etc" aria-label="Username" aria-describedby="basic-addon1" name="product">
</div>
										
										
					</td>
					
					
											 
							
											 
							</tr>
			</table>
			 <input type="submit" value="SAVE" class="btn-dark" style= "width: 100%" name = "A" >
											
											</form>
											
											
										</div>
					
										
								
				<div class="col-md-3" 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
			  //==================================================================================
			 //this junk of code is to sum up daily transaction
			//==================================================================================
	  $SQL_sum = "SELECT SUM(amount) FROM txn_table where date= current_date   ";
	  $sum = mysqli_query($db_handle, $SQL_sum);
	  $db_found_sum = mysqli_fetch_assoc($sum) ;
	  //===================================================================================
	  		?>
		
	
		
		<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: #645151">
				  		 <strong ><span style="color:#FAF7FF;padding: 4px"><br>
				  		 BUYERS
					     </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 width="101%" class="table table-hover" style="font-size: 12" >
  <tbody>
    <tr  style="background-color: <?php echo $bottom_backgroundcolor ?> ; text-align: center; color:  <?php echo $bottom_textcolor ?>">
     
		
		<th width="9%" scope="col">S/N</th>
		
	<th width="22%" scope="col"> </th>
    
		 <th width="5%" scope="col"></th>
		 
		<!-- <th scope="col">DESCRIPTION</th>-->
	
		<!-- <th scope="col" style="background-color: #798B15">Available Quantity</th>-->
		 <th width=""style="background-color:" scope="col">Phone</th>
		<th width="" style="background-color:" scope="col">   Address  </th>
		<!-- <th width="" style="background-color: " scope="col"> Date </th>-->
		
		
     
    </tr>
 			
		


<?PHP

//if ($db_found) {

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

	  
	  
$SQL = "SELECT * FROM customers_table where type = 'customer' and  branch_key='$branch_key' ORDER BY name ASC   ";

	  //$SQL = "SELECT  product_name,product_id,user_id, amount, time FROM txn_table   where date= current_date  ORDER BY product_id DESC";

	  $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>'.$db_found['user_id'].'</td>';
	
	
	echo '<td>'.$i++.'</td>';
	echo '<td>'.$db_found['id'].'</td>';
	 echo '<td>'.$db_found['name'].'</td>';
	//echo '<td style="background-color: #798B15">'.$db_found['unit_q'].'</td>';
	// echo '<td>'.$db_found['user_id'].'</td>';
	
	
	// echo '<td>'.'<a href="www.lawped.com.ng?id=$db_found['product_id']">details</a>'.'</td>';
	
	// $db_found_sum['SUM(amount)'];
	
	
	// echo '<td style="background-color: #798B15">'.$db_found['unit_p'].'</td>';
	echo '<td style="background-color:">'.$db_found['phone'].'</td>';
	/*
	echo '<td style="background-color: black">'.$db_found['bundle_q'].'</td>';
	echo '<td style="background-color: black">'.$db_found['bundle_p'].'</td>';
	*/
	//echo '<td style="background-color: black">'.$db_found['unit_c'].'</td>';
	echo '<td style="background-color:   ">'.$db_found['address'].'</td>';
	
//	echo '<td style="background-color:  ">'.$db_found['time'].'</td>';
	//echo '<td style="background-color:  ">'.$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>-->
	  
	  
	  <td>
  <!--  <input type="button" value="Restock"onClick= "window.alert('The page  you requsted is still under Development. Contact us (Alaye David 09055158742, head of iCT LAWPED GROUP,www.lawped.com.ng')" >--></td>
	  
	 <td><a href="customers_delete.php?txnId= <?php echo $db_found["id"]?>">
   <input type="button" value="Remove" onClick="spinner()"></a> </td>
	  
	 
	  
	  
	  <?php
	echo '</tr>';

	
	
}

//}
//else {

//print "Database NOT Found ";

//}
//mysqli_close($db_handle);
	  
			?>
	
	
	
	
	
  </tbody>
</table>
						
	
	
	</div>
			</div>
						
						
			<div class = "col-md-6 " style="background-color: #6E6565">
				  		 <strong ><span style="color:#FAF7FF;padding: 4px"><br>
				  		 SUPPLIERS </span> </strong>
				
						 <div class="jumbotron-fluid scroll_history" style="font-size:12; background-color:  ">
				  
				  <!--<strong ><span style="color:#260B4D;background-color: #FBFBFC;padding: 4px">TRANSACTION HISTORY
					     </span></strong>-->
				  
	  <table class="table table-hover" style="background-color: ; font-size: 12">
  <tbody >
	  
	  
	  
    <tr  style="background-color: <?php echo $bottom_backgroundcolor?>; text-align: center; color: <?php echo $bottom_textcolor?>;width: 100%">
      <th scope="col"></th>
		
	<th scope="col"> </th>
    
		 <th scope="col"></th>
		 
		<!-- <th scope="col">DESCRIPTION</th>-->
	
		<!-- <th scope="col" style="background-color: #798B15">Available Quantity</th>-->
		 <th scope="col"style="background-color:">Phone </th>
		<th scope="col" style="background-color:">   Address  </th>
		
		
		
		
     
    </tr>
 			
		


<?PHP

//if ($db_found) {

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

	  
	  
$SQL = "SELECT * FROM customers_table  where type = 'supplier' and branch_key = '$branch_key' ORDER BY name ASC   ";

	  //$SQL = "SELECT  product_name,product_id,user_id, amount, time FROM txn_table   where date= current_date  ORDER BY product_id DESC";

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

while ( $db_found = mysqli_fetch_assoc($result) ) {
	   
	echo'<tr style="text-align: center; color:black; background-color:white" >';
     // echo '<td>'.$db_found['user_id'].'</td>';
	
	
	echo '<td>'.$i++.'</td>';
	echo '<td>'.$db_found['id'].'</td>';
	 echo '<td>'.$db_found['name'].'</td>';
	//echo '<td style="background-color: #798B15">'.$db_found['unit_q'].'</td>';
	// echo '<td>'.$db_found['user_id'].'</td>';
	
	
	// echo '<td>'.'<a href="www.lawped.com.ng?id=$db_found['product_id']">details</a>'.'</td>';
	
	// $db_found_sum['SUM(amount)'];
	
	
	// echo '<td style="background-color: #798B15">'.$db_found['unit_p'].'</td>';
	echo '<td style="background-color:">'.$db_found['phone'].'</td>';
	/*
	echo '<td style="background-color: black">'.$db_found['bundle_q'].'</td>';
	echo '<td style="background-color: black">'.$db_found['bundle_p'].'</td>';
	*/
	//echo '<td style="background-color: black">'.$db_found['unit_c'].'</td>';
	echo '<td style="background-color:   ">'.$db_found['address'].'</td>';
	
	
		?>
	
	
	
	
	 
	 

<!--	  
  <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>-->
	  
	  
	  <td>
  <!--  <input type="button" value="Restock"onClick= "window.alert('The page  you requsted is still under Development. Contact us (Alaye David 09055158742, head of iCT LAWPED GROUP,www.lawped.com.ng')" >--></td>
	  
	 <td><a href="customers_delete.php?txnId= <?php echo $db_found["id"]?>">
   <input type="button" value="Remove" onClick="spinner()"></a> </td>
	  
	 
	  
	  
	  <?php
	echo '</tr>';

	
	
}

//}
//else {

//print "Database NOT Found ";

//}
mysqli_close($db_handle);
	  
			?>
	
	
	
	
	
  </tbody>
</table>
						
	
	
	</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>			
			

<script>


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



</script>