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. 树中的路径和 Sum of Distances in Tree

    2019-03-28 15:25:43 问题描述: 问题求解: 写过的最好的Hard题之一. 初看本题,很经典的路径和嘛,dfs一遍肯定可以得到某个节点到其他所有节点的距离和.这种算法的时间复杂度是O ...

  2. 1GB pages can only be allocated at boot time using hugepages= and not freed afterwards

    2018-6-27 9:12:38 https://stackoverflow.com/questions/26385554/error-setting-nr-hugepages-via-sysfs ...

  3. jquery表单提交获取数据(带toast dialog)

    最近写了一个召集令,传统表单提交注册.写写遇到的费时间的点与解决办法 git项目地址:form-demo(针对于手机版,懒人可以直接使用,有排版和样式) demo使用Jquery,toast使用jqu ...

  4. Spring的事务初见

    一.事务的特性 原子性: 事务是最小的执行单位,不允许分割.事务的原子性确保动作要么全部完成,要么完全不起作用: 一致性: 执行事务前后,数据保持一致: 隔离性: 并发访问数据库时,一个用户的事物不被 ...

  5. vmware12启动centos6.8报错ACPI:memory_hp:Memory online failed

    报错信息 打开后出现黑屏上只显示 ACPI:memory_hp:Memory online failed for 0x10000000 - 0x80000000 BUG: soft lockup - ...

  6. DMA 内存存取原理

    DMA直接内存存取原理 DMADMA直接内存存取原理是指外部设备不通过CPU而直接与系统内存交换数据的接口技术. 要把外设的数据读入内存或把内存的数据传送到外设,一般都要通过CPU控制完成,如CPU程 ...

  7. MFC界面分割以及挂载

     MFC中文档与视图(二) Last Edit 2013/11/19 这篇主要是介绍一下怎么去分割视图. 视图的分割分为:动态分割,静态分割.所谓的静态分割是指软件一启动视图就分割完成,而动态分割是在 ...

  8. Mxnet编译安装

    在安装之前请你们自行安装好cuda和cudnn,记得修改环境变量并且source一下,下面讲一下mxnet的安装 严格按照我的所有的指令 sudo apt-get update sudo apt-ge ...

  9. 网络编程-day3

    ---恢复内容开始--- 一.缓冲区:  将程序和网络解耦 输入缓冲区 输出缓冲区 每个 socket 被创建后,都会分配两个缓冲区,输入缓冲区和输出缓冲区. write()/send() 并不立即向 ...

  10. Java实现post和get请求

    GET请求:GET请求会向服务器发索取数据的请求,从而来获取信息,该请求就像数据库的select操作一样,只是用来查询一下数据,不会修改.增加数据,不会影响资源的内容,即该请求不会产生副作用.无论进行 ...