<?php
$servername = "localhost";
$username = "savarnai_payment";
$password = "techno@123";
$dbname = "savarnai_payment_db";

// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
  die("Connection failed: " . $conn->connect_error);
}

	$s=$_SERVER["SERVER_NAME"];
$school_name= strstr($s, '.', true);

          
    $txnid=$school_name."_".$_REQUEST['txnid'];
   

    $sql="select pay_type,txnid,school_name,idno,class,last_month,month,fee_amt, session,pay_type from mss_pay_log where txnid='$txnid'";

$result = $conn->query($sql);

if ($result->num_rows > 0) {
  // output data of each row
  while($rowc = $result->fetch_assoc()) 
	{
    	$jsonc[]=array("pay_type"=>$rowc['pay_type'],"txnid"=>$rowc['txnid'], "school_name"=>$rowc['school_name'],"idno"=>$rowc['idno'],"class"=>$rowc['class'],"last_month"=>$rowc['last_month'],"month"=>$rowc['month'],"fee_amt"=>$rowc['fee_amt'],"session"=>$rowc['session']);
	  
        //$json['status']=1;
		
	}  
	
	
	
	
	$json['data']=$jsonc;
	

	echo json_encode($json);
	}
	else
	{
	   	echo json_encode(array('status' => 0));
	}
	
	


?>