김유현

Modify 월간 graph -> 일간 graph

......@@ -9,7 +9,11 @@
<br>
<div id = "salary" class="in"></div>
<br>
<div id = "payPerDay" class="in"></div>
<br>
<div id = "moneyPerSec" class="in"></div>
</div>
<div class="progress-bar"></div>
<h1 class="count"></h1>
......@@ -31,14 +35,21 @@
var workTime = Number(getParam("workTime"));
var offWork = Number(getParam("offWork"));
var workingDayNum = getParam("workDay").length / 9;
var payPerDay = salary/(4*workingDayNum);
document.getElementById("salary").innerHTML = "salary : " + salary;
document.getElementById("payPerDay").innerHTML = "charge per day : " + payPerDay;
//document.getElementById("workDay").innerHTML = "working day : " + getParam("workDay");
//document.getElementById("workTime").innerHTML = "working time : " + workTime;
//document.getElementById("offWork").innerHTML = "time of work : " + offWork;
//document.getElementById("workedHour").innerHTML = "worked hour : " + String(offWork - workTime);
var nowTime = new Date();
var workStart = new Date(nowTime.getFullYear(), nowTime.getMonth(), nowTime.getDate(), workTime,00, 00);
var moneyPerSec = 0;
var diff = (nowTime.getTime() - workStart.getTime())/1000;
//document.getElementById("diff").innerHTML = diff;
var moneyPerSec = diff*salary/(60*60*(offWork - workTime)*workingDayNum*4);
setInterval("dpTime()",1);
function dpTime(){
var now = new Date();
......@@ -46,12 +57,12 @@
minutes = now.getMinutes();
seconds = now.getSeconds();
if (hours > 12)
{ hours -= 12;
ampm = "오후 ";
}else
{ ampm = "오전 ";
}
//if (hours > 12)
//{ hours -= 12;
// ampm = "오후 ";
//}else
//{ ampm = "오전 ";
//}
if (hours < 10){
hours = "0" + hours;
} if (minutes < 10){
......@@ -59,7 +70,7 @@
} if (seconds < 10){
seconds = "0" + seconds;
}
document.getElementById("dpTime").innerHTML = "현재 시간 : "+ ampm + hours + ":" + minutes + ":" + seconds;
document.getElementById("dpTime").innerHTML = "현재 시간 : "+ hours + ":" + minutes + ":" + seconds;
if (hours < workTime){
document.getElementById("moneyPerSec").innerHTML = "출근할 때까지 " + String(workTime - hours) + "시간 남았당";
}
......@@ -91,9 +102,10 @@
}
else{
bar.style.width = i + '%';
i = (moneyPerSec / payPerDay) * 100;
bar.style.width = i.toFixed(4) + '%';
counter.innerHTML = i.toFixed(4) + '%';
i = moneyPerSec / salary * 100
}
//if(r < throttle) { // Simulate d/l speed and uneven bitrate
// i = i + r;
......