Example #1
0
 /**
  * 得到当前站点的统计信息
  */
 public function statking()
 {
     // 初始化返回数据
     $return_data = array();
     //请求结构体
     $request_data = array();
     try {
         $site_detail = Mysite::instance()->detail();
         $statking_id = $site_detail['statking_id'];
         $statking_main = statking::get_main_detail($statking_id);
         //0.7s
         $statking_str = statistics::get_statkings($statking_id);
         //0.8s
         $this->template = new View('template_blank');
         $this->template->content = new View("site/statistics_statking");
         $this->template->content->statking_str = $statking_str;
         $this->template->content->statking_main = $statking_main;
         $html = $this->template->render();
         $data = array();
         $data['statking_str'] = $statking_str;
         $data['statking_main'] = $statking_main;
         $return_data['count_ip'] = $statking_main['site']['all_count_ip'];
         $return_data['html'] = $html;
         exit(json_encode($return_data));
     } catch (MyRuntimeException $ex) {
         $return_struct['status'] = 0;
         $return_struct['code'] = $ex->getCode();
         $return_struct['msg'] = $ex->getMessage();
         //TODO 异常处理
         //throw $ex;
         if ($this->is_ajax_request()) {
             $this->template = new View('layout/empty_html');
             $this->template->content = $return_struct['msg'];
         } else {
             $this->template->return_struct = $return_struct;
             $content = new View('info');
             $this->template->content = $content;
             /* 请求结构数据绑定 */
             $this->template->content->request_data = $request_data;
             /* 返回结构体绑定 */
             $this->template->content->return_struct = $return_struct;
         }
     }
 }
