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的更多相关文章

  1. Spring Framework5.0 学习(3)—— spring配置文件的三种形式

    Spring Framework  是 IOC (Inversion of Control  控制反转)原则的实践. IoC is also known as dependency injection ...

  2. CSS样式三种形式222

    markdown CSS基本表现形式只有三种:标签样式.Class类样式.ID样式 标签样式: 必须与HTML标签同名.仅仅影响同名标签 Class样式:可以在任何标签中使用: class=" ...

  3. CSS样式三种形式

    CSS基本表现形式只有三种:标签样式.Class类样式.ID样式 标签样式: 必须与HTML标签同名.仅仅影响同名标签 Class样式:可以在任何标签中使用: class="样式名" ...

  4. Jquery中each的三种遍历方法

    Jquery中each的三种遍历方法 $.post("urladdr", { "data" : "data" }, function(dat ...

  5. Qt学习 之 多线程程序设计(QT通过三种形式提供了对线程的支持)

    QT通过三种形式提供了对线程的支持.它们分别是, 一.平台无关的线程类 二.线程安全的事件投递 三.跨线程的信号-槽连接. 这使得开发轻巧的多线程Qt程序更为容易,并能充分利用多处理器机器的优势.多线 ...

  6. 【淡墨Unity3D Shader计划】五 圣诞用品: Unity在Shader三种形式的控制&amp;混合操作编译

    本系列文章由@浅墨_毛星云 出品,转载请注明出处. 文章链接:http://blog.csdn.net/poem_qianmo/article/details/42060963 作者:毛星云(浅墨)  ...

  7. c++中new的三种用法详细解析

    转载至: http://www.jb51.net/article/41524.htm 以下的是对c++中new的三种使用方法进行了详细的分析介绍,需要的朋友可以过来参考下,希望对大家有所帮助. 一. ...

  8. spring对事务支持的三种形式

    spring对事务支持的三种形式: 1.通过spring配置文件进行切面配置 <bean id="***Manager" class="org.springfram ...

  9. spring Bean配置的三种形式

    Spring Bean配置有以下三种形式: 传统的xml配置 Spring 2.5 以后新增注解配置 Spring3.0以后新增JavaConfig 1. 传统的xml配置 <?xml vers ...

随机推荐

  1. tensorbordX使用

    安装: pip install tensorflow-1.7.0 pip install tensorbord pip install tensorbordX 启动 tensorboard --log ...

  2. C++实现的一些功能代码

    将当前时间输出到txt中: 调用c++中的fstream流文件,用tm结构获取日期和时间,其在time.h中定义 用ofstream的时候,ofstream out(txtpath,ios::app) ...

  3. zoj3223

    其实这题不超时完全是因为串长度太小,如果串够长,一次匹配后都要往上跳,复杂度是n^2的. #include <iostream> #include <cstdio> #incl ...

  4. RxJava2

    原文地址 这可能是最好的RxJava 2.x 入门教程(一) 这可能是最好的RxJava 2.x 入门教程(二) 这可能是最好的RxJava 2.x 入门教程(三) 这可能是最好的RxJava 2.x ...

  5. mysql5.7版本tar包手动安装---redhat7.0

    1.官网下载安装包,删除系统自带的mariadb,查到几个包,卸载几个包,总之得删除干净 [root@localhost Desktop]# yum list | grep mariadb maria ...

  6. Jekyll博客添加Valine评论

    Jekyll博客添加Valine评论 关于github搭建jekyl博客,在这里不做过多描述,详情参考: 百度搜索关键字:github搭建jekyll博客 官网:https://www.jekyll. ...

  7. mac系统 安装pip,用python读写excel(xlrd、xlwt)安装

    1: 先安装python, 下载地址:https://www.python.org/downloads/release/python-372/ 2: 安装pip 下载一个get-pip.py的文件  ...

  8. php session 保存到redis 实现session的共享

    1.redis安装肯定都会了,就不介绍了. 2.核心代码

  9. Json 数组传值

    1. var _content = {}; _content[_title] = _oldValue + ' -- > ' + statusVal; 2. var eventData = { T ...

  10. day 06 编码and知识点总结

    1.day 05 内容回顾 dict:dic = {'name':'alex'} 增:dic['age']=21#存在就覆盖 dic.setdefault(),没有就增加 删除: pop()按照key ...