* SPDX-License-Identifier: AGPL-3.0-only
************************************/
global $adb,$table_prefix;
$cvid = vtlib_purify($_REQUEST["cvid"]);
$cvmodule = vtlib_purify($_REQUEST["cvmodule"]);
$mode = $_REQUEST["mode"];
$subject = $_REQUEST["subject"];
$body = $_REQUEST["body"];
if($cvid != "")
{
if($mode == "new")
{
$customactionsql = "insert into ".$table_prefix."_customaction(cvid,subject,module,content) values (?,?,?,?)";
$customactionparams = array($cvid, $subject, $cvmodule, $body);
$customactionresult = $adb->pquery($customactionsql, $customactionparams);
if($customactionresult == false)
{
include('modules/VteCore/header.php'); //crmv@30447
$errormessage = "Error Message
- Error while inserting the record
" ;
echo $errormessage;
}
}elseif($mode == "edit")
{
$updatecasql = "update ".$table_prefix."_customaction set subject=?, content=? where cvid=?";
$updatecaresult = $adb->pquery($updatecasql, array($subject, $body, $cvid));
if($updatecaresult == false)
{
include('modules/VteCore/header.php'); //crmv@30447
$errormessage = "Error Message
- Error while inserting the record
" ;
echo $errormessage;
}
}
}
header("Location: index.php?action=index&module=$cvmodule&viewname=$cvid");
?>