当前仓库属于暂停状态,部分功能使用受限,详情请查阅 仓库状态说明
1 Star 0 Fork 4

LukeZhang / wss
暂停

forked from 小老虎 / wss
暂停
 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
chart_pie_user.php 2.91 KB
一键复制 编辑 原始数据 按行查看 历史
陈学虎 提交于 2016-04-23 19:26 . 1.3.2版本提交
<?php
include_once ('config/tank_config.php');
include_once ('chart/php-ofc-library/open-flash-chart.php');
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
if (PHP_VERSION < 6) {
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
}
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}
$title = new title( );
$title->set_style("font-size:12px; font-weight:bold;");
$pie = new pie();
$pie->set_alpha(0.6);
$pie->set_start_angle( 32 );
$pie->add_animation( new pie_fade() );
$pie->set_tooltip( '#val# '.$multilingual_project_hour );
$pie->set_colours( array('#99C754','#54C7C5','#999999','#996699','#009900','#77C600','#ff7400',
'#FF0000','#4096ee','#c79810') );
$projectid = $_GET['recordID'];
mysql_select_db($database_tankdb, $tankdb);
$query_Recordset_sumtotal = sprintf("SELECT
sum(csa_tb_manhour) as sum_hour
FROM tk_task_byday
WHERE csa_tb_backup2 = %s", GetSQLValueString($projectid, "text"));
$Recordset_sumtotal = mysql_query($query_Recordset_sumtotal, $tankdb) or die(mysql_error());
$row_Recordset_sumtotal = mysql_fetch_assoc($Recordset_sumtotal);
$t=$row_Recordset_sumtotal['sum_hour'];
$sql=sprintf("SELECT * , sum(csa_tb_manhour) as summ1 FROM tk_task_byday
inner join tk_task_tpye on tk_task_byday.csa_tb_backup4=tk_task_tpye.id
WHERE csa_tb_backup2 = %s GROUP BY csa_tb_backup4 ORDER BY summ1 DESC", GetSQLValueString($projectid, "text"));
$query = mysql_query($sql, $tankdb) or die(mysql_error());
while($row=mysql_fetch_assoc($query)){
$total=$row['summ1'];
if(!empty($t)){
$v=round($total/$t,2)*100;
}else{
$v=0;
}
$dis[]=array("name"=>$row['task_tpye'],"total"=>$row['summ1'],"v"=>$v);
}
$len_dis=count($dis);
for($i=0;$i<$len_dis;$i++){
$dis_value[]=new pie_value(intval($dis[$i]['total']),$dis[$i]['name'].":".$dis[$i]['total'].$multilingual_project_hour."(".$dis[$i]['v']."%)");
}
$pie->set_values($dis_value);
$chart = new open_flash_chart();
$chart->set_title( $title );
$chart->add_element( $pie );
$chart->x_axis = null;
$chart->bg_colour = ( '#FFFFFF' );
echo $chart->toPrettyString();
?>
<?php echo $projectid; ?>
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
PHP
1
https://gitee.com/keenlove/wss.git
git@gitee.com:keenlove/wss.git
keenlove
wss
wss
master

搜索帮助

344bd9b3 5694891 D2dac590 5694891