PageCompThird_db_num); } function PageCompPageMainCodeWithForm() { global $oTemplConfig, $site; $sActionText = ''; $aForm = array( 'form_attrs' => array( 'id' => 'post_us_form', 'action' => $_SERVER['PHP_SELF'], 'method' => 'post', ), 'params' => array ( 'db' => array( 'submit_name' => 'do_submit', ), ), 'inputs' => array( 'name' => array( 'type' => 'text', 'name' => 'name', 'caption' => _t('_Your name'), 'required' => true, ), 'email' => array( 'type' => 'text', 'name' => 'email', 'caption' => _t('_Your email'), 'required' => true, 'checker' => array( 'func' => 'email', 'error' => _t( '_Incorrect Email' ) ), ), 'message_subject' => array( 'type' => 'text', 'name' => 'subject', 'caption' => _t('_message_subject'), 'required' => true, ), 'message_text' => array( 'type' => 'textarea', 'name' => 'body', 'caption' => _t('_Message text'), 'required' => true, ), 'captcha' => array( 'type' => 'captcha', 'caption' => _t('_Enter what you see:'), 'name' => 'securityImageValue', 'required' => true, 'checker' => array( 'func' => 'captcha', 'error' => _t( '_Incorrect Captcha' ), ), ), 'submit' => array( 'type' => 'submit', 'name' => 'do_submit', 'value' => _t('_Submit'), ), ), ); $oForm = new BxTemplFormView($aForm); $oForm->initChecker(); if ( $oForm->isSubmittedAndValid() ) { $sSenderName = process_pass_data( $_POST['name'], 1 ); $sSenderEmail = process_pass_data( $_POST['email'], 1 ); $sLetterSubject = process_pass_data( $_POST['subject'], 1 ); $sLetterBody = process_pass_data( $_POST['body'], 1 ); $sLetterBody = $sLetterBody . "\r\n" . '============' . "\r\n" . _t('_from') . ' ' . $sSenderName . "\r\n" . 'with email ' . $sSenderEmail; if (sendMail($site['email'], $sLetterSubject, $sLetterBody)) { $sActionText = MsgBox( _t('_ADM_PROFILE_SEND_MSG') ); } else { $sActionText = MsgBox( _t('_Email sent failed') ); } } $sForm = $sActionText . $oForm->getCode(); return DesignBoxContent(_t('_CONTACT_H1'), $sForm, $oTemplConfig->PageCompThird_db_num); } ?>