本文整理汇总了PHP中Browser::getName方法的典型用法代码示例。如果您正苦于以下问题:PHP Browser::getName方法的具体用法?PHP Browser::getName怎么用?PHP Browser::getName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Browser
的用法示例。
在下文中一共展示了Browser::getName方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Browser
$input = array_merge($_GET, $_POST);
template_repository_path($template_folder . get_lang());
template_load_dictionnary('translations.xml');
//
// Login/logout
//
// Saves the URL used to access the website
if (!isset($_SESSION['first_input']) && isset($input['action']) && $input['action'] != 'logout' && $input['action'] != 'login' && $input['action'] != 'client_trace') {
$_SESSION['first_input'] = array_merge($_GET, $_POST);
}
// Saves user's web browser information
if (!isset($_SESSION['browser_name']) || !isset($_SESSION['browser_version']) || !isset($_SESSION['user_os'])) {
Autoloader::register();
$browser = new Browser();
$os = new Os();
$_SESSION['browser_name'] = $browser->getName();
$_SESSION['browser_version'] = $browser->getVersion();
$user_agent = $browser->getUserAgent();
$_SESSION['browser_full'] = $user_agent->getUserAgentString();
$_SESSION['user_os'] = $os->getName();
}
// If we're not logged in, we try to log in or display the login form
if (!user_logged_in()) {
// if the url contains the parameter 'anon' the session is assumed as anonymous
if (isset($input['anon']) && $input['anon'] == true) {
user_anonymous_session();
} else {
if (isset($input['action']) && $input['action'] == 'login') {
// The user continues without any authentication
if (isset($_POST['anonymous_session'])) {
user_anonymous_session();
示例2: showOutputStatisticsPlatform
function showOutputStatisticsPlatform()
{
if (loadvar(DATA_OUTPUT_TYPEDATA) != "") {
if (loadvar(DATA_OUTPUT_TYPEDATA) == DATA_TEST) {
$_SESSION[SURVEY_EXECUTION_MODE] = SURVEY_EXECUTION_MODE_TEST;
} else {
$_SESSION[SURVEY_EXECUTION_MODE] = SURVEY_EXECUTION_MODE_NORMAL;
}
} else {
$_SESSION[SURVEY_EXECUTION_MODE] = SURVEY_EXECUTION_MODE_NORMAL;
}
$survey = new Survey($_SESSION['SUID']);
$headers[] = array('link' => setSessionParamsHref(array('page' => 'sysadmin.output'), Language::headerOutput()), 'label' => Language::headerOutputData());
$headers[] = array('link' => setSessionParamsHref(array('page' => 'sysadmin.output.statistics'), Language::headerOutputStatistics()), 'label' => Language::headerOutputStatistics());
$headers[] = array('link' => '', 'label' => Language::headerOutputStatisticsPlatform());
$returnStr = $this->showOutputHeader($headers);
$surveys = new Surveys();
$surveys = $surveys->getSurveys();
$returnStr .= '<form id=surveyform method="post">';
$returnStr .= '<span class="label label-default">' . Language::headerOutputStatisticsPlatform() . '</span>';
$returnStr .= '<div class="well well-sm">';
$returnStr .= '<table>';
//if (sizeof($surveys) > 0) {
$returnStr .= $this->displayComboBox();
$returnStr .= '<tr><td>' . Language::labelOutputScreenDumpsSurvey() . '</td><td>' . $this->displaySurveys("survey", "survey", $_SESSION["SUID"]) . '</td></tr>';
$returnStr .= '<script type=text/javascript>
$(document).ready(function(){
$("#survey").on("change", function(event) {
document.getElementById("surveyform").submit();
});
});
</script>';
//}
$returnStr .= '<tr><td>' . Language::labelOutputDataType() . '</td><td>';
$returnStr .= "<select id='typedata' class='selectpicker show-tick' name=" . DATA_OUTPUT_TYPEDATA . ">";
//$returnStr .= "<option></option>";
$selected = array('', '');
if (loadvar(DATA_OUTPUT_TYPEDATA) != "") {
$selected[loadvar(DATA_OUTPUT_TYPEDATA)] = "selected";
}
//print_r($selected);
$returnStr .= "<option " . $selected[0] . " value=" . DATA_REAL . ">" . Language::optionsDataReal() . "</option>";
$returnStr .= "<option " . $selected[1] . " value=" . DATA_TEST . ">" . Language::optionsDataTest() . "</option>";
$returnStr .= "</select>";
$returnStr .= "</td></tr>";
$returnStr .= '<script type=text/javascript>
$(document).ready(function(){
$("#typedata").on("change", function(event) {
document.getElementById("surveyform").submit();
});
});
</script>';
$returnStr .= '</table><br/>';
$returnStr .= "</form>";
// high chart
$returnStr .= '<script src="js/highcharts.js"></script>';
$returnStr .= '<script src="js/modules/exporting.js"></script>';
$returnStr .= '<script src="js/export-csv.js"></script>';
$data = new Data();
$data = $data->getPlatformData($_SESSION['SUID']);
// determine devices
$devices = array();
require_once "detection_bootstrap.php";
$detect = new Mobile_Detect();
$total = sizeof($data);
if ($total == 0) {
$total = 1;
}
$mobilecount = 0;
$tabletcount = 0;
$othercount = 0;
$browsercounts = array();
$oscounts = array();
foreach ($data as $d) {
$detect->setUserAgent($d);
if ($detect->isMobile() && !$detect->isTablet()) {
$mobilecount++;
} else {
if ($detect->isTablet()) {
$tabletcount++;
} else {
$othercount++;
}
}
$browser = new Browser($d);
$name = $browser->getName();
if ($name == 'Navigator') {
// rename if android mobile browser
$name = "Android browser";
}
if (isset($browsercounts[ucwords($name)])) {
$browsercounts[ucwords($name)]++;
} else {
$browsercounts[ucwords($name)] = 1;
}
$os = new Os($d);
$name = $os->getName();
if (isset($oscounts[ucwords($name)])) {
$oscounts[ucwords($name)]++;
} else {
//.........这里部分代码省略.........