function smart_issueRefund($values, $action) { global $adminInfo; $sql = "Select * FROM `cs_callnotes` WHERE note_id = '" . $values['append'] . "'"; $result = sql_query_read($sql) or dieLog(mysql_error() . " ~ {$sql}"); $callNoteInfo = mysql_fetch_assoc($result); if ($adminInfo['li_level'] == 'full') { require_once '../includes/int.refund.php'; $sql = "Select * FROM `cs_callnotes` WHERE note_id = '" . $values['append'] . "'"; $result = sql_query_read($sql) or dieLog(mysql_error() . " ~ {$sql}"); $callNoteInfo = mysql_fetch_assoc($result); $sql = "Select * from `cs_transactiondetails` where transactionId = '" . $callNoteInfo['transaction_id'] . "'"; $result = sql_query_read($sql) or dieLog(mysql_error() . " ~ {$sql}"); $transInfo = mysql_fetch_assoc($result); $response = execute_refund($transInfo, $callNoteInfo['service_notes'] . ": " . $callNoteInfo['customer_notes']); $error_msg = "success"; if ($response['success'] == false) { $error_msg = "ERROR: Refund Not successful ~ " . $response['errormsg']; } return array("action" => "Transaction ID " . $transInfo['reference_number'] . " refund attempted:", "status" => "{$error_msg}"); } return array("action" => "Transaction ID " . $transInfo['reference_number'] . " refund attempted:", "status" => "failed. insufficient privilages."); }
$headerInclude = "customerservice"; include "includes/header.php"; include "includes/message.php"; if ($_POST['Action'] == "Delete" && $adminInfo['li_level'] == 'full') { $sql = "DELETE FROM `cs_callnotes` WHERE note_id = '" . $_POST['note_id'] . "'"; $result = mysql_query($sql, $cnn_cs) or dieLog(mysql_errno() . ": " . mysql_error() . "<BR>Cannot execute query"); } if ($_POST['Action'] == "Refund" && $adminInfo['li_level'] == 'full') { $sql = "Select * FROM `cs_callnotes` WHERE note_id = '" . $_POST['note_id'] . "'"; $result = mysql_query($sql) or dieLog(mysql_error() . " ~ {$sql}"); $callNoteInfo = mysql_fetch_assoc($result); $sql = "Select * from `cs_transactiondetails` where transactionId = '" . $callNoteInfo['transaction_id'] . "'"; $result = mysql_query($sql) or dieLog(mysql_error() . " ~ {$sql}"); $transInfo = mysql_fetch_assoc($result); require '../includes/refundIntegration.php'; $response = execute_refund($transInfo, $callNoteInfo['service_notes']); if ($response['success'] == false) { $error_msg = "ERROR: Refund Not successful ~ " . $response['errormsg']; } } if ($_POST['Action'] == "Mark As Refunded" && $adminInfo['li_level'] == 'full') { $sql = "Select * FROM `cs_callnotes` WHERE note_id = '" . intval($_POST['note_id']) . "'"; $result = mysql_query($sql) or dieLog(mysql_error() . " ~ {$sql}"); $callNoteInfo = mysql_fetch_assoc($result); $sql = "update `cs_transactiondetails` set cancelstatus='Y' where transactionId = '" . $callNoteInfo['transaction_id'] . "'"; $result = mysql_query($sql) or dieLog(mysql_error() . " ~ {$sql}"); $error_msg = "Refund Marked (Note: No email sent out) "; } if ($_POST['Action'] == "Remove Refunded Mark" && $adminInfo['li_level'] == 'full') { $sql = "Select * FROM `cs_callnotes` WHERE note_id = '" . intval($_POST['note_id']) . "'"; $result = mysql_query($sql) or dieLog(mysql_error() . " ~ {$sql}");