Documentation

SetEvent

bool
CFormResult::SetEvent(
 int result_id,
 string event1 = false,
 string event2 = false,
 string event3 = false,
 mixed money = "",
 mixed currency = "",
 mixed goto = "",
 mixed chargeback = "N"
)

The method creates an event in the "Statistics" module. Returns true on success, otherwise returns false. Non-static method.

Parameters

Parameter Description
result_id ID of the result.
event1 The event type identifier - event1.
Optional. "false" by default (which means "form").
event2 The event type identifier - event2.
Optional. "false" by default (which means the symbol identifier of the web form).
event3 The event type identifier - event3.
Optional. "false" by default (which means link to the administrative page for viewing the result result_id).
money The event amount of money.
Optional. Default is "".
currency Three character currency identifier of money.
Optional. Empty by default.
chargeback Setting this parameter to "Y" causes the amount of money to be registered as the negative value in the module.
Optional. Empty by default.

Example


<?
$RESULT_ID = 189; // result ID

// create event in the "Statistics" module
if (CFormResult::SetEvent($RESULT_ID))
{
    echo "Event successfully created.";
}
else // error
{
    global $strError;
    echo $strError;
}
?>
© «Bitrix24», 2001-2024
Up