Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function MM_displayStatusMsg(msgStr) { //v1.0
- status=msgStr;
- document.MM_returnValue = true;
- }
- function findObj(n, d) {
- var p,i,x;
- if(!d) d=document;
- if((p=n.indexOf("?"))>0 && parent.frames.length) {
- d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);
- }
- if(!(x=d[n]) && d.all) x=d.all[n];
- for (i=0;!x && i < d.forms.length;i++) x=d.forms[i][n];
- for(i=0;!x&&d.layers&&i<d.layers.length;i++)
- x=MM_findObj(n,d.layers[i].document);
- if(!x && document.getElementById) x=document.getElementById(n);
- //alert(n);
- return x;
- //document.frm.
- }
- function stateChanged(){
- var c = document.frm.counter.value;
- var txt;
- c=parseInt(c)+1;
- document.frm.counter.value=c;
- txt=""
- //alert("tes");
- for (i=5;i<=c;i++)
- {
- nameObject = findObj('frm_'+i)
- //findObj ('f'+i);
- //if (nameObject)
- //alert(i);
- nameObject.style.display="";
- }
- //document.frm.add_button.disabled=true;
- //document.frm.add_button.disabled=false;
- }
- function MM_openBrWindow(theURL,winName,features) { //v2.0
- window.open(theURL,winName,features);
- }
- function openWin(src1, src2)
- {
- url='cariObat.php?source1='+src1.name+'&source2='+src2.name+'&cari='+src1.value+'&t='+1341763073 window.open(url, '_obat', 'HEIGHT=250,resizable=yes,WIDTH=400');
- }
- function jumlah(){
- num=0;
- if(eval(document.post1.harga1.value)&& !isNaN(document.post1.harga1.value) )num=num+ (eval(document.post1.jml1.value) *eval(document.post1.harga1.value));
- if(eval(document.post1.harga2.value)&& !isNaN(document.post1.harga2.value) )num=num+ (eval(document.post1.jml2.value) *eval(document.post1.harga2.value));
- if(eval(document.post1.harga3.value)&& !isNaN(document.post1.harga3.value) )num=num+ (eval(document.post1.jml3.value) *eval(document.post1.harga3.value));
- if(eval(document.post1.harga4.value)&& !isNaN(document.post1.harga4.value) )num=num+ (eval(document.post1.jml4.value) *eval(document.post1.harga4.value));
- if(eval(document.post1.harga5.value)&& !isNaN(document.post1.harga5.value) )num=num+ (eval(document.post1.jml5.value) *eval(document.post1.harga5.value));
- if(eval(document.post1.harga6.value)&& !isNaN(document.post1.harga6.value) )num=num+ (eval(document.post1.jml6.value) *eval(document.post1.harga6.value));
- if(eval(document.post1.harga7.value)&& !isNaN(document.post1.harga7.value) )num=num+ (eval(document.post1.jml7.value) *eval(document.post1.harga7.value));
- if(eval(document.post1.harga8.value)&& !isNaN(document.post1.harga8.value) )num=num+ (eval(document.post1.jml8.value) *eval(document.post1.harga8.value));
- if(eval(document.post1.harga9.value)&& !isNaN(document.post1.harga9.value) )num=num+ (eval(document.post1.jml9.value) *eval(document.post1.harga9.value));
- if(eval(document.post1.harga10.value)&& !isNaN(document.post1.harga10.value) )num=num+ (eval(document.post1.jml10.value) *eval(document.post1.harga10.value));
- if(eval(document.post1.harga11.value)&& !isNaN(document.post1.harga11.value) )num=num+ (eval(document.post1.jml11.value) *eval(document.post1.harga11.value));
- if(eval(document.post1.harga12.value)&& !isNaN(document.post1.harga12.value) )num=num+ (eval(document.post1.jml12.value) *eval(document.post1.harga12.value));
- if(eval(document.post1.harga13.value)&& !isNaN(document.post1.harga13.value) )num=num+ (eval(document.post1.jml13.value) *eval(document.post1.harga13.value));
- if(eval(document.post1.harga14.value)&& !isNaN(document.post1.harga14.value) )num=num+ (eval(document.post1.jml14.value) *eval(document.post1.harga14.value));
- if(eval(document.post1.harga15.value)&& !isNaN(document.post1.harga15.value) )num=num+ (eval(document.post1.jml15.value) *eval(document.post1.harga15.value));
- if(eval(document.post1.harga16.value)&& !isNaN(document.post1.harga16.value) )num=num+ (eval(document.post1.jml16.value) *eval(document.post1.harga16.value));
- if(eval(document.post1.harga17.value)&& !isNaN(document.post1.harga17.value) )num=num+ (eval(document.post1.jml17.value) *eval(document.post1.harga17.value));
- if(eval(document.post1.harga18.value)&& !isNaN(document.post1.harga18.value) )num=num+ (eval(document.post1.jml18.value) *eval(document.post1.harga18.value));
- if(eval(document.post1.harga19.value)&& !isNaN(document.post1.harga19.value) )num=num+ (eval(document.post1.jml19.value) *eval(document.post1.harga19.value));
- if(eval(document.post1.harga20.value)&& !isNaN(document.post1.harga20.value) )num=num+ (eval(document.post1.jml20.value) *eval(document.post1.harga20.value));
- document.post1.helpbox.value = 'total : Rp.' + num;
- url='harga.php?tot='+num
- window.open(url, 'harga', 'HEIGHT=250,resizable=yes,WIDTH=400');
- }
- function makeRequest(url) {
- http_request = false ;
- var browser = navigator.appName;
- if(browser == "Microsoft Internet Explorer"){
- http_request = new ActiveXObject("Microsoft.XMLHTTP");
- } else {
- http_request = new XMLHttpRequest();
- }
- if (!http_request) {
- alert ('Tidak bisa membuat XMLHTTP');
- return false ;
- }
- http_request.onreadystatechange = alertContents;
- http_request.open('GET', url, true);
- //alert (url);
- http_request.send(null);
- }
- function alertContents() {
- if (http_request.readyState==4) {
- if (http_request.status==200) {
- var elemen=elem('listbox');
- elemen.innerHTML=http_request.responseText;
- } else {
- alert('Gagal Request!');
- }
- }
- }
- function getposOffset(obj, offsettype){
- var totaloffset=(offsettype=="left")? obj.offsetLeft : obj.offsetTop;
- var parentEl=obj.offsetParent;
- while (parentEl!=null){
- totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
- parentEl=parentEl.offsetParent;
- }
- return totaloffset;
- }
- function init() {
- var elemen = document.createElement("div");
- elemen.setAttribute("id","listbox");
- document.body.appendChild(elemen);
- elemen.style.zIndex=100;
- elemen.style.position="absolute";
- elemen.style.background="silver";
- elemen.style.border="1px solid black";
- }
- function elem(id) {
- return document.getElementById(id);
- }
- function cari(txt,id,idvalue) {
- var elemen=elem('listbox');
- elemen.style.left=getposOffset(elem(id),"left");
- elemen.style.top=getposOffset(elem(id),"top")+21;
- elemen.style.display="";
- makeRequest("listObat.php?t=1341763073&text="+txt+"&id="+id+";"+idvalue);
- }
- function cariSigna(txt,id,idvalue) {
- var elemen=elem('listbox');
- elemen.style.left=getposOffset(elem(id),"left");
- elemen.style.top=getposOffset(elem(id),"top")+21;
- elemen.style.display="";
- makeRequest("listSigna.php?text="+txt+"&id="+id+";"+idvalue);
- }
- function isi(txt,id,idvalue) {
- elem(id).value=txt;
- var elemen=elem('listbox');
- elemen.style.display="none";
- }
- if (window.addEventListener)
- window.addEventListener("load", init, false)
- else if (window.attachEvent)
- window.attachEvent("onload", init)
- else if (document.getElementById)
- window.onload=init;
- function MM_openBrWindow(theURL,winName,features) { //v2.0
- window.open(theURL,winName,features);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement