Answer the question
In order to leave comments, you need to log in
Automatic daily database change?
There is a user's daily income in the database. How can I make it automatically calculated?
Answer the question
In order to leave comments, you need to log in
A couple of options:
a) run a script by cron that will update the records;
b) store only the user's registration date. His income at any point in time is calculated from the number of days since registration.
language="JavaScript" is the wrong approach, there is not even such an attribute. it is more correct to write
type="text/javascript"
and also with onclick, hang the handler via js
function multiply(){
document.getElementsByClassName('window')[0].innerhtml = '';
var a=document.forma1.t1.value*2;
alert("Ширина окна слишком велика");
var s=(a-5)/19;
var b=a+30;
if((a+30)>580)
{
alert("Ширина окна слишком велика");
return(0);
}
s = Math.ceil(s);
document.getElementsByClassName('window')[0].style.width = s*19;
var i=0;
for(i=0;i<s;i++)
{
var newdiv = document.createElement('div');
newdiv.className = 'lamel' ;
document.getElementsByClassName('window')[0].appendChild(newdiv);
}
document.forma1.res.value=s;
}
document.addEventListener('readystatechange', function(){
var btn = document.getElementsByName('button');
btn.addEventListener('click', multiply);
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question