<?php 
	require_once('../Connections/conn_ama.php'); 
	include("../../../../../../functions/functions.php");    
	
	$curr_time = date("Y-m-d H:i:s");

	if (!isset($_SESSION)) {
	  session_start();
	}

	if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "add-beneficiary")) {

											$insertSQL = sprintf("INSERT INTO scholarshipbeneficiaries ( indexno, fname, mname, lname, programme, email) VALUES (%s, %s, %s, %s, %s, %s)",	
											GetSQLValueString(trim($_POST['indexno']), "text"),
											GetSQLValueString($_POST['fname'], "text"),
											GetSQLValueString($_POST['mname'], "text"),
											GetSQLValueString($_POST['lname'], "text"),
											GetSQLValueString($_POST['programme'], "text"),
											GetSQLValueString($_POST['email'], "text"));

	  	$Result1 = mysqli_query($conn_ama, $insertSQL) or die(mysqli_error($conn_ama));
	  		//$newsID = mysqli_insert_id($conn_ama);
		  if($Result1){

				
				  echo "datasent";

			 }
			else{
				echo "notset";
			}
	}

 ?>