<?php
echo "<?phpxml version=\"1.0\" encoding=\"UTF-8\"?>";
?>
<vxml version="2.1">
 <form>
  <block>
  	<prompt>

<?php
	$acode=$_GET['account_number'];
	$pin=$_GET['pin'];
	include('../db.inc.php');
	$sql=mysqli_query($connectionString ,"SELECT * FROM users WHERE number='$acode' AND pin='$pin'");
	if(mysqli_num_rows($sql) == 0) {
		echo "You entered an invalid Account number or pin. Please try again. Goodbye!";
	}
	else {
		$user=mysqli_fetch_array($sql, MYSQLI_ASSOC);
		$status=$user['status'];
		$firstname=$user['firstname'];
		$lastname=$user['lastname'];
		echo "<sentence>Hello <prosody rate=\"-10%\">$firstname $lastname</prosody></sentence>".
		      "<sentence>Welcome to your account</sentence>";
		echo "<sentence>Your account status is <prosody rate=\"-20%\">$status</prosody> </sentence>";
		}
	
?>
  </prompt>
  <goto next="../nw.vxml#goodbye"/>
  </block>
</form>
</vxml>
