function showDuplicateMetaInfo($data, $exportVersion, $projectInfo)
 {
     $repType = addslashes($data['report_type']);
     $projectId = $projectInfo['id'];
     $sql = "select {$repType},count(*) as count from auditorreports where project_id={$projectId} and {$repType}!=''";
     $filter = "";
     // check for page url
     if (isset($data['crawled']) && $data['crawled'] != -1) {
         $data['crawled'] = intval($data['crawled']);
         $filter .= "&crawled=" . $data['crawled'];
         $sql .= " and crawled=" . $data['crawled'];
     }
     // to find order col
     if (!empty($data['order_col'])) {
         $orderCol = $data['order_col'];
         $orderVal = $data['order_val'];
     } else {
         $orderCol = 'count';
         $orderVal = 'DESC';
     }
     $filter .= "&order_col={$orderCol}&order_val={$orderVal}";
     $pgScriptPath = SP_WEBPATH . "/siteauditor.php?sec=showreport&report_type={$repType}&project_id=" . $projectId . $filter;
     // pagination setup
     $sql .= " group by {$repType} having count>1";
     $this->db->query($sql, true);
     $this->paging->setDivClass('pagingdiv');
     $this->paging->loadPaging($this->db->noRows, SP_PAGINGNO);
     $pagingDiv = $this->paging->printPages($pgScriptPath, '', 'scriptDoLoad', 'subcontent', 'layout=ajax');
     $this->set('pagingDiv', $pagingDiv);
     $sql .= " order by " . addslashes($orderCol) . " " . addslashes($orderVal);
     if (!$exportVersion) {
         $sql .= " limit " . $this->paging->start . "," . $this->paging->per_page;
     }
     $totalResults = $this->db->noRows;
     $headArr = array('page_title' => $this->spTextSA["Duplicate Title"], 'page_description' => $this->spTextSA["Duplicate Description"], 'page_keywords' => $this->spTextSA["Duplicate Keywords"], 'page_urls' => $this->spTextSA["Page Links"], 'count' => $_SESSION['text']['label']["Count"]);
     $list = $this->db->select($sql);
     $dupInfo[$repType] = $list;
     $auditorComp = $this->createComponent('AuditorComponent');
     foreach ($dupInfo[$repType] as $i => $listInfo) {
         $dupInfo[$repType][$i]['page_urls'] = $auditorComp->getAllreportPages(" and project_id={$projectId} and {$repType}='" . addslashes($listInfo[$repType]) . "'", 'id,page_url');
     }
     if ($exportVersion) {
         $spText = $_SESSION['text'];
         $exportContent = createExportContent(array('', $headArr[$repType] . " " . $_SESSION['text']['common']['Reports'], ''));
         $exportContent .= createExportContent(array());
         $exportContent .= createExportContent(array());
         $exportContent .= createExportContent(array($this->spTextSA['Project Url'], $projectInfo['url']));
         $exportContent .= createExportContent(array($_SESSION['text']['label']['Updated'], $projectInfo['last_updated']));
         $exportContent .= createExportContent(array($_SESSION['text']['label']['Total Results'], $totalResults));
         $exportContent .= createExportContent(array());
         $exportContent .= createExportContent(array($spText['common']['No'], $headArr[$repType], $headArr["page_urls"], $headArr["count"]));
         foreach ($dupInfo[$repType] as $i => $listInfo) {
             $pageUrls = "";
             foreach ($listInfo['page_urls'] as $urlInfo) {
                 $pageUrls .= $urlInfo['page_url'] . "\n";
             }
             $exportContent .= createExportContent(array($i + 1, $listInfo[$repType], $pageUrls, $listInfo['count']));
         }
         exportToCsv('siteauditor_duplicate_' . $repType, $exportContent);
     } else {
         $this->set('orderCol', $orderCol);
         $this->set('orderVal', $orderVal);
         $this->set('filter', $filter);
         $this->set('pageNo', $_GET['pageno']);
         $this->set('totalResults', $totalResults);
         $this->set('list', $dupInfo[$repType]);
         $this->set('repType', $repType);
         $this->set('headArr', $headArr);
         $this->render('siteauditor/showduplicatemetainfo');
     }
 }
示例#2
0
 function index($searchInfo = '')
 {
     $spTextHome = $this->getLanguageTexts('home', $_SESSION['lang_code']);
     $this->set('spTextHome', $spTextHome);
     if (isLoggedIn()) {
         $userId = isLoggedIn();
         $exportVersion = false;
         switch ($searchInfo['doc_type']) {
             case "export":
                 $exportVersion = true;
                 $exportContent = "";
                 break;
             case "print":
                 $this->set('printVersion', true);
                 break;
         }
         $websiteCtrler = new WebsiteController();
         $list = $websiteCtrler->__getAllWebsites($userId, true);
         include_once SP_CTRLPATH . "/saturationchecker.ctrl.php";
         include_once SP_CTRLPATH . "/rank.ctrl.php";
         include_once SP_CTRLPATH . "/backlink.ctrl.php";
         $rankCtrler = new RankController();
         $backlinlCtrler = new BacklinkController();
         $saturationCtrler = new SaturationCheckerController();
         $dirCtrler = new DirectoryController();
         $websiteList = array();
         foreach ($list as $listInfo) {
             # rank reports
             $report = $rankCtrler->__getWebsiteRankReport($listInfo['id']);
             $report = $report[0];
             $listInfo['alexarank'] = empty($report['alexa_rank']) ? "-" : $report['alexa_rank'] . " " . $report['rank_diff_alexa'];
             $listInfo['googlerank'] = empty($report['google_pagerank']) ? "-" : $report['google_pagerank'] . " " . $report['rank_diff_google'];
             # back links reports
             $report = $backlinlCtrler->__getWebsitebacklinkReport($listInfo['id']);
             $report = $report[0];
             $listInfo['google']['backlinks'] = empty($report['google']) ? "-" : $report['google'] . " " . $report['rank_diff_google'];
             $listInfo['yahoo']['backlinks'] = empty($report['yahoo']) ? "-" : $report['yahoo'] . " " . $report['rank_diff_yahoo'];
             $listInfo['msn']['backlinks'] = empty($report['msn']) ? "-" : $report['msn'] . " " . $report['rank_diff_msn'];
             $listInfo['altavista']['backlinks'] = empty($report['altavista']) ? "-" : $report['altavista'] . " " . $report['rank_diff_altavista'];
             $listInfo['alltheweb']['backlinks'] = empty($report['alltheweb']) ? "-" : $report['alltheweb'] . " " . $report['rank_diff_alltheweb'];
             # rank reports
             $report = $saturationCtrler->__getWebsiteSaturationReport($listInfo['id']);
             $report = $report[0];
             $listInfo['google']['indexed'] = empty($report['google']) ? "-" : $report['google'] . " " . $report['rank_diff_google'];
             $listInfo['yahoo']['indexed'] = empty($report['yahoo']) ? "-" : $report['yahoo'] . " " . $report['rank_diff_yahoo'];
             $listInfo['msn']['indexed'] = empty($report['msn']) ? "-" : $report['msn'] . " " . $report['rank_diff_msn'];
             $listInfo['dirsub']['total'] = $dirCtrler->__getTotalSubmitInfo($listInfo['id']);
             $listInfo['dirsub']['active'] = $dirCtrler->__getTotalSubmitInfo($listInfo['id'], true);
             $websiteList[] = $listInfo;
         }
         if ($exportVersion) {
             $exportContent .= createExportContent(array());
             $exportContent .= createExportContent(array());
             $exportContent .= createExportContent(array('', $spTextHome['Website Statistics'], ''));
             $exportContent .= createExportContent(array());
             $headList = array('Id', 'Website', 'Google Pagerank', 'Alexa Rank', 'Google Backlinks', 'Yahoo Backlinks', 'MSN Backlinks', 'Altavista Backlinks', 'Alltheweb Backlinks', 'Google Indexed', 'Yahoo Indexed', 'MSN Indexed', 'Total Submission', 'Active Submission');
             $exportContent .= createExportContent($headList);
             foreach ($websiteList as $websiteInfo) {
                 $valueList = array($websiteInfo['id'], $websiteInfo['url'], strip_tags($websiteInfo['googlerank']), strip_tags($websiteInfo['alexarank']), strip_tags($websiteInfo['google']['backlinks']), strip_tags($websiteInfo['yahoo']['backlinks']), strip_tags($websiteInfo['msn']['backlinks']), strip_tags($websiteInfo['altavista']['backlinks']), strip_tags($websiteInfo['alltheweb']['backlinks']), strip_tags($websiteInfo['google']['indexed']), strip_tags($websiteInfo['yahoo']['indexed']), strip_tags($websiteInfo['msn']['indexed']), $websiteInfo['dirsub']['total'], $websiteInfo['dirsub']['active']);
                 $exportContent .= createExportContent($valueList);
             }
             exportToCsv('website_statistics', $exportContent);
         } else {
             $this->set('websiteList', $websiteList);
             $layout = $searchInfo['doc_type'] == "print" ? "ajax" : "";
             $this->render('user/userhome', $layout);
         }
     } else {
         $this->render('home');
     }
 }
示例#3
0
 function showKeywordReportSummary($searchInfo = '')
 {
     $userId = isLoggedIn();
     $exportVersion = false;
     switch ($searchInfo['doc_type']) {
         case "export":
             $exportVersion = true;
             $exportContent = "";
             break;
         case "print":
             $this->set('printVersion', true);
             break;
     }
     $websiteController = new WebsiteController();
     $websiteList = $websiteController->__getAllWebsitesWithActiveKeywords($userId, true);
     $this->set('websiteList', $websiteList);
     $websiteId = isset($searchInfo['website_id']) ? $searchInfo['website_id'] : $websiteList[0]['id'];
     $this->set('websiteId', $websiteId);
     $seController = new SearchEngineController();
     $this->seLIst = $seController->__getAllSearchEngines();
     $this->set('seList', $this->seLIst);
     $keywordController = new KeywordController();
     $list = $keywordController->__getAllKeywords($userId, $websiteId, true);
     foreach ($list as $keywordInfo) {
         $positionInfo = $this->__getKeywordSearchReport($keywordInfo['id']);
         $keywordInfo['position_info'] = $positionInfo;
         $keywordList[] = $keywordInfo;
     }
     if ($exportVersion) {
         $spText = $_SESSION['text'];
         $exportContent .= createExportContent(array('', $this->spTextTools['Keyword Position Summary'], ''));
         $exportContent .= createExportContent(array());
         $headList = array($spText['common']['Website'], $spText['common']['Keyword']);
         foreach ($this->seLIst as $seInfo) {
             $headList[] = $seInfo['domain'];
         }
         $exportContent .= createExportContent($headList);
         foreach ($keywordList as $listInfo) {
             $positionInfo = $listInfo['position_info'];
             $valueList = array($listInfo['weburl'], $listInfo['name']);
             foreach ($this->seLIst as $index => $seInfo) {
                 $rank = empty($positionInfo[$seInfo['id']]['rank']) ? '-' : $positionInfo[$seInfo['id']]['rank'];
                 $rankDiff = empty($positionInfo[$seInfo['id']]['rank_diff']) ? '' : $positionInfo[$seInfo['id']]['rank_diff'];
                 $valueList[] = $rank . strip_tags($rankDiff);
             }
             $exportContent .= createExportContent($valueList);
         }
         exportToCsv('keyword_report_summary', $exportContent);
     } else {
         $this->set('list', $keywordList);
         $this->render('report/reportsummary');
     }
 }
