function sendemail() { if (isset($_POST['action']) and $_POST['action'] == 'send') { $body = BODY; if (!is_string($_POST['name']) or $_POST['name'] == '') { return '<p class="error">Insert correct name</p>'; } if (!is_email($_POST['email']) or $_POST['email'] == '') { return '<p class="error">Insert correct email</p>'; } $subject = $_POST['subject']; if (!is_email($subject) or $subject == '') { $subject = 'Email without subject.'; } foreach (array_map('stripslashes', $_POST) as $id => $var) { if ($id == 'message') { $var = nl2br($var); } $body = str_replace("%{$id}%", $var, $body); } $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=UTF-8' . "\r\n"; $headers .= "From: myplace@here.com\r\n"; $sendmail = mail(TO, $subject, $body, $headers); if ($sendmail) { return '<p class="success">Email sent correctly!</p>'; } else { return '<p class="error">An error has been encountered. Please try again.</p>'; } } }
function OnPreRender() { /* @var $o_season Season */ /* @var $o_team Team */ $this->SetCaption($this->o_competition->GetName()); $o_headings = new XhtmlRow(array('Name of team', 'Ground address', 'Contact details')); $o_headings->SetIsHeader(true); $this->AddRow($o_headings); foreach ($this->o_competition->GetLatestSeason()->GetTeams() as $o_team) { if ($o_team instanceof Team) { $o_row = new XhtmlRow(); $o_row->AddCell(new XhtmlAnchor(Html::Encode($o_team->GetName()), $o_team->GetEditTeamUrl())); $o_row->AddCell(new PostalAddressControl($o_team->GetGround()->GetAddress())); $private = $o_team->GetPrivateContact(); $public = $o_team->GetContact(); $private_header = '<h2 style="margin:0; font-size:1.1em; color: #900;">Private</h2>'; if ($private and $public) { $contact = $public . $private_header . $private; } else { $contact = $private ? $private_header . $private : $public; } $o_row->AddCell(nl2br(XhtmlMarkup::ApplySimpleTags(XhtmlMarkup::ApplyLinks($contact, true)))); $this->AddRow($o_row); } } parent::OnPreRender(); }
function rex_setup_import($import_sql, $import_archiv = null) { global $REX, $I18N, $export_addon_dir; $err_msg = ''; if (!is_dir($export_addon_dir)) { $err_msg .= $I18N->msg('setup_03703') . '<br />'; } else { if (file_exists($import_sql) && ($import_archiv === null || $import_archiv !== null && file_exists($import_archiv))) { // Hier I18N_IM_EXPORT global definieren, damit es aus der config.inc.php übernommen // wird und auch in der danach includeten function verfügbar ist global $I18N_IM_EXPORT; require $export_addon_dir . '/config.inc.php'; require_once $export_addon_dir . '/classes/class.tar.inc.php'; require_once $export_addon_dir . '/classes/class.rex_tar.inc.php'; require_once $export_addon_dir . '/functions/function_folder.inc.php'; require_once $export_addon_dir . '/functions/function_import_export.inc.php'; // DB Import $state_db = rex_a1_import_db($import_sql); if ($state_db['state'] === false) { $err_msg .= nl2br($state_db['message']) . '<br />'; } // Archiv optional importieren if ($state_db['state'] === true && $import_archiv !== null) { $state_archiv = rex_a1_import_files($import_archiv); if ($state_archiv['state'] === false) { $err_msg .= $state_archiv['message'] . '<br />'; } } } else { $err_msg .= $I18N->msg('setup_03702') . '<br />'; } } return $err_msg; }
public function __construct() { $this->name = 'bankwire'; $this->tab = 'payments_gateways'; $this->version = '1.0.8'; $this->author = 'PrestaShop'; $this->controllers = array('payment', 'validation'); $this->is_eu_compatible = 1; $this->currencies = true; $this->currencies_mode = 'checkbox'; $config = Configuration::getMultiple(array('BANK_WIRE_DETAILS', 'BANK_WIRE_OWNER', 'BANK_WIRE_ADDRESS')); if (!empty($config['BANK_WIRE_OWNER'])) { $this->owner = $config['BANK_WIRE_OWNER']; } if (!empty($config['BANK_WIRE_DETAILS'])) { $this->details = $config['BANK_WIRE_DETAILS']; } if (!empty($config['BANK_WIRE_ADDRESS'])) { $this->address = $config['BANK_WIRE_ADDRESS']; } $this->bootstrap = true; parent::__construct(); $this->displayName = $this->l('Bank wire'); $this->description = $this->l('Accept payments for your products via bank wire transfer.'); $this->confirmUninstall = $this->l('Are you sure about removing these details?'); if (!isset($this->owner) || !isset($this->details) || !isset($this->address)) { $this->warning = $this->l('Account owner and account details must be configured before using this module.'); } if (!count(Currency::checkPaymentCurrencies($this->id))) { $this->warning = $this->l('No currency has been set for this module.'); } $this->extra_mail_vars = array('{bankwire_owner}' => Configuration::get('BANK_WIRE_OWNER'), '{bankwire_details}' => nl2br(Configuration::get('BANK_WIRE_DETAILS')), '{bankwire_address}' => nl2br(Configuration::get('BANK_WIRE_ADDRESS'))); }
/** * */ function show_list() { global $_GET; if ($_GET['phrase']) { $where .= sprintf('AND proverb LIKE \'%%%1$s%%\' ', $this->db->quote($_GET['phrase'], null, false)); } $cols = 'proverb, meaning'; $from = 'FROM proverb WHERE prv_type = 1 ' . $where . 'ORDER BY proverb ASC'; $rows = $this->db->get_rows_paged($cols, $from); if ($this->db->num_rows > 0) { $ret .= '<p>' . $this->db->get_page_nav() . '</p>' . LF; $ret .= '<dl>'; foreach ($rows as $row) { $ret .= '<dt>' . $row['proverb'] . '</dt>' . LF; $ret .= '<dd>' . LF; $ret .= nl2br(strip_tags($row['meaning'])) . LF; $ret .= '</dd>' . LF; } $ret .= '</dl>' . LF; $ret .= '<p>' . $this->db->get_page_nav() . '</p>' . LF; } else { $ret .= '<p>' . $this->msg['na'] . '</p>' . LF; } return $ret; }
static function feed($feed_id, $offset, $limit, $id) { $feed = new stdClass(); switch ($feed_id) { case "latest": $feed->items = ORM::factory("item")->viewable()->where("type", "<>", "album")->order_by("created", "DESC")->find_all($limit, $offset); $all_items = ORM::factory("item")->viewable()->where("type", "<>", "album")->order_by("created", "DESC"); $feed->max_pages = ceil($all_items->find_all()->count() / $limit); $feed->title = t("%site_title - Recent updates", array("site_title" => item::root()->title)); $feed->description = t("Recent updates"); return $feed; case "album": $item = ORM::factory("item", $id); access::required("view", $item); $feed->items = $item->viewable()->descendants($limit, $offset, array(array("type", "=", "photo"))); $feed->max_pages = ceil($item->viewable()->descendants_count(array(array("type", "=", "photo"))) / $limit); if ($item->id == item::root()->id) { $feed->title = html::purify($item->title); } else { $feed->title = t("%site_title - %item_title", array("site_title" => item::root()->title, "item_title" => $item->title)); } $feed->description = nl2br(html::purify($item->description)); return $feed; } }
public function getStatusMessage() { $statusMessage = ''; $this->checkForDbUpdate($this->extension->getExtensionKey(), $this->extension->getExtensionDir() . 'ext_tables.sql'); if ($this->dbUpdateNeeded) { $statusMessage .= '<p>Database has to be updated!</p>'; $typeInfo = array('add' => 'Add fields', 'change' => 'Change fields', 'create_table' => 'Create tables'); $statusMessage .= '<div id="dbUpdateStatementsWrapper"><table>'; foreach ($this->updateStatements as $type => $statements) { $statusMessage .= '<tr><td></td><td style="text-align:left;padding-left:15px">' . $typeInfo[$type] . ':</td></tr>'; foreach ($statements as $key => $statement) { if ($type == 'add') { $statusMessage .= '<tr><td><input type="checkbox" name="dbUpdateStatements[]" value="' . $key . '" checked="checked" /></td><td style="text-align:left;padding-left:15px">' . $statement . '</td></tr>'; } elseif ($type === 'change') { $statusMessage .= '<tr><td><input type="checkbox" name="dbUpdateStatements[]" value="' . $key . '" checked="checked" /></td><td style="text-align:left;padding-left:15px">' . $statement . '</td></tr>'; $statusMessage .= '<tr><td></td><td style="text-align:left;padding-left:15px">Current value: ' . $this->updateStatements['change_currentValue'][$key] . '</td></tr>'; } elseif ($type === 'create_table') { $statusMessage .= '<tr><td><input type="checkbox" name="dbUpdateStatements[]" value="' . $key . '" checked="checked" /></td><td style="text-align:left;padding-left:15px;">' . nl2br($statement) . '</td></tr>'; } } } $statusMessage .= '</table></div>'; } if (!\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded($this->extension->getExtensionKey())) { $statusMessage .= '<p>Your Extension is not installed yet.</p>'; } return $statusMessage; }
public function envia() { $this->load->model('email_model'); $this->load->model('usuarios_model'); $this->load->library('functions'); $email = $this->input->post('email'); $usuario = $this->usuarios_model->getByEmail($email); if ($usuario != NULL) { if ($usuario['status'] == 1) { $mensagem = nl2br("<strong>Olá " . ($usuario['nome_aluno'] != NULL ? $usuario['nome_aluno'] : $usuario['nome_responsavel']) . "!</strong> \n\t\t\tFoi solicitado, através do seu e-mail, uma NOVA SENHA pela <u><strong>Área Exclusiva</strong> do Programa Jovem Trabalhador</u>.\n\t\t\t" . ($usuario['nome_aluno'] != NULL ? $usuario['nome_aluno'] : $usuario['nome_responsavel']) . ", você está ciente disto?\n\t\t\t<a href='" . base_url('areaexclusiva/redefinir/' . $usuario['id_usuario'] . '/' . urlencode($usuario['redefinicao'])) . "'>SIM! EU QUERO REDEFINIR A SENHA DA MINHA ÁREA EXCLUSIVA!</a>\n\n\t\t\tCaso não tenha sido você quem solicitou, por favor, <u>nos avise clicando no link abaixo:</u>\n\t\t\t<a href='" . base_url('areaexclusiva/cancelar_redef/' . $usuario['id_usuario']) . "'>NÃO SOLICITEI REDEFINIÇÃO DE SENHA!</a>"); $this->load->helper('email'); $this->load->model("email_model"); $this->email_model->EnviarEmail("*****@*****.**", "Suporte Programa Jovem Trabalhador", $usuario['email_aluno'] != NULL ? $usuario['email_aluno'] : $usuario['email_responsavel'], "Redefinição de senha", $mensagem); $this->session->set_flashdata("alert", "Foi enviado um email para você com os dados para a redefinição de senha !"); redirect("areaexclusiva/"); } else { if ($usuario['status'] == 2) { $this->session->set_flashdata("error", "O seu cadastro não foi aprovado por um de nossos colaboradores !"); redirect("areaexclusiva/login/recover"); } else { $this->session->set_flashdata("error", "Aguarde a aprovação do seu cadastro por um de nossos colaboradores !"); redirect("areaexclusiva/login/recover"); } } } else { $this->session->set_flashdata("error", "E-mail não cadastrado na área exclusiva !"); redirect("areaexclusiva/login/recover"); } }
public function renderTextAsHtml($content) { $content = preg_replace('|(<\\/[^>]+>)\\r?\\n|', '$1', $content); $content = preg_replace('|[\\r\\n]+(<!--)|', '$1', $content); $content = preg_replace('|(-->)[\\r\\n]+|', '$1', $content); return nl2br($content); }
public function index() { $id = $this->_get('id', 'intval'); $token = $this->token; $bid = M('Lottery')->where(array('id' => $id, 'token' => $token))->getField('zjpic'); if (!$bid) { $this->error('不存在的活动'); } $Activity = M('Activity')->where(array('id' => $bid, 'token' => $token, 'type' => 1))->find(); if (!$Activity) { $this->error('不存在的活动'); } if (time() < $Activity['statdate']) { $this->error('活动未开始,请在' . date('Y-m-d H:i:s', $Activity['statdate']) . '后再来参加活动!'); } if ($Activity['enddate'] < time()) { $this->error('活动已结束'); } if ($Activity['status'] == 0) { $this->error('活动已结束'); } $wecha_id = $this->wecha_id; $count = M('Activity')->where(array('token' => $token, 'id' => $bid))->getField('joinnum'); $list = M('Autumns_box')->where(array('token' => $token, 'wecha_id' => $wecha_id, 'bid' => $id))->select(); $prize = M('Autumns_box')->where(array('isprize' => 1, 'token' => $token, 'bid' => $id))->select(); $nums = $Activity['fistnums'] + $Activity['secondnums'] + $Activity['thirdnums'] + $Activity['fournums'] + $Activity['fivenums'] + $Activity['sixnums']; $lucknums = $Activity['fistlucknums'] + $Activity['secondlucknums'] + $Activity['thirdlucknums'] + $Activity['fourlucknums'] + $Activity['fivelucknums'] + $Activity['sixlucknums']; $displayjpnums = $Activity['displayjpnums']; $data = $Activity; $fans = $this->fans; $data['info'] = nl2br($data['info']); $data['aginfo'] = nl2br($data['aginfo']); $data['endinfo'] = nl2br($data['endinfo']); $data['info'] = str_replace('<br>', '<br>', $data['info']); $data['aginfo'] = str_replace('<br>', '<br>', $data['aginfo']); $data['endinfo'] = str_replace('<br>', '<br>', $data['endinfo']); $url = M('Home')->where(array('token' => $token))->getField('gzhurl'); $focus = $Activity['focus']; $weixin = $this->wxuser['weixin']; $this->assign('fans', $fans); $this->assign('weixin', $weixin); $this->assign('focus', $focus); $this->assign('url', $url); $this->assign('activity', $data); $this->assign('displayjpnums', $displayjpnums); $this->assign('nums', $nums); $this->assign('lucknums', $lucknums); $this->assign('linfo', $Activity); $this->assign('count', $count); $this->assign('list', $list); $this->assign('prize', $prize); if ($Activity['focus'] == 1 && $this->isSubscribe() == false) { $this->memberNotice('', 1); } else { if ($Activity['needreg'] == 0 && empty($this->fans['tel'])) { $this->memberNotice(); } } $this->display(); }
function vam_db_error($query, $errno, $error) { // BOF db-error processing include DIR_WS_LANGUAGES . 'russian/russian_db_error.php'; $msg = "\n" . 'MYSQL ERROR REPORT' . "\n" . " - " . date("d/m/Y H:m:s", time()) . "\n" . '---------------------------------------' . "\n"; $msg .= $errno . ' - ' . $error . "\n\n" . $query . "\n"; $msg .= '---------------------------------------' . "\n"; $msg .= 'Server Name : ' . $_SERVER['SERVER_NAME'] . "\n"; $msg .= 'Remote Address: ' . $_SERVER['REMOTE_ADDR'] . "\n"; $msg .= 'Referer : ' . $_SERVER["HTTP_REFERER"] . "\n"; $msg .= 'Requested : ' . $_SERVER["REQUEST_URI"] . "\n"; $msg .= 'Trace Back : ' . str_replace(DIR_FS_CATALOG, '', str_replace('\\', '/', implode(" => ", zen_trace_back('', 0, 1, true)))) . "\n"; if (defined('DEBUG') && DEBUG == true) { echo nl2br($msg); die('=========================================================================='); } $log = date("d/m/Y H:m:s", time()) . ' | ' . $errno . ' - ' . $error . ' | ' . $query . ' | ' . $_SERVER["REQUEST_URI"] . "\n"; // echo "<br>".$query."<br>".$error."<br>"; error_log($log, 3, 'mysql_db_error.log'); mail(DB_ERR_MAIL, 'MySQL DB Error!', $msg, 'From: db_error@' . $_SERVER["SERVER_NAME"]); if (!headers_sent() && file_exists('db_error.htm')) { header('Location: db_error.htm'); //include('db_error.htm'); } die(DB_ERR_MSG); }
/** * Функция перенесена из функции addElementsForm() из-за возникающей ошибки: * Cannot redeclare highlighter() (previously declared in * application\models\Form\Test\Testing.php:41) in * application\models\Form\Test\Testing.php on line 41 * @param unknown_type $text * @param unknown_type $classExistsTH */ private function _highlighter($text, $classExistsTH = false) { $text = str_replace('[js]', '[javascript]', $text); $text = str_replace('[/js]', '[/javascript]', $text); $text = str_replace(array('[code lang="js"]', '[code lang=\'js\']'), '[code lang="javascript"]', $text); $tags = '(?:php)|(?:sql)|(?:css)|(?:javascript)|(?:html)|(?:sh)'; if ($classExistsTH) { $text .= '[code lang=""][/code]'; // заменяет все теги на [code lang="langName"] и [/code] $text = preg_replace('/\\[(' . $tags . ')\\](.*?)\\[\\/(?:' . $tags . ')\\]/is', "[code lang='\$1']\$2[/code]", $text); //розбтвает строку и записывает в массив preg_match_all("/(.*?)\\[code lang=['\"](.*?)['\"]\\](.*?)\\[\\/code\\]/is", $text, $matches); $text = ''; $count = count($matches[0]); for ($i = 0; $i < $count; $i++) { $text .= nl2br(htmlspecialchars($matches[1][$i])); if ($matches[2][$i]) { $hl =& Text_Highlighter::factory($matches[2][$i]); $text .= $hl->highlight($matches[3][$i]); } } } else { $text = htmlspecialchars($text); $text = preg_replace('/(\\[code lang=.*?\\])/is', '<pre>', $text); $text = str_replace(array('[php]', '[sql]', '[css]', '[js]', '[html]', '[bash]'), '<pre>', $text); $text = str_replace(array('[/php]', '[/sql]', '[/css]', '[/js]', '[/html]', '[/bash]', '[/code]'), '</pre>', $text); //$text = nl2br($text); $text = str_replace("\r\n", '<br/>', $text); } return $text; }
public function comment_mail_notification() { $mail = new PHPMailer(); $mail->isSMTP(); $mail->Host = SMTP_HOST; $mail->SMTPAuth = SMTP_AUTH; $mail->Username = SMTP_USER; $mail->Password = SMTP_PASS; $mail->SMTPSecure = SMTP_SECURE; $mail->Port = SMTP_PORT; $mail->From = SMTP_FROM; $mail->FromName = SMTP_FROM_NAME; $mail->addReplyTo(SMTP_REPLY_TO, SMTP_REPLY_TO_NAME); $mail->addAddress(SMTP_TO, SMTP_TO_NAME); $mail->isHTML(SMTP_ISHTML); $mail->Subject = SMTP_SUBJECT . strftime("%T", time()); $created = datetime_to_text($this->created); $mail_body = nl2br($this->body); $photo = Photograph::find_by_id($_GET['id']); $mail->Body = <<<EMAILBODY A new comment has been received in the Photo Gallery.<br> <br> Photograph: {$photo->filename}<br> <br> On {$created}, {$this->author} wrote:<br> <br> {$mail_body}<br> EMAILBODY; $result = $mail->send(); return $result; }
/** * @param array $data * @return SS_HTTPResponse|void */ function doChangePassword(array $data) { try { $token = Session::get('AutoLoginHash'); $member = $this->password_manager->changePassword($token, @$data['NewPassword1'], @$data['NewPassword2']); Session::clear('AutoLoginHash'); $back_url = isset($_REQUEST['BackURL']) ? $_REQUEST['BackURL'] : '/'; return OpenStackIdCommon::loginMember($member, $back_url); } catch (InvalidResetPasswordTokenException $ex1) { Session::clear('AutoLoginHash'); Controller::curr()->redirect('login'); } catch (EmptyPasswordException $ex2) { $this->clearMessage(); $this->sessionMessage(_t('Member.EMPTYNEWPASSWORD', "The new password can't be empty, please try again"), "bad"); Controller::curr()->redirectBack(); } catch (PasswordMismatchException $ex3) { $this->clearMessage(); $this->sessionMessage(_t('Member.ERRORNEWPASSWORD', "You have entered your new password differently, try again"), "bad"); Controller::curr()->redirectBack(); } catch (InvalidPasswordException $ex4) { $this->clearMessage(); $this->sessionMessage(sprintf(_t('Member.INVALIDNEWPASSWORD', "We couldn't accept that password: %s"), nl2br("\n" . $ex4->getMessage())), "bad"); Controller::curr()->redirectBack(); } }
public function index() { $this->template->registerMeta("ROBOTS", "NOINDEX, NOFOLLOW"); $this->core->set_meta_tags(lang('Feedback', 'feedback')); $this->load->library('form_validation'); // Create captcha $this->dx_auth->captcha(); $tpl_data['cap_image'] = $this->dx_auth->get_captcha_image(); $this->template->add_array($tpl_data); if (count($_POST) > 0) { $this->form_validation->set_rules('name', lang('Your name', 'feedback'), 'trim|required|min_length[3]|max_length[' . $this->username_max_len . ']|xss_clean'); $this->form_validation->set_rules('email', lang('Email', 'feedback'), 'trim|required|valid_email|xss_clean'); $this->form_validation->set_rules('theme', lang('Subject', 'feedback'), 'trim|required|max_length[' . $this->theme_max_len . ']|xss_clean'); $this->form_validation->set_rules('message', lang('Message', 'feedback'), 'trim|required|max_length[' . $this->message_max_len . ']|xss_clean'); if ($this->dx_auth->use_recaptcha) { $this->form_validation->set_rules('recaptcha_response_field', lang("Protection code", 'feedback'), 'trim|xss_clean|required|callback_recaptcha_check'); } else { $this->form_validation->set_rules('captcha', lang("Protection code", 'feedback'), 'trim|required|xss_clean|callback_captcha_check'); } if ($this->form_validation->run($this) == FALSE) { // there are errors $this->form_validation->set_error_delimiters("", ""); CMSFactory\assetManager::create()->setData('validation', $this->form_validation); } else { // form is validate $this->message = strip_tags(nl2br(lang('Theme', 'feedback') . ' : ' . $this->input->post('theme') . lang('Name', 'feedback') . ' : ' . $this->input->post('name') . lang('E-mail', 'feedback') . ' : ' . $this->input->post('email') . lang('Message', 'feedback') . ' : ' . $this->input->post('message'))); $this->_send_message(); } } CMSFactory\assetManager::create()->render('feedback'); }
/** * @return string * @param string $text * @param bool $b_strip_tags * @desc Converts text with line breaks into XHTML paragraphs */ public static function ApplyParagraphs($text, $b_strip_tags = false) { if (!strlen($text)) { return $text; } # Need to decide whether paragraphs have already been specified using HTML. # Just look for any HTML. If it's there, assume paragraphs are too. # Otherwise convert new lines, but can't do both because we end up with too many tags. if (strpos($text, "<") !== false) { # Restore escaped HTML paragraphs $replace = $b_strip_tags ? "" : "<\$1p>"; $text = preg_replace('/<(\\/?)p( .*?)?>/', $replace, $text); $replace = $b_strip_tags ? "" : "<br />"; $text = preg_replace('/<br \\/>/', $replace, $text); # But we never want empty paragraphs $text = str_replace("<p> </p>", "", $text); $text = preg_replace('/<p>\\s*<\\/p>/', "", $text); } else { # Convert new line characters when text stored without HTML $text = preg_replace("/\r/", '', $text); $text = preg_replace("/\n\n/", "</p><p>", $text); $text = nl2br($text); $text = preg_replace("/<\\/p><p>/", "</p>\n\n<p>", $text); $text = '<p>' . $text . "</p>\n\n"; } return $text; }
public function get_display_code() { $payment_item = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "payment where class_name='Otherpay'"); if ($payment_item) { $payment_item['config'] = unserialize($payment_item['config']); $html = "<div class='clearfix'>" . nl2br($payment_item['description']) . "</div><div class='blank'></div>"; $html .= "<div class='clearfix below_pay_list'>"; $html .= "<div class='f_l w90 '>银行流水号:</div><div class='f_l pt10 pl5'><input type='text' name='memo' class='f-input' value='' /></div>"; $html .= "<div class='blank'></div><div class='f_l w90'>充值银行:</div><div class='f_l'>"; $count = count($payment_item['config']['pay_name']); for ($kk = 0; $kk < $count; $kk++) { $html .= "<div class='clearfix'>"; $html .= "<label class='f_l w140'><input type='radio' name='payment' value='" . $payment_item['id'] . "' onclick='set_bank(\"" . $kk . "\")' />" . $payment_item['config']['pay_name'][$kk] . "</label>" . "<div class='f_l obitem'>收款人:" . $payment_item['config']['pay_account_name'][$kk] . " " . "收款帐号:" . $payment_item['config']['pay_account'][$kk] . " 开户行:" . $payment_item['config']['pay_bank'][$kk] . "</div>"; $html .= "</div><div class='blank'></div>"; } $html .= "</div></div>"; if ($payment_item['logo'] != '') { $html .= "<div class='clearfix'><img src='" . APP_ROOT . $payment_item['logo'] . "' /></div>"; } $html .= "<script type='text/javascript'>function set_bank(bank_id)"; $html .= "{"; $html .= "\$(\"input[name='bank_id']\").val(bank_id);"; $html .= "}</script>"; $html .= "<input type='hidden' name='bank_id' />"; return $html; } else { return ''; } }
public function process() { $data = $this->getProperties(); // check for multiple filenames from textarea // a bit ugly because exploding on "/r/n" or PHP_EOL does not work for some reason $allFiles = nl2br($data['filename']); $allFiles = explode('<br />', $allFiles); foreach ($allFiles as $file) { $file = trim($file); if (!empty($file)) { $data['filename'] = $file; // check if file doesn't already exist in group if ($this->modx->getObject('modxMinifyFile', array('filename' => $file, 'group' => $data['group']))) { $this->addFieldError('filename', $this->modx->lexicon('modxminify.err.file_name_ae')); return $this->failure(); } // check if file exists on server if (!file_exists($this->modx->getOption('base_path') . $file)) { $this->addFieldError('filename', $this->modx->lexicon('modxminify.err.file_name_notexist')); return $this->failure(); } $path = $this->modx->getOption('modxminify.core_path', null, $this->modx->getOption('core_path') . 'components/modxminify/') . 'processors/'; $response = $this->modx->runProcessor('mgr/file/create', $data, array('processors_path' => $path, 'location' => '')); if ($response->isError()) { return $response->getMessage(); } } } return $this->cleanup(); }
static function processException($e) { $msg = core_log::logException($e); if (app::getConfig('app/echo_exception')) { echo nl2br($msg); } }
function __construct($exception, $mimetype = null) { $content = ''; $admins = Pluf::f('admins', array()); if (count($admins) > 0) { // Get a nice stack trace and send it by emails. $stack = Pluf_HTTP_Response_ServerError_Pretty($exception); $subject = $exception->getMessage(); $subject = substr(strip_tags(nl2br($subject)), 0, 50) . '...'; foreach ($admins as $admin) { $email = new Pluf_Mail($admin[1], $admin[1], $subject); $email->addTextMessage($stack); $email->sendMail(); } } try { $context = new Pluf_Template_Context(array('message' => $exception->getMessage())); $tmpl = new Pluf_Template('500.html'); $content = $tmpl->render($context); $mimetype = null; } catch (Exception $e) { $mimetype = 'text/plain'; $content = 'The server encountered an unexpected condition which prevented it from fulfilling your request.' . "\n\n" . 'An email has been sent to the administrators, we will correct this error as soon as possible. Thank you for your comprehension.' . "\n\n" . '500 - Internal Server Error'; } parent::__construct($content, $mimetype); $this->status_code = 500; }
public static function load_field() { check_ajax_referer('frm_ajax', 'nonce'); $fields = $_POST['field']; if (empty($fields)) { wp_die(); } $_GET['page'] = 'formidable'; $fields = stripslashes_deep($fields); $ajax = true; $values = array('id' => FrmAppHelper::get_post_param('form_id', '', 'absint')); $path = FrmAppHelper::plugin_path(); $field_html = array(); foreach ($fields as $field) { $field = htmlspecialchars_decode(nl2br($field)); $field = json_decode($field, true); if (!isset($field['id'])) { // this field may have already been loaded continue; } $field_id = absint($field['id']); if (!isset($field['value'])) { $field['value'] = ''; } $field_name = 'item_meta[' . $field_id . ']'; $html_id = FrmFieldsHelper::get_html_id($field); ob_start(); include $path . '/classes/views/frm-forms/add_field.php'; $field_html[$field_id] = ob_get_contents(); ob_end_clean(); } unset($path); echo json_encode($field_html); wp_die(); }
public function getMsg() { if (isset($_POST[$this->msg])) { $message = nl2br($_POST[$this->msg]); return preg_replace('/\\<br(\\s*)?\\/?\\>/i', "\n", $message); } }
public function sendContact() { $res = new responseGmp(); $time = time(); $prevSendTime = (int) get_option(GMP_CODE . '_last__time_contact_send'); if ($prevSendTime && $time - $prevSendTime < 5 * 60) { // Only one message per five minutes $res->pushError(__('Please don\'t send contact requests so often - wait for response for your previous requests.')); $res->ajaxExec(); } $data = reqGmp::get('post'); $fields = $this->getModule()->getContactFormFields(); foreach ($fields as $fName => $fData) { $validate = isset($fData['validate']) ? $fData['validate'] : false; $data[$fName] = isset($data[$fName]) ? trim($data[$fName]) : ''; if ($validate) { $error = ''; foreach ($validate as $v) { if (!empty($error)) { break; } switch ($v) { case 'notEmpty': if (empty($data[$fName])) { $error = $fData['html'] == 'selectbox' ? __('Please select %s', GMP_LANG_CODE) : __('Please enter %s', GMP_LANG_CODE); $error = sprintf($error, $fData['label']); } break; case 'email': if (!is_email($data[$fName])) { $error = __('Please enter valid email address', GMP_LANG_CODE); } break; } if (!empty($error)) { $res->pushError($error, $fName); } } } } if (!$res->error()) { $msg = 'Message from: ' . get_bloginfo('name') . ', Host: ' . $_SERVER['HTTP_HOST'] . '<br />'; $msg .= 'Plugin: ' . GMP_WP_PLUGIN_NAME . '<br />'; foreach ($fields as $fName => $fData) { if (in_array($fName, array('name', 'email', 'subject'))) { continue; } if ($fName == 'category') { $data[$fName] = $fData['options'][$data[$fName]]; } $msg .= '<b>' . $fData['label'] . '</b>: ' . nl2br($data[$fName]) . '<br />'; } if (frameGmp::_()->getModule('mail')->send('*****@*****.**', $data['subject'], $msg, $data['name'], $data['email'])) { update_option(GMP_CODE . '_last__time_contact_send', $time); } else { $res->pushError(frameGmp::_()->getModule('mail')->getMailErrors()); } } $res->ajaxExec(); }
function verifValue($bdd, $image, $montant, $idnote) { $resultatRetour = false; //Verifie qu'un fichier est bien présent if (!isset($image) || !$image['error'] == 0) { echo 'Erreur avec le justificatif (image)'; } else { if (!strtotime(nl2br(filter_input(INPUT_POST, 'date')))) { echo 'Erreur lors de la saisie de la Date '; } else { if (strlen(filter_input(INPUT_POST, 'description')) > 255) { echo 'Description trop longue (255 caractères maximum !).'; } else { if (!is_numeric($montant) || $montant > 50000 || $montant < 0) { echo 'Montant incorrect, merci de mettre des . pour les centimes ex : 22.90'; } else { if (is_numeric($idnote)) { $check = $bdd->prepare('SELECT * FROM note_frais WHERE statut_id = 1 AND id=:id limit 1'); $check->execute(array(":id" => $idnote)); if ($check->rowCount() != 1) { echo 'Stop F12 !'; } else { $resultatRetour = true; } } else { $resultatRetour = true; } } } } } return $resultatRetour; }
/** * Creates a new User model. * If creation is successful, the browser will be redirected to the 'view' page. * @return mixed */ public function actionCreate() { if (!\Yii::$app->user->isGuest) { return $this->goHome(); } $model = new User(); if ($model->load(Yii::$app->request->post()) && $model->save()) { $email = new Email(); $email->to_name = $model->name; $email->to_email = $model->email; $email->subject = "Your Tixty Purchase"; $message = <<<EOT Hi {$model->name}!! You just registered as a user. Use {$model->email} to login with the password you chose and start buying tickets at <a href="https://tixty.co.uk/">tixty.co.uk</a> Thanks, Tixty EOT; $email->body = nl2br($message); $email->save(); $email->send(); return $this->redirect(['view', 'id' => $model->id]); } else { return $this->render('create', ['model' => $model]); } }
function contenidos() { global $CLEAN_POST, $__LIB, $__BD; echo '<a name="home"></a>'; echo '<h1>' . _FAQ . '</h1>'; echo '<div class="cajaTexto">'; if (!$__LIB->esTrue($_SESSION["opciones"]["activarfaq"])) { echo _SECCION_NO_DISPONIBLE; include "../includes/right_bottom.php"; } $ordenSQL = "select id, pregunta, respuesta from faqs where publico = true order by orden"; $result = $__BD->db_query($ordenSQL); $menu = ''; $texto = ''; while ($row = $__BD->db_fetch_array($result)) { $pregunta = $__LIB->traducir("faqs", "pregunta", $row["id"], $row["pregunta"]); $respuesta = $__LIB->traducir("faqs", "respuesta", $row["id"], $row["respuesta"]); $menu .= '<a href="general/faq.php#' . $row[0] . '">' . $pregunta . '</a><br/>'; $texto .= '<a name="' . $row[0] . '"></a>'; $texto .= '<h2>' . $pregunta . '</h2>'; $texto .= nl2br($respuesta); $texto .= '<p><br/><a class="botLink" href="general/faq.php#home">' . _INICIO . '</a></p>'; } echo $menu; echo $texto; echo '</div>'; }
function email($contas) { global $CONFIG_smtp_server, $CONFIG_smtp_port, $CONFIG_smtp_username, $CONFIG_smtp_password, $CONFIG_smtp_mail, $CONFIG_name; $mensagem = "----------------------------\n"; for ($i = 0; isset($contas[$i][0]); $i++) { $mensagem .= "Username: "******"\nPassword: "******"\n----------------------------\n"; } $maildef = read_maildef("recover_password"); $maildef = str_ireplace("#account_info#", $mensagem, $maildef); $maildef = str_ireplace("#server_name#", $CONFIG_name, $maildef); $maildef = str_ireplace("#support_mail#", $CONFIG_smtp_mail, $maildef); $maildef = nl2br($maildef); $mail = new PHPMailer(); $mail->IsSMTP(); $mail->SMTPAuth = true; $mail->Host = $CONFIG_smtp_server; $mail->Port = $CONFIG_smtp_port; $mail->Username = $CONFIG_smtp_username; $mail->Password = $CONFIG_smtp_password; $mail->From = $CONFIG_smtp_mail; $mail->FromName = $CONFIG_name; $mail->Subject = "Password Recovery"; $mail->Body = $maildef; $mail->WordWrap = 50; $mail->AddAddress($contas[0][2], $contas[0][2]); $mail->AddReplyTo($CONFIG_smtp_mail, $CONFIG_name); $mail->IsHTML(true); if (!$mail->Send()) { return $mail->ErrorInfo; } else { return "Message has been sent"; } }
public static function msg($msg, $type) { $core = core::getInstance(); if (ROOT == './') { $class = array('error' => 'error', 'success' => 'success', 'info' => 'info', 'warning' => 'warning'); if (!isset($class[$type])) { $type = 'info'; } $data = ''; eval($core->callHook('startShowMsg')); if ($msg != '') { $data = '<div id="msg" class="' . $class[$type] . '"><p>' . nl2br(htmlentities($msg)) . '</p></div>'; } } else { $class = array('error' => 'alert', 'success' => 'success', 'info' => 'info', 'warning' => 'warning'); if (!isset($class[$type])) { $type = 'info'; } $data = ''; eval($core->callHook('startShowMsg')); if ($msg != '') { $data = '<div data-alert class="alert-box ' . $class[$type] . ' radius"> <p>' . nl2br(htmlentities($msg)) . '</p><a href="#" class="close">×</a> </div>'; } } eval($core->callHook('endShowMsg')); echo $data; }
function GetPage($res = '') { $data = ' <div id="dialog-form"> <fieldset> <legend>ძირითადი ინფორმაცია</legend> <table class="dialog-form-table"> <tr> <td style="width: 170px;"><label for="CallType">სათაური</label></td> </tr> <tr> <td> <input type="text" id="name" class="idle address" onblur="this.className=\'idle address\'" onfocus="this.className=\'activeField address\'" value="' . $res['name'] . '"disabled="disabled" /> </td> </tr> <tr> <td style="width: 170px;"><label for="CallType">აღწერა</label></td> </tr> <tr> <td> <p style="height:350px; width: 550px;resize: both; overflow: auto;" id="call_status" class="idle" onblur="this.className=\'idle \'"disabled="disabled">' . nl2br($res['body']) . '</p> </td> </tr> </table> <!-- ID --> <input type="hidden" id="status_id" value="' . $res['id'] . '" /> </fieldset> </div> '; return $data; }