Example #2
0
if (!$sess->CheckValidAdminSession()) {
    // Validates Session
    $log = new log($_SERVER["PHP_SELF"], $_GET, $_POST, $_SERVER['HTTP_REFERER']);
    if (!$sess->CheckValidSession()) {
        header('Location: login.php');
    } else {
        header('Location: ../fb/bind.php');
    }
}
$db = new Database();
// Creates database object
if (!$db->connect()) {
    echo "<p>Error connecting to the database</p>";
}
//$log= new log('AdminIndex');
$stats = new statistics();
$getstatsbackdays = 60;
$daysago = 0;
$getstatsbackmonths = 24;
$monthsago = 0;
$active_users_graph = $pageviews_graph = $month_pageviews_graph = array();
while ($getstatsbackdays >= $daysago) {
    $datetopull = date('Y-m-d', strtotime("-" . $daysago . " days"));
    $active_users_graph[] = "['" . $datetopull . "', " . intval($stats->dailyactiveusercount($datetopull)) . "]";
    $pageviews_graph[] = "['" . $datetopull . "', " . intval($stats->viewcount($datetopull)) . "]";
    $daysago++;
}
while ($getstatsbackmonths >= $monthsago) {
    $monthtopull = date('Y-m', strtotime("-" . $monthsago . " months")) . "-0";
    $monthly_pageviews_graph[] = "['" . date('Y-m', strtotime("-" . $monthsago . " months")) . "', " . intval($stats->monthlyviewcount($monthtopull)) . "]";
    $monthsago++;
Example #3
0
 public function amount_report()
 {
     $start = IFilter::act(IReq::get('start'));
     $end = IFilter::act(IReq::get('end'));
     //获取时间段
     $_date = statistics::dateParse($start, $end);
     $startArray = explode('-', $_date[0]);
     $endArray = explode('-', $_date[1]);
     $startCondition = $startArray[0] . '-' . $startArray[1] . '-' . $startArray[2];
     $endCondition = $endArray[0] . '-' . $endArray[1] . '-' . ($endArray[2] + 1);
     $strTable = '<table width="500" border="1">';
     $strTable .= '<tr>';
     $strTable .= '<td style="text-align:center;font-size:12px;width:120px;">日期</td>';
     $strTable .= '<td style="text-align:center;font-size:12px;" width="*">订单量</td>';
     $strTable .= '<td style="text-align:center;font-size:12px;" width="*">销售额</td>';
     $strTable .= '</tr>';
     $db = new IQuery('collection_doc');
     $db->fields = 'sum(amount) as count,count(order_id) as ordernum, `time`';
     $db->where = 'pay_status = 1';
     $db->group = "DATE_FORMAT(`time`,'Y-%m-%d') having `time` >= '{$startCondition}' and `time` < '{$endCondition}'";
     $spandingList = $db->find();
     foreach ($spandingList as $k => $val) {
         $strTable .= '<tr>';
         $strTable .= '<td style="text-align:center;font-size:12px;">' . $val['time'] . ' </td>';
         $strTable .= '<td style="text-align:left;font-size:12px;">' . $val['ordernum'] . ' </td>';
         $strTable .= '<td style="text-align:left;font-size:12px;">' . $val['count'] . ' </td>';
         $strTable .= '</tr>';
     }
     $strTable .= '</table>';
     $reportObj = new report();
     $reportObj->setFileName('amount');
     $reportObj->toDownload($strTable);
     exit;
 }
Example #4
0
			<div class="title">商户信息</div>
			<div class="content">
				<div class="c_box">
					<dl class="clearfix">
						<dt><strong><?php 
echo isset($sellerRow['true_name']) ? $sellerRow['true_name'] : "";
?>
</strong></dt>
					</dl>

					<p> 评分:<span class="grade"><i style="width:<?php 
echo Common::gradeWidth(statistics::gradeSeller($sellerRow['id']));
?>
px"></i></span></p>
					<p> 销量:<?php 
echo statistics::sellCountSeller($sellerRow['id']);
?>
 件</p>
					<p> 官网:<a href="<?php 
echo isset($sellerRow['home_url']) ? $sellerRow['home_url'] : "";
?>
" target="_blank" class="orange">点击进入</a></p>
					<p> 联系电话:<?php 
echo isset($sellerRow['phone']) ? $sellerRow['phone'] : "";
?>
</p>
					<p> 所在地:<?php 
echo join(' ', area::name($sellerRow['province'], $sellerRow['city'], $sellerRow['area']));
?>
 <?php 
echo isset($sellerRow['address']) ? $sellerRow['address'] : "";
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html dir="rtl" lang="he">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="../styles.css">
<title>מערכת מעקב סעודות - מרכז "בני ברוך" פתח גהגה תקוה</title>
<?php 
include "class_coll.php";
?>
</head>
<body>

<?php 
include "seudot_top_menu.html";
$display = new display();
$statistics = new statistics();
$condition = $statistics->f_get_condition(7);
$query_string = $condition;
$uploader = new file_uploader();
$if_tbl_exists = $uploader->if_tbl_exists('seudot_stat', $query_string);
$stat_query = 'select * from seudot_stat';
?>

<form name="xls" action="../e2xls.php" method="post">
<input type="hidden" name="xls_query" value="<?php 
echo preg_replace('/LIMIT (.*)/', '', $stat_query);
?>
" />
<input type="hidden" name="filename" value="stat" /> 
<input type="submit" value="Excel" class="button_excel"/>
</form> 
 function runJob($job, $force = false)
 {
     $stopAfterJob = false;
     $startTime = microtime(true);
     $this->log($job->task . ', started ' . date('g:i a \\a\\t D M n, Y', $startTime));
     if (!isset($_GET['test']) && !$force) {
         if ($job->isRunning == 1) {
             $this->db->log('Cron race condition: ' . $job->task . ' last start= ' . $job->lastStart);
             echo 'Warning: Cron Race condition<br />';
             return;
         } else {
             $this->db->update("cronJobs", "isRunning=1,failureNoticeSent=0", "id={$job->id}");
         }
     }
     //echo 'Task: '.$job->task."\n";
     switch ($job->task) {
         default:
             // do nothing
             break;
         case 'updateUserLevels':
             require_once 'teamBackend.class.php';
             $teamObj = new teamBackend($this->db);
             $teamObj->updateUserLevels();
             break;
         case 'updateSiteChallenges':
             require_once 'teamBackend.class.php';
             $teamObj = new teamBackend($this->db);
             $teamObj->updateSiteChallenges();
             break;
         case 'updateCachedPointsAndChallenges':
             require_once 'teamBackend.class.php';
             $teamObj = new teamBackend($this->db);
             $teamObj->updateCachedPointsAndChallenges();
             break;
         case 'calcWeeklyLeaders':
             require_once 'teamBackend.class.php';
             $teamObj = new teamBackend($this->db);
             $teamObj->calcWeeklyLeaders();
             break;
         case 'updateUserLevels':
             require_once 'teamBackend.class.php';
             $teamObj = new teamBackend($this->db);
             $teamObj->updateUserLevels();
         case 'updateTwitter':
             // post top stories to twitter
             if (USE_TWITTER) {
                 require_once 'twitter.class.php';
                 $twitterObj = new twitter_old($this->db);
                 $twitterObj->postFeaturedStories();
                 $twitterObj->postNextTopStory();
             }
             break;
         case 'microAccountsSync':
             // sync twitter service accounts for micro blog room - done daily
             if (defined('ENABLE_MICRO')) {
                 require_once PATH_FACEBOOK . "/classes/micro.class.php";
                 $mObj = new micro();
                 $mObj->cleanRoom();
                 try {
                     $mObj->resetFriends(false);
                 } catch (Exception $e) {
                     $this->log('Failed running ' . $job->task . ', Error: ' . $e);
                     // reset this cron task manually because of twitter class trown exceptions
                     $execTime = microtime(true) - $startTime;
                     $this->db->update("cronJobs", "nextRun=date_sub(NOW(), INTERVAL (0-{$job->freqMinutes}) MINUTE),lastExecTime={$execTime},lastStart='" . date('Y-m-d H:i:s', $startTime) . "',isRunning=0", "id={$job->id}");
                 }
             }
             break;
         case 'microBlog':
             // post top stories to micro blog room
             if (defined('ENABLE_MICRO')) {
                 require_once PATH_FACEBOOK . "/classes/micro.class.php";
                 $mObj = new micro();
                 try {
                     $mObj->updateRoom();
                 } catch (Exception $e) {
                     $this->log('Failed running ' . $job->task . ', Error: ' . $e);
                     // reset this cron task manually because of twitter class trown exceptions
                     $execTime = microtime(true) - $startTime;
                     $this->db->update("cronJobs", "nextRun=date_sub(NOW(), INTERVAL (0-{$job->freqMinutes}) MINUTE),lastExecTime={$execTime},lastStart='" . date('Y-m-d H:i:s', $startTime) . "',isRunning=0", "id={$job->id}");
                 }
             }
             break;
         case 'updateCache':
             // build cached content for cover page layout
             require_once 'cache.class.php';
             $cacheObj = new cache($this->db);
             $cacheObj->update();
             break;
         case 'syncProperties':
             // sync Cloud properties with NewsCloud services
             require_once 'apiCloud.class.php';
             $apiObj = new apiCloud($this->db, $this->apiKey);
             $props = $apiObj->syncProperties($this->cloudid);
             require_once 'systemStatus.class.php';
             $ssObj = new systemStatus($this->db);
             $ssObj->setProperties($props['items'][0]);
             break;
         case 'syncAnnouncements':
             require_once 'apiCloud.class.php';
             $apiObj = new apiCloud($this->db, $this->apiKey);
             $resp = $apiObj->syncAnnouncements($this->cloudid);
             if ($resp[result] !== false) {
                 $itemlist = $resp[items];
                 require_once 'systemStatus.class.php';
                 $ssObj = new systemStatus($this->db);
                 $ssObj->resetAnnouncements();
                 if (count($itemlist) > 0) {
                     foreach ($itemlist as $data) {
                         $ssObj->insertState('announcement', html_entity_decode($data['announce']));
                     }
                 }
             }
             break;
         case 'syncNewswire':
             /* deprecated
             			require_once ('apiCloud.class.php');
             			$apiObj=new apiCloud($this->db,$this->apiKey);
             			$resp=$apiObj->syncNewswire($this->cloudid,$this->timeStrToUnixModB($job->lastItemTime));
             			$itemlist=$resp[items];
             			echo 'count: '.count($itemlist).'<br />';
             			if (count($itemlist)>0) {
             				require_once('newswire.class.php');
             				$nwObj=new newswire($this->db);
             				$lastItemTime=date('Y-m-d H:i:s',(time()-(6*30*24*3600))); // set to six months earlier 
             				foreach ($itemlist as $data) {					
             					$wire=$nwObj->serialize($data[title],$data[caption],$data[blogtitle],$data[webpage],$data[date],$data[blogid]);						
             					$id=$nwObj->add($wire);
             					if ($data[date]>$lastItemTime)						
             						$lastItemTime=$data[date];
             					if ($id===false)
             						echo 'skip '.$data[title].'<br />';
             					else						
             						echo 'adding '.$data[title].' id->'.$id.'<br />';
             				}
             				$this->db->update("cronJobs","lastItemTime='$lastItemTime'","id=$job->id");
             			}
             			*/
             break;
         case 'syncLog':
             require_once 'apiCloud.class.php';
             $apiObj = new apiCloud($this->db, $this->apiKey);
             // request server ask for log
             $resp = $apiObj->requestSyncLog($this->cloudid, URL_HOME, $this->timeStrToUnixModB($job->lastStart));
             // get result of log sync
             $logResult = $resp[items][0][log];
             require_once PATH_CORE . "/classes/log.class.php";
             $logObj = new log($this->db);
             // process results from sync operation
             $result = $logObj->receive($logResult);
             echo $result;
             break;
         case 'syncContent':
             // bring content from NewsCloud for this cloud to the remote site
             require_once 'apiCloud.class.php';
             $apiObj = new apiCloud($this->db, $this->apiKey);
             $resp = $apiObj->syncContent($this->cloudid, $this->timeStrToUnixModB($job->lastItemTime));
             $itemlist = $resp[items];
             if (count($itemlist) > 0) {
                 require_once 'content.class.php';
                 $cObj = new content($this->db);
                 // to do : set this to actual time
                 $lastItemTime = date('Y-m-d H:i:s', time() - 6 * 30 * 24 * 3600);
                 // set to six months earlier
                 foreach ($itemlist as $data) {
                     echo 'Contentid' . $data[contentid] . '<br />';
                     // to do: before we can do this below, we need to be syncing ncuid when new users register
                     // to do: get userid from ncUid
                     // lookup userid in user table where ncuid=submitbyid
                     // if not found make it 0
                     // to do: if external story, then check for local userid and set here
                     $story = $cObj->serialize($data[contentid], $data[title], $data[description], '', $data[webpage], $data[permalink], $data[submitbyid], $data[submit_member], $data[userid], $data[date], $data[avgrank], 0, $data[imageid]);
                     $id = $cObj->add($story);
                     // update comments table with new contentids
                     $cObj->updateCommentsTable($data[contentid], $id);
                     if ($data[date] > $lastItemTime) {
                         $lastItemTime = $data[date];
                     }
                     echo 'story added' . $id . '<br><br/>';
                 }
                 $this->db->update("cronJobs", "lastItemTime='{$lastItemTime}'", "id={$job->id}");
             }
             break;
         case 'syncComments':
             // bring comments from stories in this cloud from NewsCloud over to remote site
             require_once 'content.class.php';
             $cObj = new content($this->db);
             $idList = $cObj->fetchRecentStoryList(14, 99, true);
             $this->db->log('syncComments - stories to check for.', PATH_SYNCLOGFILE);
             $this->db->log($idList, PATH_SYNCLOGFILE);
             if ($idList != '') {
                 require_once 'comments.class.php';
                 $commentsObj = new comments($this->db);
                 require_once 'apiCloud.class.php';
                 $apiObj = new apiCloud($this->db, $this->apiKey);
                 $result = $apiObj->syncComments($this->cloudid, $idList, $this->timeStrToUnixModB($job->lastItemTime));
                 $itemlist = $result[items];
                 $this->db->log($itemlist, PATH_SYNCLOGFILE);
                 // update comment thread for each story
                 if (count($itemlist) > 0) {
                     $lastItemTime = date('Y-m-d H:i:s', time() - 6 * 30 * 24 * 3600);
                     // set to six months earlier
                     foreach ($itemlist as $data) {
                         $temp = 'Bring over contentid' . $data[contentid] . ' Commentid' . $data[commentid] . '<br />';
                         // to do: if external story, then check for local userid and set here
                         $comment = $commentsObj->remoteSerialize($data);
                         if ($data[date] > $lastItemTime) {
                             $lastItemTime = $data[date];
                         }
                         $id = $commentsObj->add($comment);
                         echo $temp . '<br />';
                         var_dump($comment);
                         $this->db->log($temp, PATH_SYNCLOGFILE);
                         $this->db->log($comment, PATH_SYNCLOGFILE);
                     }
                 }
                 $this->db->update("cronJobs", "lastItemTime='{$lastItemTime}'", "id={$job->id}");
             }
             break;
         case 'syncScores':
             require_once 'content.class.php';
             $cObj = new content($this->db);
             $idList = $cObj->fetchRecentStoryList(14, 99, true);
             if ($idList != '') {
                 require_once 'apiCloud.class.php';
                 $apiObj = new apiCloud($this->db, $this->apiKey);
                 $resp = $apiObj->syncScores($this->cloudid, $idList, $this->timeStrToUnixModB($job->lastStart));
                 $itemlist = $resp[items];
                 //var_dump($resp);
                 if (count($itemlist) > 0) {
                     // update the score for each story with new votes
                     foreach ($itemlist as $data) {
                         $this->db->update("Content", "score={$data['score']}", "contentid={$data['contentid']}");
                         $temp = 'Set score of contentid:' . $data[contentid] . 'to ' . $data[score];
                         echo $temp . '<br />';
                         $this->db->log($temp, PATH_SYNCLOGFILE);
                     }
                 }
             }
             break;
         case 'syncResources':
             require_once 'apiCloud.class.php';
             $apiObj = new apiCloud($this->db, $this->apiKey);
             require_once 'resources.class.php';
             $resObj = new resources($this->db);
             $result = $apiObj->syncResources($this->cloudid);
             $resObj->sync(html_entity_decode($result[items][0][resources]));
             break;
         case 'updateSiteMap':
             $currentHour = date('G');
             // 0 - 24
             $currentDayOfWeek = date('w');
             // day of week 0-6
             $currentDayOfMonth = date('j');
             // day of month 1-31
             require_once 'siteMap.class.php';
             $smObj = new siteMap($this->db);
             // do always - build the map for content from the last hour
             $smObj->buildMap('hourly');
             // only do this as midnight
             if ($currentHour == 0) {
                 // map to all the content from the last day
                 $smObj->buildMap('daily');
             }
             // only do this at 3 am on first day of week
             if ($currentDayOfWeek = 0 and $currentHour == 3) {
                 // map to all the content from the last week, etc.
                 $smObj->buildMap('weekly');
             }
             // only do this at 2 am on first day of month
             if ($currentDayOfMonth == 1 and $currentHour == 2) {
                 $smObj->buildMap('monthly');
             }
             // call buildIndexMap after updating any individual child maps above
             // just the time stamps from each individual map file are updated in the indexmap
             // warning: if a individual map hasn't been built - the index map won't include a reference to it
             $smObj->buildIndexMap();
             break;
         case 'fetchFeeds':
             // import stories from feeds
             require_once 'feed.class.php';
             $feedObj = new feed($this->db);
             $feedObj->fetchBookmarks();
             $feedObj->fetchFeeds();
             $feedObj->fetchImages();
             if ($feedObj->newStoryLoaded) {
                 // update features
             }
             break;
         case 'logHourlyStats':
             require_once 'statistics.class.php';
             $statsObj = new statistics($this->db);
             $statsObj->logHourlyStats();
             break;
         case 'facebookMinifeed':
             require_once PATH_FACEBOOK . "/classes/app.class.php";
             $app = new app(NULL, true);
             $facebook =& $app->loadFacebookLibrary();
             require_once PATH_FACEBOOK . '/classes/miniFeeds.class.php';
             $feedObj = new miniFeeds($this->db);
             $feedObj->loadFacebook($facebook);
             $feedObj->updateMiniFeeds();
             break;
         case 'facebookProfileBoxes':
             require_once PATH_FACEBOOK . "/classes/app.class.php";
             $app = new app(NULL, true);
             $facebook =& $app->loadFacebookLibrary();
             require_once PATH_FACEBOOK . '/classes/profileBoxes.class.php';
             $proObj = new profileBoxes($this->db);
             $proObj->loadFacebook($facebook);
             $proObj->updateProfileBoxes();
             break;
         case 'facebookEmailEngine':
             // tbd
             break;
         case 'facebookAllocations':
             // check nightly facebook allocations
             $ssObj = new systemStatus($this->db);
             /* initialize the SMT Facebook appliation class, NO Facebook library */
             require_once PATH_FACEBOOK . "/classes/app.class.php";
             $app = new app(NULL, true);
             $facebook =& $app->loadFacebookLibrary();
             $npd = $facebook->api_client->admin_getAllocation('notifications_per_day');
             $ssObj->setState('notifications_per_day', $npd);
             $ssObj->setState('announcement_notifications_per_week', $facebook->api_client->admin_getAllocation('announcement_notifications_per_week'));
             $ssObj->setState('requests_per_day', $facebook->api_client->admin_getAllocation('requests_per_day'));
             $ssObj->setState('emails_per_day', $facebook->api_client->admin_getAllocation('emails_per_day'));
             break;
         case 'facebookSendNotifications':
             require_once PATH_FACEBOOK . "/classes/app.class.php";
             $app = new app(NULL, true);
             $facebook =& $app->loadFacebookLibrary();
             require_once PATH_FACEBOOK . "/classes/shareStories.class.php";
             $ssObj = new shareStories($app);
             $ssObj->processNotifications();
             break;
         case 'facebookSendPromos':
             /* not needed for now
             				if (date('G')==0) {
             					require_once PATH_FACEBOOK."/classes/promos.class.php";
             					$promoObj=new promos($this->db);				
             					$promoObj->send();
             				}			
             */
             break;
         case 'insertNewResearchData':
             require_once PATH_CORE . "/classes/researchRawSession.class.php";
             require_once PATH_CORE . "/classes/researchRawExtLink.class.php";
             require_once PATH_CORE . "/classes/researchSessionLength.class.php";
             require_once PATH_CORE . "/classes/researchLogDump.class.php";
             require_once PATH_CORE . "/classes/researchUserCollective.class.php";
             $rawExtLinkTable = new RawExtLinkTable($this->db);
             $rawExtLinkTable->insertNewestData();
             $rawSessionTable = new RawSessionTable($this->db);
             $rawSessionTable->insertNewestData();
             $sessionLengthTable = new SessionLengthTable($this->db);
             $sessionLengthTable->insertNewestData();
             $logDumpTable = new LogDumpTable($this->db);
             $logDumpTable->insertNewestData();
             $userCollectiveTable = new UserCollectiveTable($this->db);
             $userCollectiveTable->assimilateUsers();
             $stopAfterJob = true;
             break;
         case 'autoFeature':
             require_once PATH_CORE . '/classes/content.class.php';
             $cObj = new content($this->db);
             $cObj->autoFeature();
             break;
         case 'cleanup':
             require_once 'cleanup.class.php';
             $cleanObj = new cleanup($this->db, 'daily');
             break;
             // deprecated
         // deprecated
         case 'syncFeedList':
             require_once 'apiCloud.class.php';
             $apiObj = new apiCloud($this->db, $this->apiKey);
             $result = $apiObj->syncFeedList($this->cloudid);
             require_once 'feed.class.php';
             $feedObj = new feed($this->db);
             $feedObj->syncFeedList($result[items]);
             break;
     }
     $execTime = microtime(true) - $startTime;
     $this->log('...completed in ' . $execTime . ' seconds.');
     $this->history[$this->cntJobs]['task'] = $job->task;
     $this->history[$this->cntJobs]['time'] = $execTime;
     $this->cntJobs += 1;
     $this->db->update("cronJobs", "nextRun=date_sub(NOW(), INTERVAL (0-{$job->freqMinutes}) MINUTE),lastExecTime={$execTime},lastStart='" . date('Y-m-d H:i:s', $startTime) . "',isRunning=0", "id={$job->id}");
     if ($stopAfterJob) {
         exit;
     }
 }
Example #7
0
    echo isset($item['mobile']) ? $item['mobile'] : "";
    ?>
"><?php 
    echo isset($item['mobile']) ? $item['mobile'] : "";
    ?>
</td>
					<td><?php 
    echo $item['is_vip'] == 0 ? '否' : '是';
    ?>
</td>
					<td><?php 
    echo statistics::sellCountSeller($item['id']);
    ?>
 件</td>
					<td><?php 
    echo statistics::gradeSeller($item['id']);
    ?>
 分</td>
					<td><a href="<?php 
    echo IUrl::creatUrl("/member/seller_balance_log/id/" . $item['id'] . "");
    ?>
"><?php 
    echo $item['balance'];
    ?>
</a></td>
					<td>
						<select onchange="changeStatus(<?php 
    echo isset($item['id']) ? $item['id'] : "";
    ?>
,this)">
							<option value="0" <?php 