示例#4
0
 function showOverallReportSummary($searchInfo = '', $cronUserId = false)
 {
     $spTextHome = $this->getLanguageTexts('home', $_SESSION['lang_code']);
     $this->set('spTextHome', $spTextHome);
     $this->set('cronUserId', $cronUserId);
     $exportVersion = false;
     switch ($searchInfo['doc_type']) {
         case "export":
             $exportVersion = true;
             $exportContent = "";
             break;
         case "print":
             $this->set('printVersion', true);
             break;
     }
     $this->set('sectionHead', 'Overall Report Summary');
     $userId = empty($cronUserId) ? isLoggedIn() : $cronUserId;
     $isAdmin = isAdmin();
     $websiteCtrler = new WebsiteController();
     $websiteList = $websiteCtrler->__getAllWebsites($userId, true);
     $this->set('siteList', $websiteList);
     $websiteId = isset($searchInfo['website_id']) ? $searchInfo['website_id'] : $websiteList[0]['id'];
     $websiteId = intval($websiteId);
     $this->set('websiteId', $websiteId);
     $urlarg = "website_id={$websiteId}";
     $websiteUrl = "";
     foreach ($websiteList as $websiteInfo) {
         if ($websiteInfo['id'] == $websiteId) {
             $websiteUrl = $websiteInfo['url'];
             break;
         }
     }
     $this->set('websiteUrl', $websiteUrl);
     $reportTypes = array('keyword-position' => $this->spTextTools["Keyword Position Summary"], 'website-stats' => $spTextHome["Website Statistics"]);
     $this->set('reportTypes', $reportTypes);
     $urlarg .= "&report_type=" . $searchInfo['report_type'];
     if (!empty($searchInfo['from_time'])) {
         $fromTime = strtotime($searchInfo['from_time'] . ' 00:00:00');
     } else {
         $fromTime = mktime(0, 0, 0, date('m'), date('d') - 1, date('Y'));
     }
     if (!empty($searchInfo['to_time'])) {
         $toTime = strtotime($searchInfo['to_time'] . ' 00:00:00');
     } else {
         $toTime = mktime(0, 0, 0, date('m'), date('d'), date('Y'));
     }
     $fromTimeShort = date('Y-m-d', $fromTime);
     $this->set('fromTime', $fromTimeShort);
     $toTimeShort = date('Y-m-d', $toTime);
     $this->set('toTime', $toTimeShort);
     $urlarg .= "&from_time={$fromTimeShort}&to_time={$toTimeShort}";
     $seController = new SearchEngineController();
     $this->seLIst = $seController->__getAllSearchEngines();
     $this->set('seList', $this->seLIst);
     $this->set('isAdmin', $isAdmin);
     $this->set('urlarg', $urlarg);
     # keyword position report section
     if (empty($searchInfo['report_type']) || $searchInfo['report_type'] == 'keyword-position') {
         // to find order col
         if (!empty($searchInfo['order_col'])) {
             $orderCol = $searchInfo['order_col'];
             $orderVal = $searchInfo['order_val'];
         } else {
             $orderCol = $this->seLIst[0]['id'];
             $orderVal = 'ASC';
         }
         $this->set('orderCol', $orderCol);
         $this->set('orderVal', $orderVal);
         $keywordController = new KeywordController();
         $list = $keywordController->__getAllKeywords($userId, $websiteId, true, true, $orderVal);
         $indexList = array();
         foreach ($list as $keywordInfo) {
             $positionInfo = $this->__getKeywordSearchReport($keywordInfo['id'], $fromTime, $toTime);
             // check whether the sorting search engine is there
             $indexList[$keywordInfo['id']] = empty($positionInfo[$orderCol]) ? 10000 : $positionInfo[$orderCol]['rank'];
             $keywordInfo['position_info'] = $positionInfo;
             $keywordList[$keywordInfo['id']] = $keywordInfo;
         }
         // sort array according the value
         if ($orderCol != 'keyword') {
             if ($orderVal == 'DESC') {
                 arsort($indexList);
             } else {
                 asort($indexList);
             }
         }
         $this->set('indexList', $indexList);
         if ($exportVersion) {
             $spText = $_SESSION['text'];
             $reportHeading = $this->spTextTools['Keyword Position Summary'] . "({$fromTimeShort} - {$toTimeShort})";
             $exportContent .= createExportContent(array('', $reportHeading, ''));
             $exportContent .= createExportContent(array());
             $headList = array($spText['common']['Website'], $spText['common']['Keyword']);
             foreach ($this->seLIst as $seInfo) {
                 $headList[] = $seInfo['domain'];
             }
             $exportContent .= createExportContent($headList);
             foreach ($indexList as $keywordId => $rankValue) {
                 $listInfo = $keywordList[$keywordId];
                 $positionInfo = $listInfo['position_info'];
                 $valueList = array($listInfo['weburl'], $listInfo['name']);
                 foreach ($this->seLIst as $index => $seInfo) {
                     $rank = empty($positionInfo[$seInfo['id']]['rank']) ? '-' : $positionInfo[$seInfo['id']]['rank'];
                     $rankDiff = empty($positionInfo[$seInfo['id']]['rank_diff']) ? '' : $positionInfo[$seInfo['id']]['rank_diff'];
                     $valueList[] = $rank . strip_tags($rankDiff);
                 }
                 $exportContent .= createExportContent($valueList);
             }
         } else {
             $this->set('list', $keywordList);
             $this->set('keywordPos', true);
         }
     }
     # website report section
     if (empty($searchInfo['report_type']) || $searchInfo['report_type'] == 'website-stats') {
         include_once SP_CTRLPATH . "/saturationchecker.ctrl.php";
         include_once SP_CTRLPATH . "/rank.ctrl.php";
         include_once SP_CTRLPATH . "/backlink.ctrl.php";
         include_once SP_CTRLPATH . "/directory.ctrl.php";
         $rankCtrler = new RankController();
         $backlinlCtrler = new BacklinkController();
         $saturationCtrler = new SaturationCheckerController();
         $dirCtrler = new DirectoryController();
         $websiteRankList = array();
         foreach ($websiteList as $listInfo) {
             // if only needs to show onewebsite selected
             if (!empty($websiteId) && $listInfo['id'] != $websiteId) {
                 continue;
             }
             # rank reports
             $report = $rankCtrler->__getWebsiteRankReport($listInfo['id'], $fromTime, $toTime);
             $report = $report[0];
             $listInfo['alexarank'] = empty($report['alexa_rank']) ? "-" : $report['alexa_rank'] . " " . $report['rank_diff_alexa'];
             $listInfo['googlerank'] = empty($report['google_pagerank']) ? "-" : $report['google_pagerank'] . " " . $report['rank_diff_google'];
             # back links reports
             $report = $backlinlCtrler->__getWebsitebacklinkReport($listInfo['id'], $fromTime, $toTime);
             $report = $report[0];
             $listInfo['google']['backlinks'] = empty($report['google']) ? "-" : $report['google'] . " " . $report['rank_diff_google'];
             $listInfo['alexa']['backlinks'] = empty($report['alexa']) ? "-" : $report['alexa'] . " " . $report['rank_diff_alexa'];
             $listInfo['msn']['backlinks'] = empty($report['msn']) ? "-" : $report['msn'] . " " . $report['rank_diff_msn'];
             # rank reports
             $report = $saturationCtrler->__getWebsiteSaturationReport($listInfo['id'], $fromTime, $toTime);
             $report = $report[0];
             $listInfo['google']['indexed'] = empty($report['google']) ? "-" : $report['google'] . " " . $report['rank_diff_google'];
             $listInfo['msn']['indexed'] = empty($report['msn']) ? "-" : $report['msn'] . " " . $report['rank_diff_msn'];
             $listInfo['dirsub']['total'] = $dirCtrler->__getTotalSubmitInfo($listInfo['id']);
             $listInfo['dirsub']['active'] = $dirCtrler->__getTotalSubmitInfo($listInfo['id'], true);
             $websiteRankList[] = $listInfo;
         }
         // if export function called
         if ($exportVersion) {
             $exportContent .= createExportContent(array());
             $exportContent .= createExportContent(array());
             $exportContent .= createExportContent(array('', $spTextHome['Website Statistics'] . "({$fromTimeShort} - {$toTimeShort})", ''));
             if (isAdmin() && !empty($webUserId)) {
                 $exportContent .= createExportContent(array());
                 $exportContent .= createExportContent(array());
                 $userInfo = $userCtrler->__getUserInfo($webUserId);
                 $exportContent .= createExportContent(array($_SESSION['text']['common']['User'], $userInfo['username']));
             }
             $exportContent .= createExportContent(array());
             $headList = array($_SESSION['text']['common']['Id'], $_SESSION['text']['common']['Website'], 'Google Pagerank', 'Alexa Rank', 'Google ' . $spTextHome['Backlinks'], 'alexa ' . $spTextHome['Backlinks'], 'Bing ' . $spTextHome['Backlinks'], 'Google ' . $spTextHome['Indexed'], 'Bing ' . $spTextHome['Indexed'], $_SESSION['text']['common']['Total'] . ' Submission', $_SESSION['text']['common']['Active'] . ' Submission');
             $exportContent .= createExportContent($headList);
             foreach ($websiteRankList as $websiteInfo) {
                 $valueList = array($websiteInfo['id'], $websiteInfo['url'], strip_tags($websiteInfo['googlerank']), strip_tags($websiteInfo['alexarank']), strip_tags($websiteInfo['google']['backlinks']), strip_tags($websiteInfo['alexa']['backlinks']), strip_tags($websiteInfo['msn']['backlinks']), strip_tags($websiteInfo['google']['indexed']), strip_tags($websiteInfo['msn']['indexed']), $websiteInfo['dirsub']['total'], $websiteInfo['dirsub']['active']);
                 $exportContent .= createExportContent($valueList);
             }
         } else {
             $this->set('websiteRankList', $websiteRankList);
             $this->set('websiteStats', true);
         }
     }
     if ($exportVersion) {
         exportToCsv('archived_report', $exportContent);
     } else {
         $this->set('searchInfo', $searchInfo);
         // if execution through cron job then just return teh content to send through mail
         if (!empty($cronUserId)) {
             return $this->getViewContent('report/archive');
         } else {
             $this->render('report/archive');
         }
     }
 }
