我从数据库中获取数据。如果我点击网址(如图片中所示),则转到特定网站页面。但是,当我点击特定网址时,我想重定向特定的报告页面。
<?php
public function getTemperatures()
{
$mysql_hostname = "localhost";
$mysql_user = "root";
$mysql_password = "";
$mysql_database = "api_enterprise";
$bd = mysql_connect($mysql_hostname, $mysql_user, $mysql_password) or die("Oops some thing went wrong");
mysql_select_db($mysql_database, $bd) or die("Oops some thing went wrong");// we are now connected to database
$result = mysql_query("SELECT * FROM website"); // selecting data through mysql_query()
while($data = mysql_fetch_array($result))
{
$temperatures[] = array(
'label1' => '<a href="'.$data['link'].'" target="_blank">'.$data['link'].'</a>',
'label2' => $data['time'],
'label3' => $data['os'],
'label4' => $data['browser'],
'label5' => $data['status'],
'label6' => $data['location'],
array('label6' => $data['widget_load_time'])
);
}
return DataTable::makeFromIndexedArray($temperatures);
}
答案 0 :(得分:0)
我看了piwik演示。我觉得这就是你的需要:
'label1' => '<a href="index.php?module=CoreHome&action=index&date=yesterday&period=day&idSite='.$data['id'].'" target="_blank">'.$data['link'].'</a>',
您可以根据需要编辑期间和日期参数。但也许是产生这种联系的更好方式。