Import in repository
This commit is contained in:
parent
b3fa7a3d27
commit
e18a050c70
102 changed files with 37581 additions and 0 deletions
60
html/compute.js
Normal file
60
html/compute.js
Normal file
|
|
@ -0,0 +1,60 @@
|
|||
/*
|
||||
* This file is part of WCOMPTA.
|
||||
*
|
||||
* WCOMPTA is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* WCOMPTA is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with WCOMPTA; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
function CheckTotal() {
|
||||
var ie4=false;
|
||||
if ( document.all ) {
|
||||
ie4=true;
|
||||
}// Ajouter getElementById par document.all[str]
|
||||
var deb=0;
|
||||
for (var i=0;1;i++) {
|
||||
a=document.getElementById("mont_deb"+i);
|
||||
if ( a == null ) {
|
||||
document.forms[0].sum_deb.value=deb;
|
||||
break;
|
||||
} else {
|
||||
if ( isNaN(a.value) == true) {
|
||||
a.value=0;
|
||||
alert ("Not a Number !!! ");
|
||||
}
|
||||
deb+=eval(a.value);
|
||||
}
|
||||
}
|
||||
var cred=0;
|
||||
for (var i=0;1;i++) {
|
||||
a=document.getElementById("mont_cred"+i);
|
||||
if ( a == null ) {
|
||||
document.forms[0].sum_cred.value=cred;
|
||||
break;
|
||||
} else {
|
||||
if ( isNaN(a.value) == true) {
|
||||
a.value=0;
|
||||
alert ("Not a Number !!! ");
|
||||
}
|
||||
cred+=eval(a.value);
|
||||
}
|
||||
}
|
||||
if ( deb != cred ) {
|
||||
document.getElementById("diff").style.color="red";
|
||||
document.getElementById("diff").style.fontWeight="bold";
|
||||
document.getElementById("diff").innerHTML="Différence";
|
||||
|
||||
} else {
|
||||
document.getElementById("diff").innerHTML="";
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue