function output($title, $content, $disposition = 'browser') { $_SERVER['PLANOWNER_DISPLAY_NAME'] = str_replace("'", "", $_SERVER['PLANOWNER_DISPLAY_NAME']); $_SERVER['STOPWATCH']['content_end'] = array_sum(explode(' ', microtime())); $_SERVER['STOPWATCH']['output_begin'] = array_sum(explode(' ', microtime())); // if there is no cookie, user is 'guest' if (!$_SERVER['USER']) { $_SERVER['USER'] = '******'; } if ($_SERVER['OUTPUT_MODE'] == 'HTML') { Header("Content-type: text/html; charset=UTF-8"); $page = output_html($title, $content); } if ($_SERVER['OUTPUT_MODE'] == 'IPHONE') { Header("Content-type: text/html; charset=UTF-8"); $page = output_iphone($title, $content); } if ($_SERVER['OUTPUT_MODE'] == 'RSS' || strstr($_SERVER['OUTPUT_MODE'], 'ATOM')) { Header("Content-type: text/xml; charset=UTF-8"); $page = output_feed($title, $content); } if ($_SERVER['OUTPUT_MODE'] == 'AJAX') { Header("Content-type: text/html; charset=UTF-8"); $page = output_ajax($title, $content); } if ($disposition == 'return') { return $page; } if (strstr($disposition, $_SERVER['DOCUMENT_ROOT'])) { file_write_contents($disposition, $page); return $page; } echo $page; exit; }
$top_max = $_GET['top_max']; } if (isset($_GET['output_type'])) { if ($_GET["output_type"] == "json") { $output_type = "json"; } elseif ($_GET["output_type"] == "html") { $output_type = "html"; } elseif ($_GET["output_type"] == "debug") { $output_type = "debug"; } } if (isset($_GET['list_type'])) { $list_type = $_GET['list_type']; } #---------------------------------- # Detect which statement $result = dl_read_stat_per_path('%', $sortBy, $sort, $list_type, $top_max); #------------------------------------------------ # Output if (is_array($result)) { if ($output_type == "html") { # Template file for HTML output include $config["HTML_TEMPLATE_FILE"]; output_html($result, array('list_type' => $list_type, 'top_max' => $top_max, "sortBy" => $sortBy, "sortOrder" => $sort, "filter_path" => false, "script_url" => $_ENV['REQUEST_URI'])); } elseif ($output_type == "json") { header('Content-Type: application/json'); print json_encode($result); } elseif ($output_type == "debug") { print_r($result); } }
function error() { global $form, $natural_form, $errors; if (isset($form['missing_fields_redirect'])) { if (isset($form['redirect_values'])) { header('Location: ' . $form['missing_fields_redirect'] . '?' . getenv('QUERY_STRING') . "\r\n"); } else { header('Location: ' . $form['missing_fields_redirect'] . "\r\n"); } } else { if (!isset($form['title'])) { $form['title'] = 'PHPFormMail - Error'; } $output = "<div class=\"title\">The following errors were found:</div>\n<ul>\n"; $crit_error = 0; while (list(, $val) = each($errors)) { list($crit, $message) = explode('|', $val); $output .= ' <li>' . $message . "</li>\n"; if ($crit == 1) { $crit_error = 1; } } $output .= "</ul>\n"; if ($crit_error == 1) { $output .= "<div class=\"crit\">PHPFormMail has experienced errors that must be fixed by the webmaster. Mail will NOT be sent until these issues are resolved. Once these issues are resolved, you will have to resubmit your form to PHPFormMail for the mail to be sent.</div><div class=\"returnlink\">Please use the <a href=\"javascript: history.back();\">back</a> button to return to the site.</div>\n"; } else { $output .= "<div class=\"returnlink\">Please use the <a href=\"javascript: history.back();\">back</a> button to correct these errors.</div>\n"; } output_html($output); } }
/** * The standard log function for Open-AudIT. Writes logs to a text file in the desired format (json or syslog). * * @access public * * @category Function * * @author Mark Unwin <*****@*****.**> * * @param Object log_details An object containing details you wish to log * * @return NULL [logs the provided string to the log file] */ function output() { error_reporting(E_ALL); $CI =& get_instance(); if ($CI->response->meta->id == 888888888888.0) { $CI->response->meta->id = NULL; unset($CI->response->data); $CI->response->data = array(); } if (!empty($CI->response->data) and count($CI->response->data) > 0) { $CI->response->data = output_convert($CI->response->data); } if (!empty($CI->response->included) and $CI->response->meta->collection != 'scripts') { $CI->response->included = output_convert($CI->response->included); } create_links(); // if we have errors set, make sure we remove the data object / array if (count($CI->response->errors) > 0) { unset($CI->response->data); } else { unset($CI->response->errors); } switch ($CI->response->meta->format) { case 'screen': output_screen($CI->response); break; case 'json_data': output_json_data(); break; case 'datatables': output_datatables(); break; case 'excel': output_excel($CI->response); break; case 'csv': output_csv($CI->response); break; case 'html': output_html($CI->response); break; case 'table': output_report($CI->response); break; case 'html_formatted': output_html_formatted($CI->response); break; case 'table_formatted': output_table_formatted($CI->response); break; case 'xml': output_xml($CI->response); break; case 'json': output_json($CI->response); break; case 'rss': output_rss($CI->response); break; case 'pdf': // TODO: need to insert the PDF function here output_screen($CI->response); break; case 'doc': // TODO: need to insert the doc / docx function here output_screen($CI->response); break; default: output_screen($CI->response); break; } }
<?php require_once dirname(realpath(__FILE__)) . '/../../../src/Config.php'; $config = new Config(dirname(realpath(__FILE__)) . '/../../../settings/Config.ini'); require_once HV_ROOT_DIR . '/docs/index.php'; output_html($api_version);