ID;
}, $data->data));
$sql = "UPDATE apps.yty_g_prc_modifier_list_tl
SET approval_flag = 'P',
submitted_date = sysdate
WHERE period = :period
AND currency_code = :currency
AND NVL(approval_flag,'N') IN ('N','R')
AND created_by = :userid
AND id in (".$id_selected.")";
$sqlarr = oci_parse($dbcon , $sql);
oci_bind_by_name($sqlarr, ':period', $data->period->ID);
oci_bind_by_name($sqlarr, ':currency', $data->currency->ID);
oci_bind_by_name($sqlarr, ':userid', $data->userid);
$r = oci_execute($sqlarr, OCI_NO_AUTO_COMMIT);
if (!$r) {
$e = oci_error($sqlarr);
$errorMsg = json_encode($e['message']);
goto finalStep;
}
$sql = "SELECT emp_id, employee_name, email_id
FROM production.employee_master
WHERE emp_id = :userid";
$sqlarr = oci_parse($dbcon , $sql);
oci_bind_by_name($sqlarr, ':userid', $data->userid);
$r = oci_execute($sqlarr);
if (!$r) {
$e = oci_error($sqlarr);
$resMsg = json_encode($e['message']);
}
oci_fetch_all($sqlarr, $rows_emp, null, null, OCI_FETCHSTATEMENT_BY_ROW);
//Approver Email
//$senderEmail = 'reyndo.frenliedo@ytygroup.com.my,satish.madala@ytygroup.com.my';
$senderEmail = 'suresh.bhalla@ytygroup.com.my,laura.chong@ytygroup.com.my';
$html='
|
|
|
|
|
Dear Approver,
Your kind approval is sought on the quotation price list for '.$data->period->ID.'. Please login to Pricing system to respond.
Sincerely, YTY Workflow
Note: This message is auto-generated so please do not respond to this email. |
|
|
|
|
|
|
|
';
$mailSubject="Request for quotation price list for ".$data->period->ID;
$strInsertEmailQuery = "BEGIN
ytycustom.set_notification.generate(ytycustom.set_notification.get_id, --no change
'EMAIL', --no change
'".$senderEmail."', --to email id
NULL, --cc email id (Null for none)
NULL, --attachment file path, let it be null for the time being
'".$mailSubject."', --Email Subject
'".$html."', --Email body (in html format)
'HTML', --no change
SYSDATE, --no change
'ORACLE PRICING', --Claim system (will change later on)
Null --bcc email id (Null for none)
);
END;";
$insertEmailQuery = oci_parse($dbcon, $strInsertEmailQuery);
oci_execute($insertEmailQuery);
//Sender Email
$html1='
|
|
|
|
|
Dear '.$rows_emp[0]["EMPLOYEE_NAME"].',
Your quotation price list for '.$data->period->ID.' is sent for Approval.
Sincerely, YTY Workflow
Note: This message is auto-generated so please do not respond to this email. |
|
|
|
|
|
|
|
';
$mailSubject="Request for quotation price list for ".$data->period->ID;
$strInsertEmailQuery1= "BEGIN
ytycustom.set_notification.generate(ytycustom.set_notification.get_id, --no change
'EMAIL', --no change
'".$rows_emp[0]["EMAIL_ID"]."', --to email id
NULL, --cc email id (Null for none)
NULL, --attachment file path, let it be null for the time being
'".$mailSubject."', --Email Subject
'".$html1."', --Email body (in html format)
'HTML', --no change
SYSDATE, --no change
'ORACLE PRICING', --Claim system (will change later on)
Null --bcc email id (Null for none)
);
END;";
$insertEmailQuery1 = oci_parse($dbcon, $strInsertEmailQuery1);
oci_execute($insertEmailQuery1);
finalStep:
$result = [];
if ($errorMsg == "") {
oci_commit($dbcon);
$result[] = [
"message" => "Success",
"id" => $newid
];
} else {
oci_rollback($dbcon);
$result[] = [
"message" => $errorMsg,
"id" => ""
];
}
print json_encode($result);
?>