Location: PHPKode > projects > Bug Jr. Support System > dist/index_events.php
<?php
//BindEvents Method @1-0705220C
function BindEvents()
{
    global $support;
    $support->ds->CCSEvents["BeforeBuildInsert"] = "support_ds_BeforeBuildInsert";
}
//End BindEvents Method

function support_ds_BeforeBuildInsert() { //support_ds_BeforeBuildInsert @4-9045D1A8

//Custom Code @13-2A29BDB7
// -------------------------
global $support;
$nowtime = mktime();
$misc = rand(5,330);
$support->ds->support_status->SetValue(0);
$support->ds->support_opened_datetime->SetValue($nowtime);
$support->ds->support_ticket_number->SetValue($misc + $nowtime);
$support->ds->Hidden1->SetValue(0);
$mailfrom = "hide@address.com";
$mailto = $support->ds->support_customer_email->Value;
$mailsubject = "Support Ticket Information";
$body1 = "Thank you for submitting a support request.  Your support ticket number is ";
$body1a = $support->ds->support_ticket_number->Value;
$body2 = " Return to the page where you submitted your request to check on the ticket status anytime";
$body3 = " - Help Desk Support Team.";
$mailbody = $body1 . $body1a . $body2 . $body3;
$additional_headers = "From: $from\nReply-To: $from";
mail($mailto, $mailsubject, $mailbody, $additional_headers);
// -------------------------
//End Custom Code

//Validate Email @29-A331F168
    global $support;
    if (strlen($support->support_customer_email->GetText()) && !preg_match("/^[\w\.-]{1,}\@([\da-zA-Z-]{1,}\.){1,}[\da-zA-Z-]+$/", $support->support_customer_email->GetText()))
    {
        $support->support_customer_email->Errors->addError("Not A Valid E-mail Address");
    }
//End Validate Email



} //Close support_ds_BeforeBuildInsert @4-FCB6E20C





?>
Return current item: Bug Jr. Support System