Example #8
0
 public static function OutputStatisticsNationality($stattype = "applicants", $distinguishNordic = TRUE, $distinguishBaltic = TRUE, $countPolandAsBaltic = FALSE, $showOnlyNordic = FALSE, $showSummary = FALSE)
 {
     //    if ($stattype=="visitors") return statistics::statisticsVisitors($stattype,$showOnlyNordic,$showSummary);
     if (!in_array($stattype, array("applicants", "events", "visitors", "allguests"))) {
         return "<p class='box error padding background bold'>Found no data to process</p>\r\n";
     }
     // ------------------------
     if (!class_exists("fromdb_jam", FALSE) || !isset($dbJam) || !is_object($dbJam)) {
         require_once PATH_CLASSES . "/fromdb/jam.php";
         $dbJam = new fromdb_jam();
     }
     if (!class_exists("fromdb_vm", FALSE) || !isset($dbVm) || !is_object($dbVm)) {
         require_once PATH_CLASSES . "/fromdb/vm.php";
         $dbVm = new fromdb_vm();
     }
     //TESTING JAM: if (in_array($stattype,array("applicants"))) $dbJam->getJamPositions();
     // ------------------------
     $stdout = "";
     $personData = array();
     $outdata = array();
     // ------------------------------------------------------------------------
     // AUXILIARY VARIABLES
     // ------------------------------------------------------------------------
     // ------------------------
     // -- Construct auxiliary arrays
     //      $aux["conts"]    = array (integer=>continentCode)
     //      $aux["extConts"] = array (continentCode=>label)
     // ------------------------
     if ($distinguishNordic) {
         $aux["conts"][] = "NO";
     }
     if ($distinguishBaltic) {
         $aux["conts"][] = "BA";
     }
     $aux["conts"] = array_merge($aux["conts"], array("EU", "NA", "AS", "AF", "SA", "OC", ""));
     foreach ($aux["conts"] as $cc) {
         $aux["extConts"][$cc] = functions::fromContinentCode($cc, $distinguishNordic, $distinguishBaltic, $countPolandAsBaltic);
     }
     // ------------------------------------------------------------------------
     // GPC WITH DEFAULT VALUES
     // ------------------------------------------------------------------------
     functions::gpc_declare_input("beenthere", false, true);
     functions::gpc_declare_input("all", false, true);
     functions::gpc_declare_input("reset", false, true);
     functions::gpc_declare_input("eventindex", self::getDefaultEvents($stattype), false);
     // if (in_array($stattype,array("allguests"))) {
     functions::gpc_declare_input("yearfrom", VM_START_YEAR, false);
     functions::gpc_declare_input("yearto", date("Y"), false);
     functions::gpc_declare_input("mindays", 1, false);
     // ------------------------------------------------------------------------
     // OBTAIN BASIC DATA
     //   --> visitorDataRecord $personData
     // ------------------------------------------------------------------------
     // -- When 'applicants' requested
     if (in_array($stattype, array("applicants"))) {
         $personData = $dbJam->getApplicantData($stattype, $distinguishNordic, $distinguishBaltic, $countPolandAsBaltic);
         $outdata["applicant"]["applicants"] = $personData;
     }
     // -- When 'events' requested
     if (in_array($stattype, array("events"))) {
         $personData = $dbVm->getVisitorData($stattype, $distinguishNordic, $distinguishBaltic, $countPolandAsBaltic, $showOnlyNordic, isset($GLOBALS["eventindex"]) ? array_keys($GLOBALS["eventindex"]) : array());
         $outdata["applicant"]["events"] = $personData;
     }
     // -- When 'visitors' requested
     if (in_array($stattype, array("visitors"))) {
         $personData = $dbVm->getVisitorData($stattype, true, true, false, $showOnlyNordic, array());
         $outdata["applicant"]["visitors"] = $personData;
     }
     // -- When 'allguests' requested
     if (in_array($stattype, array("allguests"))) {
         $participant = $dbVm->getVisitorData("events", $distinguishNordic, $distinguishBaltic, $countPolandAsBaltic, $showOnlyNordic, isset($GLOBALS["eventindex"]) ? array_keys($GLOBALS["eventindex"]) : array());
         $visitor = $dbVm->getVisitorData("visitors", $distinguishNordic, $distinguishBaltic, $countPolandAsBaltic, $showOnlyNordic, array());
         //      $outdata["applicant"][$stattype] = ...;
         $outdata = array_merge($outdata, $dbVm->participantStatistics("events", $distinguishNordic, $distinguishBaltic, $countPolandAsBaltic, $showOnlyNordic, isset($GLOBALS["eventindex"]) ? array_keys($GLOBALS["eventindex"]) : array()));
         // => $outdata["applicant"]["events"]
         //      foreach (self::$emptyEvents as $idx) if (isset(self::$eventTitles[$idx])) unset(self::$eventTitles[$idx]);
         //echo"<hr>";debug::rr(array_keys($outdata["applicant"]));
         //echo"<hr>";debug::rr(array_keys($outdata));
         $outdata1 = $dbVm->participantStatistics("visitors", $distinguishNordic, $distinguishBaltic, $countPolandAsBaltic, $showOnlyNordic, array());
         $outdata["applicant"]["allguests"] = $outdata["applicant"]["visitors"] = $outdata1["applicant"]["visitors"];
         //echo"<hr>";debug::rr(array_keys($outdata["applicant"]));
         $personData = $outdata["applicant"]["allguests"];
     }
     // -- Return if no data found
     if (empty($personData)) {
         return "          <p class='box error padding background bold'>Found no data to process</p>\r\n";
     }
     // ------------------------
     // --> self::$eventTitles
     // ------------------------
     if (in_array($stattype, array("applicants"))) {
         self::$eventTitles = $dbJam->getCampaigns();
     }
     if (in_array($stattype, array("events", "allguests"))) {
         self::$eventTitles = array("0" => "All " . (isset($_REQUEST["beenthere"]) ? "Selected " : "") . "Events") + $dbVm->getAllEventsTitles(mktime(0, 0, 0, 1, 1, 2009), time());
         foreach (self::$emptyEvents as $idx) {
             if (isset(self::$eventTitles[$idx])) {
                 unset(self::$eventTitles[$idx]);
             }
         }
     }
     //echo"<hr>";debug::rr(array_keys($outdata));
     //debug::rr(self::$eventTitles);
     // ------------------------
     // -- Construct auxiliary arrays
     //      $aux["columns"]
     //      $aux["extColumns"]
     // ------------------------
     switch ($stattype) {
         case "applicants":
             $showCols = array("cit", "res", "phd");
             break;
         case "events":
         case "allguests":
             $showCols = array("res");
             break;
         case "visitors":
             $showCols = array();
             break;
     }
     $aux["columns"] = array();
     foreach ($showCols as $col) {
         switch ($col) {
             case "cit":
                 $aux["columns"][$col] = "Citizens";
                 break;
             case "res":
                 $aux["columns"][$col] = "Residents";
                 break;
             case "ms":
                 $aux["columns"][$col] = "MS Degree";
                 break;
             case "phd":
                 $aux["columns"][$col] = "PhD Degree";
                 break;
         }
     }
     $aux["extColumns"] = $aux["columns"];
     if (in_array($stattype, array("applicants"))) {
         $aux["extColumns"]["any"] = "Any connection";
     }
     // ------------------------------------------------------------------------
     // CALCULATE STATISTICS (extracted from $personData)
     //   --> array $tables
     //   --> array $charts
     // ------------------------------------------------------------------------
     $tables = $charts = array();
     $maxbin = 100;
     if (in_array($stattype, array("visitors"))) {
         $tables["visitorsAlphabetical"] = self::calculateVisitors($personData, $GLOBALS["yearfrom"], $GLOBALS["yearto"], $GLOBALS["mindays"]);
         $tables["visitorsSummary"] = $showSummary ? self::calculateNordicVisitors(self::calculateVisitorsYear($personData), $GLOBALS["yearfrom"], $GLOBALS["yearto"], $GLOBALS["mindays"]) : array();
         $charts = self::calculateVisitorsCharts($tables["visitorsAlphabetical"], $maxbin);
     }
     if (in_array($stattype, array("applicants", "events"))) {
         $tables["nationlists"] = self::calculateNationLists($personData, $aux);
         $charts = self::calculateNationPies($tables["nationlists"], $aux);
     }
     if (in_array($stattype, array("allguests"))) {
         $tables["visitorsSummary"] = self::calculateNordicVisitors(self::calculateVisitorsYear($outdata["applicant"]["visitors"]), $GLOBALS["yearfrom"], $GLOBALS["yearto"], $GLOBALS["mindays"]);
         $tables["nationlists"] = self::calculateNationLists($personData, $aux);
     }
     // ------------------------------------------------------------------------
     // OUTPUT DATA
     // ------------------------------------------------------------------------
     // -- Output intro texts
     $stdout .= self::outputBlurb($stattype, $showSummary, $showOnlyNordic);
     // -- Output form
     if (in_array($stattype, array("applicants", "events", "allguests"))) {
         $stdout .= self::outputForm($stattype, in_array($stattype, array("applicants")) ? false : true);
     } elseif (in_array($stattype, array("visitors"))) {
         $stdout .= self::outputFormVisitors();
     }
     if ($GLOBALS["reset"]) {
         return $stdout;
     }
     // -- Output tables and charts
     if (in_array($stattype, array("visitors"))) {
         $totvisitors = isset($tables["visitorsSummary"][0]["tot"]) ? $tables["visitorsSummary"][0]["tot"] : 0;
         $stdout .= ($showSummary ? self::outputVisitorsSummary($tables["visitorsSummary"], $showOnlyNordic) : "") . self::outputChart("dataDays", $charts["dataDays"], $maxbin) . ($GLOBALS["mindays"] == 1 ? self::outputVisitorsAlphabeticalColumns($tables["visitorsAlphabetical"], $showOnlyNordic) : self::outputVisitorsAlphabeticalList($tables["visitorsAlphabetical"], $showOnlyNordic, $totvisitors, $GLOBALS["mindays"]));
     }
     if (in_array($stattype, array("applicants", "events", "allguests"))) {
         $stdout .= self::outputNationLists($stattype, $tables["nationlists"], $charts, $aux, $countPolandAsBaltic, $showOnlyNordic);
     }
     if (in_array($stattype, array("allguests"))) {
         $stdout .= self::outputVisitorsSummary($tables["visitorsSummary"], $showOnlyNordic);
     }
     return $stdout;
 }
Example #9
0
<?php

include 'header.php';
include "class/statistics.php";
if (isset($_POST['test_stat'])) {
    $data = array();
    for ($y = 0; $y < $_GET['numbers_data']; $y++) {
        $data[$_POST['data_0_' . $y . '']] = $_POST['data_1_' . $y . ''];
    }
    $stat = new statistics($data);
    $result = $stat->getResult();
}
if ($_SESSION['langue'] == 'en') {
    $text = array("Statistics Series", "The system does not manage the complex numbers.", "Numbers of data", "Generate", "Calculate", "Data", "You have to choose the size of the array to generate it");
} else {
    if ($_SESSION['langue'] == 'fr') {
        $text = array("Series statistiques", "Le système ne prend pas en charge les nombres complexes.", "Nombres de données", "Generer", "Calculer", "Données", "Vous devez choisir la taille du tableau de données pour le générer");
    }
}
?>
<div id="page-wrapper">
    <div class="row">
        <div class="col-lg-12" style="margin-top: 10px;">
            <div class="alert alert-warning" role="alert"><?php 
echo $text[1];
?>
</div>
        </div>
        <div class="col-lg-4">
            <div class="panel panel-default">
                <div class="panel-heading">
Example #10
0
			<?php 
}
?>
			</span>
		</div>

		<div id="admin_left">
			<ul class="submenu"></ul>
			<div id="copyright"></div>
		</div>

		<div id="admin_right">
			<?php 
$start = IFilter::act(IReq::get('start'));
$end = IFilter::act(IReq::get('end'));
$countData = statistics::userReg($start, $end);
?>

<script type="text/javascript" charset="UTF-8" src="<?php 
echo BASE_URL;
?>
/runtime/_systemjs/my97date/wdatepicker.js"></script>
<script type="text/javascript" charset="UTF-8" src="<?php 
echo BASE_URL;
?>
/runtime/_systemjs/highcharts/highcharts.js"></script>
<script type='text/javascript' src='<?php 
echo IUrl::creatUrl("") . "views/" . $this->theme . "/javascript/event.js";
?>
' charset="UTF-8"></script>
Example #11
0
"><?php 
echo statistics::countUserWaitComment($user_id);
?>
</b>)</a></label></span>
				<span>待付款订单:<label>(<b><a class="red2" href="<?php 
echo IUrl::creatUrl("/ucenter/order");
?>
"><?php 
echo statistics::countUserWaitPay($user_id);
?>
</b>)</a></label></span>
				<span>待确认收货:<label>(<b><a class="red2" href="<?php 
echo IUrl::creatUrl("/ucenter/order");
?>
"><?php 
echo statistics::countUserWaitCommit($user_id);
?>
</b>)</a></label></span>
			</div>
			</dd>
		</dl>
	</div>
	<h3 class="bg">我的订单</h3>
	<div class="box m_10">
		<table class="list_table" width="100%" cellpadding="0" cellspacing="0">
			<col width="140px" />
			<tr>
				<th>订单编号</th><th>下单日期</th><th>收货人</th><th>支付方式</th><th>总金额</th><th>订单状态</th>
			</tr>
			<?php 
