<iframe> 标签 中 src 的三种形式. display , echart
1.形式一:
<iframe scrolling="yes" src="action.php?c=HLogin&a=linkPage&p=fx" width="100%" height="100%" frameborder="0"></iframe>
----------
访问的方法:
//关联页面管理:
public function linkPageAction()
{
$theKey = isset($_REQUEST["p"]) ? $_REQUEST["p"] : 'pj'; switch ($theKey)
{
//1: 评价:
case 'pj':
$this->pjService();
break; //2: 分析:
case 'fx':
18 $this->fxService();
break; //3: 留言板:
case 'lyb':
$this->lybService();
break; default:
$this->pjService();
break;
} }
//2: 分析 页面:
public function fxService()
{ //1: 取出分析
$chart = array(); $AnalysisModel = new AnalysisModel();
$where["where"] = " isHidden = 0 order by orderBy asc, id asc ";
$data = $AnalysisModel->getDataList($where); foreach ($data["rows"] as $k => $model)
{
$cell = array();
$cell["id"] = $model->id;
$cell["chart"] = $model->chart;
$cell["title"] = $model->title; $chart[] = $cell;
} foreach ($chart as $k => &$v)
{
if ($v["chart"] == 0)
{
// echo "条形图";
//条形图:
$v["content"] = $this->txChartService($v["id"]);
}
else
{
// echo "雷达图";
//雷达图:
$v["content"] = $this->ldChartService($v["id"]);
} } //去除引用的变量值$v
unset($v); // echo "<pre>";
// var_dump($chart); //返回数据:
$parameter = array();
$parameter["chart"] = $chart; 52 $this->display("Home/iframe/fx.php", $parameter);
} /**
* [txChartService 处理条形图数据]
* @param [type] $id [Analysis 的 id ]
* @return [type] [description]
*/
public function txChartService($id)
{
//1: 取出 分析 对应 的 分析项:
$content = array(); $AnalysisItemModel = new AnalysisItemModel();
$where["where"] = " analysisId = $id order by orderBy asc, id asc ";
$data = $AnalysisItemModel->getDataList($where); //分析项:
$legend = array();
foreach ($data["rows"] as $k => $model)
{
$legend[$model->id] = $model->title;
} //取出学生: 如果所有的分析项 都没有数据. 那么剔除这个学生.
$yAxis = array();
$StudentModel = new StudentModel();
$where["where"] = " 1 = 1 order by orderBy asc, id asc ";
$data = $StudentModel->getDataList($where);
foreach ($data["rows"] as $k => $model)
{
$num = 0; foreach ($legend as $k2 => $v2)
{
$StudentAnalysisItemModel = new StudentAnalysisItemModel();
$where = " where studentId = $model->id and analysisItemId = $k2 ";
$StudentAnalysisItemModel->getDataRow($where); if ($StudentAnalysisItemModel->getDB == false)
{
$num++;
}
} if ($num != count($legend))
{
$yAxis[$model->id] = $model->userName;
}
} //取出每个分类项 对应 的 学生数据.
$series = array(); foreach ($legend as $k => $v)
{
$cell = array();
$cell["name"] = $v;
$cell["type"] = 'bar'; foreach ($yAxis as $k2 => $v2)
{
$StudentAnalysisItemModel = new StudentAnalysisItemModel();
$where = " where studentId = $k2 and analysisItemId = $k ";
$StudentAnalysisItemModel->getDataRow($where); if ($StudentAnalysisItemModel->getDB)
{
$cell["data"][] = intval($StudentAnalysisItemModel->score);
}
else
{
$cell["data"][] = 0;
} } $series[] = $cell;
} $hasContent = empty($yAxis) ? 0 : 1; $content["hasContent"] = $hasContent;
$content["legend"] = $legend;
$content["yAxis"] = $yAxis;
$content["series"] = $series; return $content; } /**
* [ldChartService 处理 雷达图数据]
* @param [type] $id [Analysis 的 id]
* @return [type] [description]
*/
public function ldChartService($id)
{
//1: 取出 分析 对应 的 分析项:
$content = array(); $AnalysisItemModel = new AnalysisItemModel();
$where["where"] = " analysisId = $id order by orderBy asc, id asc ";
$data = $AnalysisItemModel->getDataList($where); //分析项:
$item = array();
foreach ($data["rows"] as $k => $model)
{
$item[$model->id] = $model->title;
} //indicator:
$indicator = array();
foreach ($item as $k => $v)
{
$cell = array();
$cell["name"] = $v;
$cell["max"] = 0; $StudentAnalysisItemModel = new StudentAnalysisItemModel();
$where["where"] = " analysisItemId = $k ";
$data = $StudentAnalysisItemModel->getDataList($where);
foreach ($data["rows"] as $k2 => $model2)
{
if (intval($model2->score) > $cell["max"])
{
$cell["max"] = intval($model2->score);
}
} $indicator[] = $cell;
} //取出学生: 如果所有的分析项 都没有数据. 那么剔除这个学生.
$legend = array();
$StudentModel = new StudentModel();
$where["where"] = " 1 = 1 order by orderBy asc, id asc ";
$data = $StudentModel->getDataList($where);
foreach ($data["rows"] as $k => $model)
{
$num = 0; foreach ($item as $k2 => $v2)
{
$StudentAnalysisItemModel = new StudentAnalysisItemModel();
$where = " where studentId = $model->id and analysisItemId = $k2 ";
$StudentAnalysisItemModel->getDataRow($where); if ($StudentAnalysisItemModel->getDB == false)
{
$num++;
}
} if ($num != count($item))
{
$legend[$model->id] = $model->userName;
}
} //取出每个分类项 对应 的 学生数据.
$series = array(); foreach ($legend as $k => $v)
{
$cell = array();
$cell["name"] = $v; foreach ($item as $k2 => $v2)
{
$StudentAnalysisItemModel = new StudentAnalysisItemModel();
$where = " where studentId = $k and analysisItemId = $k2 ";
$StudentAnalysisItemModel->getDataRow($where); if ($StudentAnalysisItemModel->getDB)
{
$cell["value"][] = intval($StudentAnalysisItemModel->score);
}
else
{
$cell["value"][] = 0;
} } $series[] = $cell;
} $hasContent = empty($legend) ? 0 : 1; $content["hasContent"] = $hasContent;
$content["indicator"] = $indicator;
$content["legend"] = $legend;
$content["series"] = $series; return $content;
}
display方法:
/**
* 显示页面
*
* @param unknown $parameter
* @param unknown $url
*/
protected function display($url, $parameter = array()) {
$path = pathinfo ( $url );
$location = CURR_VIEW_PATH . $path ["dirname"] . '/' . $path ["filename"] . 'Proxy' . '.' . $path ["extension"];
if (file_exists ( $location )) {
// 读取文件行数5.0以上版本
$fileProxy = fopen ( $location, 'r' );
$line = 0; // 初始化行数
while ( stream_get_line ( $fileProxy, 8192, "\n" ) ) {
$line ++;
}
fclose ( $fileProxy ); // 关闭文件 // 读取文件行数,效率低,适合5.0及5.0以下版本
// $line = count(file($location)); // 如果文件行数 大于一行,择跳转该文件
if ($line > 1) {
include $location;
} else {
include CURR_VIEW_PATH . $url;
}
} else {
include CURR_VIEW_PATH . $url;
}
}
2. 形式2. 网址.
<iframe scrolling="yes" src="127.0.0.1/test/test.php" width="100%" height="100%" frameborder="0"></iframe>
3. 形式三 . 相对地址.
<iframe scrolling="yes" src="./test/test.php" width="100%" height="100%" frameborder="0"></iframe>
<iframe> 标签 中 src 的三种形式. display , echart的更多相关文章
- Spring Framework5.0 学习(3)—— spring配置文件的三种形式
Spring Framework 是 IOC (Inversion of Control 控制反转)原则的实践. IoC is also known as dependency injection ...
- CSS样式三种形式222
markdown CSS基本表现形式只有三种:标签样式.Class类样式.ID样式 标签样式: 必须与HTML标签同名.仅仅影响同名标签 Class样式:可以在任何标签中使用: class=" ...
- CSS样式三种形式
CSS基本表现形式只有三种:标签样式.Class类样式.ID样式 标签样式: 必须与HTML标签同名.仅仅影响同名标签 Class样式:可以在任何标签中使用: class="样式名" ...
- Jquery中each的三种遍历方法
Jquery中each的三种遍历方法 $.post("urladdr", { "data" : "data" }, function(dat ...
- Qt学习 之 多线程程序设计(QT通过三种形式提供了对线程的支持)
QT通过三种形式提供了对线程的支持.它们分别是, 一.平台无关的线程类 二.线程安全的事件投递 三.跨线程的信号-槽连接. 这使得开发轻巧的多线程Qt程序更为容易,并能充分利用多处理器机器的优势.多线 ...
- 【淡墨Unity3D Shader计划】五 圣诞用品: Unity在Shader三种形式的控制&混合操作编译
本系列文章由@浅墨_毛星云 出品,转载请注明出处. 文章链接:http://blog.csdn.net/poem_qianmo/article/details/42060963 作者:毛星云(浅墨) ...
- c++中new的三种用法详细解析
转载至: http://www.jb51.net/article/41524.htm 以下的是对c++中new的三种使用方法进行了详细的分析介绍,需要的朋友可以过来参考下,希望对大家有所帮助. 一. ...
- spring对事务支持的三种形式
spring对事务支持的三种形式: 1.通过spring配置文件进行切面配置 <bean id="***Manager" class="org.springfram ...
- spring Bean配置的三种形式
Spring Bean配置有以下三种形式: 传统的xml配置 Spring 2.5 以后新增注解配置 Spring3.0以后新增JavaConfig 1. 传统的xml配置 <?xml vers ...
随机推荐
- NopCommerce源码架构详解
NopCommerce源码架构详解--初识高性能的开源商城系统cms 很多人都说通过阅读.学习大神们高质量的代码是提高自己技术能力最快的方式之一.我觉得通过阅读NopCommerce的源码,可以从 ...
- storybook构建vue组件
最近在研究业务型组件的使用,因为在单独开发组件的时候需要调试,所以为每一个组件都编写一个webpack开发环境,然后上传上去为了其他人可以直接使用又把webpack上传上去,这样会有两个问题: 1:每 ...
- hdu-1536 S-Nim SG函数
http://acm.hdu.edu.cn/showproblem.php?pid=1536 给出能够取的方法序列,然后求基本石子堆问题. 只要用S序列去做转移即可. 注意has初始化的一些技巧 #i ...
- Confluence 6 针对合并完全失败的内容重新运行合并
如果在系统合并的时候有任何内容的合并失败的话,一个 Confluence 的管理员可以再次重新启动内容合并(请参考前面页面的内容).只有内容还是使用 wiki 格式的才会被合并,因此重新合并所需要的时 ...
- 字体图标库 IcoMoon IconFont Font Awesome的使用
在项目开发的过程中,我们会经常用到一些图标.但是我们在使用这些图标时,往往会遇到失真的情况,而且图片数量很多的话,页面加载就越慢.所以,我们可以使用字体图标的方式来显示图标,字体图标任意放大缩小不会失 ...
- JavaScript判断苹果 iPhone X Series 机型
原文链接: JavaScript 判断 iPhone X Series 机型 现状 iPhone X 底部是需要预留 34px 的安全距离,需要在代码中进行兼容. 现状对于 iPhone X 的判断基 ...
- 判断PDF文件是否相同(通过二进制流判断)
一.Java代码 1.将PDF转为字节流 /* * @step * 1.使用BufferedInputStream和FileInputStream从File指定的文件中读取内容 ...
- ASP.NET上传大文件报错,IIS7.0
打开你系统盘(我是C盘),找到C:\Windows\System32\inetsrv\config\schema目录,该目录下有一个IIS_schema.xml,右击打开文件,Ctrl+F,然后输入& ...
- C# 获取Newtonsoft.Json的JObject多层节点内容
json形如 { "object":{ "name":"cwr" }, " } 要获取name的值,则需要构造两个JObject来 ...
- 性能测试遭遇TPS抖动问题
目前性能测试组正在对独立秒杀进行性能压测,性能抖动特别厉害. 由于独立秒杀的接口大多数是经过volicity渲染过的页面和数据的整合,所以在压测的时候有很多volicity的错误.初步判定,感觉是vo ...