<?php
require_once('config.php');

function insert_notification_log_send($site_cd, $row, $tkn_site, $tokenlist, $RowID,$send_status,$send_error,$audit_user){
	global $conn;
	
	
	//echo '<pre>'; print_r($tokenlist); echo '</pre>';	
	//echo '<pre>'; print_r($RowID); echo '</pre>';
	//echo '<pre>'; print_r($send_status); echo '</pre>';
	//echo '<pre>'; print_r($audit_user); echo '</pre>';

	
	$insert_ntf_send = true;
	
	
	$sql_insert_ntf_log_send = "	INSERT ntf_log_send (	site_cd,				mst_RowID,				ntf_log_send_curr_site,	ntf_log_send_tkn_id,	tkn_rowid,			
															ntf_log_send_status, 	ntf_log_send_error,		audit_user,				audit_date)

							VALUES 
														(	?,						?,						?,						?,						?,						
															?,						?,						?,						getdate())";

	$params_insert_ntf_log_send = array(					$site_cd,					$row,					$tkn_site,				$tokenlist,				$RowID,
															$send_status,				$send_error,			$audit_user);
	


	$stmt_insert_ntf_log_send = sqlsrv_query( $conn, $sql_insert_ntf_log_send, $params_insert_ntf_log_send);	
	
	if( !$stmt_insert_ntf_log_send ) {
	$error_message = "Error (INSERT Table ntf_log_send )";
	returnError($error_message);
	die( print_r( sqlsrv_errors(), true));
	
	$insert_ntf_send = false;
		
	}
	sqlsrv_free_stmt($stmt_insert_ntf_log_send);
	
	
	return $insert_ntf_send;
}


?>