function addMapView($ip, $mapId, $mapName, $createdBy_id)
 {
     $details = (array) json_decode(file_get_contents("http://ipinfo.io/{$ip}/json"));
     $hostname = "";
     $city = "";
     $region = "";
     $country = "";
     $org = "";
     $postal = "";
     $phone = "";
     $loc = "0,0";
     if ($details['hostname']) {
         $hostname = $details['hostname'];
         $city = $details['city'];
         $region = $details['region'];
         $country = $details['country'];
         $org = $details['org'];
         $postal = $details['postal'];
         $phone = $details['phone'];
         $loc = $details['loc'];
     }
     $browser = getBrowser();
     $browser_name = $browser['name'];
     $browser_version = $browser['version'];
     $os = $browser['platform'];
     $user = getUserInfo($createdBy_id);
     $browser = $_SERVER['HTTP_USER_AGENT'];
     $res = pg_query($this->stats_db, "INSERT INTO statistics_maps_view (ip, maps_id, maps_name, apikey, hostname, city, region, country, loc, org, postal, phone, referer_url, browser_name, browser_version, os) \n\t\t\tVALUES('" . $ip . "', " . (int) $mapId . ", '" . pg_escape_string($map_name) . "', '" . pg_escape_string($user['apikey']) . "', '" . pg_escape_string($hostname) . "', '" . pg_escape_string($city) . "', '" . pg_escape_string($region) . "', '" . pg_escape_string($country) . "', '" . pg_escape_string($loc) . "', '" . pg_escape_string($org) . "', '" . pg_escape_string($postal) . "', '" . pg_escape_string($phone) . "', '" . pg_escape_string($_SERVER['HTTP_REFERER']) . "', '" . pg_escape_string($browser_name) . "', '" . pg_escape_string($browser_version) . "', '" . pg_escape_string($os) . "'); SELECT currval(pg_get_serial_sequence('statistics_maps_view','id')) as last_insert_id;") or die(pg_last_error());
     if ($d = pg_fetch_assoc($res)) {
         $id = $d['last_insert_id'];
     }
     return $id;
 }
function get_downloadButton()
{
    $version_number = get_field('version', 'option');
    $version_name = get_field('version_name', 'option');
    $version_date = get_field('version_date', 'option');
    $titleMac = '<a><b>Mac - Ultraschall Download</a></b> <br>
              <center>V.' . $version_number . ' - ' . $version_date . ' (' . $version_name . ')</center>';
    $titleWin = '<a>Windows - Ultraschall Download</a> <br>
              <center>V.' . $version_number . ' - ' . $version_date . ' (' . $version_name . ')</center>';
    // now try it
    $ua = getBrowser();
    $browserType = $ua['platform'];
    if ($browserType == "mac") {
        $type = 'apple';
        $hrefAttr = get_field('mac_url', 'option');
        $titleAttr = $titleMac;
    } elseif ($browserType == "win") {
        $type = 'windows';
        $hrefAttr = get_field('win_url', 'option');
        $titleAttr = $titleWin;
    } elseif ($browserType == "linux") {
        $type = 'windows';
        $hrefAttr = get_field('win_url', 'option');
        $titleAttr = $titleWin;
    } else {
        $type = 'apple';
        $hrefAttr = get_field('mac_url', 'option');
        $titleAttr = $titleMac;
    }
    echo '<a title="' . $titleAttr . '"
            class="uk-button uk-button-success" href="' . $hrefAttr . '" data-uk-tooltip="{pos:\'bottom\'}" >';
    echo 'Download ( <i class="uk-icon-' . $type . '"></i> ' . $version_number . ' )';
    echo '</a>';
}
 function script_header()
 {
     $this->_header->addJavaScript('/scripts/elementSwapper.js', 'element_swap_library');
     #$script = '<script type="text/javascript" src = "/scripts/elementSwapper.js"></script>'."\n";
     #$script .= '<script type = "text/javascript">'."\n";
     $script = '';
     foreach ($this->swappers as $swapper_name => $swapper_set) {
         $script .= 'function loadSwapper_' . $swapper_name . '() {' . "\n" . 'window.' . $swapper_name . ' = new ElementSwapper("' . $this->getFormName($swapper_name) . "\");\n" . $swapper_name . ".visibleStyle = \"" . (getBrowser() == "win/ie" ? "inline" : "table-row") . "\";\n";
         foreach ($swapper_set as $setkey => $fieldset) {
             $script .= $swapper_name . ".addSwapSet( '{$setkey}' );\n";
             foreach ($fieldset as $fieldkey => $fDef) {
                 if (is_string($fDef)) {
                     $fieldname = $fDef;
                 }
                 if (!is_numeric($fieldkey)) {
                     $fieldname = $fieldkey;
                 }
                 $script .= $swapper_name . ".addSwapElement( '{$fieldname}', '{$setkey}' );\n";
             }
         }
         $script .= $this->js_ActivateInitial($swapper_name) . "} \n";
         $this->_header->addJavascriptOnLoad("loadSwapper_" . $swapper_name . "();");
     }
     #$script .= "</script>";
     $this->_header->addJavascriptDynamic($script, 'element_swap_dynamic');
     return false;
 }
Exemple #4
0
function process($data)
{
    $data = json_decode($data, true);
    if ($data['csp-report']) {
        $data = $data['csp-report'];
        if (isset($data["document-uri"])) {
            $parsed_url = parse_url($data["document-uri"]);
            $parsed_url = array_merge(array("host" => "", "path" => "", "query" => ""), $parsed_url);
        } else {
            return;
        }
        $violated = explode(" ", $data["violated-directive"]);
        if (sizeof($violated) > 0) {
            $violated = $violated[0];
        } else {
            $violated = '';
        }
        $browser = getBrowser();
        if ($browser) {
            $browser = $browser['name'] . ", " . $browser['version'] . ", " . $browser['platform'];
        }
        $data = array_merge(array("document-uri" => "", "referrer" => "", "blocked-uri" => "", "violated-directive" => "", "original-policy" => "", "source-file" => "", "script-sample" => "", "line-number" => ""), $data);
        DB::add($parsed_url["host"], $parsed_url["path"], $parsed_url["query"], $data["document-uri"], $data["referrer"], $data["blocked-uri"], $violated, $data["violated-directive"], $data["original-policy"], $data["source-file"], $data["script-sample"], $data["line-number"], $browser);
    }
}
Exemple #5
0
 function get_ip_location($ipaddress)
 {
     $location['browser'] = getBrowser();
     $location['countrycode'] = '';
     $location['country'] = '';
     $location['zipcode'] = '';
     $location['city'] = '';
     $location['region'] = '';
     $location['isp'] = '';
     $location['latitude'] = '';
     $location['longitude'] = '';
     #TODO: Upgrade IP address locator to be independent using:
     #http://pecl.php.net/package/geoip
     #http://www.maxmind.com/app/php
     #>>>http://ipinfodb.com/ip_location_api.php
     #Requires azziwa's API key with ipinfodb.com
     $this->iplocator->setKey('a0eb7ac4688fbf30a813868ddcbccb74106c43a54b192e5d30be0740a94e144d');
     //Get errors and locations
     $dlocation = $this->iplocator->getCity($ipaddress);
     $errors = $this->iplocator->getError();
     #Use backup server if cannot make a connection
     #stripos(BASE_URL, '/localhost') === FALSE &&
     if (!empty($dlocation)) {
         $location['countrycode'] = $dlocation['countryCode'];
         $location['country'] = $dlocation['countryName'];
         $location['zipcode'] = $dlocation['zipCode'];
         $location['city'] = $dlocation['cityName'];
         $location['region'] = $dlocation['regionName'];
         $location['isp'] = $dlocation['ipAddress'];
         $location['latitude'] = $dlocation['latitude'];
         $location['longitude'] = $dlocation['longitude'];
     }
     return $location;
 }
 public function __construct()
 {
     $guest['user'] = array('id' => 0, 'username' => 'Guest', 'theme' => $this->config('site', 'theme'), 'timezone' => isset($_SESSION['user']) ? doArgs('timezone', $this->config('time', 'timezone'), $_SESSION['user']) : $this->config('time', 'timezone'), 'userkey' => doArgs('userkey', null, $_SESSION['user']));
     // Get the Page Object
     $objPage = Core_Classes_coreObj::getPage();
     self::addConfig(array('global' => array('user' => isset($_SESSION['user']['id']) ? $_SESSION['user'] : $guest['user'], 'ip' => Core_Classes_User::getIP(), 'useragent' => doArgs('HTTP_USER_AGENT', null, $_SERVER), 'browser' => getBrowser($_SERVER['HTTP_USER_AGENT']), 'platform' => $objPage->getCSSSelectors($_SERVER['HTTP_USER_AGENT']), 'language' => 'en', 'secure' => isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === true ? true : false, 'referer' => doArgs('HTTP_REFERER', null, $_SERVER), 'realPath' => realpath('') . '/', 'rootPath' => '/' . root(), 'fullPath' => $_SERVER['REQUEST_URI'], 'rootUrl' => (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === true ? 'https' : 'http') . '://' . $_SERVER['HTTP_HOST'] . '/' . root(), 'url' => (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === true ? 'https' : 'http') . '://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'])), 'user');
     $user = $this->config('global', 'user');
     $this->setIsOnline(!($user['id'] == 0 ? true : false));
     $this->initPerms();
 }
