File: /home/web.paitoan.com/.trash/data/toto_converter.php
<?php
add_shortcode( 'toto_converter', 'toto_converter' );
function toto_converter(){
?>
<p align="justify">Masukan Bola toto kedalam form dibawah ini, tidak harus urut karena sudah otomatis.</p>
<style>
.tbl-biru td,.tbl-biru td {border: 0px solid #AAA;}
</style>
<script type="text/javascript">
function hapus(){
var fom = document.fom;
result.style.display="none";
eval("fom.s1").value="";
eval("fom.s2").value="";
eval("fom.s3").value="";
eval("fom.s4").value="";
eval("fom.s5").value="";
eval("fom.s6").value="";
eval("fom.s7").value="";
eval("fom.s1").focus();
}
function convert(){
var fom = document.fom;
var s1 = eval("fom.s1");
var s2 = eval("fom.s2");
var s3 = eval("fom.s3");
var s4 = eval("fom.s4");
var s5 = eval("fom.s5");
var s6 = eval("fom.s6");
var s7 = eval("fom.s7");
if ((!s1.value) || (!s2.value) || (!s3.value) || (!s4.value) || (!s5.value) || (!s6.value) || (!s7.value)){
alert("Harus diisi dengan angka, tidak boleh kosong");
s1.focus();
return;
}
result.style.display="block";
var myarray=[s1.value, s2.value, s3.value, s4.value, s5.value, s6.value]
myarray.sort(function(a,b){return a - b});
no7 = s7.value;
no1 = myarray[0];
no2 = myarray[1];
no3 = myarray[2];
no4 = myarray[3];
no5 = myarray[4];
no6 = myarray[5];
var c = parseInt(myarray[0])+parseInt(myarray[1])+parseInt(myarray[2])+parseInt(myarray[3])+parseInt(myarray[4])+parseInt(myarray[5]);
c = parseInt(c) * 2;
c = parseInt(c) - parseInt(myarray[0]) - parseInt(myarray[5]);
c = parseInt(c) + Number(s7.value);
c = ""+c;
if (c.length > 2){
c = c.substr(1,2);
}
var d = c.substr(1);
c = c.substr(0,1);
var b = parseInt(myarray[3]) + parseInt(myarray[4]);
b = ""+b;
if (b.length > 2){
b = b.substr(2,1);
}else {
b = b.substr(1);
}
var a = parseInt(myarray[1]) + parseInt(myarray[2]);
a = ""+a;
if (a.length >= 2){
a = a.substr(1);
}
document.getElementById("result").innerHTML = a+""+b+""+c+""+d;
}
_dom = 0;
_dom=document.all?3:(document.getElementById?1:(document.layers?2:0));
</script>
<form name="fom">
<table class="table tbl-biru">
<thead>
<tr>
<th colspan="7" class="p-1 bg-danger text-white text-center">Winning Numbers</th>
<th class="p-1 bg-danger text-white text-center">Add</th>
</tr>
</thead>
<tbody>
<tr>
<td class="p-1 text-center"><input type="text" id="s1" class="form-control text-center bold" width="10%" maxlength="2" oninput="this.value = this.value.replace(/[^0-9.]/g, '').replace(/(\..*)\./g, '$1');"/></td>
<td class="p-1 text-center"><input type="text" id="s2" class="form-control text-center bold" width="10%" maxlength="2" oninput="this.value = this.value.replace(/[^0-9.]/g, '').replace(/(\..*)\./g, '$1');"/></td>
<td class="p-1 text-center"><input type="text" id="s3" class="form-control text-center bold" width="10%" maxlength="2" oninput="this.value = this.value.replace(/[^0-9.]/g, '').replace(/(\..*)\./g, '$1');"/></td>
<td class="p-1 text-center"><input type="text" id="s4" class="form-control text-center bold" width="10%" maxlength="2" oninput="this.value = this.value.replace(/[^0-9.]/g, '').replace(/(\..*)\./g, '$1');"/></td>
<td class="p-1 text-center"><input type="text" id="s5" class="form-control text-center bold" width="10%" maxlength="2" oninput="this.value = this.value.replace(/[^0-9.]/g, '').replace(/(\..*)\./g, '$1');"/></td>
<td class="p-1 text-center"><input type="text" id="s6" class="form-control text-center bold" width="10%" maxlength="2" oninput="this.value = this.value.replace(/[^0-9.]/g, '').replace(/(\..*)\./g, '$1');"/></td>
<td class="p-1 text-center">+</td>
<td class="p-1 text-center"><input type="text" id="s7" class="form-control text-center bold" width="10%" maxlength="2" oninput="this.value = this.value.replace(/[^0-9.]/g, '').replace(/(\..*)\./g, '$1');"/></td>
</tr>
<tr>
<td colspan="8" class="p-1 text-center">
<button type="button" class="btn btn-success btn-sm" onclick="convert();">Convert</button> <button type="button" class="btn btn-danger btn-sm" onclick="hapus();">Hapus</button>
</td>
</tr>
</tbody>
<thead>
<tr>
<th colspan="8" class="p-1 bg-danger text-white text-center">4D Result</th>
</tr>
</thead>
<tbody>
<tr>
<td colspan="8" class="p-1 text-center"><h1 id="result" class="bold"></h1></td>
</tr>
</tbody>
</table>
</form>
<?php } ?>