<?php
    session_start();
	include('dbconnection.php');
    date_default_timezone_set('Asia/Kolkata');
	$date=date("d-m-Y h:i:s A");
	
	$json_decoded = json_decode($_SESSION['srinivasa']);

    //echo $json_decoded[0];
	$firstname=$json_decoded[0];
	$email=$json_decoded[1];
	$phone=$json_decoded[2];
	$amount=$json_decoded[3];
	$address=$json_decoded[4];
	$txnid=$json_decoded[5];
	
	$sql="insert into transaction(trnno,amount,name,email,mobile,address,date)value('$txnid','$amount','$firstname','$email','$phone','$address','$date')";
	
	$result=mysql_query($sql);
	if($result!=NULL)
	{
		$url="success.php?txnid=".$txnid;
		echo '<script language="javascript">location.href=\'' . $url . '\'</script>';
	}
	else
	{
		$url="success.php?txnid=".$txnid;
	    echo '<script language="javascript">location.href=\'' . $url . '\'</script>';
	}
	
?>