Exemple #7
0
 public static function loadEveryTime($RemoveSUBURL = false)
 {
     $ua = \getBrowser();
     $SKT_Header = \CmsDev\Header\Make::instance();
     $loadEveryTimeVars = '' . 'var SKTServerURL = "' . \SERVER_DIR . \SUBSITE . '";' . 'var SKTImageSized = "' . \SERVER_DIR . \SUBSITE . 'SKTSize/";' . 'var SKTGoTo = "' . \SERVER_DIR . \SUBSITE . 'SKTGoTo/";' . 'var SKTURL_BASE = "' . \SKTURL_BASE . '";' . 'var URL_VERSION = "' . \URL_VERSION . '";' . 'var SKT_VERSION = "' . \SKT_VERSION . '";' . 'var SKTURL_TemplateSite = "' . \SKTURL_TemplateSite . '";' . 'var SUBURL = "' . \SUBURL . '";' . 'var ASSETS = "' . \ASSETS . '"; ' . 'var SUBSITE = "' . \SUBSITE . '";' . 'var SKT_SECTION_ID = "' . \SKT_SECTION_ID . '";' . 'var Language = "' . \THIS_LANG . '";' . 'var LanguageFromFile = "' . \LanguageFromFile . '";' . 'var SKTURL_REQUEST_URI = "' . addslashes(\SKTURL_REQUEST_URI) . '";' . 'var SKTURL_REQUEST_PARAMS = "' . \SKTURL_REQUEST_PARAMS . '";' . 'var SKTURL_Here = "' . addslashes(\SKTURL_Here) . '";' . 'var SKT_TEMPLATE = "' . addslashes(\SKT_TEMPLATE) . '";' . 'var SKTPATH = "' . addslashes(\SKTPATH) . '";' . 'var SKTPATH_CmsDev = "' . addslashes(\SKTPATH_CmsDev) . '";' . 'var SKTPATH_FileSystems = "' . addslashes(\SKTPATH_FileSystems) . '";' . 'var SKTPATH_TemplateSite = "' . addslashes(\SKTPATH_TemplateSite) . '";' . 'var SKTURL = "' . \SKTURL . '";' . 'var TOTAL_REQUEST = "' . \TOTAL_REQUEST . '";' . 'var TOTAL_REQUEST = "' . \TOTAL_REQUEST . '";' . 'var TOTAL_REQUEST = "' . \TOTAL_REQUEST . '";' . 'var SERVER_DIR = "' . \SERVER_DIR . '";' . 'var SKT_BROWSER = "' . $ua['name'] . '";' . 'var EditorLayoutsBox = "' . addslashes(\EditorLayoutsBox) . '";' . 'var URL_docCSSFile = "' . \SKTURL_TemplateSite . '/EditorStyles.css";' . 'var SKT_ADMIN_Message_Update_OK = "' . \SKT_ADMIN_Message_Update_OK . '";' . 'var SKT_ADMIN_Message_Update_Error = "' . \SKT_ADMIN_Message_Update_Error . '";' . 'var SKT_ADMIN_Message_Validating = "' . \SKT_ADMIN_Message_Validating . '"; ' . 'var SKT_ADMIN_Message_Delete_Image = "' . \SKT_ADMIN_Message_Delete_Image . '";' . 'var SKT_ADMIN_Message_Upload_Image = "' . \SKT_ADMIN_Message_Upload_Image . '";' . 'var Msg_RefreshIn = "' . \SKT_ADMIN_Reloading . '";' . 'var SKT_ADMIN_Btn_Delete = "' . \SKT_ADMIN_Btn_Delete . '";' . 'var SKT_ADMIN_Btn_RestartCancel = "' . \SKT_ADMIN_Btn_RestartCancel . '";' . 'var SKT_ADMIN_Btn_Acept = "' . \SKT_ADMIN_Btn_Acept . '"; ' . 'var SKT_ADMIN_Btn_Create = "' . \SKT_ADMIN_Btn_Create . '"; ' . 'var SKT_ADMIN_Btn_Save = "' . \SKT_ADMIN_Btn_Save . '";' . 'var SKT_ADMIN_Btn_Edit = "' . \SKT_ADMIN_Btn_Edit . '";' . 'var SKT_ADMIN_Btn_Activate = "' . \SKT_ADMIN_Btn_Activate . '";' . 'var URL_CheckURLName = "' . \URL_CheckURLName . '";' . 'var ExtraColorsEditor = SKT_EDITOR_COLORS = "' . \SKT_EDITOR_COLORS . '";' . 'var ExtraFontEditor = SKT_EDITOR_FONTS = "' . \SKT_EDITOR_FONTS . '";' . 'var EditorLayoutsBox = "' . addslashes(\EditorLayoutsBox) . '";' . 'var SKT_EDITOR_BODY = SKT_EDITOR_BODY = "' . \SKT_EDITOR_BODY . '";' . \GoToURLJS . ';';
     $appPack = new \CmsDev\JavaScriptPacker($loadEveryTimeVars);
     $SKT_Header->addCss(\ASSETS . 'css/skt.let.styles.combined.php');
     $SKT_Header->addScript(\ASSETS . 'js/jquery.js', 'text/javascript', true, 'jquery');
     $SKT_Header->addScript(\ASSETS . 'js/jquery-ui.min.js', 'text/javascript', true, 'jquery-ui');
     $SKT_Header->custom('<script type="text/javascript">' . $appPack->pack() . '</script>', true, 'loadEveryTime css + vars');
     $SKT_Header->addScript(\ASSETS . 'skt.let.script.combined.php', 'text/javascript', false, 'bootstrap, bootstrap-switch, bootstrap-select,' . 'jquery.cookie, scrollspy, store, jquery.tmpl, jquery.tmplPlus,' . 'prettyPhoto, easytabs, cleditor, resizableColumns, classie, gnmenu,' . 'highlight, slidebars, easyTooltip');
 }
 public function logEntry($id)
 {
     $browser_info = getBrowser();
     $model = new Log;
     $model->user_id = $id;
     $model->ip_address = $_SERVER['REMOTE_ADDR'];
     $model->browser = $browser_info['name']; 
     $model->platform = $browser_info['platform']; 
     $model->os = $browser_info['platform'];
     $model->user_agent = $browser_info['userAgent'];
     $model->save();
 }        
Exemple #9
0
function geraXLS($exibir, $criterios)
{
    $campos = "cred.*, c.nome, reg.desc_regional, c.cod_grupo";
    $tabela = "credenciados cred INNER JOIN consultor c ON (c.cod_consultor = cred.cod_consultor) " . "INNER JOIN regional reg ON (reg.cod_regional = cred.cod_regional)";
    $query = "SELECT " . $campos . " FROM " . $tabela . " WHERE " . $criterios . " ORDER BY c.cod_grupo, c.nome, cred.cod_regional, cred.desc_empresa";
    $resultado = mysql_query($query);
    // Nome do arquivo que será exportado
    $arquivo = 'lista_empresas.xls';
    //Constroi o HTML
    $html = '<style>td{font-size:12px;text-align:center;white-space:nowrap;} ' . 'table{border:1px black solid; width:100%} ' . 'td.head{background-color:#cc6;font-weight:bold} ' . 'td{padding:2px} ' . 'tr{background-color:#fff} ' . '</style>';
    $html .= '<table>';
    $html .= '<tr>';
    $html .= '<td class="head">#</td>';
    $html .= '<td class="head">GESTOR</td>';
    $html .= '<td class="head">CONSULTOR</td>';
    $html .= '<td class="head">PDV</td>';
    $html .= '<td class="head">EMPRESA</td>';
    $html .= '<td class="head">REGIONAL</td>';
    $html .= '<td class="head">PERIODICIDADE</td>';
    $html .= '</tr>';
    $contador = 1;
    while ($coluna = mysql_fetch_array($resultado)) {
        $html .= '<tr onMouseOver="this.style.backgroundColor=\'#ff0\';this.style.cursor=\'pointer\';" onMouseOut="this.style.backgroundColor=\'#fff\';" ' . 'onClick="window.open(\'edita_credenciado.php?cod_tipo_empresa=' . $coluna['cod_tipo_empresa'] . '&nome=' . $coluna['nome'] . '&pdv_empresa=' . $coluna['pdv_empresa'] . '&desc_empresa=' . $coluna['desc_empresa'] . '&desc_regional=' . $coluna['desc_regional'] . '&periodicidade=' . $coluna['periodicidade'] . '&nvl=' . $_SESSION['nivel_acesso'] . '\',\'_blank\',\'fullscreen=no,toolbar=no,scrollbars=no,resizable=no,location=no,top=\'+((screen.height/2)-150)+\',left=\'+((screen.width/2)-175)+\',width=350,height=' . ($coluna['cod_tipo_empresa'] == 2 ? $_SESSION['nivel_acesso'] < 3 ? 380 : 200 : 200) . '\')">';
        $html .= '<td>' . $contador++ . '</td>';
        $html .= '<td>' . buscaCampo("nome", "SELECT", "consultor c INNER JOIN grupo grp ON (grp.cod_consultor = c.cod_consultor)", "c.nome", "grp.cod_grupo = " . (int) $coluna['cod_grupo']) . '</td>';
        $html .= '<td>' . $coluna['nome'] . '</td>';
        $html .= '<td>' . $coluna['pdv_empresa'] . '</td>';
        $html .= '<td>' . $coluna['desc_empresa'] . '</td>';
        $html .= '<td>' . $coluna['desc_regional'] . '</td>';
        $html .= '<td>' . $coluna['periodicidade'] . '</td>';
        $html .= '</tr>';
    }
    $html .= '</table>';
    //Acesso ao BD - FIM
    if (!$exibir) {
        // Configurações header para forçar o download
        header("Content-type: application/x-msexcel");
        header("Content-Disposition: attachment; filename=\"{$arquivo}\"");
        header("Pragma: no-cache");
        header("Expires: 0");
        header("Last-Modified: " . gmdate("D,d M YH:i:s") . " GMT");
        header("Cache-Control: no-cache, must-revalidate");
        header("Content-Description: PHP Generated Data");
        // Detecta o Browser e Plataforma e Envia o conteúdo do arquivo no formato correto
        $ua = getBrowser();
        echo $ua['platform'] == 'windows' ? utf8_decode($html) : $html;
    } else {
        echo "<center>";
        echo $html;
        echo "</center>";
    }
}
 public function onBeforeWrite()
 {
     parent::onBeforeWrite();
     $browser = getBrowser();
     $this->UserAgent = $browser['user_agent'];
     $this->Browser = $browser['name'];
     $this->BrowserVersion = $browser['version'];
     $this->Platform = $browser['platform'];
     $this->ViewDay = date('d');
     $this->ViewDayName = date('l');
     $this->ViewMonth = date('F');
     $this->ViewYear = date('Y');
 }