示例#5
0
 function index($searchInfo = '')
 {
     $spTextHome = $this->getLanguageTexts('home', $_SESSION['lang_code']);
     $this->set('spTextHome', $spTextHome);
     if (isLoggedIn()) {
         isHavingWebsite();
         $userId = isLoggedIn();
         $exportVersion = false;
         switch ($searchInfo['doc_type']) {
             case "export":
                 $exportVersion = true;
                 $exportContent = "";
                 break;
             case "pdf":
                 $this->set('pdfVersion', true);
                 break;
             case "print":
                 $this->set('printVersion', true);
                 break;
         }
         if (isAdmin()) {
             $userCtrler = new UserController();
             $userList = $userCtrler->__getAllUsersHavingWebsite();
             if (isset($_POST['user_id']) || isset($_GET['user_id'])) {
                 $webUserId = intval($_POST['user_id']) ? intval($_POST['user_id']) : intval($_GET['user_id']);
             } else {
                 $webUserId = $userList[0]['id'];
             }
             $this->set('userList', $userList);
             // if print method called
             if ($searchInfo['doc_type'] == 'print' && !empty($webUserId)) {
                 $userInfo = $userCtrler->__getUserInfo($webUserId);
                 $this->set('userName', $userInfo['username']);
             }
         } else {
             $webUserId = $userId;
         }
         $this->set('webUserId', $webUserId);
         $websiteCtrler = new WebsiteController();
         $adminCheck = isAdmin() && empty($webUserId) ? true : false;
         $list = $websiteCtrler->__getAllWebsites($webUserId, $adminCheck, $searchInfo['search_name']);
         include_once SP_CTRLPATH . "/saturationchecker.ctrl.php";
         include_once SP_CTRLPATH . "/rank.ctrl.php";
         include_once SP_CTRLPATH . "/backlink.ctrl.php";
         $rankCtrler = new RankController();
         $backlinlCtrler = new BacklinkController();
         $saturationCtrler = new SaturationCheckerController();
         $dirCtrler = new DirectoryController();
         $fromTime = mktime(0, 0, 0, date('m'), date('d') - 1, date('Y'));
         $toTime = mktime(0, 0, 0, date('m'), date('d'), date('Y'));
         $websiteList = array();
         foreach ($list as $listInfo) {
             # rank reports
             $report = $rankCtrler->__getWebsiteRankReport($listInfo['id'], $fromTime, $toTime);
             $report = $report[0];
             $listInfo['alexarank'] = empty($report['alexa_rank']) ? "-" : $report['alexa_rank'] . " " . $report['rank_diff_alexa'];
             $listInfo['googlerank'] = empty($report['google_pagerank']) ? "-" : $report['google_pagerank'] . " " . $report['rank_diff_google'];
             # back links reports
             $report = $backlinlCtrler->__getWebsitebacklinkReport($listInfo['id'], $fromTime, $toTime);
             $report = $report[0];
             $listInfo['google']['backlinks'] = empty($report['google']) ? "-" : $report['google'] . " " . $report['rank_diff_google'];
             $listInfo['alexa']['backlinks'] = empty($report['alexa']) ? "-" : $report['alexa'] . " " . $report['rank_diff_alexa'];
             $listInfo['msn']['backlinks'] = empty($report['msn']) ? "-" : $report['msn'] . " " . $report['rank_diff_msn'];
             # rank reports
             $report = $saturationCtrler->__getWebsiteSaturationReport($listInfo['id'], $fromTime, $toTime);
             $report = $report[0];
             $listInfo['google']['indexed'] = empty($report['google']) ? "-" : $report['google'] . " " . $report['rank_diff_google'];
             $listInfo['msn']['indexed'] = empty($report['msn']) ? "-" : $report['msn'] . " " . $report['rank_diff_msn'];
             $listInfo['dirsub']['total'] = $dirCtrler->__getTotalSubmitInfo($listInfo['id']);
             $listInfo['dirsub']['active'] = $dirCtrler->__getTotalSubmitInfo($listInfo['id'], true);
             $websiteList[] = $listInfo;
         }
         // if export function called
         if ($exportVersion) {
             $exportContent .= createExportContent(array());
             $exportContent .= createExportContent(array());
             $exportContent .= createExportContent(array('', $spTextHome['Website Statistics'], ''));
             if (isAdmin() && !empty($webUserId)) {
                 $exportContent .= createExportContent(array());
                 $exportContent .= createExportContent(array());
                 $userInfo = $userCtrler->__getUserInfo($webUserId);
                 $exportContent .= createExportContent(array($_SESSION['text']['common']['User'], $userInfo['username']));
             }
             $exportContent .= createExportContent(array());
             $headList = array($_SESSION['text']['common']['Id'], $_SESSION['text']['common']['Website'], 'Google Pagerank', 'Alexa Rank', 'Google ' . $spTextHome['Backlinks'], 'alexa ' . $spTextHome['Backlinks'], 'Bing ' . $spTextHome['Backlinks'], 'Google ' . $spTextHome['Indexed'], 'Bing ' . $spTextHome['Indexed'], $_SESSION['text']['common']['Total'] . ' Submission', $_SESSION['text']['common']['Active'] . ' Submission');
             $exportContent .= createExportContent($headList);
             foreach ($websiteList as $websiteInfo) {
                 $valueList = array($websiteInfo['id'], $websiteInfo['url'], strip_tags($websiteInfo['googlerank']), strip_tags($websiteInfo['alexarank']), strip_tags($websiteInfo['google']['backlinks']), strip_tags($websiteInfo['alexa']['backlinks']), strip_tags($websiteInfo['msn']['backlinks']), strip_tags($websiteInfo['google']['indexed']), strip_tags($websiteInfo['msn']['indexed']), $websiteInfo['dirsub']['total'], $websiteInfo['dirsub']['active']);
                 $exportContent .= createExportContent($valueList);
             }
             exportToCsv('website_statistics', $exportContent);
         } else {
             $this->set('websiteList', $websiteList);
             // if pdf export
             if ($searchInfo['doc_type'] == "pdf") {
                 $fromTimeTxt = date('Y-m-d', $fromTime);
                 $toTimeTxt = date('Y-m-d', $toTime);
                 exportToPdf($this->getViewContent('user/userhome'), "account_summary_{$fromTimeTxt}-{$toTimeTxt}.pdf");
             } else {
                 $layout = $searchInfo['doc_type'] == "print" ? "ajax" : "";
                 $this->set('searchInfo', $searchInfo);
                 $this->render('user/userhome', $layout);
             }
         }
     } else {
         $this->render('home');
     }
 }