function my_die($error = '') { if (is_string($error)) { if (empty($error)) { $error = 'db_error'; } $error .= ': ' . my_trace(debug_backtrace()); $error .= "\r\n" . mysql_error(); } elseif (is_object($error)) { $error = $error->getMessage() . ': ' . my_exeption_trace($error); } $subject = $_SERVER['HTTP_HOST'] . ' ' . 'error'; $message = $error . "\r\n\r\n" . my_info(); my_mail($message, $subject); if (defined('DEBUG') || defined('LOCALHOST')) { // echo("<div style=\"padding: 20px; margin: 20px; border: 1px solid red;\"><pre>$error</pre></div>"); include_once FLGR_COMMON . '/exit.php'; } else { $die = "Произошла ошибка.<br />"; $die .= "Администратору сайта выслан e-mail с ее описанием - <br />"; $die .= "он постарается все исправить в самое ближайшее время."; echo $die; include_once FLGR_COMMON . '/exit.php'; } }
if ($bFlag404) { // nat $sql = $Db->sqlGetSelect(DB_PREFIX . DB_TBL_NAT, array('to')) . $Db->sqlGetWhere(array('from' => $sRequest)); $sql = $Db->queryRow($sql); if (!empty($sql)) { // 301 // cStat::bSaveEvent(EVENT_301); $nat = current($sql); header('301 Moved Permanently'); header('Location: ' . $nat); die("<h1>301 Moved Permanently</h1>" . '<a href="' . $nat . '">http://' . HOST . $nat . '</a>'); } else { // 404 header('HTTP/1.1 404 Not Found'); $subject = $_SERVER['HTTP_HOST'] . ' ' . '404 Not Found'; $message = my_info(); my_mail($message, $subject); // cStat::bSaveEvent(EVENT_404); die('404 Not Found'); } } // Вывод header('Content-Type: text/html; charset=' . CHARSET); $sOut = $_t->get(); if (defined('CACHE_ON')) { if ($bFlagCache) { $Cashe->Add($sRequest, $nLastId, $sOut); } } //echo preg_replace('/\s{2,}/', ' ', $_t->get()); echo $sOut;
function parse_window($long_msg, $separator="§", $titel, $add_msg="") { if ($titel == "") $titel= _("Fehler"); if ($add_msg == "") $add_msg= sprintf(_("%sHier%s geht es zurück zur Startseite."), "<a href=\"index.php\"><em>", "</em></a>") . "<br>"; ?> <table border="0" bgcolor="#000000" align="center" cellspacing="0" cellpadding="2" width="70%"> <tr> <td class="table_header_bold"><b><? echo $titel?></b></td> </tr> <tr> <td class="blank"> </td> </tr> <?php $msg = explode ($separator,$long_msg); for ($i=0; $i < count($msg); $i=$i+2) { switch ($msg[$i]) { case "error" : my_error($msg[$i+1], "blank", 1); break; case "info" : my_info($msg[$i+1], "blank", 1); break; case "msg" : my_msg($msg[$i+1], "blank", 1); break; } } ?> <tr> <td class="blank"><?= $add_msg ?></td> </tr> </table> <? }
} else { my_error(_("Konfiguration konnte nicht gelöscht werden")); } } echo "<tr><td class=\"blank\" width=\"100%\" valign=\"top\">\n"; if (Request::option('com') == 'delete_sec') { $config = ExternConfig::GetConfigurationMetaData($range_id, $config_id); $message = sprintf(_("Wollen Sie die Konfiguration <b>"%s"</b> des Moduls <b>%s</b> wirklich löschen?"), $config["name"], $GLOBALS["EXTERN_MODULE_TYPES"][$config["type"]]["name"]); $message .= '<br><br>'; $message .= LinkButton::createAccept("JA", URLHelper::getURL('?com=delete&config_id='.$config_id)); $message .= LinkButton::createCancel("NEIN", URLHelper::getURL('?list=TRUE&view=extern_inst')); my_info($message, "blank", 1); print_footer(); $template = $GLOBALS['template_factory']->open('layouts/base.php'); $template->content_for_layout = ob_get_clean(); echo $template->render(); page_close(); die; } $css_switcher = new cssClassSwitcher(); if (Request::option('com') == 'info') { include($RELATIVE_PATH_EXTERN . "/views/extern_info_module.inc.php"); print_footer();
// Если передана чужая форма if (isset($_POST['act'])) { $process = 'INIT'; } switch ($process) { case 'send': //dbg($metaForm->getFormMeta(), 'input array'); $aTmp = $metaForm->getFormMeta(); $aTmp = $aTmp['value']; unset($aTmp[$metaFormAction->process()]); // unser($act) unset($aTmp['kcaptcha']); $to = EMAIL_CONTACTS; $subject = $_SERVER['HTTP_HOST'] . ' ' . 'contacts'; $message = 'Здравствуйте, ' . $_POST['name'] . "\r\n\r\n" . $_POST['message']; $message .= "\r\n\r\n" . my_info(); $from = $_POST['email']; my_mail(crbr($message), $subject, $to, $from); $tpl = $_t->fetchBlock('ContentBlock'); $tpl->assign('title', $sTitle); $tpl->assign('content', 'Ваше сообщение успешно отправлено.<br />'); $tpl->assign('content', 'Мы ответим вам на указанный e-mail.<br />'); $_t->assign('ContentBlock', $tpl); $tpl->reset(); cStat::bSaveEvent(EVENT_SENDMAIL, $_POST['name'] . ' < ' . $_POST['email'] . ' > ' . $_POST['message']); break; default: //dbg($metaFormAction->getErrors(), 'Validator error:'); //dbg($metaForm->getFormMeta(), 'input array'); $tpl = $_t->fetchBlock('ContentBlock'); $tpl->assign('title', 'Ошибка!');
<tr valign="top"> <td width="1%" class="blank"> </td> <td width="90%" class="blank"> <? if (!empty($new_account_cms)) { $output = ELearningUtils::getNewAccountForm($new_account_cms); } if ($messages["info"] != "") { echo "<table>"; my_info($messages["info"]); echo "</table>"; } if ($messages["error"] != "") { echo "<table>"; my_error($messages["error"]); echo "</table>"; } ?> <table cellpadding="10" cellspacing="01" border="0" width="100%"><tr><td> <? echo $output;
function my_die($error = '') { if (empty($error)) { $error = 'db_error'; } $error .= ': '; $bsod = debug_backtrace(); for ($i = count($bsod) - 1; $i >= 0; $i--) { $file = $bsod[$i]['file']; $file = substr($file, strrpos($file, '\\') + 1); $error .= substr($file, 0, count($file) - 5); switch ($bsod[$i]['function']) { case 'include': $calltype = 'i'; case 'io': $calltype = 'io'; case 'r': $calltype = 'r'; case 'ro': $calltype = 'ro'; break; default: $calltype = $bsod[$i]['function']; } $error .= '['; if ($i != 0) { $error .= $calltype . ':'; } $error .= $bsod[$i]['line'] . ']'; if ($i != 0) { $error .= '-'; } } $error .= "\r\n" . mysql_error(); $subject = $_SERVER['HTTP_HOST'] . ' ' . 'error'; $message = $error . "\r\n\r\n" . my_info(); my_mail($message, $subject); if (defined('DEBUG') || defined('LOCALHOST')) { echo $error; include_once FLGR_COMMON . '/exit.php'; } else { $die = "Произошла ошибка.<br />"; $die .= "Администратору сайта выслан e-mail с ее описанием - <br />"; $die .= "он постарается все исправить в самое ближайшее время."; echo $die; include_once FLGR_COMMON . '/exit.php'; } }
* @package Export */ if (($o_mode != "direct") AND ($o_mode != "passthrough")) { // Start of Output PageLayout::setTitle($export_pagename); Navigation::activateItem('/tools/export'); ?> <? if (isset($export_error)) my_error($export_error); if (isset($export_msg)) my_msg($export_msg); if (isset($export_info)) my_info($export_info); ?> <? echo $export_pagecontent; if (isset($xml_printlink)) { ?> <table cellspacing="0" cellpadding="0" border="0" width="100%"> <tr> <? printhead ("99%", FALSE, "", "open", true, ' ' . $xml_printimage, $xml_printlink, $xml_printdesc); ?> </tr> </table> <table cellspacing="0" cellpadding="0" border="0" width="100%">
$selx = 'tddaterowp'; $check = ''; } $txtzeit = $zz[$z][0] . ':' . $zz[$z][1] . ' - ' . $zz[$z][2] . ':' . $zz[$z][3]; $txtzeitc = $zz[$z][0] . ':' . $zz[$z][1] . ' - ' . $zz[$z][2] . ':' . $zz[$z][3] . ' ' . _("Uhr") . ' ' . _("eintragen"); echo '<td class="', $selx, '" ', tooltip($txtzeitc), '><input type="radio" name="timei" value="', $z, '"', $check, '>', $txtzeit, '</td>', "\n"; } if ($sel == 0 && $ss != '' && $sm != '' && $es != '' && $em != '') { $txtzeit = $ss . ':' . $sm . ' - ' . $es . ':' . $em; $txtzeitc = _("zurücksetzen auf") . ' ' . $ss . ':' . $sm . ' - ' . $es . ':' . $em . ' ' . _("Uhr"); echo '<td class="tddaterowpx" ', tooltip($txtzeitc), '><input type="radio" name="timei" value="', $z, '" checked>', $txtzeit, ' </td>', "\n"; } echo '</tr></table></form>'; echo '</td></tr>', "\n"; } elseif ($preset_error != '') { my_info($preset_error, 'blank', $mcounth, FALSE); } // navigation arrows echo '<tr>'; $zeiten_buttons = LinkButton::create(_('übernehmen'), 'javascript:insert_time' . $function_addition. '()').' '. LinkButton::createCancel(_('abbrechen'), 'javascript:window.close();'); if ($kalender) { echo '<td class="blank"> <a href="'; echo URLHelper::getLink('', array('imt' => mktime(0, 0, 0, $atimex['mon'] - $mcount, 10, $atimex['year']), 'form_name' => ($form_name ? $form_name : ''), 'submit' => ($submit ? '1' : ''), 'mcount' => $mcount, 'element_switch' => $element_switch, 'c' => $c, 'atime' => $atime)) . $q . '">'; echo Icon::create('arr_2left', 'clickable', ['title' => $mcount.' '._('Monate zurück')])->asImg(16) . '</a>'; echo ' <a href="' . URLHelper::getLink('', array('imt' => mktime(0, 0, 0, $atimex['mon'] - $mcounth, 10, $atimex['year']), 'form_name' => ($form_name ? $form_name : ''), 'submit' => ($submit ? '1' : ''), 'mcount' => $mcount, 'element_switch' => $element_switch, 'c' => $c, 'atime' => $atime)) . $q . '">'; echo Icon::create('arr_1left', 'clickable', ['title' => $mcounth.' '._('Monate zurück')])->asImg(16) . '</a></td>', "\n"; if ($mcounth - 2 > 0) { echo '<td class="blank" colspan="', ($mcounth - 2), '" align=center>'; if ($zeiten)