Exemple #11
0
 public function indeed_job_sync($search_str)
 {
     $publisher = $this->get_publisher_id();
     if (function_exists('getBrowser')) {
         $useragent = getBrowser();
         $useragent = $useragent['name'];
     } else {
         $useragent = '';
     }
     $userip = $_SERVER['REMOTE_ADDR'];
     $url = "http://api.indeed.com/ads/apisearch?publisher={$publisher}&format=xml&v=2&userip={$userip}&{$search_str}";
     // echo $url;
     $ch = curl_init();
     curl_setopt($ch, CURLOPT_URL, $url);
     //return the transfer as a string
     curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
     curl_setopt($ch, CURLOPT_USERAGENT, $useragent);
     $response = curl_exec($ch);
     curl_close($ch);
     $job_data = simplexml_load_string($response);
     return $job_data;
 }
?>
" />
						<input type="hidden" name="url_withpw"    value="<?php 
echo printPHP_SELF("bookmark_withpw");
?>
" />
						<input type="hidden" name="url_withoutpw" value="<?php 
echo printPHP_SELF("bookmark_withoutpw");
?>
" />
						<input type="hidden" name="text"          value="net2ftp <?php 
echo $net2ftp_globals["ftpserver"];
?>
" />
<?php 
if ($net2ftp_globals["state"] != "bookmark") {
    printActionIcon("bookmark", "document.forms['StatusbarForm'].state.value='bookmark';document.forms['StatusbarForm'].submit();");
}
if (getBrowser("agent") != "Chrome") {
    printActionIcon("refresh", "window.location.reload();");
}
printActionIcon("help", "void(window.open('" . $net2ftp_globals["application_rootdir_url"] . "/modules/help/help-user.html','Help','location,menubar,resizable,scrollbars,status,toolbar'));");
printActionIcon("logout", "document.forms['StatusbarForm'].state.value='logout';document.forms['StatusbarForm'].submit();");
?>
						</form>
					</div>
				</div>
				<!-- ENDS title -->

