最近在做一个工资统计模块,之前用了一个叫amchart
的flash组件,感觉还是挺不错的,使用的效果如下,
后来又要实现一个明细的页面,心想已经用了flash技术了,干脆把flex技术也搞上,于是安装了flex builder,现学现用,
花了些时间, 做了个效果图,如下
这里就只附上flex的代码,关于amchart,大家就自己google一下吧,
flex代码如下
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"
xmlns="*" applicationComplete="send_data()">
<mx:Script>
<![CDATA[
import mx.rpc.events.ResultEvent;
import mx.rpc.http.HTTPService;
import mx.controls.Alert;
private var service:HTTPService=new HTTPService();
private function send_data():void {
service.url="http://192.168.1.190/wage/services.php?month="+this.parameters.month+"&team="+encodeURI(this.parameters.team);
service.useProxy=false;
service.method="post";
Alert.show(this.parameters.month+" "+this.parameters.team+" "+service.url);
service.send();
}
]]>
</mx:Script>
<mx:DataGrid id="dataResult" dataProvider="{service.lastResult.wages.mem}" horizontalCenter="-38" verticalCenter="11" width="900" height="500">
<mx:columns>
<mx:DataGridColumn headerText="姓名" dataField="xm"/>
<mx:DataGridColumn headerText="加班补贴" dataField="jbbt"/>
<mx:DataGridColumn headerText="请假" dataField="qj"/>
<mx:DataGridColumn headerText="扣款" dataField="kk"/>
<mx:DataGridColumn headerText="住宿" dataField="sz"/>
<mx:DataGridColumn headerText="满勤" dataField="mq"/>
<mx:DataGridColumn headerText="社保" dataField="sb"/>
<mx:DataGridColumn headerText="工龄" dataField="gl"/>
<mx:DataGridColumn headerText="其他补贴" dataField="bt"/>
<mx:DataGridColumn headerText="卡号" dataField="kh"/>
</mx:columns>
</mx:DataGrid>
</mx:Application>
flex builder对应自动生成的html,为实现html传参,需做些修改,代码如下
<!-- saved from url=(0014)about:internet -->
<html lang="en">
<!--
Smart developers always View Source.
This application was built using Adobe Flex, an open source framework
for building rich Internet applications that get delivered via the
Flash Player or to desktops via Adobe AIR.
Learn more about Flex at http://flex.org
// -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- BEGIN Browser History required section -->
<link rel="stylesheet" type="text/css" href="history/history.css" />
<!-- END Browser History required section -->
<title></title>
<script src="AC_OETags.js" language="javascript"></script>
<!-- BEGIN Browser History required section -->
<script src="history/history.js" language="javascript"></script>
<!-- END Browser History required section -->
<style>
body { margin: 0px; overflow:hidden }
</style>
<script language="JavaScript" type="text/javascript">
<!--
// -----------------------------------------------------------------------------
// Globals
// Major version of Flash required
var requiredMajorVersion = 9;
// Minor version of Flash required
var requiredMinorVersion = 0;
// Minor version of Flash required
var requiredRevision = 124;
// -----------------------------------------------------------------------------
// -->
//注:这个是重点,用于实现html传参
function getparafromurl() {
var url,pos,parastr,para;
url = window.location.href;
pos = url.indexOf("?")
parastr = url.substring(pos+1);
return parastr;
}
</script>
</head>
<body scroll="no">
<script language="JavaScript" type="text/javascript">
<!--
// Version check for the Flash Player that has the ability to start Player Product Install (6.0r65)
var hasProductInstall = DetectFlashVer(6, 0, 65);
// Version check based upon the values defined in globals
var hasRequestedVersion = DetectFlashVer(requiredMajorVersion, requiredMinorVersion, requiredRevision);
if ( hasProductInstall && !hasRequestedVersion ) {
// DO NOT MODIFY THE FOLLOWING FOUR LINES
// Location visited after installation is complete if installation is required
var MMPlayerType = (isIE == true) ? "ActiveX" : "PlugIn";
var MMredirectURL = window.location;
document.title = document.title.slice(0, 47) + " - Flash Player Installation";
var MMdoctitle = document.title;
AC_FL_RunContent(
"src", "playerProductInstall",
"FlashVars", "MMredirectURL="+MMredirectURL+'&MMplayerType='+MMPlayerType+'&MMdoctitle='+MMdoctitle+"",
"width", "100%",
"height", "100%",
"align", "middle",
"id", "fourFlex",
"quality", "high",
"bgcolor", "#869ca7",
"name", "fourFlex",
"allowScriptAccess","sameDomain",
"type", "application/x-shockwave-flash",
"pluginspage", "http://www.adobe.com/go/getflashplayer",
//为保证flex能接受到html参数,需加如下语句
"FlashVars", getparafromurl()
);
} else if (hasRequestedVersion) {
// if we've detected an acceptable version
// embed the Flash Content SWF when all tests are passed
AC_FL_RunContent(
"src", "fourFlex",
"width", "100%",
"height", "100%",
"align", "middle",
"id", "fourFlex",
"quality", "high",
"bgcolor", "#869ca7",
"name", "fourFlex",
"allowScriptAccess","sameDomain",
"type", "application/x-shockwave-flash",
"pluginspage", "http://www.adobe.com/go/getflashplayer",
//为保证flex能接受到html参数,需加如下语句
"FlashVars", getparafromurl()
);
} else { // flash is too old or we can't detect the plugin
var alternateContent = 'Alternate HTML content should be placed here. '
+ 'This content requires the Adobe Flash Player. '
+ '<a href=http://www.adobe.com/go/getflash/>Get Flash</a>';
document.write(alternateContent); // insert non-flash content
}
// -->
</script>
<noscript>
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
id="fourFlex" width="100%" height="100%"
codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab">
<param name="movie" value="fourFlex.swf" />
<param name="quality" value="high" />
<param name="bgcolor" value="#869ca7" />
<param name="allowScriptAccess" value="sameDomain" />
<embed src="fourFlex.swf" quality="high" bgcolor="#869ca7"
width="100%" height="100%" name="fourFlex" align="middle"
play="true"
loop="false"
quality="high"
allowScriptAccess="sameDomain"
type="application/x-shockwave-flash"
pluginspage="http://www.adobe.com/go/getflashplayer">
</embed>
</object>
</noscript>
</body>
</html>
services.php:
require_once("db_class.php");
$db=new mysql("127.0.0.1","root","1234","wage","conn","utf8");
$month=$_REQUEST['month'];
$team_name=urldecode($_REQUEST['team']);
$sql="select xm,jbbt,qj,kk,sz,fk,mq,sb,gl,bt,kh,team from wage_detail where month=$month and team='$team_name'";
$arr=$db->fetchrows($sql);
$doc = new DOMDocument('1.0','utf-8');
$doc->formatOutput = true;
$r = $doc->createElement( "wages" );
$doc->appendChild( $r );
foreach( $arr as $user )
{
$mem = $doc->createElement( "mem" );
$xm = $doc->createElement( "xm" );
$xm->appendChild(
$doc->createTextNode( $user['xm'] )
);
$mem->appendChild( $xm );
$jbbt = $doc->createElement( "jbbt" );
$jbbt->appendChild(
$doc->createTextNode( $user['jbbt'] )
);
$mem->appendChild( $jbbt );
$qj= $doc->createElement( "qj" );
$qj->appendChild(
$doc->createTextNode( $user['qj'] )
);
$mem->appendChild( $qj );
$kk = $doc->createElement( "kk" );
$kk->appendChild(
$doc->createTextNode( $user['kk'] )
);
$mem->appendChild( $kk );
$sz = $doc->createElement( "sz" );
$sz->appendChild(
$doc->createTextNode( $user['sz'] )
);
$mem->appendChild( $sz );
$mq = $doc->createElement( "mq" );
$mq->appendChild(
$doc->createTextNode( $user['mq'] )
);
$mem->appendChild( $mq );
$sb = $doc->createElement( "sb" );
$sb->appendChild(
$doc->createTextNode( $user['sb'] )
);
$mem->appendChild( $sb );
$gl = $doc->createElement( "gl" );
$gl->appendChild(
$doc->createTextNode( $user['gl'] )
);
$mem->appendChild( $gl );
$bt = $doc->createElement( "bt" );
$bt->appendChild(
$doc->createTextNode( $user['bt'] )
);
$mem->appendChild( $bt );
$kh = $doc->createElement( "kh" );
$kh->appendChild(
$doc->createTextNode( $user['kh'] )
);
$mem->appendChild( $kh );
$r->appendChild( $mem );
}
echo $doc->saveXML();
?>
- 大小: 38 KB
- 大小: 59.1 KB
分享到:
相关推荐
标题中的“初探PureMVC:使用PHP+MySQL+Flex结合PureMVC框架做了个Flex留言本”揭示了本文将探讨如何使用PureMVC框架,结合PHP后端和MySQL数据库,构建一个基于Flex的前端留言本应用。PureMVC是一个轻量级、可扩展的...
《CMA与Flex在Flash(FMS)视频教学中的应用初探》 在当前数字化时代,多媒体教学成为一种普遍且高效的学习方式,其中Flash(FMS)技术因其强大的交互性和实时性,被广泛应用于在线教育领域。"cma.rar_cma_flex"这个...
**Cairngorm框架初探** Cairngorm是一种基于ActionScript 3.0的轻量级MVC(Model-View-Controller)框架,主要用于Flex和Adobe AIR应用程序的开发。这个框架提供了一种结构化的方式来组织和管理代码,使得大型项目...
- `display`属性值为`inline-block`, `table-cell`, `table-caption`, `flex`, `grid`的元素 - `overflow`属性值不为`visible`的元素(包括`hidden`, `auto`, `scroll`) 3. **BFC的作用**: - **清除浮动**:在...
### Flash测试方法初探 #### 一、引言 随着互联网技术的发展,Flash作为一种重要的多媒体技术,在线视频、游戏等领域发挥了重要作用。然而,Flash的测试技术相较于传统的Web测试来说并不十分成熟,这给开发者和...
《性能加倍 能耗减半——HP ProLiant G6服务器初探》 HP ProLiant G6服务器是惠普公司在全球经济衰退背景下为应对IT经理挑战而推出的一款创新产品,其核心目标在于提升服务器的投入产出效率,兼顾节能减排、简化...
文中首先介绍"天地图"、"天地图·甘肃"服务资源,分析其GIS服务模式,研究基于ArcGIS API For Flex接口调用"天地图"、"天地图·甘肃"地图服务的关键技术,实现了地质灾害专题数据与"天地图·甘肃"地图服务的聚合与集成,...
《使用Flexbox构建个人投资组合页面的初探》 在Web开发领域,创建美观且响应式的布局是一项必备技能。随着技术的发展,Flexbox( Flexible Box 或 Flex 布局)应运而生,为实现这样的目标提供了强大的工具。本文将...
《instacopy:初探Instagram界面克隆,深入学习CSS Flexbox》 instacopy是一个项目,旨在通过复制Instagram的初始屏幕来提供一个实践CSS(层叠样式表)的平台,特别是聚焦于Flexbox模块的学习。这个项目对于任何...
【微信小程序开发初探】 微信小程序,作为腾讯公司推出的一种轻量级应用开发平台,它无需下载安装即可使用,极大地提升了用户体验。这个压缩包“小程序demo集合”包含了28个不同功能与应用场景的小程序示例,是学习...
为何我反对使用 flex: 1 简写 如何判断是否点击在元素内部 从 cc._decorator 中学习 ts 装饰器 服务端渲染 SSR 梳理 随笔感想 闲谈 css 的 float 读《面向前端的设计规范-文字初探》 关于间距样式的两点建议 我理解...
- **开发体验初探**:介绍了Flutter的开发流程和热重载功能,热重载使得开发者可以在运行时快速看到代码更改的效果。 - **编写第一个Flutter应用**:引导开发者通过一个简单的“Hello, World”示例了解Flutter的基本...
Vue.js 移动端 App 开发实战初探 在本文中,我们将深入探讨使用 Vue.js 2.x 构建一个移动端 Web 应用程序的基本配置。这个项目虽然规模不大,但涵盖了许多常见的功能,例如轮播图、下拉刷新、上拉加载和图片懒加载...
《HTML与CSS响应式设计初探》 在Web开发领域,HTML和CSS是构建网页的基础。HTML(HyperText Markup Language)负责定义网页的结构,而CSS(Cascading Style Sheets)则用来控制网页的样式和布局。随着移动设备的...
《Flutter_App_First——初探Dart与Flutter应用开发》 Flutter,谷歌推出的开源移动应用开发框架,以其高效、跨平台的特性受到了开发者们的热烈欢迎。本项目“Flutter_App_First”旨在帮助初学者快速入门,通过实际...
《React Native初探:构建“Hello”应用》 React Native,作为Facebook开源的一款跨平台移动应用开发框架,允许开发者使用JavaScript和React来构建原生的iOS和Android应用。本篇文章将深入探讨如何利用React Native...
《MeizhiReactNative——初探React Native世界》 React Native,由Facebook开发并开源,是一种基于JavaScript的框架,用于构建原生移动应用程序。MeizhiReactNative项目,正如其名,是您初次接触和实践React Native...