<?php 


if(isset($_POST['A'])){
	
	 
   // $product = $_POST['product'];
// $amount = @ $_POST['amount'] ;
	 $qty = @ $_POST['qty'] ;
	 $unit_q = @ $_POST['amount'] ;
	
	//$customers = $_POST['customer'];
echo	$total = $qty * $unit_q;
	
}
	
	else {
		
		$notification = "OPERATION FAILD||database is filled";
	
	}
	







?>



<html>
<head>
<script>
function showUser(str) {
  if (str == "") {
    document.getElementById("txtHint").innerHTML = "";
    return;
  } else {
    var xmlhttp = new XMLHttpRequest();
    xmlhttp.onreadystatechange = function() {
      if (this.readyState == 4 && this.status == 200) {
        document.getElementById("txtHint").innerHTML = this.responseText;
		//  var myobj =JSON.parse(this.responseText);
		  
		  var strArray = xmlhttp.responseText.split(":::");
   // document.getElementById("txtHint").innerHTML = myobj[0];
		  
		  // document.getElementById("txtHint").innerHTML = myobj[0];
   //document.getElementById("result_address").innerHTML=strArray[1];
   // document.getElementById("result_phone").innerHTML=strArray[2];
		  
		  
		  
		  
		  
		  
		  
      }
    };
    xmlhttp.open("GET","getuser.php?q="+str,true);
    xmlhttp.send();
  }
}

	
	
	

function multiply(str) {
 
	if(str == "")
		
		{
			document.getElementById("amount").value == "";
			return;
		}
	
		
else {   
		var qty =  parseInt(document.getElementById("qty").value) ;
		var total_amount = parseInt (document.getElementById("unit_p").value);
		
		
	var sum = qty*total_amount;
	document.getElementById("amount").value = sum;
		}   
		  
 
   
}
</script>
	
		
	
</head>
	
<style>
	
			
	body, html {
background-color:blue;
		
}

	
	</style>	
<body>

<form action="dashboardmodify.php" method="post">
	
<select name="users" onchange="showUser(this.value)" id="product">
  <option value="">Select a person:</option>
  <option value="type and print">type and print</option>
  <option value="PhotocopyA4">Photocopy</option>
 
  </select>

<br> 
<div id="txtHint" style="color: white"><b>Person info will be listed here...</b>
	
	</div>
	
	<label>amount</label> <input type="text" value = "" name="amount" id="amount">
	<label>Qty</label>  <input type="number" value = "" name="qty"  id="qty" onkeyup="multiply(this.value)"  >
	
	<input type="submit" name="A" onClick="multiply()" >
	
		<input type="button" name="A" value="multiply" onClick="multiply()">
	
	</form>
	

</body>
</html>