foreach (Api::run('getOrderListByUserid', array('#user_id#', $user['user_id'])) as $key => $item) {
Example #12
0
?>
				  <br>
				  <a href="account.php">My Account</a><br>
				  <a href="accountprivacy.php">My Privacy</a><br>
				
				</p>


                  <!--<br>-->

              </td></tr></table>
			  <br>
			  
			  <?php 
if ($sess->Retrieve('accountstatus') == 9) {
    $ministats = new statistics();
    //$yesministats = new statistics();
    $today = date('Y-m-d');
    $yesterday = date('Y-m-d', strtotime("yesterday"));
    ?>
			  <table class="dashedtable" cellspacing=0 cellpadding=5 width=100%>

              <tr><td align=left style="color:#538ADC">

                  <p style="color:#538ADC">
				  
				  <a href="http://www.thefacebook.us/a/">Admin Panel</a><br>
				  <a href="https://gator1523.hostgator.com:2083/3rdparty/phpMyAdmin/index.php?db=newportb_harvardconnection" target="_new">PHPMYADMIN</a><br>
				  <br>
				  <b>Today:</b>
				  <hr>
Example #13
0
<?php 
    if (count($info['releases']) > 0) {
        ?>
    <br />
    <table cellspacing="0" cellpadding="3" style="border: 0px; width: 90%;">
    <caption style="background-color: #CCCCCC;">Release Statistics</caption>
    <tr>
        <th style="text-align: left;">Version</th>
        <th style="text-align: left;">Downloads</th>
        <th style="text-align: left;">Released</th>
        <th style="text-align: left;">Last Download</th>
    </tr>
<?php 
        $rid = isset($_GET['rid']) ? $_GET['rid'] : '';
        $release_statistics = statistics::release($_GET['pid'], $rid);
        foreach ($release_statistics as $key => $value) {
            $version = make_link('/package/' . $info['name'] . '/download/' . $value['release'], $value['release']);
            echo ' <tr>';
            echo '  <td>' . $version . "</td>\n";
            echo '  <td>' . number_format($value['dl_number'], 0, '.', ',');
            echo "  </td>\n";
            echo '  <td>';
            echo format_date(strtotime($value['releasedate']), 'Y-m-d');
            echo "  </td>\n";
            echo '  <td>';
            echo format_date(strtotime($value['last_dl']));
            echo "  </td>\n";
            echo " </tr>\n";
        }
        echo "</table>\n";
Example #14
0
        echo 'No package or release found.';
        $bb->end();
    }
    if (count($info['releases']) > 0) {
        echo "<br />\n";
        $bb = new Borderbox('Release Statistics');
        ?>
    <table cellspacing="0" cellpadding="3" style="border: 0px; width: 100%;">
    <tr>
        <th style="text-align: left;">Version</th>
        <th style="text-align: left;">Downloads</th>
        <th style="text-align: left;">Released</th>
        <th style="text-align: left;">Last Download</th>
    </tr>
<?php 
        $release_statistics = statistics::activeRelease($_GET['pid'], isset($_GET['rid']) ? $_GET['rid'] : '');
        foreach ($release_statistics as $key => $value) {
            $version = make_link('/package/' . $info['name'] . '/' . $value['release'], $value['release']);
            echo ' <tr>';
            echo '  <td>' . $version . "</td>\n";
            echo '  <td>' . number_format($value['dl_number'], 0, '.', ',');
            echo "  </td>\n";
            echo '  <td>';
            echo make_utc_date(strtotime($value['releasedate']), 'Y-m-d');
            echo "  </td>\n";
            echo '  <td>';
            echo make_utc_date(strtotime($value['last_dl']));
            echo "  </td>\n";
            echo " </tr>\n";
        }
        echo "</table>\n";
Example #15
0
session_start();
if (!session_is_registered(myusername)) {
    $url = "http://" . $_SERVER['HTTP_HOST'] . "/";
    die('<script type="text/javascript">window.location=\'' . $url . '\';</script>');
}
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html dir="rtl" lang="he">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="styles.css">
<title>מערכת מעקב נוכחות טסט - מרכז "בני ברוך" פתח גהגה תקוה</title>
<?php 
include "class_lib.php";
?>
</head>
<body>

<?php 
include 'top_menu.html';
$theDateFrom = isset($_REQUEST["date3"]) ? $_REQUEST["date3"] : "";
$theDateTo = isset($_REQUEST["date4"]) ? $_REQUEST["date4"] : "";
$surname = isset($_REQUEST["surname"]) ? $_REQUEST["surname"] : "";
$_SESSION['surname'] = $surname;
$main_id = $surname;
$statistics = new statistics();
echo '<p>דוח נוכחות מתאריך ' . $theDateFrom . ' עד תאריך ' . $theDateTo . '</p>';
$stat_select = $statistics->selectstat($theDateFrom, $theDateTo, $main_id);
include 'stat_disp.php';
Example #16
0
			<?php 
}
?>
			</span>
		</div>

		<div id="admin_left">
			<ul class="submenu"></ul>
			<div id="copyright"></div>
		</div>

		<div id="admin_right">
			<?php 
$start = IFilter::act(IReq::get('start'));
$end = IFilter::act(IReq::get('end'));
$countData = statistics::spandAvg($start, $end);
?>

<script type="text/javascript" charset="UTF-8" src="<?php 
echo BASE_URL;
?>
/runtime/_systemjs/my97date/wdatepicker.js"></script>
<script type="text/javascript" charset="UTF-8" src="<?php 
echo BASE_URL;
?>
/runtime/_systemjs/highcharts/highcharts.js"></script>
<script type='text/javascript' src='<?php 
echo IUrl::creatUrl("") . "views/" . $this->theme . "/javascript/event.js";
?>
' charset="UTF-8"></script>
<div class="headbar">
Example #17
0
				var googleSearchPath = "/cse";
			</script>
			<script type="text/javascript" src="http://www.google.com/afsonline/show_afs_search.js"></script>
		');
		break;
	case "statistics":
		$context["h1"] = "";
		$context["fake_h1"] = _("Statistics");
		$content = author::get_author_top();
		$content .= "<br /><h2>"._("Other statistics")."</h2>";
		$content .= _("Quotations count") . ": ". statistics::quote_count() . "<br />";
		if ($config_q["locale"] == "et" ) {
			$content .= _("User count") . ": ". statistics::user_count() . "<br />";
		}
		$content .= _("Domain registration") . ": ". date("d.m.Y", $config_q["domain_registration_time"]) . "<br />";
		$content .= _("Quotations add rate per day") . ": ". round( statistics::quote_count()/((time()-$config_q["domain_registration_time"])/3600/24), 1 );
		$context["content"] = $content;
		break;
	case "shortcut":
		header("Location: ".quote::get_long_link_for_permalink($a_path[0]),TRUE,301);
		die();
		break;
	case "contributors":
		$smarty_q->assign("h1", _("Quotation contributors"));
		$smarty_q->assign("fake_h1", _("Quotation contributors"));
		break;
	case "rpx_auth":
		$rpx_api = new RPX("12a3cf2d8a9ac5b12ccb865e91c2a75271977bc9", "https://quotebook-24.rpxnow.com/");
		$response = $rpx_api->auth_info($_POST["token"]);
		$xpath = new DOMXPath($response);
		$displayName = $xpath->query("/rsp/profile/displayName")->item(0)->textContent;
Example #18
0
    ?>
<a href="<?php 
    echo IUrl::creatUrl("/order/order_list/distribution_status/0");
    ?>
"><b class="f14 red3"><?php 
    echo isset($item['countNums']) ? $item['countNums'] : "";
    ?>
</b></a> 个<?php 
}
?>
</td></tr>
								<tr><th>退款申请</th><td><a href="<?php 
echo IUrl::creatUrl("/order/refundment_list");
?>
"><b class="red3 f14"><?php 
echo statistics::refundsCount();
?>
</b></a> 个</td></tr>
								<tr><th>待审商家</th><td><?php 
$query = new IQuery("seller");
$query->fields = "count(id) as countNums";
$query->where = "is_lock = 1";
$items = $query->find();
foreach ($items as $key => $item) {
    ?>
<a href="<?php 
    echo IUrl::creatUrl("/member/seller_list");
    ?>
"><b class="red3 f14"><?php 
    echo isset($item['countNums']) ? $item['countNums'] : "";
    ?>
Example #19
0
			<hr />
			<p><strong>Copyright &copy; 2015 Sunup</strong></p>
			<p>Powered by <a href="<?php 
echo BASE_URL;
?>
">尚普商城</a></p>
		</footer>
	</aside>
	<!--侧边栏菜单 结束-->

	<!--主体内容 开始-->
	<section id="main" class="column">
		<?php 
$this->startDate = IFilter::act(IReq::get('startDate'));
$this->endDate = IFilter::act(IReq::get('endDate'));
$countData = statistics::sellerAmount($this->seller['seller_id'], $this->startDate, $this->endDate);
?>
<script type="text/javascript" charset="UTF-8" src="<?php 
echo BASE_URL;
?>
/runtime/_systemjs/my97date/wdatepicker.js"></script>
<script type="text/javascript" charset="UTF-8" src="<?php 
echo BASE_URL;
?>
/runtime/_systemjs/highcharts/highcharts.js"></script>

<article class="module width_full">
	<header>
		<h3 class="tabs_involved">销售统计</h3>
		<ul class="tabs">
			<li>
Example #20
0
echo statistics::commentCount($this->seller['seller_id']);
?>
 条</a></td>
					<td>退款申请:<a href="<?php 
echo IUrl::creatUrl("/seller/refundment_list");
?>
"><?php 
echo statistics::refundsCount($this->seller['seller_id']);
?>
 条</a></td>
					<td>总销售量:<?php 
echo statistics::sellCountSeller($this->seller['seller_id']);
?>
 件</td>
					<td>信用评分:<?php 
echo statistics::gradeSeller($this->seller['seller_id']);
?>
 分</td>
				</tr>
			</tbody>
		</table>
	</div>
</article>

<article class="module width_full">
	<header><h3>销售统计</h3></header>
	<div class="module_content">
		<div id="myChart" style="width:100%;min-height:320px;"></div>
	</div>
</article>