⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sumdata.php

📁 电子派单系统
💻 PHP
字号:
<?php
session_start();
include("resp.inc");
resp_db_connect_i();
$gtime=mysql_fetch_array(mysql_query("select sum(time_to_sec(timediff(deliver.ttime,deliver.stime))/60)  as dtime from deliver where tflag='1' "));
$gnum=mysql_fetch_array(mysql_query("select count(*) as num from deliver where tflag='1' "));
echo "<br>故障总数:";
echo $gnum[0];
echo "<br>故障处理总时长:";
echo $gtime[0];
echo "<br>故障处理均时长:";
echo $gtime[0]/$gnum[0];
$pnum=mysql_query("select goin, count(*) as dnumber ,sum(time_to_sec(timediff(comptm,arrtm))/60) as ptime from flow where sn=any(select sn from deliver where tflag='1') group by goin order by dnumber  desc"); 

echo "<table  style='position:absolute;left:0px; top:100px;width=50%; border=1px' >";
echo "<tr><th align=left>参与部门<th align=left>参与次数<th align=left>处理均时长(分)</tr>";
for ($p=1;$p<mysql_num_rows($pnum);$p++){
$psum=mysql_fetch_array($pnum);
$psum[ptime]=round($psum[ptime]/$psum[dnumber]);
echo "<tr><td>$psum[goin]</td><td>$psum[dnumber]</td><td>$psum[ptime]</td></tr>";
}
echo "</table>";

$private=mysql_query("select coman,count(distinct  sn) as dnum,count(sn) as pnum from flow where sn=any(select sn from deliver where tflag='1') group by coman order by dnum,pnum desc");

echo "<table   style='position:absolute;right:0px; top:100px;width=50%;border=1px'>";
echo "<tr><th align=left>名称<th align=left>参与工单数<th align=left>参与次数</tr>";
for ($i=1;$i<=mysql_num_rows($private);$i++){
$pri=mysql_fetch_array($private);
echo "<tr><td>$pri[coman]</td><td>$pri[dnum]</td><td>$pri[pnum]<td></tr>";
}
echo "</table>";

?>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -