Rabu, 30 September 2020

Javascript event listener on all class

  const divs = document.querySelectorAll('.hitung');

or

 const divs = document.querySelector('button[type="submit"]');

divs.forEach(el => el.addEventListener('keyup', event => {

var fm=el.form;

fm['a[harga1]'].value=fm["a[bruto]"].value - (fm["a[diskon1]"].value * fm["a[bruto]"].value / 100);

fm['a[harga2]'].value=fm["a[harga1]"].value - (fm["a[diskon2]"].value * fm["a[harga1]"].value / 100);

fm['a[harga3]'].value=fm["a[harga2]"].value - (fm["a[diskon3]"].value * fm["a[harga2]"].value / 100);

fm['a[harga]'].value=fm['a[harga3]'].value;


event.preventDefault();

  //console.log(event.target.classList[1]);

}));


Minggu, 27 September 2020

Ajax JSON to fill form

form to display data

 code to load data

code to display

Minggu, 13 September 2020

Senin, 07 September 2020

Let's encrypt Wilcard ssl on Centos 7

yum install epel-release
yum install yum-utils
yum install python2-certbot-apache
yum install python2-certbot-nginx


certbot certonly --manual -d *.easyware.id -d easyware.id --agree-tos --manual-public-ip-logging-ok --preferred-challenges dns-01 --server https://acme-v02.api.letsencrypt.org/directory

certbot certonly --manual -d *.pastioke.com --agree-tos --manual-public-ip-logging-ok --preferred-challenges dns-01 --server https://acme-v02.api.letsencrypt.org/directory --register-unsafely-without-email


key
/etc/letsencrypt/live/easyware.id/privkey.pem


cert atas //  CA bundle bawah
/etc/letsencrypt/live/easyware.id/fullchain.pem