function outputbrowser($Agent) { $ua_info = getbrowser($Agent); if (!empty($ua_info)) { $br = explode(' ', $ua_info); switch ($br[0]) { case stristr($br[0], 'chrome'): $br_img = 'chrome.png'; break; case stristr($br[0], 'internet'): $br_img = 'ie.png'; break; case stristr($br[0], 'firefox'): $br_img = 'firefox.png'; break; case stristr($br[0], 'opera'): $br_img = 'opera.png'; break; case stristr($br[0], 'Safari'): $br_img = 'safari.png'; break; case stristr($br[0], 'uc'): $br_img = 'ucweb.png'; break; default: $br_img = ''; break; } $br_img_output = $br_img !== '' ? '<span class="comment_author_ua tooltip-trigger" title="' . $ua_info . '"><img class="ua_img" src="' . get_bloginfo('template_directory') . '/images/ua/' . $br_img . '" /></span>' : ''; return $br_img_output; } return ''; }
public function intro() { $auto_login = new \User\Api\UserApi(); $auto_login->AutoLogin(); if (getbrowser() == 'IELOW') { $this->redirect('/User/Page/intro_ie'); } $year_arr = M('Attendandate')->where('id in (SELECT attendandate_id FROM class)')->order('id desc')->select(); foreach ($year_arr as $key => &$value) { $value['classlist'] = M('Class')->query("SELECT class.*,COUNT(alumnus.id) as usercount FROM class LEFT JOIN alumnus ON class.id = alumnus.class_id WHERE attendandate_id=" . $value['id'] . " GROUP BY class.id"); } $this->assign('yearlist', $year_arr); $this->display(); }
function make_log_file() { // log文件名 $filename = 'mylogs.txt'; // 去除rc-ajax评论以及cron机制访问记录 if (strstr($_SERVER["REQUEST_URI"], "rc-ajax") == false && strstr($_SERVER["REQUEST_URI"], "wp-cron.php") == false) { $word .= date('mdHis', $_SERVER['REQUEST_TIME'] + 3600 * 8) . " "; //访问页面 $word .= $_SERVER["REQUEST_URI"] . " "; //协议 $word .= $_SERVER['SERVER_PROTOCOL'] . " "; //方法,POST OR GET $word .= $_SERVER['REQUEST_METHOD'] . " "; //$word .= $_SERVER['HTTP_ACCEPT'] . " "; //获得浏览器信息 $word .= getbrowser() . " "; //传递参数 $word .= "[" . $_SERVER['QUERY_STRING'] . "] "; //跳转地址 $word .= $_SERVER['HTTP_REFERER'] . " "; //获取IP $word .= getIP() . " "; $word .= "\n"; $day = date('md', $_SERVER['REQUEST_TIME'] + 3600 * 8); if (getIP() != "211.97.6.123") { if (file_exists($filename)) { $fh = fopen($filename, "r"); $data = fread($fh, 10); if (substr($data, 0, 4) == $day) { $fh = fopen($filename, "a"); } else { $fh = fopen($filename, "w"); } //w fwrite($fh, $word); fclose($fh); } } } }
$dzien = substr($dataRoz, 8, 2); $mies = substr($dataRoz, 5, 2); $rok = substr($dataRoz, 0, 4); $dzienZak = substr($dataZak, 8, 2); $miesZak = substr($dataZak, 5, 2); $rokZak = substr($dataZak, 0, 4); if (isset($_POST['submit'])) { $daty = true; $idDziennika = $_SESSION['dziennik']; $tytul = $_POST['title']; if (isset($_POST['trip'])) { $opis = $_POST['trip']; } else { $opis = ""; } if (getbrowser() == 'ie' || getbrowser() == 'firefox') { // wczytanie dat dla przegladarek bez typu DATE if (!is_numeric($_POST['dDateRoz'])) { echo '<br><span style="color: blue; font-weight: bold;">Dzien to liczba z przedziału 1..31!</span><br>'; $daty = false; } else { $dzien = (int) $_POST['dDateRoz']; } if (!is_numeric($_POST['mDateRoz'])) { echo '<br><span style="color: blue; font-weight: bold;">Miesiąc to liczba z przedziału 1..12!</span><br>'; $daty = false; } else { $mies = (int) $_POST['mDateRoz']; } if (!is_numeric($_POST['yDateRoz'])) { echo '<br><span style="color: blue; font-weight: bold;">Rok to cztero-cyfrowa liczba!</span><br>';
<?php $core->loadDimconfig(true); // info $b = getbrowser(false); $core->template->assign("browser", $b[0]); $core->template->assign("fullbrowser", isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : ""); $core->template->assign("islegacy", $b[1] ? "1" : "0"); $core->template->assign("ismobile", $b[2] ? "1" : "0"); $core->template->assign("ip", CONS_IP); $core->template->assign("servertime", date("H:i d/m/Y")); $core->template->assign("system", $b[3]); if (!$core->loaded('stats')) { $core->template->assign("_stats"); } # This page borrows a lot of code from edit.php $maxWidth = 750; // used when choosing to show or not an image field $maxHeight = 500; if ($core->layout == 0 && defined('CONS_USER_RESOLUTION') && isset($_SESSION[CONS_USER_RESOLUTION])) { $maxWidth = explode("x", $_SESSION[CONS_USER_RESOLUTION]); $maxHeight = $maxWidth[1] - 400; $maxWidth = $maxWidth[0] - 420; } if (!$core->authControl->checkPermission('bi_adm', 'can_options')) { $core->fastClose(403); } if ($_SESSION[CONS_SESSION_ACCESS_LEVEL] < $core->dimconfig['minlvltooptions']) { $core->fastClose(403); } $dimconfigMD = unserialize(cReadFile(CONS_PATH_CACHE . $_SESSION['CODE'] . "/meta/_dimconfig.dat"));
$hasil = mysql_query("SELECT browser FROM statistiksitus"); // mencari jumlah semua statistik $query = "SELECT count(*) AS statistik FROM statistiksitus WHERE dateflag BETWEEN '{$_POST['DariTanggal']}' AND '{$_POST['SampaiTanggal']}'"; $hasil = mysql_query($query); $data = mysql_fetch_array($hasil); $statistik = $data['statistik']; $total = $statistik; /***********************************/ $getbrowser1 = getbrowser("Chrome"); $getbrowser2 = getbrowser("Firefox"); $getbrowser3 = getbrowser("Internet Explorer"); $getbrowser4 = getbrowser("Safari"); $getbrowser5 = getbrowser("Opera"); $getbrowser6 = getbrowser("Netscape"); $getbrowser7 = getbrowser("Konqueror"); $getbrowser8 = getbrowser("Handheld Browser"); $getos1 = getos("Windows 8"); $getos2 = getos("Windows 7"); $getos4 = getos("Windows XP"); $getos5 = getos("Mac OS X"); $getos7 = getos("Linux"); $getos9 = getos("iPhone"); $getos12 = getos("Android"); $getos13 = getos("BlackBerry"); $getos14 = getos("Mobile"); /*************************************/ $chart = new PieChart(400); $dataSet = new XYDataSet(); $dataSet->addPoint(new Point("Chrome ({$getbrowser1})", $getbrowser1)); $dataSet->addPoint(new Point("Firefox ({$getbrowser2})", $getbrowser2)); $dataSet->addPoint(new Point("Internet Explorer ({$getbrowser3})", $getbrowser3));