<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 ...
随机推荐
- 两两交换链表中的节点(java实现)
题目: 给定一个链表,两两交换其中相邻的节点,并返回交换后的链表. 你不能只是单纯的改变节点内部的值,而是需要实际的进行节点交换. 示例: 给定 1->2->3->4, 你应该返回 ...
- 什么是LDAP?
LDAP是轻量目录访问协议,英文全称是Lightweight Directory Access Protocol,一般都简称为LDAP.它是基于X.500标准的,但是简单多了并且可以根据需要定制.与X ...
- 保存标注对象到txt 制作xml
1.算法将检测的目标名称和目标位置保存到txt文本 图片名 xmin ymin xmax ymax (4).avi237face.jpg4smoke 83 234 142 251hand 119 2 ...
- HttpUrlConnection流传输问题(正确传输包含中文的JSON字符串)
目前在写一个功能,主要是使用 HttpURLConnection 发送http请求调用外部接口.本来一切正常的,可是在发送post请求上传数据给服务端时,服务端返回错误信息:获取的JSON请求是乱码的 ...
- lxml 解析字符处理规则
规则1:无论输入的字符串是何种状态,lxml包接收后一律转换成unicode,其处理结果也是unicodetype,输出到文件时,需要指定编码,转换成特定的stringtype状态.规则2:lxml用 ...
- 深入理解CADisplayLink和NSTimer
一.什么是CADisplayLink 简单地说,它就是一个定时器,每隔几毫秒刷新一次屏幕. CADisplayLink是一个能让我们以和屏幕刷新率相同的频率将内容画到屏幕上的定时器.我们在应用中创建一 ...
- balcanced-binary-tree
题目描述 Given a binary tree, determine if it is height-balanced. For this problem, a height-balanced bi ...
- springboot秒杀课程学习整理1-4
1)商品模型设计 (应该是先设计商品的model,然后才是数据库表) 模型字段(id,title,price(double),stock(库存),description,sales,imgUrl) 创 ...
- 第三周博客之二---Oracle中的sql语句
一.用户及权限(DBA有最高系统权限) 1.数据库的安全性:系统的安全性.数据的安全性 2.权限分类: 2.1系统权限:获得后可访问数据库 常用的有create table,create user,c ...
- 使用EXE4J和Inno Setup 编译器将java程序打包成windows桌面应用安装程序
java项目结构如下: Demo是模仿程序快照,主要设计两个按钮:保存快照和恢复快照: 保存快照将对象(窗口)序列化保存下来,后面无论做了什么操作,只要点击恢复快照, 就会读取之前保存的序列化的对象. ...