<?php 

$paymentInfoShow = "";
$sqlPaymentInfo = "select payments.id, payments_paymenttype_bridge.ref_no, payment_type.payment_type_desc from payments 
				inner join payments_paymenttype_bridge on payments.id = payments_paymenttype_bridge.payment_id
				inner join payment_type on payments_paymenttype_bridge.payment_type_id = payment_type.id where payments.id = $payment_id
				";
$runPaymentInfo = mysqli_query($link, $sqlPaymentInfo);
if($runPaymentInfo === FALSE){
	die(mysqli_error($link));
}
$countRowPaymentInfo = mysqli_num_rows($runPaymentInfo);
if($countRowPaymentInfo == 1 ){
	$resultPaymentInfo = mysqli_fetch_assoc($runPaymentInfo);
	$payment_type_desc = $resultPaymentInfo["payment_type_desc"];
	$ref_no = $resultPaymentInfo["ref_no"];
	if($payment_type_desc != 'Cash')
		$paymentInfoShow = "(". $payment_type_desc . "-Ref. No: " . $ref_no .")";
	
}
/* if(strpos($info, 'payment') !== false)
		$paymentInfoShow = "(". $payment_type_desc . "-Ref. No: " . $ref_no .")"; */
?>