コード例 #1
0
ファイル: func.php プロジェクト: nikuha/rs
function separ_float($digit, $separ=" ")
{
	$digit = exp_to_dec($digit);
	
	@list($whole, $fractional) = split("\\.", $digit);
	
	$arr = array();
	while(strlen($whole)>3)
	{
		$arr[] = substr($whole, -3);
		$whole = substr($whole, 0, strlen($whole)-3);
	} 
	if(strlen($whole)>0) $arr[] = $whole;
	
	$whole = join($separ, array_reverse($arr));
	
	return ($fractional) ? $whole.".".$fractional : $whole;
}
コード例 #2
0
ファイル: db.php プロジェクト: jliman/SEOStat
function saveFacebookStat($account, $result, $result2) {
	global $conn;
	$interactions = $result['Total Interactions'];
	$comments = $result['Comments'];
	$wallposts = $result['Wall Posts'];
	$likes = $result['Likes'];
	$fans = $result2['Total Fans'];
	$unsubscribe = $result2['Unsubscribed Fans'];
	
	$stat = array();
	
	foreach($interactions as $data) {
		$date = date("Y-m-d",exp_to_dec($data[0])/1000);
		if (!isset($stat[$date])) {
			$stat[$date] = array();
		}
		$stat[$date]['date'] = $date;
		$stat[$date]['interactions'] = $data[1];
	}

	foreach($comments as $data) {
		$date = date("Y-m-d",exp_to_dec($data[0])/1000);
		if (!isset($stat[$date])) {
			$stat[$date] = array();
		}
		$stat[$date]['comments'] = $data[1];
	}

	foreach($wallposts as $data) {
		$date = date("Y-m-d",exp_to_dec($data[0])/1000);
		if (!isset($stat[$date])) {
			$stat[$date] = array();
		}
		$stat[$date]['wallposts'] = $data[1];
	}

	foreach($likes as $data) {
		$date = date("Y-m-d",exp_to_dec($data[0])/1000);
		if (!isset($stat[$date])) {
			$stat[$date] = array();
		}
		$stat[$date]['likes'] = $data[1];
	}

	foreach($fans as $data) {
		$date = date("Y-m-d",exp_to_dec($data[0])/1000);
		if (!isset($stat[$date])) {
			$stat[$date] = array();
		}
		$stat[$date]['date'] = $date;
		$stat[$date]['fans'] = $data[1];
	}

	foreach($unsubscribe as $data) {
		$date = date("Y-m-d",exp_to_dec($data[0])/1000);
		if (!isset($stat[$date])) {
			$stat[$date] = array();
		}
		$stat[$date]['date'] = $date;
		$stat[$date]['unsubscribe'] = $data[1];
	}
	
	foreach($stat as $data) {
		$year = strftime("%Y",strtotime($data['date']));
		$month = strftime("%m",strtotime($data['date']));
		$week = strftime("%W",strtotime($data['date']));
		$sql = "REPLACE INTO tbl_facebook_stat (id_profile, stat_date, year, month, week, interactions, comments, wallposts, fans, likes, unsubscribe) VALUES (".$account['id'].", '".$data['date']."', '$year', '$month', '$week', '".$data['interactions']."', '".$data['comments']."', '".$data['wallposts']."', '".$data['fans']."', '".$data['likes']."', '".$data['unsubscribe']."')";
		mysql_query($sql,$conn);
	}
}
コード例 #3
0
    $core->SQL("UPDATE operations_params SET `Value`=" . $station_standing . " WHERE `Name`='station_standing'");
    $core->SQL("UPDATE operations_params SET `Value`=" . $station_tax . " WHERE `Name`='station_tax'");
    UpdatePrices();
    $core->Goto("index.php?result=2");
} elseif ($action == "operationalitems") {
    if ($core->CurrentUser()->AccessRight() < 4) {
        $core->Goto('../../php/access.php');
    }
    $result2 = $core->SQL("SELECT * FROM operations_items ORDER BY GroupID, Name ASC");
    // id  EveTypeID  Name  GroupID   Price  DisplayOrder
    while ($row = mysql_fetch_assoc($result2)) {
        $manage_id[$row['id']] = $row['id'];
        $manage_EveTypeID[$row['id']] = $row['EveTypeID'];
        $manage_Name[$row['id']] = $row['Name'];
        $manage_GroupID[$row['id']] = $row['GroupID'];
        $manage_Price[$row['id']] = number_format(exp_to_dec($row['Price']), 2, '.', ',');
        $manage_DisplayOrder[$row['id']] = $row['DisplayOrder'];
    }
    $core->assign('manage_id', $manage_id);
    $core->assign('manage_EveTypeID', $manage_EveTypeID);
    $core->assign('manage_Name', $manage_Name);
    $core->assign('manage_GroupID', $manage_GroupID);
    $core->assign('manage_Price', $manage_Price);
    $core->assign('manage_DisplayOrder', $manage_DisplayOrder);
} elseif ($action == "newitem") {
    if ($core->CurrentUser()->AccessRight() < 4) {
        $core->Goto('../../php/access.php');
    }
    $result = $core->EveSQL("SELECT DISTINCT *  FROM `invMarketGroups` WHERE `graphicID` != 2703 AND `hasTypes` = 0 ORDER BY marketGroupName");
    $items = array();
    while ($row = mysql_fetch_assoc($result)) {