<!-- Template /skins/shinra/header.template.php end -->
Exemple #13
0
function recent_users()
{
    global $user;
    // Check to see if $user has the administrator role.
    if (!in_array('administrator', array_values($user->roles))) {
        if ($user->uid) {
            echo "You need to be an Administrator to see this page.";
        }
        exit;
    }
    //Counting Views
    $path = $_GET['q'];
    $differential = $_GET['uid'];
    $path_alias = drupal_get_path_alias($_GET["q"]);
    /* Pie Graph JS */
    echo "<script type='text/javascript' src='https://www.google.com/jsapi'></script>";
    echo "<script type='text/javascript'>";
    echo "  google.load('visualization', '1', {packages: ['corechart']});";
    echo "</script>";
    if ($differential) {
        $counter = 0;
        $total_downloads = 0;
        //Main Title and miscellaneous Information
        $result_user = db_query("\n\t\t  \tSELECT\n\t\t\t  f.field_full_n_value AS fullname, \n\t\t\t  u.name AS username,\n\t\t\t  u.mail AS email, \n\t\t\t  u.created AS joindate,\n\t\t\t  u.login AS lastlogin\n\t\t\tFROM\n\t\t\t  {field_data_field_full_n} f, {users} u where f.entity_id = u.uid AND u.uid = :uid\n\t\t\t", array(':uid' => $_GET['uid']))->fetchAll();
        // Finding all the Browsers Used
        $query_all_browsers = db_select('login_activity', 'a')->condition('a.uid', $_GET['uid'], '=')->distinct()->fields('a', array('host_user_agent'));
        $result_b = $query_all_browsers->execute();
        /*
        $result = db_query("
          	SELECT
        	  a.url, a.title, a.uid,
        	  COUNT(*) AS times
        	FROM
        	  {accesslog} a where a.uid = :uid
        	GROUP BY
        	  a.url",
        	array(':uid'=>$_GET['uid'])) -> fetchAll();
        */
        $result = db_query("\n\t\t  \tSELECT\n\t\t\t  n.title, n.nid,\n\t\t\t  COUNT(*) AS times\n\t\t\tFROM\n\t\t\t  {node_view_count} a, {node} n where a.nid = n.nid AND a.uid = :uid\n\t\t\tGROUP BY\n\t\t\t  n.title\n\t\t\tORDER BY\n\t\t\t  times desc", array(':uid' => $_GET['uid']))->fetchAll();
        echo "<div class='data-container' id='profile-info'>";
        echo "<span><a href=" . $GLOBALS['base_url'] . "/" . "user-statistics>&larr; Back to Main Analytics Page</a></span>";
        echo "</div>";
        echo "<div class='data-container'>";
        echo "<div class='left' style='width: 40%';>";
        foreach ($result_user as $r) {
            $date = date('Y-m-d H:i:s', $r->joindate);
            $dtz = 'America/New_York';
            $joinTimestamp = getNoteDateTimeZone($date, 'US/Central', $dtz);
            $ldate = date('Y-m-d H:i:s', $r->lastlogin);
            $loginTimestamp = getNoteDateTimeZone($ldate, 'US/Central', $dtz);
            echo "<h1>" . $r->fullname . "</h1>";
            echo "<span> Username: </span><span class='content-span'>" . $r->username . "</span><br />";
            echo "<span> Joining Date: </span><span class='content-span'>" . date("F jS, Y  \\( h:i a \\)", strtotime($joinTimestamp)) . "</span><br />";
            echo "<span> Last Login: </span><span class='content-span'>" . date("F jS, Y  \\( h:i a \\)", strtotime($loginTimestamp)) . "</span><br /><br />";
            echo "<span style='border-bottom: 1px solid #adadad; padding-bottom:5px; margin-bottom: 8px;'> Browsing History: </span><span class='content-span'><br />";
            echo "<table id='ver-minimalist' summary='Browsing History'>";
            echo "<tbody>";
            while ($record_all_browsers = $result_b->fetchAssoc()) {
                $detail_arr = getBrowser($record_all_browsers['host_user_agent']);
                echo "<tr>";
                echo "<td><img src ='" . $detail_arr['icon'] . "' width='20' height='20' />" . " | " . "<img src ='" . $detail_arr['os_icons'] . "' width='24' height='24' /> (" . $detail_arr['name'] . ", Version " . $detail_arr['version'] . " on " . $detail_arr['os'] . ")  </td>";
                echo "</tr>";
            }
            echo "</tbody>";
            echo "</table>";
            echo "</span>";
        }
        echo "</div>";
        /* <Pie Graph JS */
        echo "<script type='text/javascript'>";
        echo "function drawVisualization_pages_visited() {";
        echo "var options = { ";
        echo "\t  width: 550,";
        echo "    height: 550,";
        echo "    chartArea:{left:7,top:5, width:'100%'},";
        echo "    fontName: 'Open Sans',";
        echo "    tooltip: { textStyle: { fontName: 'Tahoma', fontSize: 11 } },";
        echo "    colors: [ '#d8b71a', '#193153', '#9c2b11', '#e5760a', '#1d83ae', '#919b02', '#097092', '#ddb928', '#890c0c', '#5c6677', '#0fa7ad', '#ad560f', '#d41473' ]";
        echo "};";
        //echo "var options = {'title':'asdasdasd asd asd ','width':500,'height':450,'chartArea':{left:0,top:10,width:'100%'}}";
        echo "var data = google.visualization.arrayToDataTable([";
        echo "['Pages Visited', 'No. of Visits'],";
        foreach ($result as $r) {
            //echo "['".$r->title."', ".$r->times."],";
            $resultstr_pages_visited[] = "['" . $r->title . "', " . $r->times . "]";
        }
        echo implode(",", $resultstr_pages_visited);
        echo "]);";
        echo "new google.visualization.PieChart(document.getElementById('visualization_visit_graph')).";
        echo "draw(data, options); ";
        echo " }";
        echo "google.setOnLoadCallback(drawVisualization_pages_visited);";
        echo "</script>";
        /* </Pie Graph JS */
        echo "<div class='right' style='width: 50%';>";
        echo "<div id='holder'>";
        /* Pie Graph Code */
        echo "<div id='visualization_visit_graph'></div>";
        echo "</div>";
        echo "</div>";
        echo "<div class='clear'></div>";
        echo "</div>";
        // Count the number of times the current logged in user has
        // visited the current page
        $query_count_visits = db_select('accesslog', 'a')->condition('a.uid', $_GET['uid'], '=')->condition('a.path', $path, '=')->fields('a', array('uid', 'title'))->execute()->rowCount();
        // Finding all the Pages visited by the logged in User.
        // Also Count the number of times each Unique page is visited.
        echo "<div id='page-wrap' class='content_scroll'>";
        echo "\n<table id='hor-minimalist-b'>";
        echo "\n\n<thead>";
        echo "\n\n\n<tr>";
        echo "\n\n\n\n<th>Pages Visited</th>";
        echo "\n\n\n\n<th>Visits</th>";
        echo "\n\n\n</tr>";
        echo "\n\n</thead>";
        echo "\n\n<tbody>";
        foreach ($result as $r) {
            //$string = (strlen($r->url) > 110) ? substr($r->url,0,107).'...' : $r->url;
            echo "<tr>" . "<td><a href=./" . drupal_lookup_path('alias', "node/" . $r->nid) . ">" . $r->title . "</a></td>" . "<td>" . $r->times . " times" . "</td>" . "</tr>";
        }
        echo "\n\n</tbody>";
        echo "\n</table>";
        echo "</div>";
        // Documents Downloaded
        $result_dl = db_query("\n\t\t  \tSELECT\n\t\t\t  d.name, d.url, n.title, d.count\n\t\t\tFROM\n\t\t\t  {pubdlcnt} d, {node} n where n.nid = d.nid AND d.uid = :uid\n\t\t\tORDER BY\n\t\t\t  d.count desc\n\t\t\t", array(':uid' => $_GET['uid']))->fetchAll();
        foreach ($result_dl as $r) {
            $counter++;
            $total_downloads += $r->count;
        }
        /* Download Numbers PIE Graph */
        echo "<div class='data-container'>";
        echo "<div class='left sharewidth'>";
        echo "<h2>Documents Downloaded</h2>";
        echo "<span> Total Documents downloaded: </span><span class='content-span'>" . $counter . "</span><br />";
        echo "<span> Total Downloaded Count:  </span><span class='content-span'>" . $total_downloads . "</span><br />";
        echo "<br />";
        echo "<div id='page-wrap' class='document_scroll'>";
        echo "\n<table id='hor-minimalist-c'>";
        echo "\n\n<thead>";
        echo "\n\n\n<tr>";
        echo "\n\n\n\n<th>Document Name</th>";
        echo "\n\n\n\n<th>Page</th>";
        echo "\n\n\n\n<th>Type</th>";
        echo "\n\n\n\n<th>Count</th>";
        echo "\n\n\n</tr>";
        echo "\n\n</thead>";
        echo "\n\n<tbody>";
        foreach ($result_dl as $r) {
            echo "<tr>" . "<td>" . cut_me_Short(preg_replace("/\\.[^.\\s]{3,4}\$/", "", str_replace("_", " ", $r->name)), 45, true) . "</td>" . "<td>" . $r->title . "</td>" . "<td>" . pathinfo($r->name, PATHINFO_EXTENSION) . "</td>" . "<td>" . $r->count . "</td>" . "</tr>";
        }
        echo "\n\n</tbody>";
        echo "\n</table>";
        echo "</div>";
        echo "</div>";
        /* <Pie Graph JS */
        echo "<script type='text/javascript'>";
        echo "function drawVisualization() {";
        echo "var options = { ";
        echo "\t  width: 450,";
        echo "    height: 450,";
        echo "    fontName: 'Open Sans',";
        echo "    tooltip: { textStyle: { fontName: 'Tahoma', fontSize: 11 } },";
        echo "    chartArea:{left:10,top:10,width:'100%'},";
        echo "    colors: [ '#e5760a', '#d8b71a', '#ad560f', '#1ad8d1', '#193153', '#1d83ae', '#919b02', '#9c2b11',  '#5c6677', '#0fa7ad', '#ad560f', '#d41473' ]";
        echo "};";
        //echo "var options = {'title':'asdasdasd asd asd ','width':500,'height':450,'chartArea':{left:0,top:10,width:'100%'}}";
        echo "var data = google.visualization.arrayToDataTable([";
        echo "['Document', 'No. of Downloads'],";
        foreach ($result_dl as $r) {
            $string = strlen($r->name) > 55 ? substr($r->name, 0, 52) . '...' : $r->name;
            $resultstr_documents_downloaded[] = "['" . preg_replace("/\\.[^.\\s]{3,4}\$/", "", str_replace("_", " ", $string)) . "', " . $r->count . "]";
        }
        echo implode(",", $resultstr_documents_downloaded);
        echo "]);";
        echo "new google.visualization.PieChart(document.getElementById('visualization')).";
        echo "draw(data, options); ";
        echo " }";
        echo "google.setOnLoadCallback(drawVisualization);";
        echo "</script>";
        /* </Pie Graph JS */
        echo "<div class='right'>";
        echo "<div id='holder'>";
        /* Pie Graph Code */
        echo "<div id='visualization'></div>";
        echo "</div>";
        echo "</div>";
        echo "<div class='clear'></div>";
        echo "</div>";
        // Documents Emailed
        $result_em = db_query("\n\t\t  \tSELECT\n\t\t\t  d.name, d.url, n.title, d.count\n\t\t\tFROM\n\t\t\t  {pubdlcnt} d, {node} n where n.nid = d.nid AND d.uid = :uid\n\t\t\t", array(':uid' => $_GET['uid']))->fetchAll();
        foreach ($result_em as $r) {
            $counter++;
            $total_downloads += $r->count;
        }
        /* Emailed Numbers PIE Graph */
        echo "<div class='data-container' id='profile-info'>";
        echo "<div class='left sharewidth'>";
        echo "<h2>Documents Emailed (Disabled)</h2>";
        echo "<span> Total Documents Emailed: </span><span class='content-span'>N/A</span><br />";
        echo "<span> Total Emails Sent:  </span><span class='content-span'>N/A</span><br />";
        echo "<br />";
        echo "<div id='page-wrap' class='document_scroll'>";
        echo "\n<table id='hor-minimalist-c'>";
        echo "\n\n<thead>";
        echo "\n\n\n<tr>";
        echo "\n\n\n\n<th>Document Name</th>";
        echo "\n\n\n\n<th>Page</th>";
        echo "\n\n\n\n<th>Count</th>";
        echo "\n\n\n</tr>";
        echo "\n\n</thead>";
        echo "\n\n<tbody>";
        foreach ($result_em as $r) {
            echo "<tr>" . "<td>" . cut_me_Short(preg_replace("/\\.[^.\\s]{3,4}\$/", "", str_replace("_", " ", $r->name)), 48, true) . "</td>" . "<td>" . $r->title . "</td>" . "<td>" . $r->count . "</td>" . "</tr>";
        }
        echo "\n\n</tbody>";
        echo "\n</table>";
        echo "</div>";
        echo "</div>";
        /* <Pie Graph JS for Email */
        echo "<script type='text/javascript'>";
        echo "function drawVisualization_for_email() {";
        echo "var options = { ";
        echo "\t  width: 450,";
        echo "    height: 450,";
        echo "    fontName: 'Open Sans',";
        echo "    tooltip: { textStyle: { fontName: 'Tahoma', fontSize: 11 } },";
        echo "    chartArea:{left:10,top:10,width:'100%'},";
        //echo "	  title: 'Toppings I Like On My Pizza',";
        //echo "    colors: ['#9c2b11', '#e5760a', '#1d83ae', '#193153', '#919b02' ]";
        echo "    colors: ['#dddddd' ]";
        echo "};";
        //echo "var options = {'title':'asdasdasd asd asd ','width':500,'height':450,'chartArea':{left:0,top:10,width:'100%'}}";
        echo "var data = google.visualization.arrayToDataTable([";
        echo "['Document', 'No. of Emails'],";
        foreach ($result_em as $r) {
            $string = strlen($r->name) > 55 ? substr($r->name, 0, 52) . '...' : $r->name;
            $resultstr_documents_emailed[] = "['" . preg_replace("/\\.[^.\\s]{3,4}\$/", "", str_replace("_", " ", $string)) . "', " . $r->count . "]";
        }
        echo implode(",", $resultstr_documents_emailed);
        echo "]);";
        echo "new google.visualization.PieChart(document.getElementById('visualization_email')).";
        echo "draw(data, options); ";
        echo " }";
        echo "google.setOnLoadCallback(drawVisualization_for_email);";
        echo "</script>";
        /* </Pie Graph JS */
        echo "<div class='right'>";
        echo "<div id='holder'>";
        /* Pie Graph Code */
        echo "<div id='visualization_email'></div>";
        echo "</div>";
        echo "</div>";
        echo "<div class='clear'></div>";
        echo "<hr />";
        echo "<span><a href=" . $GLOBALS['base_url'] . "/" . "user-statistics>&larr; Back to Main Analytics Page</a></span>";
        echo "</div>";
        //echo "<br />"."Total number of Visits on all Pages: " . "1234" . "<br />";
    } else {
        $result_at_glance = db_query("\n\t\t  \tSELECT\n\t\t\t  DISTINCT(n.title), n.nid, a.totalcount, a.daycount\n\t\t\t  \n\t\t\tFROM\n\t\t\t  {node_counter} a, {node_view_count} b, {node} n where a.nid = n.nid AND n.nid <> 83\n\t\t\tLIMIT 15\n\t\t\t")->fetchAll();
        // 83 is the analytics page.
        $result_top_pages = db_query("\n\t\t  \tSELECT\n\t\t\t  n.title, n.nid,\n\t\t\t  COUNT(*) AS times\n\t\t\tFROM\n\t\t\t  {node_view_count} a, {node} n where a.nid = n.nid AND n.nid <> 83 \n\t\t\tGROUP BY\n\t\t\t  n.title\n\t\t\tORDER BY\n\t\t\t  times desc\n\t\t\tLIMIT 10\n\t\t\t  ")->fetchAll();
        $result_top_visitors = db_query("\n\t\t  \tSELECT\n\t\t\t  f.field_full_n_value, u.name, n.nid,\n\t\t\t  COUNT(*) AS times\n\t\t\tFROM\n\t\t\t  {node_view_count} a, {node} n, {users} u, {field_data_field_full_n} f where a.nid = n.nid AND u.uid = a.uid AND f.entity_id = u.uid and u.uid NOT IN (1,2,3,6,7,9,17,35,75,1133)\n\t\t\tGROUP BY\n\t\t\t  u.name\n\t\t\tORDER BY\n\t\t\t  times desc")->fetchAll();
        $result_all_users = db_query("\n\t\t  \tSELECT\n\t\t\t  f.field_full_n_value as title, u.name , u.mail, u.created, u.access, u.uid, COUNT(a.uid) AS times\n\t\t\tFROM\n\t\t\t  {users} u, {field_data_field_full_n} f, {node_view_count} a where f.entity_id = u.uid and a.uid = u.uid and u.uid NOT IN (1,2,3,6,7,9,17,35,75,1133)\n\t\t\tGROUP BY\n\t\t\t  u.name\n\t\t\tORDER BY\n\t\t\t  times desc")->fetchAll();
        //u.access desc") -> fetchAll();
        // Show Top Pages & Top Visitors Pie Chart in the first Row
        echo "<div class='data-container'>";
        echo "<h1>At a Glance</h1><br />";
        /* <Area Graph JS for At a Glance */
        echo "<script type='text/javascript'>";
        echo "function drawVisualization_for_glance() {";
        echo "var options = { ";
        echo "\t  width: 968,";
        echo "    height: 400,";
        echo "    fontName: 'Open Sans',";
        echo "    tooltip: { textStyle: { fontName: 'Tahoma', fontSize: 11 } },";
        echo "    chartArea:{width:'82%'},";
        //echo " title: 'Recent Visits',";
        echo "    colors: ['#A2AD00', '#9c2b11', '#e5760a', '#1d83ae', '#193153', '#919b02' ],";
        //echo "	  hAxis: {title: 'Pages',  titleTextStyle: {color: 'blue'}}";
        echo "\t  vAxis: {title: 'No. of Visits',  titleTextStyle: {color: 'olive'}}";
        echo "};";
        //echo "var options = {'title':'asdasdasd asd asd ','width':500,'height':450,'chartArea':{left:0,top:10,width:'100%'}}";
        echo "var data = google.visualization.arrayToDataTable([";
        // echo "['Day', 'Visits'],";
        $resultstr_at_a_glance[] = "['Pages', 'No. of Visits']";
        foreach ($result_at_glance as $r) {
            $resultstr_at_a_glance[] = "['" . $r->title . "', " . $r->totalcount . "]";
        }
        echo implode(",", $resultstr_at_a_glance);
        echo "]);";
        echo "new google.visualization.ColumnChart(document.getElementById('visualization_glance')).";
        echo "draw(data, options); ";
        echo " }";
        echo "google.setOnLoadCallback(drawVisualization_for_glance);";
        echo "</script>";
        /* </Pie Graph JS */
        echo "<div class='right'>";
        echo "<div id='holder'>";
        /* Pie Graph Code */
        echo "<div id='visualization_glance'></div>";
        echo "</div>";
        echo "</div>";
        echo "<div class='clear' id='below-space'></div>";
        /* <Pie Graph - Top Visits */
        echo "<script type='text/javascript'>";
        echo "function drawVisualization_pages_top() {";
        echo "var options = { ";
        echo "\t  width: 450,";
        echo "    height: 450,";
        echo "    fontName: 'Open Sans',";
        echo "    tooltip: { textStyle: { fontName: 'Tahoma', fontSize: 11 } },";
        echo "    chartArea:{left:7,top:5, width:'100%'},";
        echo "    colors: ['#0065BD', '#7D9AAA', '#D4BA00', '#A2AD00', '#00ACED', '#666666', '#E37222', '#CD202C', '#AD005B', '#66307C', '#009AA6', '#006699', '#B5B38C', '#939D98' ]";
        echo "};";
        //echo "var options = {'title':'asdasdasd asd asd ','width':500,'height':450,'chartArea':{left:0,top:10,width:'100%'}}";
        echo "var data = google.visualization.arrayToDataTable([";
        echo "['Top Pages', 'No. of Visits'],";
        foreach ($result_top_pages as $r) {
            $resultstr_pages_top[] = "['" . $r->title . "', " . $r->times . "]";
        }
        echo implode(",", $resultstr_pages_top);
        echo "]);";
        echo "new google.visualization.PieChart(document.getElementById('visualization_top_visits')).";
        echo "draw(data, options); ";
        echo " }";
        echo "google.setOnLoadCallback(drawVisualization_pages_top);";
        echo "</script>";
        /* </Pie Graph JS */
        echo "<div class='left' style='width: 45%';>";
        echo "<h3>Top 10 Pages</h3>";
        echo "<div id='holder' class='push-down'>";
        /* Pie Graph Code */
        echo "<div id='visualization_top_visits'></div>";
        echo "</div>";
        echo "</div>";
        /* <Pie Graph JS */
        echo "<script type='text/javascript'>";
        echo "function drawVisualization_pages_visited() {";
        echo "var options = { ";
        echo "\t  width: 450,";
        echo "    height: 450,";
        echo "    fontName: 'Open Sans',";
        echo "    tooltip: { textStyle: { fontName: 'Tahoma', fontSize: 11 } },";
        echo "    chartArea:{left:7,top:5, width:'100%'},";
        echo "    colors: ['#d8b71a', '#193153', '#9c2b11', '#e5760a', '#1d83ae', '#919b02', '#097092', '#42239b', '#ddb928', '#890c0c', '#5c6677', '#0fa7ad', '#ad560f', '#d41473' ]";
        echo "};";
        //echo "var options = {'title':'asdasdasd asd asd ','width':500,'height':450,'chartArea':{left:0,top:10,width:'100%'}}";
        echo "var data = google.visualization.arrayToDataTable([";
        echo "['Pages Visited', 'No. of Visits'],";
        foreach ($result_top_visitors as $r) {
            $resultstr_pages_visited[] = "['" . $r->field_full_n_value . "', " . $r->times . "]";
        }
        echo implode(",", $resultstr_pages_visited);
        echo "]);";
        echo "new google.visualization.PieChart(document.getElementById('visualization_visit_graph')).";
        echo "draw(data, options); ";
        echo " }";
        echo "google.setOnLoadCallback(drawVisualization_pages_visited);";
        echo "</script>";
        /* </Pie Graph JS */
        echo "<div class='right' style='width: 45%';>";
        echo "<h3>Top Visitors</h3>";
        echo "<div id='holder' class='push-down'>";
        /* Pie Graph Code */
        echo "<div id='visualization_visit_graph'></div>";
        echo "</div>";
        echo "</div>";
        echo "<div class='clear' id='push-up'></div>";
        echo "</div>";
        echo "<h3 class='analytics-heading'>Registered Users ( Total active registered members: " . count($result_all_users) . " )</h3><br />";
        echo "<div id='page-wrap' class='content_scroll'>";
        echo "\n<table id='hor-minimalist-b'>";
        echo "\n\n<thead>";
        echo "\n\n\n<tr>";
        echo "\n\n\n\n<th>Name</th>";
        echo "\n\n\n\n<th>Username</th>";
        echo "\n\n\n\n<th>Registered On</th>";
        echo "\n\n\n\n<th>Last Login</th>";
        echo "\n\n\n</tr>";
        echo "\n\n</thead>";
        echo "\n\n<tbody>";
        foreach ($result_all_users as $r) {
            $rdate = date('Y-m-d H:i:s', $r->created);
            $dtz = 'America/New_York';
            $regTimestamp = getNoteDateTimeZone($rdate, 'US/Central', $dtz);
            $ldate = date('Y-m-d H:i:s', $r->access);
            $loginTimestamp = getNoteDateTimeZone($ldate, 'US/Central', $dtz);
            echo "<tr>" . "<td><a href =" . $path_alias . "?uid=" . $r->uid . ">" . $r->title . "</a></td>" . "<td>" . $r->name . "</td>" . "<td>" . date("F jS, Y  \\( h:i a \\)", strtotime($regTimestamp)) . "</td>" . "<td>" . date("F jS, Y  \\( h:i a \\)", strtotime($loginTimestamp)) . "</td>" . "</tr>";
        }
        echo "\n\n</tbody>";
        echo "\n</table>";
        echo "</div>";
        echo "<br /><br /><br />";
    }
}
.top_bar.fixed
{
	position: fixed;
	animation-name: fadeIn;
	-webkit-animation-name: fadeIn;	
	animation-duration: 0.5s;	
	-webkit-animation-duration: 0.5s;
	visibility: visible !important;
}
<?php 
}
?>

<?php 
//Hack animation CSS for Safari
$current_browser = getBrowser();
//If enable animation
$pp_animation = get_option('pp_animation');
if ($pp_animation && isset($current_browser['name']) && $current_browser['name'] != 'Internet Explorer') {
    ?>
@-webkit-keyframes fadeIn { from { opacity:0; } to { opacity:0.99; } }
@-moz-keyframes fadeIn { from { opacity:0; } to { opacity:0.99; } }
@-ms-keyframes fadeIn { from { opacity:0; } to { opacity:0.99; } }
@keyframes fadeIn { from { opacity:0; } to { opacity:0.99; } }
 
.fade-in {
    animation-name: fadeIn;
	-webkit-animation-name: fadeIn;
	-ms-animation-name: fadeIn;	

	animation-duration: 0.7s;	
function validateSkin($skin)
{
    // --------------
    // This function validates the skin
    // --------------
    global $net2ftp_settings;
    $skinArray = getSkinArray();
    if (isset($skinArray[$skin]) == true) {
        return $skin;
    } elseif (isset($_COOKIE["net2ftpcookie_skin"]) == true && isset($skinArray[$_COOKIE["net2ftpcookie_skin"]]) == true) {
        return $_COOKIE["net2ftpcookie_skin"];
    } else {
        if (defined("_VALID_MOS") == true) {
            return "mambo";
        } elseif (defined("CACHE_PERMANENT") == true) {
            return "drupal";
        } elseif (defined("XOOPS_ROOT_PATH") == true) {
            return "xoops";
        } elseif (getBrowser("platform") == "Mobile") {
            return "mobile";
        } elseif (getBrowser("platform") == "iPhone") {
            return "iphone";
        } elseif (isset($skinArray[$net2ftp_settings["default_skin"]]) == true) {
            return $net2ftp_settings["default_skin"];
        } else {
            return "india";
        }
    }
}
Exemple #16
0
function addlog($idevent, $desc = '')
{
    opendb();
    $ipa = getIP();
    $currDateTime = new Datetime();
    $currDateTime = $currDateTime->format("Y-m-d H:i:s");
    $ua = getBrowser();
    $sqlInsert = "";
    $sqlInsert .= "insert into userlog (datetime, userid, eventtypeid, description, ipaddress, notes) values ";
    $sqlInsert .= "('" . $currDateTime . "', '" . Session("user_id") . "', '" . $idevent . "', '" . $desc . "', '" . $ipa . "','" . $ua['userAgent'] . "/" . $ua['platform'] . "')";
    RunSQL($sqlInsert);
}
 /**
  * Sets initial values to $this->logData
  * 
  * @access protected
  * @return void
  */
 protected function setInitialValues()
 {
     if (!$this->loggable) {
         return;
     }
     $parameters = $this->Controller->params;
     $params = '';
     if (!empty($parameters['pass'])) {
         $params = join('/', $parameters['pass']) . '/';
     }
     foreach ($parameters['named'] as $key => $param) {
         $params .= $key . ':' . $param . '/';
     }
     $data = $this->maskData($this->Controller->data);
     $browserInfo = getBrowser() + array('userAgent' => '', 'name' => '', 'version' => '', 'platform' => '');
     $new_data = array('time' => date("Y-m-d H:i:s"), 'session_id' => $this->Session->id(), 'ip' => $this->RequestHandler->getClientIP(), 'is_ajax' => $this->RequestHandler->isAjax(), 'url' => $this->Controller->here, 'user_agent' => $browserInfo['userAgent'], 'browser_name' => $browserInfo['name'], 'browser_version' => $browserInfo['version'], 'os' => $browserInfo['platform'], 'plugin' => $parameters['plugin'], 'controller' => $parameters['controller'], 'action' => $parameters['action'], 'params' => $params, 'method' => $_SERVER['REQUEST_METHOD'], 'post' => substr(serialize($data), 0, 7300));
     foreach ($new_data as $key => $content) {
         $this->set($key, $content);
     }
 }
Exemple #18
0
function recent_users()
{
    global $user;
    //Counting Views
    $path = $_GET['q'];
    $path_alias = drupal_get_path_alias($_GET["q"]);
    $query = db_select('users', 'u');
    $query->condition('u.uid', 0, '<>');
    $query->fields('u', array('uid', 'name'));
    $result = $query->execute();
    while ($record = $result->fetchAssoc()) {
        echo $record['uid'] . "\n\t\n" . "<a href =" . $path_alias . "?uid=" . $record['uid'] . ">" . $record['name'] . "</a>" . "<br />";
    }
    if ($_GET['uid']) {
        $counter = 0;
        $total_downloads = 0;
        //    drupal_set_message($path);
        // $visits = db_query("SELECT count(*) FROM {accesslog} where path = :path", array(':path' => $path))->fetchField();
        // echo "Views from conventional Ways: " . $visits;
        // echo just query2 to know how query is parsed.
        //Main Title and miscellaneous Information
        $result_user = db_query("\n\t\t  \tSELECT\n\t\t\t  f.field_full_n_value AS fullname, \n\t\t\t  u.mail AS email, \n\t\t\t  u.created AS joindate,\n\t\t\t  u.login AS lastlogin\n\t\t\tFROM\n\t\t\t  {field_data_field_full_n} f, {users} u where f.entity_id = u.uid AND u.uid = :uid\n\t\t\t", array(':uid' => $_GET['uid']))->fetchAll();
        // Finding all the Browsers Used
        $query_all_browsers = db_select('login_activity', 'a')->condition('a.uid', $_GET['uid'], '=')->fields('a', array('host_user_agent'));
        $result_b = $query_all_browsers->execute();
        echo "<div class='data-container' id='profile-info'>";
        echo "<div class='left'>";
        foreach ($result_user as $r) {
            echo "<h1>" . $r->fullname . "</h1>";
            echo "<span> Email: " . $r->email . "</span><br />";
            echo "<span> Joining Date: " . date("F jS, Y  \\( h:i a \\)", $r->joindate) . "</span><br />";
            echo "<span> Last Login: "******"F jS, Y  \\( h:i a \\)", $r->lastlogin) . "</span><br />";
            echo "<span> Internet Browsers Used: ";
            while ($record_all_browsers = $result_b->fetchAssoc()) {
                $detail_arr = getBrowser($record_all_browsers['host_user_agent']);
                echo "<img src ='" . $detail_arr['icon'] . "' width='24' height='24' />" . " / " . "<img src ='" . $detail_arr['os_icons'] . "' width='24' height='24' />" . "<br />";
            }
            echo "</span>";
        }
        echo "</div>";
        echo "<div class='right'>";
        echo "</div>";
        echo "<div class='clear'></div>";
        echo "</div>";
        // Count the number of times the current logged in user has
        // visited the current page
        $query_count_visits = db_select('accesslog', 'a')->condition('a.uid', $_GET['uid'], '=')->condition('a.path', $path, '=')->fields('a', array('uid', 'title'))->execute()->rowCount();
        // Finding all the Pages visited by the logged in User.
        // Also Count the number of times each Unique page is visited.
        $result = db_query("\n\t\t  \tSELECT\n\t\t\t  a.url, a.title, a.uid,\n\t\t\t  COUNT(*) AS times\n\t\t\tFROM\n\t\t\t  {accesslog} a where a.uid = :uid\n\t\t\tGROUP BY\n\t\t\t  a.url", array(':uid' => $_GET['uid']))->fetchAll();
        echo "<div id='page-wrap'>";
        echo "\n<table id='hor-minimalist-b'>";
        echo "\n\n<thead>";
        echo "\n\n\n<tr>";
        echo "\n\n\n\n<th>Pages Visited</th>";
        echo "\n\n\n\n<th>Times</th>";
        echo "\n\n\n\n<th>Browser</th>";
        echo "\n\n\n</tr>";
        echo "\n\n</thead>";
        echo "\n\n<tbody>";
        foreach ($result as $r) {
            echo "<tr>" . "<td>" . $r->url . "</td>" . "<td>" . $r->times . " times" . "</td>" . "<td>" . "Browser" . "</td>" . "</tr>";
        }
        echo "\n\n</tbody>";
        echo "\n</table>";
        echo "</div>";
        // Documents Downloaded
        $result_dl = db_query("\n\t\t  \tSELECT\n\t\t\t  d.name, d.url, n.title, d.count\n\t\t\tFROM\n\t\t\t  {pubdlcnt} d, {node} n where n.nid = d.nid AND d.uid = :uid\n\t\t\t", array(':uid' => $_GET['uid']))->fetchAll();
        foreach ($result_dl as $r) {
            $counter++;
            $total_downloads += $r->count;
        }
        /* Download Numbers PIE Graph */
        echo "<div class='data-container'>";
        echo "<div class='left'>";
        echo "<h1>Documents Downloaded</h1>";
        echo "<p>Total Documents downloaded: " . $counter . " </p>";
        echo "<p>Total Downloaded Count: " . $total_downloads . "</p>";
        echo "<div id='page-wrap'>";
        echo "\n<table id='hor-minimalist-c'>";
        echo "\n\n<thead>";
        echo "\n\n\n<tr>";
        echo "\n\n\n\n<th>Document Name</th>";
        echo "\n\n\n\n<th>Page</th>";
        echo "\n\n\n\n<th>Type</th>";
        echo "\n\n\n\n<th>Count</th>";
        echo "\n\n\n</tr>";
        echo "\n\n</thead>";
        echo "\n\n<tbody>";
        foreach ($result_dl as $r) {
            echo "<tr>" . "<td>" . preg_replace("/\\.[^.\\s]{3,4}\$/", "", str_replace("_", " ", $r->name)) . "</td>" . "<td>" . $r->title . "</td>" . "<td>" . pathinfo($r->name, PATHINFO_EXTENSION) . "</td>" . "<td>" . $r->count . "</td>" . "</tr>";
        }
        echo "\n\n</tbody>";
        echo "\n</table>";
        echo "</div>";
        echo "</div>";
        /* Pie Graph JS */
        echo "<script type='text/javascript' src='https://www.google.com/jsapi'></script>";
        echo "<script type='text/javascript'>";
        echo "  google.load('visualization', '1', {packages: ['corechart']})";
        echo "</script>";
        echo "<script type='text/javascript'>";
        echo "function drawVisualization() {";
        echo "var options = { ";
        echo "\t  width: 450,";
        echo "    height: 450,";
        echo "    chartArea:{left:10,top:10,width:'100%'},";
        //echo "	  title: 'Toppings I Like On My Pizza',";
        echo "    colors: ['#193153', '#919b02', '#9c2b11', '#e5760a', '#f6c7b6']";
        echo "};";
        //echo "var options = {'title':'asdasdasd asd asd ','width':500,'height':450,'chartArea':{left:0,top:10,width:'100%'}}";
        echo "var data = google.visualization.arrayToDataTable([";
        echo "['Document', 'No. of Downloads'],";
        foreach ($result_dl as $r) {
            $string = strlen($r->name) > 55 ? substr($r->name, 0, 52) . '...' : $r->name;
            echo "['" . preg_replace("/\\.[^.\\s]{3,4}\$/", "", str_replace("_", " ", $string)) . "', " . $r->count . "],";
        }
        echo "]);";
        echo "new google.visualization.PieChart(document.getElementById('visualization')).";
        echo "draw(data, options); ";
        echo " }";
        echo "google.setOnLoadCallback(drawVisualization);";
        echo "</script>";
        /* </Pie Graph JS */
        echo "<div class='right'>";
        echo "<div id='holder'>";
        /* Pie Graph Code */
        echo "<div id='visualization'></div>";
        echo "</div>";
        echo "</div>";
        echo "<div class='clear'></div>";
        echo "</div>";
        echo "<br />" . "Total number of Visits on all Pages: " . "1234" . "<br />";
    }
}
Exemple #19
0
															</form> <br>
															<a href="#"><i class="fa fa-key"></i> Lupa Password</a> <br>
															<a href="?page=anggota"><i class="fa fa-pencil-square-o"></i> Register Anggota</a>
														</div>
														<?php 
} else {
    ?>
														<div class="panel-heading">
															<i class="fa fa-user"> Profil Anggota</i> 
														</div>
														<div class="panel-body">
														<?php 
    $query_anggota_log = mysql_query("SELECT * FROM t_anggota WHERE nim = '" . $_SESSION['nim'] . "'");
    $data_log = mysql_fetch_array($query_anggota_log);
    include "utiliti/platform_detect.php";
    $detect = getBrowser();
    ?>
															<p><b>Id Angg. :</b> <?php 
    echo $data_log['id_anggota'];
    ?>
</p>
															<p><b>Nama </b> : <?php 
    echo ucwords($data_log['nama']);
    ?>
</p>
															<p><b>IP Anda : </b> <?php 
    echo $_SERVER['REMOTE_ADDR'];
    ?>
</p>
															<p><b>Browser : </b> <?php 
    echo $detect['name'] . " " . $detect['version'];
Exemple #20
0
 function connecteJoueur()
 {
     // Enregistrement de la date de dernière connexion
     $dateDerCnx = date("Y/m/d H:i:s");
     // Enregistrement du navigateur utilisé
     $Browser = getBrowser();
     try {
         $query = "update joueur set der_cnx=:dateDerCnx, der_navigateur=:browser where joueur_id=:id";
         $stmt = $this->conn->prepare($query);
         $stmt->bindParam(':dateDerCnx', $this->joueur_der_cnx);
         $stmt->bindParam(':browser', $this->joueur_pseudo);
         $stmt->bindParam(':id', $this->joueur_id);
         if ($stmt->execute()) {
             return true;
         } else {
             return false;
         }
     } catch (PDOException $exception) {
         echo "Ajoute une saison : " . $this->host . " : " . $exception->getMessage();
     }
 }
Exemple #21
0
<?php include "../include/params.php" ?>
<?php include "../include/dictionary2.php" ?>

<?php opendb();?>

<?php

	error_reporting(E_ALL & ~E_NOTICE & ~E_WARNING);  // [josip] za error reports

	header("Content-type: text/html; charset=utf-8");
	opendb();

	$Allow = getPriv("employees", session("user_id"));
	if ($Allow == False) echo header ('Location: ../permission/?l=' . $cLang);

	$ua=getBrowser();
	$yourbrowser = (bool) strpos($ua['userAgent'], "iPad");
	$yourbrowser1 = (bool) strpos($ua['userAgent'], "Macintosh");

	addlog(47);
?>

<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<?php
	if($yourbrowser == "1")
	{ ?>
	<style type="text/css">
		html { 
		    overflow: auto; 
Exemple #22
0
            $os_platform = $value;
        }
    }
    return $os_platform;
}
function getBrowser()
{
    global $user_agent;
    $browser = "Unknown Browser";
    $browser_array = array('/msie/i' => 'Internet Explorer', '/firefox/i' => 'Firefox', '/safari/i' => 'Safari', '/chrome/i' => 'Chrome', '/opera/i' => 'Opera', '/netscape/i' => 'Netscape', '/maxthon/i' => 'Maxthon', '/konqueror/i' => 'Konqueror', '/mobile/i' => 'Handheld Browser');
    foreach ($browser_array as $regex => $value) {
        if (preg_match($regex, $user_agent)) {
            $browser = $value;
        }
    }
    return $browser;
}
$user_os = getOS();
$user_browser = getBrowser();
$_SESSION['browser'] = $user_browser;
$_SESSION['operating_system'] = $user_os;
date_default_timezone_set('GMT');
$temp = strtotime("+5 hours 30 minutes");
$login_time = date("Y-m-d H:i:s", $temp);
//echo $date;
//$login_time= date("Y-m-d H:i:s");
//echo $login_time;
$_SESSION['login_time'] = $login_time;
//$device_details =   "<strong>Browser: </strong>".$user_browser."<br /><strong>Operating System: </strong>".$user_os."";
//print_r($device_details);
//echo("<br /><br /><br />".$_SERVER['HTTP_USER_AGENT']."");
Exemple #23
0
 function _HTML_systemLogo()
 {
     $pictype = 'png';
     if (getBrowser() == 'win/ie') {
         $pictype = 'gif';
     }
     return '<nobr><img src="/system/images/amp-megaphone.' . $pictype . '" align ="middle" style="padding-right:15px">' . "\n";
 }
Exemple #24
0
    }
    return array("UNKNOWN/", true, $ismob, $so, "UN", 0);
}
function outputBrowserName($browserID)
{
    $translation = array("OP" => "Opera", "IE" => "Internet Explorer", "FF" => "Firefox", "CH" => "Chrome", "AN" => "Android Browser", "SA" => "Safari", "KO" => "Konqueror", "MO" => "MOBILE/?", "UN" => "UNKNOWN/?");
    // <-- unknown non-mobile
    if (isset($translation[$browserID])) {
        return $translation[$browserID];
    } else {
        return "UNKNOWN/?";
    }
}
# set browser constants
if (!isset($_REQUEST['nocache']) && isset($_SESSION['CONS_BROWSER'])) {
    // if I have the browser, I have the rests
    define("CONS_BROWSER", $_SESSION['CONS_BROWSER']);
    define("CONS_BROWSER_VERSION", $_SESSION['CONS_BROWSER_VERSION']);
    define("CONS_BROWSER_ISMOB", $_SESSION['CONS_BROWSER_ISMOB']);
    define("CONS_BROWSER_SO", $_SESSION['CONS_BROWSER_SO']);
} else {
    $browser = getBrowser(false);
    define("CONS_BROWSER", $browser[4]);
    define("CONS_BROWSER_VERSION", $browser[5]);
    define("CONS_BROWSER_ISMOB", $browser[2]);
    define("CONS_BROWSER_SO", $browser[3]);
    $_SESSION['CONS_BROWSER'] = CONS_BROWSER;
    $_SESSION['CONS_BROWSER_VERSION'] = CONS_BROWSER_VERSION;
    $_SESSION['CONS_BROWSER_ISMOB'] = CONS_BROWSER_ISMOB;
    $_SESSION['CONS_BROWSER_SO'] = CONS_BROWSER_SO;
}
Exemple #25
0
    <description>Leonardo Photos (' . $photoNum . ')</description>
	' . $photoStr . '
  </Folder>
</Folder>
</kml>';
                                    $file_name = "Leonardo Tracks Explorer.kml";
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
list($browser_agent, $browser_version) = getBrowser();
if ($browser_agent == 'opera') {
    $attachmentMIME = 'application/kml';
} else {
    if ($browser_agent != 'ie' && $browser_agent != 'netscape' && $browser_agent != 'mozilla') {
        $attachmentMIME = "application/octet-stream";
    }
}
DEBUG("DL", 1, "browser_agent={$browser_agent}, browser version={$browser_version}<BR>");
// to debug
//	DEBUG_END();exit;
if (!headers_sent()) {
    /// martin jursa 19.6.2008
    header("Pragma: public");
    // required
    header("Expires: 0");
Exemple #26
0
}
$topic_id = getInt($_POST['topic_id']);
$user_id = getInt($session->user_id);
$db = new nullBB_Database($_CONF, $_LANG);
$content = sanitizeQuery($_POST['content']);
$forum = $db->query('select forum_id from ' . $_CONF['dbprefix'] . 'topics where ' . 'topic_id = ' . $topic_id);
$db->freeResult();
if (empty($forum)) {
    require_once ABSOLUTE_BASEPATH . '/header.' . PHPEXT;
    notification($_LANG['invalid_topic'], $_SERVER['HTTP_REFERER'], 3);
    die;
}
$forum_id = getInt($forum[0]['forum_id']);
$ip = sanitizeQuery($_SERVER['REMOTE_ADDR']);
$so = sanitizeQuery(getSO($_SERVER['HTTP_USER_AGENT']));
$browser = sanitizeQuery(getBrowser($_SERVER['HTTP_USER_AGENT']));
$res = $db->query('select forum_postgroup from ' . $_CONF['dbprefix'] . 'forums where ' . "forum_id='" . $forum_id . "'");
$db->freeResult();
$forum_postgroup = getInt($res[0]['forum_postgroup']);
unset($res);
if ($userinfo['user_group'] > $forum_postgroup) {
    require_once ABSOLUTE_BASEPATH . '/header.' . PHPEXT;
    notification($_LANG['insufficient_privileges'], $_SERVER['HTTP_REFERER'], 3);
    die;
}
$res = $db->query('select topic_disabled from ' . $_CONF['dbprefix'] . 'topics ' . "where topic_id='{$id}'");
$db->freeResult();
$topic_disabled = getInt($res[0]['topic_disabled']);
unset($res);
if ($topic_disabled) {
    require_once ABSOLUTE_BASEPATH . '/header.' . PHPEXT;
Exemple #27
0
    $err_message .= " Could not connect to File database.<br>\n";
    $err_message .= "<br><br> Try <a href='view_file.php?fileid=" . $_GET["fileid"] . "'>again</a>?";
    do_html_footer(&$err_message);
    exit;
} else {
    if (!$rows) {
        do_html_header("View File Failed", &$err_message);
        $err_message .= " The requested file is not available.<br>\n";
        $err_message .= "<br><br> Try <a href='view_file.php?fileid=" . $_GET["fileid"] . "'>again</a>?";
        do_html_footer(&$err_message);
        exit;
    }
}
$row = $result->FetchNextObj();
$data = $row->File;
$name = $row->FileName;
$size = $row->FileSize;
$type = $row->FileType;
// Check for Internet Explorer to avoid inline PDF viewing bug
$browser = getBrowser();
if ($browser == "IEWin") {
    $method = "attachment";
} else {
    $method = "inline";
}
header("Cache-control: private");
header("Content-type: {$type}");
header("Content-length: {$size}");
header("Content-Disposition: {$method}; filename={$name}");
header("Content-Description: PHP Generated Data");
echo $data;
Exemple #28
0
function type_db($table, $champs)
{
    //le mot clé "global" permet d'ouvrir la portée des variables
    global $db_mapping;
    $browser = getBrowser();
    // navigateur utilisé ???
    // on recupere le mapping de la table en parametres
    $table_mapping = $db_mapping[$table];
    if (isset($table_mapping['key'][$champs])) {
        $key = $table_mapping['key'][$champs];
    }
    $prop = $table_mapping['champs'][$champs];
    //on genere la ligne HTML avec les propriétés defini dans le champ
    switch ($prop['type']) {
        default:
        case 'VARCHAR':
        case 'varchar':
            $balise = 'input';
            $type = 'text';
            break;
        case 'TEXT':
        case 'text':
            $balise = 'textarea';
            $type = 'area';
            break;
        case 'datetime':
        case 'DATETIME':
            $balise = 'input';
            if (preg_match('/Chrome/i', $browser['name'])) {
                $type = 'datetime-local';
            } else {
                if (preg_match('/Safari/i', $browser['name']) || preg_match('/Opera/i', $browser['name'])) {
                    $type = 'datetime';
                } else {
                    $type = 'date';
                }
            }
            break;
        case 'MEDIUMINT':
        case 'mediumint':
        case 'BIGINT':
        case 'bigint':
        case 'INT':
        case 'int':
        case 'tinyint':
        case 'TINYINT':
            if (isset($table_mapping['key'][$champs]) && preg_match('/FOREIGN/i', $key['key'])) {
                $type = "foreign";
                $balise = "select";
            } else {
                if (isset($prop['increment'])) {
                    $balise = 'input';
                    $type = 'hidden';
                } else {
                    $balise = 'input';
                    $type = 'number';
                }
            }
            break;
    }
    return array($type, $balise);
}
        return 'Mozilla Firefox';
    } elseif (strpos($user_agent, 'Edge') !== FALSE) {
        return 'IE';
    } elseif (strpos($user_agent, 'Chrome') !== FALSE) {
        return 'Google Chrome';
    } elseif (strpos($user_agent, 'Opera Mini') !== FALSE) {
        return "Opera Mini";
    } elseif (strpos($user_agent, 'Opera') !== FALSE) {
        return "Opera";
    } elseif (strpos($user_agent, 'Safari') !== FALSE) {
        return "Safari";
    } else {
        return 'OTROr';
    }
}
$navegador = getBrowser($user_agent);
?>

        <script type="text/javascript">
        jQuery(document).ready(function(){
    		$("#guardar").click(function () {
    			if($("#matricula_asignada").val() != "") { 
    				$.blockUI({message: 'Procesando por favor espere...'});
    	        	jQuery.ajax({
    		            type: 'POST',
    		            url: 'activacion_uni/getBeneficiario/',
    		            data: {matricula: $("#matricula_asignada").val()},
    		            success: function (data) {
        		            if(data == 'sinregistro') {
        		            	$.unblockUI();
        		            	$('#myModalSinRegistro').modal('show'); //open modal  
Exemple #30
0
function setCnxUtilisateur($joueur_id)
{
    // Enregistrement de la date de dernière connexion
    $dateDerCnx = date("Y/m/d H:i:s");
    // Enregistrement du navigateur utilisé
    $Browser = getBrowser();
    $requete = "update joueur set der_cnx='{$dateDerCnx}', der_navigateur='{$Browser}' where joueur_id='{$joueur_id}'";
    $result = mysql_query($requete);
    return "";
}