Home > other >  I want to do a web page data statistics, there are two pieces of code, ask the great spirit show...
I want to do a web page data statistics, there are two pieces of code, ask the great spirit show...

Time:10-04

The function calTime (begin and end)
{
Return (end. GetHours () * 60 + end. GetMinutes ()) - (the begin. GetHours () * 60 + begin. GetMinutes ());
}
Var formatFloat=function (SRC, pos) {
Return Math. Round (SRC * math.h pow (10, pos))/math.h pow (10, pos);
};

Const time=

{
'beginner disciple: 6,
'entering the river's lake: 7,
'jianghu teenager: 8,
'jianghu rookie: 10,
'jianghu little xia: 12,
'young hero: 14,
'name shock river's lake: 15
},
{
'beginner's disciple: 8,
'entering the river's lake: 9,
'jianghu teenager: 10,
'jianghu rookie: 12,
'jianghu little xia: 14,
'young hero: 16,
'name shock river's lake: 17
}
]

Const job=
{
'X' : time [0],
'S' : time [1],
'Z' : time [0],
'V' : time [1],
'D' : time [1]
};

$(function () {
Var $parent=$(' jixiaotbl ');
Var sumtime=0;
Var myl=0;
Var bmyl=0;
Var LZL=0;
Var DHSC=0;
Var hysc=0;

Var $TRS=$parent. Find (' tbody.) find (' tr);
Var $TFTRS=$parent. Find (' tfoot). Find (' tr);

Var reg=/\ d +/;
Var sumtime_str=$($TFTRS. Find (' td) [1]). The text (). The trim ();
Sumtime=reg. The exec (sumtime_str) [0];
Myl=$($TFTRS. Find (" td ") [2]). The text ();
Bmyl=$($TFTRS. Find (' td) [3]). The text ();
LZL=$($TFTRS. Find (' td) [4]). The text ();
DHSC=$($TFTRS. Find (' td) [8]). The text ();
Hysc=$($TFTRS. Find (' td) [9]). The text ();

Var job_name=$($(' info '), find (' ul '). The find (' li ') [1]). The text (). The substring (7, 8);
Var job_level=$($(' info '), find (' ul '). The find (' li ') [2]). The text (). The substring (5, 9);
Var salary=job [job_name] [job_level];
Var sum_salary=formatFloat (1.0/60 salary * * sumtime, 2);
Var shuihou_salary=sum_salary & gt; 800? (sum_salary - 800) * 0.8 + 800: sum_salary * 1.0;
Shuihou_salary=formatFloat (shuihou_salary, 2);
Var sumtime_h=formatFloat (sumtime * 1.0/60, 2);
Var $h4=$parent. Find (' h4);
$h4. After (' & lt; Font color="red" & gt; When the current general '+ sumtime + minutes (' + sumtime_h + hours), total wages' + sum_salary +' yuan, after-tax wages' + shuihou_salary + 'yuan & lt;/font> ');/* '+ myl +' satisfaction, 'disapproval rating +
Bmyl + ', flow rate + LZL + ', the dialogue time + DHSC + + hysc 'seconds, the response time' + 's & lt;/font> '); */
});

Save a great god, and can explain it in detail, and my small white,, thank you very much
  • Related