Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var httpObject = null;
- var wrong_entrytmrs = null;
- var i=0;
- //var rsuchange = new Array(63);
- var ntpval = null;
- var pmval = null;
- var haval = null;
- var licval = null;
- var networkchange = null;
- var ntpdchange = null;
- var licchange = null;
- var pmchange = null;
- var rsucha = null;
- var setradiopg = null;
- var detradioval = null;
- var defvalues = new Array();
- function navlink(elem) {
- // get all 'a' elements
- var a = document.getElementsByClassName('nav_link');
- for (i = 0; i < a.length; i++) {
- // Remove the class 'active' if it exists
- a[i].classList.remove('active')
- }
- elem.classList.add('active');
- }
- function get_dt()
- {
- //alert("goin for data");
- doWork(true,"get_dt_time","config");
- document.getElementById("close").style.display = "inline";
- document.getElementById("dt").style.opacity = 1.0;
- document.getElementById("dt").style.filter= "alpha(opacity=100)";
- document.getElementById("licence").style.opacity = 0.6;
- document.getElementById("licence").style.filter= "alpha(opacity=60)";
- }
- function networkonly()
- {
- var a = document.getElementById("net_0").value;
- var b = document.getElementById("net_1").value;
- var c = document.getElementById("net_2").value;
- if((a==b)||(a==c)||(b==c))
- {
- alert("server addresses cannot be same");
- }
- else
- {
- for(i=0;i<10;i++)
- {
- var s = document.getElementById("net_"+i);
- if(s.name == "no")
- {
- s.style.border = "1px solid #FF0000";
- document.getElementById("cross"+"net_"+i).style.display="inline";
- break;
- }
- else
- {
- var ntp = null;
- for(i=0;i<9;i++)
- {
- if(document.getElementById("net_"+i).value == "")
- break;
- else if(i==8)
- {
- for(jdx=0;jdx<10;jdx++)
- {
- var x = document.getElementById("net_"+jdx);
- if(ntp == null)
- ntp = x.value;
- else
- ntp += ":"+x.value;
- }
- }
- }
- doWork(ntp,"set_confirm","config");
- }
- }
- }
- }
- function maskvalid(mask)
- {
- //m[0] can be 128, 192, 224, 240, 248, 252, 254, 255
- //m[1] can be 128, 192, 224, 240, 248, 252, 254, 255 if m[0] is 255, else m[1] must be 0
- //m[2] can be 128, 192, 224, 240, 248, 252, 254, 255 if m[1] is 255, else m[2] must be 0
- //m[3] can be 128, 192, 224, 240, 248, 252, 254, 255 if m[2] is 255, else m[3] must be 0
- var flag = 'True';
- var correct_range = {128:1,192:1,224:1,240:1,248:1,252:1,254:1,255:1,0:1};
- var m = mask.split('.');
- for (var i = 0; i <= 3; i ++)
- {
- if (!(m[i] in correct_range)) {
- flag = 'False';
- break;
- }
- }
- if ((m[0] == 0) || (m[0] != 255 && m[1] != 0) || (m[1] != 255 && m[2] != 0) || (m[2] != 255 && m[3] != 0)) {
- flag = 'False';
- }
- return flag;
- }
- function get_enblock()
- {
- //var data = document.getElementById("grpno").value;
- doWork(true,"get_enblock","enblock");
- }
- function rfr_tone()
- {
- var data = document.getElementById("grpno").value;
- doWork(data,"get_tonetab","tone");
- }
- function rfr_proto()
- {
- //alert("rfr_proto");
- var data = document.getElementById("prino").value;
- if(data == "Select")
- {
- alert("Please select pri number");
- return;
- }
- if(document.getElementById("proto_type").value == "P")
- {
- col_me(0);
- doWork(data,"get_protoprop","protocol");
- }
- else if(document.getElementById("proto_type").value == "T")
- {
- col_me(1);
- doWork(data,"get_prototim","protocol");
- }
- }
- function rfr_protim()
- {
- var data = document.getElementById("prino").value;
- if(data == "Select")
- {
- alert("Please select pri number");
- return;
- }
- if(document.getElementById("proto_type").value == "P")
- {
- col_me(0);
- doWork(data,"get_protoprop","protocol");
- }
- else if(document.getElementById("proto_type").value == "T")
- {
- col_me(1);
- doWork(data,"get_prototim","protocol");
- }
- }
- function get_prototab()
- {
- document.getElementById("notify").style.display = "none";
- doWork(true,"get_prototab","protocol");
- }
- function get_tonesel()
- {
- document.getElementById("notify").style.display = "none";
- doWork(true,"get_tonesel","tone");
- }
- function get_ccmd()
- {
- document.getElementById("notify").style.display = "none";
- doWork(true,"get_ccmd","ccmd");
- }
- function get_dcmd()
- {
- document.getElementById("notify").style.display = "none";
- doWork(true,"get_dcmd","dcmd");
- }
- function get_wait()
- {
- document.getElementById("notify").style.display = "none";
- doWork(true,"get_wait","wtab");
- }
- function get_bill()
- {
- document.getElementById("notify").style.display = "none";
- doWork(true,"get_bill","bill");
- }
- function get_gain()
- {
- document.getElementById("notify").style.display = "none";
- doWork(true,"get_gain","gain");
- }
- function get_ulsta()
- {
- doWork(true,"get_ulsta","ulsta");
- }
- function get_ulstd()
- {
- //alert("yes");
- doWork(true,"get_ulstd","ulstd");
- }
- function get_search(obj)
- {
- document.getElementById("notify").style.display = "none";
- doWork(obj,"get_search","search");
- }
- function showcdr(obj)
- {
- //alert(obj);
- doWork(obj,"ngxcdr","autoComm");
- }
- function mail()
- {
- var mailarray = [document.getElementById("2"),document.getElementById("5"),document.getElementById("6")];
- var s = document.getElementById("ext_43").value;
- for(i=0;i<3;i++)
- {
- if(mailarray[i].id == s)
- mailarray[i].style.display = "inline";
- else
- mailarray[i].style.display = "none";
- }
- }
- function go_search1()
- {
- //alert("Go going well");
- if(document.getElementById("number").value)
- {
- var num_clue = document.getElementById("number").value;
- doWork(escape(num_clue),"get_nums","feat");
- }
- else
- info_notify("No Value Entered!");
- }
- function go_search(obj)
- {
- //alert(obj);
- //alert(document.getElementById("number").value);
- //document.getElementById("link").style.display = "None";
- if(document.getElementById("number").value)
- {
- var num_clue = document.getElementById("number").value;
- var val = num_clue+"|"+obj;
- doWork(val,"get_nums","search");
- }
- else
- info_notify("No Value Entered!");
- }
- function go_val()
- {
- var all_timers = null;
- for(jdx = 0; jdx < 80; jdx++)
- {
- var ele = document.getElementById("time_"+jdx);
- if(ele.name == "timer_changed" && ele.title != ele.value)
- {
- if(all_timers == null)
- all_timers = (jdx+"|"+ele.value);
- else
- all_timers = all_timers+":"+(jdx+"|"+ele.value);
- }
- }
- //alert(all_timers);
- doWork(all_timers,"set_timer","syst");
- }
- function update_acd()
- {
- //alert("update_acd");
- var all_values = null;
- var acdno = document.getElementById("acdno").value;
- var rsidno = 0; //document.getElementById("rsid").value;
- for(jdx = 1; jdx < 24; jdx++)
- {
- var ele = document.getElementById("acd_"+jdx);
- //alert("NAME="+ele.name);
- var name = (ele.name).split(",");
- if(name[1] == "changed")
- {
- switch(name[0])
- {
- case "chk":
- {
- //alert(ele.value+"__"+ele.type+"__"+jdx);
- if(all_values == null)
- all_values = (ele.checked+"_"+ele.type+"_"+jdx);
- else
- all_values = all_values+":"+(ele.checked+"_"+ele.type+"_"+jdx);
- //alert(all_values);
- break;
- }
- case "txt":
- {
- if(all_values == null)
- all_values = (ele.value+"_"+ele.type+"_"+jdx);
- else
- all_values = all_values+":"+(ele.value+"_"+ele.type+"_"+jdx);
- //alert(all_values);
- break;
- }
- case "slct":
- {
- if(all_values == null)
- all_values = (ele.value+"_"+ele.type+"_"+jdx);
- else
- all_values = all_values+":"+(ele.value+"_"+ele.type+"_"+jdx);
- //alert(all_values);
- break;
- }
- }
- }
- //alert("JDX="+jdx+"__"+all_values);
- }
- if(all_values != null)
- {
- all_values += ","+acdno;
- all_values = escape(all_values);
- doWork(all_values,"set_acd","acd");
- }
- else
- alert("No Change Encountered!");
- }
- function update_res()
- {
- //alert("update_res");
- var all_values = null;
- var acdno = document.getElementById("acdno").value;
- var rsidno = 0; //document.getElementById("rsid").value;
- for(jdx = 1; jdx <10; jdx++)
- {
- var ele = document.getElementById("acd_"+jdx);
- //alert("NAME="+ele.name);
- var name = (ele.name).split(",");
- if(name[1] == "changed")
- {
- switch(name[0])
- {
- case "txt":
- {
- //alert(all_values);
- if(name[1] == "changed")
- {
- if(all_values == null)
- all_values = (ele.value + "_" + ele.type + "_" + jdx);
- else
- all_values = all_values + ":" + (ele.value + "_" + ele.type + "_" + jdx);
- //alert(all_values);
- break;
- }
- else
- break;
- }
- }
- }
- else if(name[1] == "invalidValue")
- {
- alert("Enter correct Values");
- return;
- }
- //alert("JDX="+jdx+"__"+all_values);
- }
- if(all_values != null)
- {
- all_values += "|"+acdno+"|"+rsidno;
- //alert(all_values);
- //all_values = escape(all_values);
- //alert(all_values);
- doWork(all_values,"set_res","acd");
- }
- else
- alert("No Change Encountered!");
- }
- function update_acc()
- {
- //alert("update_acd");
- var all_values = null;
- var bgrpno = document.getElementById("bgrpno").value;
- for(jdx = 1; jdx <10; jdx++)
- {
- var ele = document.getElementById("acc_"+jdx);
- //alert("NAME="+ele.name);
- var name = (ele.name).split(",");
- if(name[1] == "changed")
- {
- switch(name[0])
- {
- case "txt":
- {
- if(all_values == null)
- all_values = (ele.value+"_"+ele.type+"_"+jdx);
- else
- all_values = all_values+":"+(ele.value+"_"+ele.type+"_"+jdx);
- //alert(all_values);
- break;
- }
- }
- }
- //alert("JDX="+jdx+"__"+all_values);
- }
- if(all_values != null)
- {
- all_values += ","+bgrpno;
- all_values = escape(all_values);
- //alert(all_values);
- doWork(all_values,"set_bgrp","bgrp");
- }
- else
- alert("No Change Encountered!");
- }
- function updattrk()
- {
- var data = null;
- data = document.getElementById("number").value;
- var id = document.getElementById("sip_hint").value;
- var all_values = null;
- var err_flag = 0;
- var all_values = null;
- //alert(data);
- for(jdx = 1; jdx < 33; jdx++)
- {
- var ele = document.getElementById("trk_"+jdx);
- //alert("NAME="+ele.name);
- var name = (ele.name).split(",");
- if(name[1] == "changed")
- {
- switch(name[0])
- {
- case "chk":
- {
- //alert(ele.value+"__"+ele.type+"__"+jdx);
- if(all_values == null)
- all_values = (ele.checked+"_"+ele.type+"_"+jdx);
- else
- all_values += ":"+(ele.checked+"_"+ele.type+"_"+jdx);
- //alert(all_values);
- break;
- }
- case "txt":
- {
- //alert(all_values);
- //if(name[1] == "changed")
- //{
- if(all_values == null)
- all_values = (ele.value+"_"+ele.type+"_"+jdx);
- else
- all_values += ":"+(ele.value+"_"+ele.type+"_"+jdx);
- //alert(all_values);
- //break;
- //}
- //else
- break;
- }
- case "slctd":
- {
- //alert(all_values);
- if(all_values == null)
- all_values = (ele.value+"_"+ele.type+"_"+jdx);
- else
- all_values += ":"+(ele.value+"_"+ele.type+"_"+jdx);
- //alert(all_values);
- break;
- }
- case "slctdid":
- {
- //alert(all_values);
- if(all_values == null)
- all_values = (ele.options[ele.selectedIndex].text+"_"+ele.type+"_"+jdx);
- else
- all_values += ":"+(ele.options[ele.selectedIndex].text+"_"+ele.type+"_"+jdx);
- //alert(all_values);
- break;
- }
- case "slcttnt":
- {
- //alert(all_values);
- if(all_values == null)
- all_values = (ele.options[ele.selectedIndex].text+"_"+ele.type+"_"+jdx);
- else
- all_values += ":"+(ele.options[ele.selectedIndex].text+"_"+ele.type+"_"+jdx);
- //alert(all_values);
- break;
- }
- case "slctpcos":
- {
- //alert(all_values);
- if(all_values == null)
- all_values = (ele.options[ele.selectedIndex].text+"_"+ele.type+"_"+jdx);
- else
- all_values += ":"+(ele.options[ele.selectedIndex].text+"_"+ele.type+"_"+jdx);
- //alert(all_values);
- break;
- }
- case "slctscos":
- {
- //alert(all_values);
- if(all_values == null)
- all_values = (ele.options[ele.selectedIndex].text+"_"+ele.type+"_"+jdx);
- else
- all_values += ":"+(ele.options[ele.selectedIndex].text+"_"+ele.type+"_"+jdx);
- //alert(all_values);
- break;
- }
- case "txtcos":
- {
- //alert(all_values);
- //if(name[1] == "changed")
- //{
- if(all_values == null)
- all_values = (ele.value+"_"+ele.type+"_"+jdx);
- else
- all_values += ":"+(ele.value+"_"+ele.type+"_"+jdx);
- //alert(all_values);
- //break;
- //}
- //else
- break;
- }
- case "slctdtmf":
- {
- //alert(all_values);
- if(all_values == null)
- all_values = (ele.value+"_"+ele.type+"_"+jdx);
- else
- all_values += ":"+(ele.value+"_"+ele.type+"_"+jdx);
- //alert(all_values);
- break;
- }
- case "txtctr":
- {
- //alert(all_values);
- //if(name[1] == "changed")
- //{
- if(all_values == null)
- all_values = (ele.value+"_"+ele.type+"_"+jdx);
- else
- all_values += ":"+(ele.value+"_"+ele.type+"_"+jdx);
- //alert(all_values);
- //break;
- //}
- //else
- break;
- }
- /**case "df":
- {
- //alert(ele.value+"__"+ele.type+"__"+jdx);
- if(all_values == null)
- all_values = (ele.checked+"_"+ele.type+"_"+jdx);
- else
- all_values = all_values+":"+(ele.checked+"_"+ele.type+"_"+jdx);
- //alert(all_values);
- break;
- }**/
- case "slctdlm":
- {
- //alert(all_values);
- if(all_values == null)
- all_values = (ele.value+"_"+ele.type+"_"+jdx);
- else
- all_values += ":"+(ele.value+"_"+ele.type+"_"+jdx);
- //alert(ele.value);
- break;
- }
- }
- }
- }
- if(all_values != null)
- {
- all_values += ","+data;
- all_values = all_values+"|"+id;
- //all_values = escape(all_values);
- //alert(all_values);
- doWork(all_values,"set_trk","search");
- }
- else
- alert(" No Change Encountered!");
- }
- function updatcnri()
- {
- var data = null;
- data = document.getElementById("number").value;
- var all_values = null;
- var err_flag = 0;
- var all_values = null;
- //alert(data);
- for(jdx = 1; jdx < 31; jdx++)
- {
- var ele = document.getElementById("cnri_"+jdx);
- //alert("NAME="+ele.name);
- var name = (ele.name).split(",");
- if(name[1] == "changed")
- {
- switch(name[0])
- {
- case "chk":
- {
- //alert(ele.value+"__"+ele.type+"__"+jdx);
- if(all_values == null)
- all_values = (ele.checked+"_"+ele.type+"_"+jdx);
- else
- all_values += ":"+(ele.checked+"_"+ele.type+"_"+jdx);
- //alert(all_values);
- break;
- }
- case "txt":
- case "slctd":
- {
- //alert(all_values);
- //if(name[1] == "changed")
- //{
- if(all_values == null)
- all_values = (ele.value+"_"+ele.type+"_"+jdx);
- else
- all_values += ":"+(ele.value+"_"+ele.type+"_"+jdx);
- //alert(all_values);
- //break;
- //}
- //else
- break;
- }
- }
- }
- }
- if(all_values != null)
- {
- all_values += ","+data;
- //all_values = escape(all_values);
- //alert(all_values);
- doWork(all_values,"set_cnri","search");
- }
- else
- alert(" No Change Encountered!");
- }
- function updatext()
- {
- var data = null;
- data = document.getElementById("number").value;
- var all_values = null;
- //doWork("ASDWERGF","set_ext","search");
- var err_flag = 0;
- var all_values = null;
- for(jdx = 1; jdx < 68; jdx++)
- {
- var ele = document.getElementById("ext_"+jdx);
- //alert("NAME="+ele.value+"__"+jdx);
- var name = (ele.name).split(",");
- if(name[1] == "changed")
- {
- switch(name[0])
- {
- case "chk":
- {
- //alert(ele.value+"__"+ele.type+"__"+jdx);
- if(all_values == null)
- all_values = (ele.checked+"_"+ele.type+"_"+jdx);
- else
- all_values = all_values+":"+(ele.checked+"_"+ele.type+"_"+jdx);
- //alert(all_values);
- break;
- }
- case "txt":
- {
- //alert(all_values);
- if(name[1] == "changed")
- {
- if(all_values == null)
- all_values = (ele.value+"_"+ele.type+"_"+jdx);
- else
- all_values = all_values+":"+(ele.value+"_"+ele.type+"_"+jdx);
- //alert(all_values);
- break;
- }
- else
- break;
- }
- case "ssss":
- {
- var ele1 = document.getElementById("ext_"+jdx+"_a");
- var ele2 = document.getElementById("ext_"+jdx+"_b");
- if(ele.title != ele.value || ele1.title != ele1.value || ele2.title != ele2.value)
- if(all_values == null)
- all_values = (ele.value+"'"+ele1.options[ele1.selectedIndex].text+"'"+ele2.options[ele2.selectedIndex].text+"_"+ele.type+"_"+jdx);
- else
- all_values = all_values+":"+(ele.value+"'"+ele1.options[ele1.selectedIndex].text+"'"+ele2.options[ele2.selectedIndex].text+"_"+ele.type+"_"+jdx);
- //alert(all_values);
- break;
- }
- case "cti":
- {
- var ele1 = document.getElementById("ext_"+jdx+"_a");
- //alert(ele.checked)
- if(!ele.checked)
- {
- if(all_values == null)
- all_values = (ele.checked+"'"+ele1.value+"_"+ele.type+"_"+jdx);
- else
- all_values += ":"+(ele.checked+"'"+ele1.value+"_"+ele.type+"_"+jdx);
- //alert(all_values);
- }
- else if(ele1.title != ele1.value && ele.checked)
- {
- if(ele1.value == data && !err_flag)
- {
- alert("Cannot forward calls to self!");
- err_flag = 1;
- }
- else
- {
- if(all_values == null)
- all_values = (ele.checked+"'"+ele1.value+"_"+ele.type+"_"+jdx);
- else
- all_values += ":"+(ele.checked+"'"+ele1.value+"_"+ele.type+"_"+jdx);
- }
- }
- break;
- }
- case "cte":
- {
- var ele1 = document.getElementById("ext_"+jdx+"_a");
- //alert(ele.checked)
- if(!ele.checked)
- {
- if(all_values == null)
- all_values = (ele.checked+"'"+ele1.value+"_"+ele.type+"_"+jdx);
- else
- all_values += ":"+(ele.checked+"'"+ele1.value+"_"+ele.type+"_"+jdx);
- //alert(all_values);
- }
- else if(ele1.title != ele1.value && ele.checked)
- {
- if(ele1.value == data && !err_flag)
- {
- alert("Cannot forward calls to self!");
- err_flag = 1;
- }
- else
- {
- if(all_values == null)
- all_values = (ele.checked+"'"+ele1.value+"_"+ele.type+"_"+jdx);
- else
- all_values += ":"+(ele.checked+"'"+ele1.value+"_"+ele.type+"_"+jdx);
- }
- }
- break;
- }
- case "df":
- {
- var ele1 = document.getElementById("ext_"+jdx+"_a");
- //alert(ele.checked)
- if(!ele.checked)
- {
- if(all_values == null)
- all_values = (ele.checked+"'"+ele1.value+"_"+ele.type+"_"+jdx);
- else
- all_values += ":"+(ele.checked+"'"+ele1.value+"_"+ele.type+"_"+jdx);
- //alert(all_values);
- }
- else if(ele1.title != ele1.value && ele.checked)
- {
- if(ele1.value == data && !err_flag)
- {
- alert("Cannot forward calls to self!");
- err_flag = 1;
- }
- else
- {
- if(all_values == null)
- all_values = (ele.checked+"'"+ele1.value+"_"+ele.type+"_"+jdx);
- else
- all_values += ":"+(ele.checked+"'"+ele1.value+"_"+ele.type+"_"+jdx);
- }
- }
- break;
- }
- case "slctlevel":
- {
- if(jdx == 18)
- ele1 = document.getElementById("ext_"+(jdx+1));
- else if(jdx == 19)
- ele1 = document.getElementById("ext_"+(jdx-1));
- if(name[1] == "changed" && (jdx == 18 || jdx == 19))
- {
- if(all_values == null)
- all_values = (ele.value+"'"+ele1.value+"_"+ele.type+"_"+jdx);
- else
- all_values += ":"+(ele.value+"'"+ele1.value+"_"+ele.type+"_"+jdx);
- //alert(all_values);
- }
- else if(name[1] == "changed")
- {
- if(all_values == null)
- all_values = (ele.value+"_"+ele.type+"_"+jdx);
- else
- all_values += ":"+(ele.value+"_"+ele.type+"_"+jdx);
- }
- break;
- }
- case "slctpcos":
- {
- if(name[1] == "changed")
- {
- if(all_values == null)
- all_values = (ele.value+"_"+ele.type+"_"+jdx);
- else
- all_values = all_values+":"+(ele.value+"_"+ele.type+"_"+jdx);
- break;
- }
- else
- break;
- }
- case "slctscos":
- {
- if(name[1] == "changed")
- {
- if(all_values == null)
- all_values = (ele.value+"_"+ele.type+"_"+jdx);
- else
- all_values = all_values+":"+(ele.value+"_"+ele.type+"_"+jdx);
- break;
- }
- else
- break;
- }
- case "slctdept":
- {
- //alert(name[1]);
- if(name[1] == "changed")
- {
- if(all_values == null)
- all_values = (ele.value+"_"+ele.type+"_"+jdx);
- else
- all_values = all_values+":"+(ele.value+"_"+ele.type+"_"+jdx);
- break;
- }
- else
- break;
- }
- case "slcttnt":
- {
- if(name[1] == "changed")
- {
- if(all_values == null)
- all_values = (ele.value+"_"+ele.type+"_"+jdx);
- else
- all_values = all_values+":"+(ele.value+"_"+ele.type+"_"+jdx);
- break;
- }
- else
- break;
- }
- case "hotln":
- {
- if(name[1] == "changed")
- {
- switch(ele.value)
- {
- case "None":
- {
- var ele1 = document.getElementById("ext_"+jdx+"_a");
- if(all_values == null)
- all_values = (ele.value+"'"+ele1.value+"_"+ele.type+"_"+jdx);
- else
- all_values = all_values+":"+(ele.value+"'"+ele1.value+"_"+ele.type+"_"+jdx);
- break;
- }
- case "Immediate":
- {
- var ele1 = document.getElementById("ext_"+jdx+"_a");
- //if(ele1.title != ele1.value)
- // {
- if(all_values == null)
- all_values = (ele.value+"'"+ele1.value+"_"+ele.type+"_"+jdx);
- else
- all_values = all_values+":"+(ele.value+"'"+ele1.value+"_"+ele.type+"_"+jdx);
- // break;
- // }
- //else
- break;
- }
- case "Delayed":
- {
- var ele1 = document.getElementById("ext_"+jdx+"_a");
- //if(ele1.title != ele1.value)
- //{
- if(all_values == null)
- all_values = (ele.value+"'"+ele1.value+"_"+ele.type+"_"+jdx);
- else
- all_values = all_values+":"+(ele.value+"'"+ele1.value+"_"+ele.type+"_"+jdx);
- //break;
- //}
- // else
- break;
- }
- }
- }
- break;
- }
- case "cuttype":
- {
- if(name[1] == "changed")
- {
- if(all_values == null)
- all_values = (ele.value+"_"+ele.type+"_"+jdx);
- else
- all_values = all_values+":"+(ele.value+"_"+ele.type+"_"+jdx);
- break;
- }
- else
- break;
- }
- case "cuttime":
- {
- if(name[1] == "changed")
- {
- if(all_values == null)
- all_values = (ele.value+"_"+ele.type+"_"+jdx);
- else
- all_values = all_values+":"+(ele.value+"_"+ele.type+"_"+jdx);
- break;
- }
- else
- break;
- }
- case "txtbgt":
- {
- if(all_values == null)
- all_values = (ele.value+"_"+ele.type+"_"+jdx);
- else
- all_values = all_values+":"+(ele.value+"_"+ele.type+"_"+jdx);
- break;
- }
- case "txtdbgt":
- {
- if(all_values == null)
- all_values = (ele.value+"_"+ele.type+"_"+jdx);
- else
- all_values = all_values+":"+(ele.value+"_"+ele.type+"_"+jdx);
- break;
- }
- case "alden":
- {
- if(name[1] == "changed")
- {
- if(all_values == null)
- all_values = (ele.value+"_"+ele.type+"_"+jdx);
- else
- all_values = all_values+":"+(ele.value+"_"+ele.type+"_"+jdx);
- break;
- }
- else
- break;
- }
- case "authid":
- {
- if(name[1] == "changed")
- {
- if(all_values == null)
- all_values = (ele.value+"_"+ele.type+"_"+jdx);
- else
- all_values = all_values+":"+(ele.value+"_"+ele.type+"_"+jdx);
- break;
- }
- else
- break;
- }
- case "authtp":
- {
- if(name[1] == "changed")
- {
- if(all_values == null)
- all_values = (ele.value+"_"+ele.type+"_"+jdx);
- else
- all_values = all_values+":"+(ele.value+"_"+ele.type+"_"+jdx);
- break;
- }
- else
- break;
- }
- case "mini":
- {
- if(name[1] == "changed")
- {
- switch(ele.value)
- {
- case "1":
- {
- if(all_values == null)
- all_values = (ele.value+"_"+ele.type+"_"+jdx);
- else
- all_values = all_values+":"+(ele.value+"_"+ele.type+"_"+jdx);
- break;
- }
- case "2":
- {
- var ele1 = document.getElementById("ext_"+jdx+"_a");
- var ele2 = document.getElementById("ext_"+jdx+"_b");
- if(all_values == null)
- all_values = (ele.value+"_"+ele.type+"_"+jdx+"_"+ele1.value+"_"+ele2.value);
- else
- all_values = all_values+":"+(ele.value+"_"+ele.type+"_"+jdx+"_"+ele1.value+"_"+ele2.value);
- break;
- }
- case "3":
- {
- //if(ele1.title != ele1.value)
- //{
- if(all_values == null)
- all_values = (ele.value+"_"+"_"+ele.type+"_"+jdx);
- else
- all_values = all_values+":"+(ele.value+"_"+"_"+ele.type+"_"+jdx);
- break;
- //}
- //else
- // break;
- }
- case "4":
- {
- //if(ele1.title != ele1.value)
- //{
- if(all_values == null)
- all_values = (ele.value+"_"+ele.type+"_"+jdx);
- else
- all_values = all_values+":"+(ele.value+"_"+ele1.value+"_"+ele.type+"_"+jdx);
- break;
- //}
- //else
- // break;
- }
- case "5":
- {
- var ele1 = document.getElementById("ext_"+jdx+"_c");
- var ele2 = document.getElementById("ext_"+jdx+"_d");
- //if(ele1.title != ele1.value)
- //{
- if(all_values == null)
- all_values = (ele.value+"_"+ele.type+"_"+jdx+"_"+ele1.value+"_"+ele2.value);
- else
- all_values = all_values+":"+(ele.value+"_"+ele.type+"_"+jdx+"_"+ele1.value+"_"+ele2.value);
- break;
- //}
- //else
- // break;
- }
- case "6":
- {
- var ele1 = document.getElementById("ext_"+jdx+"_e");
- //if(ele1.title != ele1.value)
- //{
- if(all_values == null)
- all_values = (ele.value+"_"+ele.type+"_"+jdx+"_"+ele1.value);
- else
- all_values = all_values+":"+(ele.value+"_"+ele.type+"_"+ele1.value);
- break;
- //}
- //else
- // break;
- }
- case "0":
- {
- //if(ele1.title != ele1.value)
- //{
- if(all_values == null)
- all_values = (ele.value+"_"+ele.type+"_"+jdx);
- else
- all_values = all_values+":"+(ele.value+"_"+ele.type+"_"+jdx);
- break;
- //}
- //else
- //break;
- }
- }
- }
- else
- break;
- }
- }
- }
- }
- if(all_values != null)
- {
- all_values += ","+data;
- //all_values = escape(all_values);
- //alert(all_values);
- doWork(all_values,"set_ext","search");
- }
- else
- alert("No Change Encountered!");
- }
- function key_val_change(obj)
- {
- var tmp = (obj.name).split(",");
- if(obj.value != obj.title)
- document.getElementById(obj.id).name = tmp[0]+",change";
- else if(obj.value == obj.title)
- document.getElementById(obj.id).name = tmp[0]+",nochange";
- }
- function key_oper(object,ptr,old_key,temp2,temp3)
- {
- var ACD_SEL = '<select onchange="key_val_change(this)" name="ACD_FUNC,change" id="slct_'+ptr+'" class="selectext" title="AS_STAT"><option value="AS_STAT">AS_STAT</option><option value="0">AW_STAT</option><option value="1">AS_STAT</option><option value="2">AT_STAT</option><option value="3">AB_STAT</option><option value="4">AV_STAT</option></select>';
- var ACD_TXT = '<input onchange="key_val_change(this)" name="ACD_FUNC,change" id="txt_'+ptr+'" class="text-inputextext" type="text">';
- var DSS_TXT = '<input onchange="key_val_change(this)" name="DSS FUNCTION,change" id="txt_'+ptr+'" class="text-inputextext" type="text">';
- var MBN_TXT = '<input onchange="key_val_change(this)" name="MEMBANK,change" id="txt_'+ptr+'" class="text-inputextext" type="text">';
- if(parseInt(object.value) == parseInt(old_key))
- {
- ACD_SEL = '<select onchange="key_val_change(this)" name="ACD_FUNC,nochange" id="slct_'+ptr+'" class="selectext" title="AS_STAT"><option value="'+temp2+'">'+temp2+'</option><option value="0">AW_STAT</option><option value="1">AS_STAT</option><option value="2">AT_STAT</option><option value="3">AB_STAT</option><option value="4">AV_STAT</option></select>';
- ACD_TXT = '<input onchange="key_val_change(this)" value="'+temp3+'" title="'+temp3+'" name="ACD_FUNC,nochange" id="txt_'+ptr+'" class="text-inputextext" type="text">';
- DSS_TXT = '<input onchange="key_val_change(this)" value="'+temp2+'" title="'+temp2+'" name="DSS FUNCTION,nochange" id="txt_'+ptr+'" class="text-inputextext" type="text">';
- MBN_TXT = '<input onchange="key_val_change(this)" value="'+temp2+'" title="'+temp2+'" name="MEMBANK,nochange" id="txt_'+ptr+'" class="text-inputextext" type="text">';
- }
- //alert("_"+object.value+"_"+ptr+"_"+old_key+"_"+temp2+"_"+temp3+"_"+DSS_TXT+"_"+MBN_TXT);
- switch(parseInt(object.value))
- {
- default:
- {
- document.getElementById("tid1_"+ptr).innerHTML = " ";
- document.getElementById("tid2_"+ptr).innerHTML = " ";
- }
- break;
- case 0:
- {
- document.getElementById("tid1_"+ptr).innerHTML = DSS_TXT;
- document.getElementById("tid2_"+ptr).innerHTML = " ";
- }
- break;
- case 17:
- {
- document.getElementById("tid1_"+ptr).innerHTML = MBN_TXT;
- document.getElementById("tid2_"+ptr).innerHTML = " ";
- }
- break;
- case 18:
- {
- document.getElementById("tid1_"+ptr).innerHTML = ACD_SEL;
- document.getElementById("tid2_"+ptr).innerHTML = ACD_TXT;
- }
- break;
- }
- //alert(object.value+"__"+ptr+"__"+tid1+"__"+tid2);
- key_val_change(object);
- }
- function go_did()
- {
- var all_did = null;
- for(jdx = 0; jdx < 18; jdx++)
- {
- var evalu = 0;
- var didno = document.getElementById("didnum").value;
- var ele = document.getElementById("did_"+(jdx+1));
- if(ele.type == "checkbox" && ele.checked)
- evalu = 1;
- else
- evalu = ele.value;
- if(ele.name == "changed_did")
- {
- if(all_did == null)
- {
- all_did = (evalu+"_"+ele.type+"_"+jdx);
- }
- else
- {
- all_did += ":"+(evalu+"_"+ele.type+"_"+jdx);
- }
- }
- }
- if(all_did != null)
- {
- if(all_did.length)
- {
- all_did += ","+didno;
- doWork(all_did,"set_did","didg");
- }
- }
- else
- alert("No Change Encountered!");
- }
- function go_dod()
- {
- var type = document.getElementById("type").value;
- var all_dod = "";
- var sitr = null;
- var eitr = null;
- if(type == "DOD")
- {
- sitr = 0;
- eitr = 19;
- }
- else if(type == "VOIP")
- {
- sitr = 19;
- eitr = 32;
- }
- else if(type == "H") // Commented for H3232
- {
- sitr = 33;
- eitr = 39;
- }
- for(jdx = sitr; jdx < eitr; jdx++)
- {
- var evalu = 0;
- var dodno = document.getElementById("dodnum").value;
- var ele = document.getElementById("dod_"+(jdx+1));
- if(ele.type == "checkbox" && ele.checked)
- evalu = 1;
- else
- evalu = ele.value;
- if(ele.name == "changed_dod")
- {
- if(jdx > 26 && jdx < 30)
- {
- if(ele.value < 0 || ele.value > 65535)
- {
- alert("Invalid Range, Should be between 0-65535!");
- return;
- }
- }
- if(jdx == 26)
- {
- if(ele.value < 5060 || ele.value > 5318)
- {
- alert("Invalid Range, Should be between 5060-5319!");
- return;
- }
- }
- if(all_dod == null)
- all_dod = (evalu+"_"+ele.type+"_"+jdx);
- else
- all_dod += ":"+(evalu+"_"+ele.type+"_"+jdx);
- //alert(all_dod);
- }
- }
- if(all_dod == null)
- {
- alert("No Change Encountered!");
- return;
- }
- all_dod += ","+dodno;
- //alert(all_dod);
- doWork(all_dod,"set_dod","dodg");
- }
- function add_dup()
- {
- var all_dup = null;
- var dup_new = document.getElementById("dupnume");
- var original = document.getElementById("oldnume");
- var rt_new = document.getElementById("rtypee");
- if(dup_new.value != null && original.value != null)
- {
- all_dup = (dup_new.value+"_"+original.value+"_"+rt_new.value);
- doWork(all_dup,"add","dup");
- }
- else if(dup_new.value == null || original.value == null)
- {
- info_notify("No Value Entered!");
- sid_dup();
- }
- }
- function go_dup()
- {
- var tabrow = (document.getElementById("duptab").rows.length);
- var all_dup = null;
- for(jdx = 0; jdx < parseInt(tabrow); jdx++)
- {
- var dup = document.getElementById("dupnum_"+(jdx+1));
- var old = document.getElementById("oldnum_"+(jdx+1));
- var rt = document.getElementById("rtype_"+(jdx+1));
- if(dup.name == "changed_dup")
- {
- if(all_dup == null)
- all_dup = (jdx+"|"+dup.value+"_"+old.value+"_"+rt.value);
- else
- all_dup = all_dup+":"+(jdx+"|"+dup.value+"_"+old.value+"_"+rt.value);
- }
- }
- doWork(all_dup,"edit","dup");
- }
- function go_feat()
- {
- var all_feat = null;
- var MaxValue = document.getElementById("MaxValueFeat").value;
- var jdx=0;
- //for(jdx = ((document.getElementById('fnum').value) - 1)*32; jdx < ((((document.getElementById('fnum').value) - 1)*32)+32); jdx++)
- for(jdx=0; jdx < MaxValue; jdx++)
- {
- var loc = document.getElementById("locate_"+jdx);
- var ele = document.getElementById("flexe_"+jdx);
- if(ele.name == "flex_changed")
- {
- if(all_feat == null)
- all_feat = (jdx+"|"+ele.value+"_"+loc.value);
- else
- all_feat = all_feat+":"+(jdx+"|"+ele.value+"_"+loc.value);
- }
- }
- if(all_feat == null)
- {
- alert("No change Encountered");
- return;
- }
- doWork(all_feat,"set_feat","feat");
- }
- function ent(evt,elem,valu)
- {
- evt = (evt) ? evt : window.event
- var charCode = (evt.which) ? evt.which : evt.keyCode
- if (charCode == 13)
- {
- go_val(elem,valu);
- }
- else
- return false;
- }
- function get_timer()
- {
- document.getElementById("notify").style.display = "none";
- doWork(true,"get_timer","syst");
- }
- function default_timer()
- {
- doWork(true,"default_timer","syst");
- }
- function get_extbulk()
- {
- document.getElementById("notify").style.display = "none";
- doWork(true,"get_extbulk","ext");
- }
- function get_sys()
- {
- // alert("i am in get sys");
- document.getElementById("notify").style.display = "none";
- doWork(true,"get_sys","sys");
- }
- function get_sysmgw()
- {
- //document.getElementById("notify").style.display = "none";
- doWork(true,"get_sysmgw","sysmgw");
- }
- function get_card()
- {
- doWork((true),"get_card","card");
- }
- function tdm_card(obj)
- {
- doWork((obj),"tdm_card","card");
- }
- function nsb_fetch_card(obj)
- {
- document.getElementById("notify").style.display = "none";
- document.getElementById("nsb_div_card").style.display = "inline";
- //document.getElementById("nsb_back").style.display = "inline";
- document.getElementById("nsb_div_port").style.display = "none";
- document.getElementById("nsb_div_cardD").style.display = "none";
- document.getElementById("nsb_div_login").style.display = "none";
- document.getElementById("nsb_div_logout").style.display = "none";
- var cardAr = obj.split("^");
- document.getElementById("card").value = cardAr[0] + " ("+cardAr[1]+")";
- document.getElementById("cardD").value = obj;
- //var tt = (+cardAr[0] + +1);
- doWork(obj,"nsb_fetch_card","search");
- }
- function nsb_change_card(obj)
- {
- var ret=confirm("WARNING! All PORTs of E1 or PRI card will be set to DEFAULT and ANY Links will be DOWN. \n Are you sure to Proceed! ?? ");
- if (ret==true)
- {
- var cardAr = obj.split("^");
- //alert(cardAr[0] + " ("+cardAr[1]+")");
- //document.getElementById("card").value = cardAr[0] + " ("+cardAr[1]+")";
- //document.getElementById("cardD").value = obj;
- //var tt = (+cardAr[0] + +1);
- doWork((obj),"change_card","search");
- }
- }
- function nsb_del_card(obj)
- {
- var ret=confirm("WARNING! All PORTs of this Card will be Removed. \n Are you sure to Proceed! ?? ");
- if (ret==true)
- {
- //var tnum = document.getElementById("anum_"+obj).value;
- //var allwdgrp = document.getElementById("allwdgrp").value;
- //alert(obj);
- //doWork(tnum+","+allwdgrp,"del_allwdgrp","ulsta");
- doWork((obj),"del_card","search");
- //hide_add();
- }
- }
- function nsb_reset_card(obj)
- {
- var ret=confirm("WARNING! CARD RESTART MAY DROP RUNNING CALLS of SYSTEM. \n Are you sure to Proceed! ?? ");
- if (ret==true)
- {
- doWork((obj),"reset_card","search");
- }
- }
- function change_utc_port(obj,obj1)
- {
- var ret=confirm("WARNING! PORT CHANGE REQUEST WILL RESET THE PORT CONFIGURATION AND TYPE. \n Are you sure to Proceed! ?? ");
- if (ret==true)
- {
- var tnum = obj1.value;
- var prt = obj + "^" + tnum;
- doWork((prt),"change_port","search");
- }
- else
- {
- // Change Combo value to Select cmbUTC
- document.getElementById("cmbUTC").selectedIndex = 0;
- }
- }
- function card_view()
- {
- doWork((true),"card_view","card");
- }
- function card_view_header()
- {
- doWork((obj),"card_view_header","card");
- }
- //NSB for NGXCDR view
- function get_search(obj)
- {
- doWork((obj),"get_cdr","dir1");
- }
- function get_cos()
- {
- document.getElementById("notify").style.display = "none";
- doWork(true,"get_cos","cos");
- }
- function get_search(obj)
- {
- doWork((obj),"get_search","search");
- }
- function get_net(obj)
- {
- doWork((obj),"get_net","cos");
- }
- function get_param(obj)
- {
- doWork((obj),"get_param","acd");
- }
- function get_acdmem(obj)
- {
- doWork((obj),"get_acdmem","acd");
- }
- function get_bgrp(obj)
- {
- //alert(obj);
- doWork((obj),"get_bgrp","bgrp");
- }
- function get_mem(obj)
- {
- //alert(obj);
- doWork((obj),"get_mem","bgrp");
- }
- function get_res(obj)
- {
- doWork((obj),"get_res","acd");
- }
- function ghan_cos()
- {
- doWork(true,"ghan_cos","cos");
- }
- function sid_acd()
- {
- doWork(true,"sid_acd","acd");
- }
- function sid_bgrp()
- {
- doWork(true,"sid_bgrp","bgrp");
- }
- function ghan_fetch_cos(obj)
- {
- doWork((obj),"ghan_fetch_cos","cos");
- }
- function sid_feat()
- {
- doWork(true,"sid_feat","feat");
- }
- function welcome()
- {
- doWork(true,"get_welcome","welcome");
- }
- function sid_did()
- {
- doWork(true,"sid_did","didg");
- }
- function sid_dod()
- {
- doWork(true,"sid_dod","dodg");
- }
- //function sid_fetch_feat(obj)
- function sid_fetch_feat()
- {
- //doWork((obj),"sid_fetch_feat","feat");
- doWork(true,"sid_fetch_feat","feat");
- }
- function sid_dup()
- {
- doWork(true,"sid_dup","dup");
- }
- function sid_dial()
- {
- doWork(true,"sid_dial","feat");
- }
- function sid_fetch_did(obj)
- {
- doWork((obj),"sid_fetch_did","didg");
- }
- function sid_fetch_dod(obj)
- {
- //alert("do work");
- doWork((obj),"sid_fetch_dod","dodg");
- }
- function sid_fetch_voip(obj)
- {
- //alert(obj);
- doWork((obj),"sid_fetch_voip","dodg");
- }
- function sid_fetch_h(obj)
- {
- //alert("do work");
- doWork((obj),"sid_fetch_h","dodg");
- }
- function show_add()
- {
- document.getElementById('add').style.display = "inline";
- }
- function show_adv()
- {
- document.getElementById('adv').style.display = "inline";
- }
- function hide_add()
- {
- document.getElementById("oldnume").value = "";
- document.getElementById("dupnume").value = "";
- var element = document.getElementById('rtypee');
- element.value = 0;
- document.getElementById('add').style.display = "none";
- }
- function hide_advance()
- {
- document.getElementById("adv").style.display = "none";
- }
- function hide_add1()
- {
- document.getElementById("add").style.display = "none";
- }
- function hide_addcard()
- {
- if(document.getElementById("addcard") != null)
- document.getElementById("addcard").style.display = "none";
- }
- function hide_add2()
- {
- document.getElementById("flex").value = "";
- document.getElementById("length").value = "";
- document.getElementById("add").style.display = "none";
- }
- function setAutoCommit(val)
- {
- //alert("i am in setAutoCommit");
- var qry = null;
- for(c=2; c<val; c++)
- {
- // alert("i am in first loop for "+c+" time");
- var cname = document.getElementById("sys_"+c).name;
- //var cname = document.getElementById("sys_0").name;
- if(cname != "nochange")
- {
- var e_val = null;
- if(document.getElementById("sys_"+c).type == 'checkbox')
- {
- var cchkd = '';
- // if(document.getElementById("sys_"+c).checked)
- // cchkd = 1;
- // else
- // cchkd = 0;
- var element = document.getElementById("name_"+c);
- cchkd = (element.innerText || element.textContent).trim();
- if(qry == null)
- qry = cchkd+"_"+c;
- else
- qry = qry+"|"+cchkd+"_"+c;
- //alert(qry);
- }
- }
- }
- if(qry == null)
- info_notify("No Changes Encountered!");
- else
- {
- //alert("i am going to doWork!"+qry);
- doWork(qry,"setAutoCommAll","autoComm");
- }
- }
- function setAutoCommitAll()
- {
- //alert("i am here");
- if(confirm('Are you sure to COMMIT the SYSTEM ??')){
- doWork(true,"setAutoCommAllYes","autoComm");}
- }
- function sysDef()
- {
- if(confirm('DANGEROUS ACTION - Are you sure to DEFAULT the ENTIRE SYSTEM ?? ALL SYSTEM SETTINGS WILL BE REMOVED and set to FACTORY DEFAULT.'))
- {
- doWork(true,"sys_Def","autoComm");
- }
- }
- function sysReboot()
- {
- if(confirm('Are you sure to REBOOT the SYSTEM ?? ALL CALLS will be DROPPED.'))
- doWork(true,"sys_reboot","autoComm");
- }
- var time_left = 120;
- var cinterval;
- function time_dec()
- {
- time_left--;
- document.getElementById('countdown').innerHTML = time_left;
- if(time_left == 0)
- {
- clearInterval(cinterval);
- showHome();
- }
- }
- function resumetime()
- {
- clearInterval(cinterval);
- cinterval = setInterval('time_dec()', 1000);
- }
- function defaultstart()
- {
- time_left = 180;
- clearInterval(cinterval);
- cinterval = setInterval('time_dec()', 1000);
- }
- function starttime()
- {
- clearInterval(cinterval);
- cinterval = setInterval('time_dec()', 1000);
- }
- function getCdrList(obj)
- {
- alert(obj);
- document.getElementById("notify").style.display = "none";
- doWork(obj,"getCdrList","autoComm");
- }
- ////////////////////////////////////////////////////////////////////////
- // Declaring valid date character, minimum year and maximum year
- var dtCh= "/";
- var minYear=1900;
- var maxYear=2100;
- function isInteger(s){
- var i;
- for (i = 0; i < s.length; i++)
- {
- // Check that current character is number.
- var c = s.charAt(i);
- if (((c < "0") || (c > "9"))) return false;
- }
- // All characters are numbers.
- return true;
- }
- function stripCharsInBag(s, bag){
- var i;
- var returnString = "";
- // Search through string's characters one by one.
- // If character is not in bag, append to returnString.
- for (i = 0; i < s.length; i++)
- {
- var c = s.charAt(i);
- if (bag.indexOf(c) == -1) returnString += c;
- }
- return returnString;
- }
- function daysInFebruary (year){
- // February has 29 days in any year evenly divisible by four,
- // EXCEPT for centurial years which are not also divisible by 400.
- return (((year % 4 == 0) && ( (!(year % 100 == 0)) || (year % 400 == 0))) ? 29 : 28 );
- }
- function DaysArray(n)
- {
- for (var i = 1; i <= n; i++)
- {
- this[i] = 31
- if (i==4 || i==6 || i==9 || i==11) {this[i] = 30}
- if (i==2) {this[i] = 29}
- }
- return this
- }
- function select()
- {
- var x = document.getElementsByTagName("select");
- for(i=0;i<x.length;i++)
- {
- var y = x[i].options;
- // alert(x[i].title);
- // alert(y.length);
- // alert(y[0].text);
- for(j=0;j<y.length;j++)
- {
- if(y[j].text == x[i].title)
- y[j].selected = "true";
- }
- }
- }
- function isDate(dtStr){
- var daysInMonth = DaysArray(12)
- var pos1=dtStr.indexOf(dtCh)
- var pos2=dtStr.indexOf(dtCh,pos1+1)
- var strDay=dtStr.substring(0,pos1)
- var strMonth=dtStr.substring(pos1+1,pos2)
- var strYear=dtStr.substring(pos2+1)
- strYr=strYear
- if (strDay.charAt(0)=="0" && strDay.length>1) strDay=strDay.substring(1)
- if (strMonth.charAt(0)=="0" && strMonth.length>1) strMonth=strMonth.substring(1)
- for (var i = 1; i <= 3; i++) {
- if (strYr.charAt(0)=="0" && strYr.length>1) strYr=strYr.substring(1)
- }
- month=parseInt(strMonth)
- day=parseInt(strDay)
- year=parseInt(strYr)
- if (pos1==-1 || pos2==-1){
- alert("The date format should be : dd/mm/yyyy")
- return false
- }
- if (strMonth.length<1 || month<1 || month>12){
- alert("Please enter a valid month")
- return false
- }
- if (strDay.length<1 || day<1 || day>31 || (month==2 && day>daysInFebruary(year)) || day > daysInMonth[month]){
- alert("Please enter a valid day")
- return false
- }
- if (strYear.length != 4 || year==0 || year<minYear || year>maxYear){
- alert("Please enter a valid 4 digit year between "+minYear+" and "+maxYear)
- return false
- }
- if (dtStr.indexOf(dtCh,pos2+1)!=-1 || isInteger(stripCharsInBag(dtStr, dtCh))==false){
- alert("Please enter a valid date")
- return false
- }
- return true
- }
- function chk_date(obj_date)
- {
- //alert("DATE SENT TO CHK_DATE ="+obj_date+"=");
- if (isDate(obj_date)==false)
- return false
- return true
- }
- ///////////////////////////////////////////////////////////////////////
- function chk_time(time)
- {
- var tim = time.split(":");
- if(tim.length == 2)
- {
- var hour = tim[0];
- var minute = tim[1];
- if(parseInt(hour) < 0 || parseInt(hour) > 23)
- return false;
- else
- {
- if(parseInt(minute) < 0 || parseInt(minute) > 59)
- return false;
- return true;
- }
- }
- else
- {
- return false;
- }
- }
- function set_sys()
- {
- //alert("i am in set_sys");
- var qry = null;
- for(c=0; c<80; c++)
- {
- // alert("i am in first loop for "+c+" time");
- var cname = document.getElementById("sys_"+(c+1)).name;
- //var cname = document.getElementById("sys_0").name;
- if(cname != "nochange")
- {
- var e_val = null;
- if(document.getElementById("sys_"+(c+1)).type == 'checkbox')
- {
- var cchkd = 0;
- if(document.getElementById("sys_"+(c+1)).checked)
- cchkd = 1;
- else
- cchkd = 0;
- if(qry == null)
- qry = cchkd+"_"+c;
- else
- qry = qry+"|"+cchkd+"_"+c;
- //alert(qry);
- }
- else
- {
- var cchkd = 0;
- //alert("Ghan promting for date! POSITION I_"+c);
- if(0 == c)
- {
- var ddate = document.getElementById("sys_"+(c+1)).value;
- var ttime = document.getElementById("syst_"+(c+1)).value;
- var tt = ttime.split(":");
- var dd = ddate.split("/");
- //alert("Ghan promting for date! POSITION 1");
- var dret = chk_date(ddate);
- var tret = chk_time(ttime);
- if(dret && tret)
- {
- var date_qry = (dd[1].toString())+(dd[0].toString())+(tt[0].toString())+(tt[1].toString())+(dd[2].toString());
- //alert(date_qry);
- if(qry == null)
- qry = date_qry+"_"+c;
- else
- qry = qry+"|"+date_qry+"_"+c;
- }
- }
- else
- {
- if(document.getElementById("sys_"+(c+1)).value != document.getElementById("sys_"+(c+1)).title)
- {
- cchkd = (document.getElementById("sys_"+(c+1)).value);
- if(qry == null)
- qry = cchkd+"_"+c;
- else
- qry = qry+"|"+cchkd+"_"+c;
- }
- }
- }
- }
- }
- //alert(qry);
- if(qry == null)
- info_notify("No Changes Encountered !");
- else
- {
- //alert("i am going to doWork!");
- doWork(qry,"set_sys","sys");
- }
- }
- function set_sysmgw()
- {
- //alert("i am in set_sysmgw");
- var qry = null;
- for(c=0; c<=27; c++)
- {
- var cname = document.getElementById("sys_"+(c+1)).name;
- //alert("Loop Count " + c + " name of element = " + cname);
- //var cname = document.getElementById("sys_0").name;
- if(cname != "nochange")
- {
- var e_val = null;
- if(document.getElementById("sys_"+(c+1)).type == 'checkbox')
- {
- var cchkd = 0;
- if(document.getElementById("sys_"+(c+1)).checked)
- cchkd = 1;
- else
- cchkd = 0;
- if(qry == null)
- qry = cchkd+"_"+c;
- else
- qry = qry+"|"+cchkd+"_"+c;
- //alert(qry);
- }
- else
- {
- var cchkd = 0;
- if(document.getElementById("sys_"+(c+1)).value != document.getElementById("sys_"+(c+1)).title)
- {
- cchkd = (document.getElementById("sys_"+(c+1)).value);
- if(qry == null)
- qry = cchkd+"_"+c;
- else
- qry = qry+"|"+cchkd+"_"+c;
- }
- }
- }
- }
- //alert(qry);
- if(qry == null)
- info_notify("No Changes Encountered !");
- else
- {
- //alert("i am going to doWork!");
- alert(qry);
- doWork(qry,"set_sysmgw","sysmgw");
- }
- }
- function update()
- {
- //alert(document.getElementById("type").value);
- switch(document.getElementById("type").value)
- {
- case "COS":
- {
- //alert("i am in cos");
- var qry = null;
- for(c = 0; c < 68; c++)
- {
- var cname = document.getElementById("cos_"+c).name;
- if(cname != "nochange")
- {
- var cchkd = 0;
- if(document.getElementById("cos_"+c).checked)
- cchkd = 1;
- if(qry == null)
- qry = cchkd+"_"+c;
- else
- qry = qry+"|"+cchkd+"_"+c;
- }
- }
- var cosno = document.getElementById("cosno").value;
- qry = cosno+":"+qry;
- //alert(qry);
- if(qry == cosno+":"+ null)
- info_notify("No Changes Encountered !");
- else
- doWork(qry,"set_cos","cos");
- break;
- }
- case "NET":
- {
- //alert ("i m in network");
- //NETWORK 0-127
- var qry = null;
- for(c = 0; c < 128; c++)
- {
- var netname = document.getElementById("net_"+c).name;
- if(netname != "nochange")
- {
- var cchkd = 0;
- if(document.getElementById("net_"+c).checked)
- cchkd = 1;
- if(qry == null)
- qry = cchkd+"_NET"+"_"+c;
- else
- qry = qry+"|"+cchkd+"_NET"+"_"+c;
- }
- }
- //TENANT 0-31
- for(c = 0; c < 32; c++)
- {
- var tntname = document.getElementById("tnt_"+c).name;
- if(tntname != "nochange")
- {
- var cchkd = 0;
- if(document.getElementById("tnt_"+c).checked)
- cchkd = 1;
- if(qry == null)
- qry = cchkd+"_TNT"+"_"+c;
- else
- qry = qry+"|"+cchkd+"_TNT"+"_"+c;
- }
- }
- //BOSS GROUP 0-7
- for(c = 0; c < 8; c++)
- {
- var bgsname = document.getElementById("bgs_"+c).name;
- if(bgsname != "nochange")
- {
- var cchkd = 0;
- if(document.getElementById("bgs_"+c).checked)
- cchkd = 1;
- if(qry == null)
- qry = cchkd+"_BGS"+"_"+c;
- else
- qry = qry+"|"+cchkd+"_BGS"+"_"+c;
- }
- }
- // ACD GROUP 0-15 effective in IP@Core
- for(c = 0; c < 16; c++)
- {
- var acdname = document.getElementById("acd_"+c).name;
- if(acdname != "nochange")
- {
- var cchkd = 0;
- if(document.getElementById("acd_"+c).checked)
- cchkd = 1;
- if(qry == null)
- qry = cchkd+"_ACD"+"_"+c;
- else
- qry = qry+"|"+cchkd+"_ACD"+"_"+c;
- }
- }
- // CONF 0-7
- for(c = 0; c < 8; c++)
- {
- var cnfname = document.getElementById("cnf_"+c).name;
- if(cnfname != "nochange")
- {
- var cchkd = 0;
- if(document.getElementById("cnf_"+c).checked)
- cchkd = 1;
- if(qry == null)
- qry = cchkd+"_CNF"+"_"+c;
- else
- qry = qry+"|"+cchkd+"_CNF"+"_"+c;
- }
- }
- var cosno = document.getElementById("cosno").value;
- qry = cosno+":"+qry;
- //alert(qry);
- if(qry == cosno+":"+ null)
- info_notify("No Changes Encountered !");
- else
- doWork(qry,"set_grp","cos");
- break;
- }
- default:
- {
- alert("I`m in Default!");
- break;
- }
- }
- }
- function rfr_ghan_fetch_cos()
- {
- document.getElementById("lrfr").style.display = "table-cell";
- if(document.getElementById("type").value == "COS")
- {
- g_cos();
- document.getElementById(0).style.color = "#ED1B03";
- document.getElementById(1).style.color = "#757575";
- }
- else
- {
- g_net();
- document.getElementById(0).style.color = "#757575";
- document.getElementById(1).style.color = "#ED1B03";
- }
- document.getElementById("lcos").style.display = "table-cell";
- document.getElementById("lcos1").style.display = "table-cell";
- }
- function rfr_sid_fetch_acd()
- {
- if(document.getElementById("type").value == "ACD")
- {
- g_param();
- document.getElementById(0).style.color = "#ED1B03";
- document.getElementById(1).style.color = "#757575";
- document.getElementById(2).style.color = "#757575";
- }
- else if(document.getElementById("type").value == "Mem")
- {
- g_amem();
- document.getElementById(0).style.color = "#757575";
- document.getElementById(2).style.color = "#ED1B03";
- document.getElementById(1).style.color = "#757575";
- }
- else
- {
- g_res();
- document.getElementById(0).style.color = "#757575";
- document.getElementById(1).style.color = "#ED1B03";
- document.getElementById(2).style.color = "#757575";
- }
- document.getElementById("Iacd").style.display = "table-cell";
- //document.getElementById("Iacd1").style.display = "table-cell";
- document.getElementById("lrfr").style.display = "table-cell";
- }
- function rfr_sid_fetch_bgrp()
- {
- if(document.getElementById("type").value == "BOSS")
- {
- g_acc();
- // document.getElementById(0).style.color = "#ED1B03";
- // document.getElementById(1).style.color = "#757575";
- }
- else
- {
- g_mem();
- document.getElementById(0).style.color = "#757575";
- document.getElementById(1).style.color = "#ED1B03";
- }
- document.getElementById("Iacd").style.display = "table-cell";
- //document.getElementById("Iacd1").style.display = "table-cell";
- //document.getElementById("lrfr").style.display = "table-cell";
- }
- function rfr_sid_fetch_feat()
- {
- g_feat();
- //alert("irfr1");
- document.getElementById("lrfrfeat").style.display = "inline";
- //alert("irfr1");
- }
- function nsb_fetch_tdm()
- {
- document.getElementById("number").value = "";
- nsb_fetch_card(document.getElementById("cardnum").value);
- }
- function rfr_sid_fetch_timers()
- {
- get_timer();
- document.getElementById("lrfr").style.display = "table-cell";
- document.getElementById("memo").style.display = "table-cell";
- document.getElementById(0).style.color = "#ED1B03";
- document.getElementById(1).style.color = "#757575";
- }
- function rfr_sid_fetch_did()
- {
- g_did();
- document.getElementById("lrfr").style.display = "table-cell";
- document.getElementById("memo").style.display = "table-cell";
- document.getElementById(0).style.color = "#ED1B03";
- document.getElementById(1).style.color = "#757575";
- }
- function rfr_sid_fetch_dod()
- {
- //alert(document.getElementById("type").value);
- //(document.getElementById("type").value);
- if(document.getElementById("type").value == "DOD")
- {
- //document.getElementById("lrfr").style.display = "table-cell";
- document.getElementById("lcos").style.display = "table-cell";
- document.getElementById("lcos1").style.display = "table-cell";
- document.getElementById("lcos2").style.display = "table-cell";
- //document.getElementById("lrfr").style.display = "table-cell";
- document.getElementById(0).style.color = "#ED1B03";
- document.getElementById(1).style.color = "#757575";
- //document.getElementById(2).style.color = "#757575";
- document.getElementById(3).style.color = "#757575";
- g_dod();
- }
- else if(document.getElementById("type").value == "VOIP")
- {
- document.getElementById("lrfr").style.display = "table-cell";
- document.getElementById("lcos").style.display = "table-cell";
- document.getElementById("lcos1").style.display = "table-cell";
- document.getElementById("lcos2").style.display = "table-cell";
- //document.getElementById("lrfr").style.display = "table-cell";
- document.getElementById(0).style.color = "#757575";
- document.getElementById(1).style.color = "#ED1B03";
- //document.getElementById(2).style.color = "#757575";
- document.getElementById(3).style.color = "#757575";
- sid_voip();
- }
- else if(document.getElementById("type").value == "H")
- {
- document.getElementById("lrfr").style.display = "table-cell";
- document.getElementById("lcos").style.display = "table-cell";
- document.getElementById("lcos1").style.display = "table-cell";
- //document.getElementById("lrfr").style.display = "table-cell";
- document.getElementById("lcos2").style.display = "table-cell";
- document.getElementById(0).style.color = "#757575";
- document.getElementById(1).style.color = "#757575";
- //document.getElementById(2).style.color = "#ED1B03";
- document.getElementById(3).style.color = "#757575";
- sid_h();
- }
- else if(document.getElementById("type").value == "Mem")
- {
- //document.getElementById("lrfr").style.display = "table-cell";
- document.getElementById("lcos").style.display = "table-cell";
- document.getElementById("lcos1").style.display = "table-cell";
- document.getElementById("lrfr").style.display = "table-cell";
- document.getElementById("lcos2").style.display = "table-cell";
- document.getElementById(0).style.color = "#757575";
- document.getElementById(1).style.color = "#757575";
- //document.getElementById(2).style.color = "#757575";
- document.getElementById(3).style.color = "#ED1B03";
- dod_mem();
- }
- }
- function rfr_sid_fetch_dup()
- {
- sid_dup();
- //document.getElementById("edit_link").style.display = "none";
- document.getElementById("lcos").style.display = "table-cell";
- document.getElementById("lcos1").style.display = "table-cell";
- document.getElementById("lcos2").style.display = "table-cell";
- document.getElementById("lrfr").style.display = "table-cell";
- }
- function g_did()
- {
- // document.getElementById("type").value = "DID";
- // if(document.getElementById("didnum").value == "Select")
- // {
- // alert("Please select DIDG Group Number");
- // return;
- // }
- // document.getElementById(0).style.color = "#ED1B03";
- // document.getElementById(1).style.color = "#757575";
- sid_fetch_did(document.getElementById("didnum").value);
- }
- function showAdvance()
- {
- if(document.getElementById('add1').style.display == "none")
- {
- document.getElementById('add1').style.display = "inline";
- //document.getElementById('add1').style = "display:inline";
- }
- else
- {
- document.getElementById('add1').style.display = "none";
- }
- return;
- }
- function get_Prev_Next(objName)
- {
- // Example: objName=didnum-P-128
- //alert(document.getElementById(objName));
- var res = objName.split("-");
- var numMax = res[2];
- if(document.getElementById(res[0]).value == "Select")
- {
- alert("Please select " + res[0]);
- return;
- }
- var numOR = document.getElementById(res[0]).value;
- var numOne = 1;
- var numR = 1; // Default set to 1 so Index 0 will be opened.
- if(res[1] == "P")
- {
- numR = (+numOR - +numOne);
- }
- else if(res[1] == "N")
- {
- numR = (+numOR + +numOne);
- //document.getElementById('add').style.display = "inline";
- }
- if(numR <= 0)
- {
- //alert("MAX Low Reached : " + numR);
- document.getElementById(55).style.display = "none";
- return;
- }
- else if(numMax < numR)
- {
- //alert("MAX High Reached : " + numR);
- document.getElementById(66).style.display = "none";
- return;
- }
- else
- {
- document.getElementById(66).style.display = "inline";
- document.getElementById(55).style.display = "inline";
- }
- document.getElementById(res[0]).value = numR;
- switch(res[0])
- {
- case 'didnum':
- //sid_fetch_did(numR);
- rfr_sid_fetch_did();
- break;
- case 'dodnum':
- rfr_sid_fetch_dod();
- //document.getElementById('add1').style.display = "inline";
- //sid_fetch_dod(numR);
- break;
- case 'acdno':
- rfr_sid_fetch_acd();
- break;
- case 'allwdgrp':
- fetch_allwdnum();
- break;
- case 'dendgrp':
- fetch_dendnum();
- break;
- default:
- return;
- break;
- }
- }
- function g_dod()
- {
- if(document.getElementById("dodnum").value == "Select")
- {
- alert("Please select DIDG Group Number");
- return;
- }
- sid_fetch_dod(document.getElementById("dodnum").value);
- }
- function sid_voip()
- {
- sid_fetch_voip(document.getElementById("dodnum").value);
- }
- function sid_h()
- {
- sid_fetch_h(document.getElementById("dodnum").value);
- }
- function g_feat()
- {
- //sid_fetch_feat(document.getElementById("fnum").value);
- sid_fetch_feat();
- }
- function g_dup()
- {
- // sid_fetch_feat(document.getElementById("fnum").value);
- sid_fetch_feat();
- }
- function g_cos()
- {
- document.getElementById("type").value = "COS";
- ghan_fetch_cos(document.getElementById("cosno").value);
- }
- function g_net()
- {
- document.getElementById("type").value = "NET";
- get_net(document.getElementById("cosno").value);
- }
- function g_param()
- {
- document.getElementById(2).style.color = "#757575";
- document.getElementById(0).style.color = "#ED1B03";
- document.getElementById(1).style.color = "#757575";
- //alert(document.getElementById("acdno").value);
- if(document.getElementById("acdno").value == "Select")
- {
- alert("Please select ACD group number");
- return;
- }
- document.getElementById("type").value = "ACD";
- get_param(document.getElementById("acdno").value);
- }
- function g_amem()
- {
- //alert(document.getElementById("acdno").value);
- if(document.getElementById("acdno").value == "Select")
- {
- alert("Please select ACD group number");
- return;
- }
- document.getElementById("type").value = "Mem";
- document.getElementById(0).style.color = "#757575";
- document.getElementById(2).style.color = "#ED1B03";
- document.getElementById(1).style.color = "#757575";
- get_acdmem(document.getElementById("acdno").value);
- }
- function g_acc()
- {
- //alert(document.getElementById("bgrpno").value);
- if(document.getElementById("bgrpno").value == "Select")
- {
- alert("Please enter Boss group number");
- return;
- }
- document.getElementById("type").value = "BOSS";
- get_bgrp(document.getElementById("bgrpno").value);
- }
- function g_mem()
- {
- //alert(document.getElementById("acdno").value);
- if(document.getElementById("bgrpno").value == "Select")
- {
- alert("Please enter Boss group number");
- return;
- }
- document.getElementById("type").value = "MEM";
- get_mem(document.getElementById("bgrpno").value);
- }
- function g_res()
- {
- document.getElementById(0).style.color = "#757575";
- document.getElementById(1).style.color = "#ED1B03";
- document.getElementById(2).style.color = "#757575";
- document.getElementById("type").value = "RES";
- //alert(document.getElementById("rsuid").value);
- //get_res(document.getElementById("acdno").value+":"+document.getElementById("rsid").value);
- if(document.getElementById("acdno").value == "Select")
- {
- alert("Please select ACD group number");
- return;
- }
- get_res(document.getElementById("acdno").value+":1");
- }
- function rfr_sid_res()
- {
- //alert(document.getElementById("acdno").value);
- document.getElementById("type").value = "RES";
- document.getElementById(0).style.color = " #757575";
- document.getElementById(1).style.color = "#ED1B03";
- get_res(document.getElementById("acdno").value+":"+document.getElementById("rsid").value);
- }
- function rfr_trk()
- {
- var data = null;
- data=document.getElementById("number").value;
- doWork(data,"gettrk","search");
- }
- function rfr_cnri()
- {
- var data = null;
- if(setradiopg != null)
- setradiopg = null;
- data = document.getElementById("number").value;
- doWork(data+"|cnri","getcnri","search");
- }
- function rfr_ext()
- {
- var data = null;
- data = document.getElementById("number").value;
- doWork(data,"getext","search");
- }
- function updateDssKtsKeys()
- {
- var data = null;
- data = document.getElementById("number").value;
- doWork(data,"getextDssKts","search");
- }
- function updateKeys()
- {
- var numkeys = null;
- var name = "";
- var data = "";
- var i = 0;
- var change = 0;
- var number = document.getElementById("number").value;
- numkeys = parseInt(document.getElementById("numkeys").value);
- data += number+","
- //alert("_"+number+"_");
- for(i=0;i<numkeys;i++)
- {
- var keyopr = (document.getElementById("keyopr_"+i).value);
- //alert("KEYOPR="+keyopr+"_");
- if(keyopr == "18")
- {
- var txt_name = document.getElementById("txt_"+i).name;
- var slct_name = document.getElementById("slct_"+i).name;
- var tmpa = txt_name.split(",");
- var tmpb = slct_name.split(",");
- if(tmpa[1] == "change" && ((document.getElementById("txt_"+i).value).length) < 1)
- {
- alert("Value can not be NULL!");
- break;
- }
- if(tmpa[1] == "change")
- {
- data += i+"_"+keyopr+"_"+document.getElementById("slct_"+i).value+"_"+document.getElementById("txt_"+i).value+"|";
- change++;
- }
- //name += keyopr+"_"+txt_name+","+slct_name+"\n";
- }
- else if(keyopr == "0" || keyopr == "17")
- {
- var tmpa = (document.getElementById("txt_"+i).name).split(",");
- if(tmpa[1] == "change" && ((document.getElementById("txt_"+i).value).length) < 1)
- {
- alert("Value can not be NULL!");
- break;
- }
- if(tmpa[1] == "change")
- {
- data += i+"_"+keyopr+"_"+document.getElementById("txt_"+i).value+"|";
- change++;
- }
- //name += keyopr+"_"+document.getElementById("txt_"+i).name+"\n";
- }
- else
- {
- var tmpa = (document.getElementById("keyopr_"+i).name).split(",");
- if(tmpa[1] == "change")
- {
- data += i+"_"+keyopr+"|";
- change++;
- }
- //name += keyopr+"_"+"NONE\n"
- }
- }
- if(!change)
- data = null;
- //alert(data);
- doWork(data,"setextDssKts","search");
- }
- function sel_all(obj,typ,itr)
- {
- if(obj.checked)
- {
- for(i =0; i < itr; i++)
- {
- if(document.getElementById(typ+i).checked == false)
- {
- check_s(document.getElementById(typ+i),i)
- document.getElementById(typ+i).checked = true;
- }
- }
- }
- else
- {
- for(i =0; i < itr; i++)
- {
- check_s(document.getElementById(typ+i),i)
- document.getElementById(typ+i).checked = false;
- }
- }
- }
- function checkIt(evt)
- {
- evt = (evt) ? evt : window.event
- var charCode = (evt.which) ? evt.which : evt.keyCode
- if (charCode > 31 && (charCode < 48 || charCode > 57))
- {
- status = "This field accepts numbers only."
- return false;
- }
- status = "";
- return true;
- }
- function checkclktext(evt)
- {
- evt = (evt) ? evt : window.event
- var charCode = (evt.which) ? evt.which : evt.keyCode
- if(charCode == 35 || charCode == 42)
- return true;
- else if (charCode > 31 && (charCode < 48 || charCode > 58))
- {
- status = "This field accepts numbers only.";
- return false;
- }
- status = "";
- return true;
- }
- function ipchecktext(evt)
- {
- evt = (evt) ? evt : window.event
- var charCode = (evt.which) ? evt.which : evt.keyCode
- if(charCode == 35 || charCode == 42)
- return true;
- else if (charCode > 31 && (charCode < 46 || charCode > 57 || charCode == 47))
- {
- status = "This field accepts IP formet only."
- return false;
- }
- status = "";
- return true;
- }
- function checkItextName(evt)
- {
- evt = (evt) ? evt : window.event
- var charCode = (evt.which) ? evt.which : evt.keyCode
- if(charCode == 32)
- return true;
- if(charCode >= 33 && charCode <= 47)
- return false;
- if(charCode >= 58 && charCode <= 64)
- return false;
- if(charCode >= 91 && charCode <= 96)
- return false;
- if(charCode == 124 || charCode == 123 || charCode == 125 || charCode == 126)
- return false;
- else if (charCode > 31 && (charCode < 48 || charCode > 122))
- {
- status = "This field accepts Alfa Numeric and * @ - _ char only."
- return false;
- }
- status = "";
- return true;
- }
- function checkItextT(evt,obj)
- {
- evt = (evt) ? evt : window.event
- var charCode = (evt.which) ? evt.which : evt.keyCode
- if(charCode == 35 || charCode == 42)
- {
- if(obj.value != "" && obj.value != 0 && (obj.value <= 0 || obj.value >= 60000))
- {
- alert("Invalid Range, Valid range is 0 - 60000!");
- obj.value = obj.title;
- return false;
- }
- return true;
- }
- else if (charCode > 31 && (charCode < 48 || charCode > 57))
- {
- status = "This field accepts numbers only."
- return false;
- }
- if(obj.value != "" && obj.value != 0 && (obj.value <= 0 || obj.value >= 60000))
- {
- alert("Invalid Range, Valid range is 0 - 60000!");
- obj.value = obj.title;
- return false;
- }
- return true;
- }
- function validate_timer(obj)
- {
- if(obj.value != "" && obj.value != 0 && (obj.value < 0 || obj.value > 60000))
- {
- alert("Invalid Range, Valid range is 0 - 60000!");
- obj.value = obj.title;
- return false;
- }
- }
- function isAlphaNum(event)
- {
- var regex = new RegExp("^[a-zA-Z0-9\\s]+$");
- //alert(event + ' - ' + regex);
- var key = String.fromCharCode(!event.charCode ? event.which : event.charCode);
- var cKey = (!event.charCode ? event.which : event.charCode);
- if(cKey == 8 || cKey == 0 || cKey == 32)
- return true;
- if(!regex.test(key))
- {
- event.preventDefault();
- return false;
- }
- }
- function getHTTPObject()
- {
- if(window.ActiveXObject)
- return new ActiveXObject("Microsoft.XMLHTTP");
- else if(window.XMLHttpRequest)
- return new XMLHttpRequest();
- else
- {
- alert("Your browser does not support AJAX.");
- return null;
- }
- }
- function doWork(obj,name,pgname)
- {
- //alert(obj+"__"+name+"__"+pgname);
- if(obj == null)
- obj = "NULL";
- httpObject = getHTTPObject();
- var nocache = Math.random();
- // alert(nocache);
- if(pgname == "gain" && name == "set_gain")
- {
- //document.getElementById('tab_data').innerHTML = "<center><img src='resources/images/ajax-loader.gif' style='margin-top:15%;'></center>";
- httpObject.open("POST", "resources/scripts/"+pgname+".php?"+name+"="+obj+'&nocache = '+nocache, true);
- httpObject.send(null);
- httpObject.onreadystatechange = setOutput;
- }
- else if(pgname == "card" && name == "nsb_fetch_card")
- {
- //document.getElementById('tab_data').innerHTML = "<center><img src='resources/images/ajax-loader.gif' style='margin-top:15%;'></center>";
- httpObject.open("POST", "resources/scripts/"+pgname+".php?"+name+"="+obj+'&nocache = '+nocache, true);
- httpObject.send(null);
- httpObject.onreadystatechange = setOutput;
- }
- else if(httpObject != null)
- {
- document.getElementById('notify_conf2').innerHTML = "<center><img src='resources/images/ajax-loader.gif' style='margin-top:15%;'></center>";
- document.getElementById('tab_data').innerHTML = "<center><img src='resources/images/ajax-loader.gif' style='margin-top:15%;'></center>";
- //To hide Menu On Click = NSB
- document.getElementById('mn1').style = "overflow:visible; visibility:hidden";
- document.getElementById('mn2').style = "overflow:visible; visibility:hidden";
- document.getElementById('mn3').style = "overflow:visible; visibility:hidden";
- document.getElementById('mn4').style = "overflow:visible; visibility:hidden";
- document.getElementById('mn5').style = "overflow:visible; visibility:hidden";
- document.getElementById('mn6').style = "overflow:visible; visibility:hidden";
- document.getElementById('mn7').style = "overflow:visible; visibility:hidden";
- document.getElementById('mn8').style = "overflow:visible; visibility:hidden";
- httpObject.open("POST", "resources/scripts/"+pgname+".php?"+name+"="+obj+'&nocache = '+nocache, true);
- // alert("resources/scripts/"+pgname+".php?"+name+"="+obj+'&nocache = '+nocache);
- // alert(obj+"__"+name+"__"+pgname);
- httpObject.send(null);
- httpObject.onreadystatechange = setOutput;
- }
- else
- {
- alert("NSB else Case :: systmr> httpObject is null");
- }
- return true;
- }
- function setOutput()
- {
- var all_data = (httpObject.responseText).split("|");
- //alert(all_data);
- if(httpObject.readyState == 4 && httpObject.status == 200)
- {
- if(all_data[0] == "<h5>Welcome</h5>")
- {
- //alert("here we go");
- var evr_data = (all_data[1]).split(",");
- document.getElementById('tab_data').innerHTML = evr_data[0];
- var sys = evr_data[3].replace(/^\s+|\s+$/g,'');
- if(evr_data[2] == 1)
- {
- //basic_config();
- }
- if(sys == "i686")
- {
- if(evr_data[4] == "0")
- {
- alert("Licence not found");
- document.getElementById("fileinfo").style.display = "inline";
- document.getElementById("licinfo2").style.display = "inline";
- }
- else if(evr_data[4] == "1")
- {
- alert("Dongle not Connected");
- document.getElementById("donginfo").style.display = "inline";
- document.getElementById("licinfo2").style.display = "inline";
- }
- else if(evr_data[4] == "2")
- {
- alert("Licence expired");
- document.getElementById("licinfo").style.display = "inline";
- document.getElementById("licinfo2").style.display = "inline";
- }
- }
- else
- {
- document.getElementById('lic').style.display ="none";
- document.getElementById("lich").style.display = "none";
- }
- }
- else if(all_data[0] == "SETFLEX")
- {
- var displayData = all_data[1].split(',');
- var cardinfo = displayData[2].split('^'); //3,FXS32,97,128,32,Trk
- var cardDet = cardinfo[0]+"^"+cardinfo[1]+"^"+cardinfo[2]+"^"+cardinfo[3]+"^"+cardinfo[4];
- // alert(cardinfo);
- if(displayData[0])
- {
- if(cardinfo[5]== "Trk")
- {
- //alert(" in trunk mode");
- sucs_notify(displayData[0]);
- nsb_fetch_card(cardDet);
- }
- else if(displayData[2] == "sip-ext")
- {
- sucs_notify(displayData[0]);
- sip_ext_show();
- }
- else if(displayData[2] == "sip-trk")
- {
- sucs_notify(displayData[0]);
- sip_trunk_show();
- }
- else
- {
- sucs_notify(displayData[0]);
- add_flex(displayData[1]);
- }
- }
- else
- {
- if(cardinfo[5]== "Trk")
- {
- //alert(" in trunk mode else section");
- sucs_notify("Operation Successful!");
- nsb_fetch_card(cardDet);
- }
- else if(displayData[2] == "sip-ext")
- {
- sucs_notify("Operation Successful!");
- sip_ext_show();
- }
- else if(displayData[2] == "sip-trk")
- {
- sucs_notify("Operation Successful!");
- sip_trunk_show();
- }
- else
- {
- sucs_notify("Operation Successful!");
- add_flex(displayData[1]);
- }
- }
- }
- else if(all_data[0] == "SETPRI")
- {
- //alert(all_data[2]);
- if(all_data[1])
- {
- sucs_notify(all_data[1]);
- rfr_proto();
- }
- else
- {
- sucs_notify("Operation Successful!");
- rfr_proto();
- }
- }
- else if(all_data[0] == "SET")
- {
- //alert(all_data[0]);
- if(all_data[1] == "No Changes Encountered!")
- info_notify(all_data[1]);
- else
- sucs_notify(all_data[1] + wrong_entrytmrs);
- wrong_entrytmrs = "";
- get_timer();
- }
- else if(all_data[0] == "SETFEAT")
- {
- if(all_data[1] == "No Changes Encountered!")
- {
- info_notify(all_data[1]);
- rfr_sid_fetch_feat();
- }
- else
- {
- sucs_notify(all_data[1]);
- rfr_sid_fetch_feat();
- }
- }
- else if(all_data[0] == "DELFLEX")
- {
- //alert("i am in deflex");
- if(all_data[1] == "No Changes Encountered!")
- {
- info_notify(all_data[1]);
- go_search1();
- }
- else
- {
- sucs_notify(all_data[1]);
- go_search1();
- }
- }
- else if(all_data[0] == "<h5>ADDEN</h5>" || all_data[0] == "<h5>DELDEN</h5>")
- {
- //alert("i am in deflex");
- if(all_data[1] == "No Changes Encountered!")
- {
- info_notify(all_data[1]);
- fetch_dendnum();
- }
- else
- {
- sucs_notify(all_data[1]);
- fetch_dendnum();
- }
- }
- else if(all_data[0] == "<h5>ADDALL</h5>" || all_data[0] == "<h5>DELALL</h5>")
- {
- //alert("i am in deflex");
- if(all_data[1] == "No Changes Encountered!")
- {
- info_notify(all_data[1]);
- fetch_allwdnum();
- }
- else
- {
- sucs_notify(all_data[1]);
- fetch_allwdnum();
- }
- }
- else if(all_data[0] == "<h5>Session Timeout</h5>")
- {
- var evr_data = (all_data[1]).split("`");
- document.getElementById('tab_data').innerHTML = evr_data[0];
- document.getElementById('contentboxhead').innerHTML =all_data[0]+"<div><a href='ngx.php' class='link'>LOGIN</a></div>";
- document.getElementById('data_update').innerHTML = "<table><tr>Relogin to Continue.<a href='ngx.php'> LOGIN </a> </tr></table>";
- }
- else if(all_data[0] == "<h5>System Timers</h5>")
- {
- var evr_data = (all_data[1]).split("`");
- document.getElementById('tab_data').innerHTML = evr_data[0];
- //document.getElementById('contentboxhead').innerHTML =all_data[0]+"<div class='link'><a href='javascript:'>Help </a> | <a href='javascript:default_timer()'> Default All </a> | <a href='javascript:get_timer()'> Refresh </a> | <a href='javascript:go_val()'> Update </a></div>";
- document.getElementById('contentboxhead').innerHTML =all_data[0]+"<div><a href='javascript:get_timer()' class='link'> Refresh </a><a href='javascript:go_val()' class='link'> Update </a></div>";
- document.getElementById('data_update').innerHTML = evr_data[1];
- $(document).ready(function()
- {
- $('tbody tr:even').addClass("alt-row"); // Add class "alt-row" to even table rows
- });
- }
- else if(all_data[0] == "<h5>User Properties</h5>")
- {
- var evr_data = (all_data[1]).split(",");
- document.getElementById('tab_data').innerHTML = evr_data[0];
- document.getElementById('data_update').innerHTML = evr_data[1];
- document.getElementById('contentboxhead').innerHTML = all_data[0] + "<div><a href='javascript:rfr_ghan_fetch_cos()' class='link'>Refresh</a><a href='javascript:update()' class='link'>Update</a></div>";
- $(document).ready(function(){
- $('tbody').addClass("ext"); // Add class "alt-row" to even table rows
- });
- }
- else if(all_data[0] == "<h5>User Search</h5>")
- {
- // alert(all_data[1]);
- var evr_data = all_data[1];
- //alert(evr_data);
- document.getElementById('tab_data').innerHTML = (evr_data);
- document.getElementById('data_update').innerHTML = all_data[0];
- document.getElementById('contentboxhead').innerHTML = all_data[0];
- $(document).ready(function(){
- $('tbody').addClass("ext"); // Add class "alt-row" to even table rows
- $('#body1 tr:even').addClass("alt-row1");
- $('#body1 tr:odd').addClass("ext");
- $('#body2 tr:even').addClass("alt-row1");
- $('#body2 tr:odd').addClass("ext");
- });
- }
- else if(all_data[0] == "<h5>Dial Plan</h5>")
- {
- //alert(all_data[1]);
- var evr_data = all_data[1];
- document.getElementById('tab_data').innerHTML = (evr_data);
- //document.getElementById('data_update').innerHTML = evr_data[1];
- document.getElementById('contentboxhead').innerHTML = all_data[0];
- $(document).ready(function(){
- $('tbody').addClass("ext"); // Add class "alt-row" to even table rows
- $('#body1 tr:even').addClass("alt-row1");
- $('#body1 tr:odd').addClass("ext");
- $('#body2 tr:even').addClass("alt-row1");
- $('#body2 tr:odd').addClass("ext");
- });
- }
- else if(all_data[0] == "<h5>Subscriber Properties</h5>")
- {
- //alert(all_data[1]);
- var evr_data = all_data[1];
- document.getElementById('tab_data').innerHTML = (evr_data);
- //document.getElementById('data_update').innerHTML = evr_data[1];
- document.getElementById('contentboxhead').innerHTML = all_data[0]
- + "<div> <a href=\"javascript:getCard();\" class='link'>Cards</a>"
- +"<a href='javascript:rfr_ext()' class='link' >Refresh</a><a href='javascript:updatext()' class='link'>Update</a></div>";
- select();
- // mail();
- $(document).ready(function(){
- $('tbody').addClass("ext"); // Add class "alt-row" to even table rows
- $('#body1 tr:even').addClass("alt-row1");
- $('#body1 tr:odd').addClass("ext");
- $('#body2 tr:even').addClass("alt-row1");
- $('#body2 tr:odd').addClass("ext");
- });
- }
- else if(all_data[0] == "<h5>Subscriber Properties-DCC</h5>")
- {
- //alert("I am in DCC ext");
- //alert(all_data[1]);
- var evr_data = all_data[1];
- document.getElementById('tab_data').innerHTML = (evr_data);
- //document.getElementById('data_update').innerHTML = evr_data[1];
- all_data[0] = "<h5>Subscriber Properties</h5>";
- document.getElementById('contentboxhead').innerHTML = all_data[0]
- + "<div> <a href=\"javascript:getCard();\" class='link'>Cards</a>"
- + " <a href='javascript:rfr_ext()' class='link'>Refresh</a><a href='javascript:updatext()' class='link'>Update</a> </div>";
- select();
- $(document).ready(function(){
- $('tbody').addClass("ext"); // Add class "alt-row" to even table rows
- $('#body1 tr:even').addClass("alt-row1");
- $('#body1 tr:odd').addClass("ext");
- $('#body2 tr:even').addClass("alt-row1");
- $('#body2 tr:odd').addClass("ext");
- });
- }
- else if(all_data[0] == "<h5>KTS-DSS Keys</h5>")
- {
- //alert("I am in KTS-DSS Keys");
- //alert(all_data[1]);
- var evr_data = all_data[1];
- document.getElementById('tab_data').innerHTML = (evr_data);
- //document.getElementById('data_update').innerHTML = evr_data[1];
- document.getElementById('contentboxhead').innerHTML = all_data[0] + "<div><span id='lrfr' style='display:inline'><a href='javascript:rfr_ext()' class='link' >Refresh</a><a href='javascript:updateKeys()' class='link'>Update</a><a href='javascript:updateDssKtsKeys()' class='link'>KTS Keys</a></span></div>";
- $(document).ready(function(){
- $('tbody').addClass("ext"); // Add class "alt-row" to even table rows
- $('#body1 tr:even').addClass("alt-row1");
- $('#body1 tr:odd').addClass("ext");
- $('#body2 tr:even').addClass("alt-row1");
- $('#body2 tr:odd').addClass("ext");
- });
- }
- else if(all_data[0] == "SETKTSDSS")
- {
- if(all_data[1].length)
- info_notify(all_data[1]);
- else
- sucs_notify("KTS Key Configuration saved successfully!");
- updateDssKtsKeys();
- }
- else if(all_data[0] == "BACKUP")
- {
- //alert(httpObject.responseText);
- if(all_data[1] == "No Changes Encountered!")
- {
- info_notify(all_data[1]);
- }
- else
- {
- sucs_notify(all_data[1]);
- export_backup();
- }
- }
- else if(all_data[0] == "<h5>Trunk Properties</h5>")
- {
- //alert(all_data[1]);
- var evr_data = all_data[1];
- document.getElementById('tab_data').innerHTML = evr_data;
- var sip_hint = document.getElementById('sip_hint').value;
- sip_hint= sip_hint.trim();
- //alert(sip_hint);
- if(sip_hint == "sip-trk")
- {
- //document.getElementById('data_update').innerHTML = evr_data[1];
- document.getElementById('contentboxhead').innerHTML = all_data[0] + "<div align='right' class='link'><span id='lrfr' style='display:inline'>"
- + " <a href='javascript:sip_trunk_show()'>Back</a> | "
- + " <a href=\"javascript:getCard();\">Cards</a> | "
- + " <a href='javascript:rfr_sip_trk()'>Refresh</a> | "
- + " <a href='javascript:updatsiptrk()'>Update</a></span></div>";
- select();
- $(document).ready(function(){
- $('tbody').addClass("ext"); // Add class "alt-row" to even table rows
- $('#body1 tr:even').addClass("alt-row1");
- $('#body1 tr:odd').addClass("ext");
- $('#body2 tr:even').addClass("alt-row1");
- $('#body2 tr:odd').addClass("ext");
- });
- }
- else
- {
- //document.getElementById('data_update').innerHTML = evr_data[1];
- document.getElementById('contentboxhead').innerHTML = all_data[0] + "<div align='right' class='link'><span id='lrfr' style='display:inline'>"
- //+ " <a href=\"javascript:getCard();\">Cards</a> | "
- //+ " <a href='javascript:rfr_trk()'>Refresh</a> | "
- + " <a href='javascript:updattrk()'>Update</a></span></div>";
- select();
- $(document).ready(function(){
- $('tbody').addClass("ext"); // Add class "alt-row" to even table rows
- $('#body1 tr:even').addClass("alt-row1");
- $('#body1 tr:odd').addClass("ext");
- $('#body2 tr:even').addClass("alt-row1");
- $('#body2 tr:odd').addClass("ext");
- });
- }
- }
- else if (all_data[0] == "<h5>CDR Display</h5>")
- {
- var evr_data = (all_data[1]).split(",");
- // alert(evr_data[1]);
- document.getElementById('tab_data').innerHTML = evr_data[0];
- document.getElementById('contentboxhead').innerHTML = all_data[0]+"<div><a href='javascript:printDiv()' class='link'>Download</a>  <a href='javascript:showcdr(\"/etc/vihaas\")' class='link'>Back</a></div>";
- //document.getElementById('data_update').innerHTML = evr_data[1];
- //document.getElementById('contentboxhead').innerHTML = all_data[0]+"<div class='link'><a href='javascript:showcdr(\"/etc/vihaas\")'>Refresh</a> </div>";
- }
- else if(all_data[0] == "<h5>CNRI Properties</h5>")
- {
- var evr_data = all_data[1];
- document.getElementById('tab_data').innerHTML = evr_data;
- //document.getElementById('data_update').innerHTML = evr_data[1];
- document.getElementById('contentboxhead').innerHTML = all_data[0] + "<div><span id='lrfr' style='display:inline'><a href='javascript:rfr_cnri()' class='link'>Refresh</a><a href='javascript:updatcnri()' class='link'>Update</a></span></div>";
- select();
- var radiotyp = document.getElementById("cnri_2").value;
- if(setradiopg == null){
- setradiopg = all_data[1];
- setradioval = radiotyp;
- }
- else
- {
- if(radiotyp == 7)
- valu = 1;
- else if(radiotyp == 3)
- valu = 2;
- else if(radiotyp == 4)
- valu = 3;
- else
- valu = 0;
- document.getElementById("cnri_2").name = "slctd,changed";
- defvalues[valu] = all_data[1];
- }
- if(document.getElementById("cnri_21").checked == true)
- document.getElementById("cnri_22").disabled = false;
- else
- document.getElementById("cnri_22").disabled = true;
- $(document).ready(function(){
- $('tbody').addClass("ext"); // Add class "alt-row" to even table rows
- $('#body1 tr:even').addClass("alt-row1");
- $('#body1 tr:odd').addClass("ext");
- $('#body2 tr:even').addClass("alt-row1");
- $('#body2 tr:odd').addClass("ext");
- });
- }
- else if(all_data[0] == "SETEXT")
- {
- //alert(httpObject.responseText);
- if(all_data[1] == "No Changes Encountered!")
- {
- info_notify(all_data[1]);
- rfr_ext();
- }
- else
- {
- sucs_notify(all_data[1]);
- rfr_ext();
- }
- }
- else if(all_data[0] == "SETENBLK")
- {
- //alert(httpObject.responseText);
- if(all_data[1] == "No Changes Encountered!")
- {
- info_notify(all_data[1]);
- }
- else
- {
- sucs_notify(all_data[1]);
- get_enblock();
- }
- }
- else if(all_data[0] == "DELCARD")
- {
- //alert(httpObject.responseText);
- if(all_data[1] == "No Changes Encountered!")
- {
- info_notify(all_data[1]);
- }
- else
- {
- sucs_notify(all_data[1]);
- getCard();
- }
- }
- else if(all_data[0] == "RESETCARD")
- {
- //alert(httpObject.responseText);
- if(all_data[1] == "No Changes Encountered!")
- {
- info_notify(all_data[1]);
- }
- else
- {
- sucs_notify(all_data[1]);
- getCard();
- }
- }
- else if(all_data[0] == "CHANGECARD")
- {
- //alert(httpObject.responseText);
- if(all_data[1] == "No Changes Encountered!")
- {
- info_notify(all_data[1]);
- }
- else
- {
- sucs_notify(all_data[1]);
- getCard();
- }
- }
- else if(all_data[0] == "CHANGECARDMODE")
- {
- //alert(httpObject.responseText);
- if(all_data[1] == "No Changes Encountered!")
- {
- info_notify(all_data[1]);
- }
- else
- {
- sucs_notify(all_data[1]);
- getCard();
- }
- }
- else if(all_data[0] == "CHANGECARDPRIDB")
- {
- //alert(httpObject.responseText);
- if(all_data[1] == "No Changes Encountered!")
- {
- info_notify(all_data[1]);
- }
- else
- {
- sucs_notify(all_data[1]);
- getCard();
- }
- }
- else if(all_data[0] == "CHANGEPORT")
- {
- //alert(httpObject.responseText);
- if(all_data[1] == "No Changes Encountered!")
- {
- info_notify(all_data[1]);
- }
- else
- {
- sucs_notify(all_data[1]);
- getCard();
- }
- }
- else if(all_data[0] == "ADDCARD")
- {
- //alert(httpObject.responseText);
- if(all_data[1] == "No Changes Encountered!")
- {
- info_notify(all_data[1]);
- }
- else
- {
- sucs_notify(all_data[1]);
- getCard();
- }
- }
- else if(all_data[0] == "SETACD")
- {
- //alert(httpObject.responseText);
- if(all_data[1] == "No Changes Encountered!")
- {
- info_notify(all_data[1]);
- rfr_sid_fetch_acd();
- }
- else
- {
- sucs_notify(all_data[1]);
- rfr_sid_fetch_acd();
- }
- }
- else if(all_data[0] == "SETRES")
- {
- //alert(httpObject.responseText);
- if(all_data[1] == "No Changes Encountered!")
- {
- info_notify(all_data[1]);
- rfr_sid_fetch_acd();
- }
- else
- {
- sucs_notify(all_data[1]);
- rfr_sid_fetch_acd();
- }
- }
- else if(all_data[0] == "ADDMEM")
- {
- //alert(httpObject.responseText);
- if(all_data[1] == "No Changes Encountered!")
- {
- info_notify(all_data[1]);
- document.getElementById("type").value == "Mem"
- rfr_sid_fetch_acd();
- }
- else
- {
- sucs_notify(all_data[1]);
- document.getElementById("type").value == "Mem"
- rfr_sid_fetch_acd();
- }
- }
- else if(all_data[0] == "SETBGRP")
- {
- //alert(httpObject.responseText);
- if(all_data[1] == "No Changes Encountered!")
- {
- info_notify(all_data[1]);
- rfr_sid_fetch_bgrp();
- }
- else
- {
- sucs_notify(all_data[1]);
- rfr_sid_fetch_bgrp();
- }
- }
- else if(all_data[0] == "DELBGRP" || all_data[0] == "ADDBGRP")
- {
- //alert(httpObject.responseText);
- if(all_data[1] == "No Changes Encountered!")
- {
- info_notify(all_data[1]);
- rfr_sid_fetch_bgrp();
- }
- else
- {
- sucs_notify(all_data[1]);
- rfr_sid_fetch_bgrp();
- }
- }
- else if(all_data[0] == "SETTRK")
- {
- //alert(httpObject.responseText);
- if(all_data[1] == "No Changes Encountered!")
- {
- info_notify(all_data[1]);
- rfr_trk();
- }
- else
- {
- sucs_notify(all_data[1]);
- rfr_trk();
- }
- }
- else if(all_data[0] == "SETSIPTRK")
- {
- if(all_data[1] == "No Changes Encountered!")
- {
- var val = all_data[1].split("^");
- info_notify(all_data[1]);
- rfr_sip_trk(val[1]);
- }
- else
- {
- var val = all_data[1].split("^");
- sucs_notify(val[0]);
- rfr_sip_trk1(val[1]);
- }
- }
- else if(all_data[0] == "SETCNRI")
- {
- //alert(httpObject.responseText);
- if(all_data[1] == "No Changes Encountered!")
- {
- info_notify(all_data[1]);
- rfr_cnri();
- }
- else
- {
- sucs_notify(all_data[1]);
- rfr_cnri();
- }
- }
- else if(all_data[0] == "<h5>Bulk Configuration</h5>")
- {
- document.getElementById('tab_data').innerHTML = all_data[1];
- document.getElementById('contentboxhead').innerHTML = all_data[0]+"<div><a href='javascript:get_extensions()' class='link'>Refresh</a><a href='javascript:' class='link'>Update</a></div>";
- $(document).ready(function(){
- $('tbody').addClass("ext"); // Add class "alt-row" to even table rows
- $('#body1 tr:even').addClass("alt-row1");
- $('#body1 tr:odd').addClass("ext");
- $('#body2 tr:odd').addClass("alt-row1");
- $('#body2 tr:even').addClass("ext");
- });
- }
- else if (all_data[0] == "<h5>System Features</h5>")
- {
- //alert("i am in System features");
- document.getElementById('data_update').innerHTML = "<span> </span>";
- //alert(all_data[1]);
- document.getElementById('tab_data').innerHTML = all_data[1];
- document.getElementById('contentboxhead').innerHTML = all_data[0] + "<div><a href='javascript:get_sys()' class='link'>Refresh</a><a href='javascript:set_sys()' class='link'>Update</a></div>";
- select();
- $(document).ready(function(){
- $('tbody').addClass("ext"); // Add class "alt-row" to even table rows
- $('#body1 tr:even').addClass("alt-row1");
- $('#body1 tr:odd').addClass("ext");
- $('#body2 tr:even').addClass("alt-row1");
- $('#body2 tr:odd').addClass("ext");
- });
- }
- else if (all_data[0] == "<h5>SYS Configuration</h5>")
- {
- //alert("i am in System features");
- document.getElementById('data_update').innerHTML = "<span> </span>";
- //alert(all_data[1]);
- document.getElementById('tab_data').innerHTML = all_data[1];
- document.getElementById('contentboxhead').innerHTML = all_data[0]+"<div><a href='javascript:get_sysmgw()' class='link'>Refresh</a><a href='javascript:set_sysmgw()' class='link'>Update</a></div>";
- select();
- $(document).ready(function(){
- $('tbody').addClass("ext"); // Add class "alt-row" to even table rows
- $('#body1 tr:even').addClass("alt-row1");
- $('#body1 tr:odd').addClass("ext");
- $('#body2 tr:even').addClass("alt-row1");
- $('#body2 tr:odd').addClass("ext");
- });
- }
- else if (all_data[0] == "<h5>System Maintenance</h5>")
- {
- //alert("i am in System Commit");
- document.getElementById('data_update').innerHTML = "<span> </span>";
- //alert(all_data[1]);
- document.getElementById('tab_data').innerHTML = all_data[1];
- document.getElementById('contentboxhead').innerHTML = all_data[0];
- $(document).ready(function(){
- $('tbody').addClass("ext"); // Add class "alt-row" to even table rows
- $('#body1 tr:even').addClass("alt-row1");
- $('#body1 tr:odd').addClass("ext");
- $('#body2 tr:even').addClass("alt-row1");
- $('#body2 tr:odd').addClass("ext");
- });
- }
- else if (all_data[0] == "<h5>getCdrList</h5>")
- {
- //alert("i am in System Commit");
- document.getElementById('data_update').innerHTML = "<span> </span>";
- //alert(all_data[1]);
- document.getElementById('tab_data').innerHTML = all_data[1];
- document.getElementById('contentboxhead').innerHTML = all_data[0];
- $(document).ready(function(){
- $('tbody').addClass("ext"); // Add class "alt-row" to even table rows
- $('#body1 tr:even').addClass("alt-row1");
- $('#body1 tr:odd').addClass("ext");
- $('#body2 tr:even').addClass("alt-row1");
- $('#body2 tr:odd').addClass("ext");
- });
- }
- else if (all_data[0] == "<h5>System Commit</h5>")
- {
- //alert("i am in System Commit");
- document.getElementById('data_update').innerHTML = "<span> </span>";
- //alert(all_data[1]);
- document.getElementById('tab_data').innerHTML = all_data[1];
- document.getElementById('contentboxhead').innerHTML = all_data[0]+"<div><a href='javascript:showAutoCommit()' class='link'>Refresh</a><a href='javascript:setAutoCommit("+all_data[2]+")' class='link' class='link'>Update</a>|<a href='javascript:setAutoCommitAll()' class='link'>Commit All</a></div>";
- $(document).ready(function(){
- $('tbody').addClass("ext"); // Add class "alt-row" to even table rows
- $('#body1 tr:even').addClass("alt-row1");
- $('#body1 tr:odd').addClass("ext");
- $('#body2 tr:even').addClass("alt-row1");
- $('#body2 tr:odd').addClass("ext");
- });
- }
- else if (all_data[0] == "<h5>CDR</h5>")
- {
- //alert("<h5>CDR</h5>");
- document.getElementById('data_update').innerHTML = "<span> </span>";
- //alert(all_data[1]);
- document.getElementById('tab_data').innerHTML = all_data[1];
- document.getElementById('contentboxhead').innerHTML = all_data[0]+"<div class='link'><a href='javascript:showcdr(\"/etc/vihaas/\")'>Refresh</a> </div>";
- $(document).ready(function(){
- $('tbody').addClass("ext"); // Add class "alt-row" to even table rows
- $('#body1 tr:even').addClass("alt-row1");
- $('#body1 tr:odd').addClass("ext");
- $('#body2 tr:even').addClass("alt-row1");
- $('#body2 tr:odd').addClass("ext");
- });
- }
- else if (all_data[0] == "setAutoCommit")
- {
- // alert(all_data[1]);
- document.getElementById("tab_data").innerHTML = "";
- if(all_data[1])
- sucs_notify(all_data[1])
- else
- {
- var err = all_data[1].split(",");
- var errn = null;
- for(i =0 ; i < err.length; i++)
- {
- if(errn == null)
- errn = "Set operation failed for "+err[i]+"\n";
- else
- errn = errn+"|"+"Set operation failed for "+err[i]+"\n";
- }
- //alert(errn);
- }
- $(document).ready(function(){
- $('tbody').addClass("ext"); // Add class "alt-row" to even table rows
- $('#body1 tr:even').addClass("alt-row1");
- $('#body1 tr:odd').addClass("ext");
- $('#body2 tr:even').addClass("alt-row1");
- $('#body2 tr:odd').addClass("ext");
- });
- }
- else if (all_data[0] == "set_sys")
- {
- //alert(all_data[1]);
- document.getElementById("tab_data").innerHTML = "";
- if(all_data[1])
- {
- sucs_notify(all_data[1]);
- //nsbAlert(all_data[1] ,10000);
- }
- else
- {
- var err = all_data[1].split(",");
- var errn = null;
- for(i =0 ; i < err.length; i++)
- {
- if(errn == null)
- errn = "Set operation failed for "+err[i]+"\n";
- else
- errn = errn+"|"+"Set operation failed for "+err[i]+"\n";
- }
- //alert(errn);
- }
- get_sys();
- $(document).ready(function(){
- $('tbody').addClass("ext"); // Add class "alt-row" to even table rows
- $('#body1 tr:even').addClass("alt-row1");
- $('#body1 tr:odd').addClass("ext");
- $('#body2 tr:even').addClass("alt-row1");
- $('#body2 tr:odd').addClass("ext");
- });
- }
- else if (all_data[0] == "set_sysmgw")
- {
- //alert(all_data[1]);
- //alert(all_data[1]);
- document.getElementById("tab_data").innerHTML = "";
- if(all_data[1])
- {
- sucs_notify(all_data[1]);
- //nsbAlert(all_data[1] ,10000);
- }
- else
- {
- var err = all_data[1].split(",");
- var errn = null;
- for(i =0 ; i < err.length; i++)
- {
- if(errn == null)
- errn = "Set operation failed for "+err[i]+"\n";
- else
- errn = errn+"|"+"Set operation failed for "+err[i]+"\n";
- }
- //alert(errn);
- }
- get_sysmgw();
- $(document).ready(function(){
- $('tbody').addClass("ext"); // Add class "alt-row" to even table rows
- $('#body1 tr:even').addClass("alt-row1");
- $('#body1 tr:odd').addClass("ext");
- $('#body2 tr:even').addClass("alt-row1");
- $('#body2 tr:odd').addClass("ext");
- });
- }
- else if (all_data[0] == "<h5>Class of Service</h5>")
- {
- var evr_data = (all_data[1]).split(",");
- document.getElementById('tab_data').innerHTML = evr_data[0];
- document.getElementById('data_update').innerHTML = evr_data[1];
- document.getElementById('contentboxhead').innerHTML = all_data[0] + "<div><span id='lrfr' style='display:none'><a href='javascript:rfr_ghan_fetch_cos()' class='link'>Refresh</a><a href='javascript:update()' class='link'>Update</a></span></div>";
- }
- else if (all_data[0] == "<h5>Protocol Table</h5>")
- {
- var evr_data = (all_data[1]).split(",");
- document.getElementById('tab_data').innerHTML = evr_data[0];
- document.getElementById('data_update').innerHTML = evr_data[1];
- //alert(all_data[0]+"_"+evr_data[0]+"|||||||||"+evr_data[1]+"_________________");
- document.getElementById('contentboxhead').innerHTML = all_data[0] + "<div><span id='lrfr' style='display:none'><a href='javascript:rfr_proto()' class='link'>Refresh</a><a href='javascript:updateproto()' class='link'>Update</a></span></div>";
- }
- else if (all_data[0] == "<h5>Tone Table</h5>")
- {
- var evr_data = (all_data[1]).split(",");
- document.getElementById('tab_data').innerHTML = evr_data[0];
- document.getElementById('data_update').innerHTML = evr_data[1];
- document.getElementById('contentboxhead').innerHTML = all_data[0] + "<div><span id='lrfr' style='display:none'><a href='javascript:rfr_ghan_fetch_cos()' class='link'>Refresh</a><a href='javascript:update()' class='link'>Update</a></span></div>";
- }
- else if (all_data[0] == "<h5>Tone Configuration</h5>")
- {
- //var evr_data = (all_data[1]).split(",");
- document.getElementById('tab_data').innerHTML = all_data[1];
- //alert(evr_data[0]);
- //document.getElementById('data_update').innerHTML = evr_data[1];
- document.getElementById('contentboxhead').innerHTML = all_data[0] + "<div><span id='lrfr' style='display:inline'><a href='javascript:rfr_tone()' class='link'>Refresh</a><a href='javascript:update()' class='link'>Update</a></span></div>";
- $(document).ready(function(){
- $('tbody').addClass("ext"); // Add class "alt-row" to even table rows
- $('#body1 tr:even').addClass("alt-row1");
- $('#body1 tr:odd').addClass("ext");
- $('#body2 tr:even').addClass("alt-row1");
- $('#body2 tr:odd').addClass("ext");
- });
- }
- else if (all_data[0] == "<h5>Bill Calculation</h5>")
- {
- var evr_data = (all_data[1]).split(",");
- document.getElementById('tab_data').innerHTML = evr_data[0];
- //alert(evr_data[0]);
- document.getElementById('data_update').innerHTML = evr_data[1];
- document.getElementById('contentboxhead').innerHTML = all_data[0] + "<div><span id='lrfr' style='display:inline'><a href='javascript:get_bill()' class='link'>Refresh</a><a href='javascript:update()' class='link'>Update</a></span></div>";
- $(document).ready(function(){
- $('tbody').addClass("ext"); // Add class "alt-row" to even table rows
- $('#body1 tr:even').addClass("alt-row1");
- $('#body1 tr:odd').addClass("ext");
- $('#body2 tr:even').addClass("alt-row1");
- $('#body2 tr:odd').addClass("ext");
- });
- }
- else if (all_data[0] == "<h5>Wait Tone Table</h5>")
- {
- var evr_data = (all_data[1]).split(",");
- document.getElementById('tab_data').innerHTML = evr_data[0];
- //alert(evr_data[0]);
- document.getElementById('data_update').innerHTML = evr_data[1];
- document.getElementById('contentboxhead').innerHTML = all_data[0] + "<div><span id='lrfr' style='display:inline'><a href='javascript:get_wait()' class='link'>Refresh</a><a href='javascript:update()' class='link'>Update</a></span></div>";
- $(document).ready(function(){
- $('tbody').addClass("ext"); // Add class "alt-row" to even table rows
- $('#body1 tr:even').addClass("alt-row1");
- $('#body1 tr:odd').addClass("ext");
- $('#body2 tr:even').addClass("alt-row1");
- $('#body2 tr:odd').addClass("ext");
- });
- }
- else if (all_data[0] == "<h5>Gain Configuration</h5>")
- {
- var evr_data = (all_data[1]).split(",");
- document.getElementById('tab_data').innerHTML = evr_data[0];
- //alert(evr_data[0]);
- document.getElementById('data_update').innerHTML = evr_data[1];
- document.getElementById('contentboxhead').innerHTML = all_data[0] + "<div><a href='javascript:get_gain()' class='link'>Refresh</a></div>";
- select();
- $(document).ready(function(){
- $('tbody').addClass("ext"); // Add class "alt-row" to even table rows
- $('#body1 tr:even').addClass("alt-row1");
- $('#body1 tr:odd').addClass("ext");
- $('#body2 tr:even').addClass("alt-row1");
- $('#body2 tr:odd').addClass("ext");
- });
- }
- else if (all_data[0] == "<h5>Search</h5>")
- {
- //alert(all_data[1]);
- var evr_data = (all_data[1]).split(",");
- // alert(evr_data[1]);
- document.getElementById('tab_data').innerHTML = evr_data[0];
- document.getElementById('data_update').innerHTML = evr_data[1];
- document.getElementById('contentboxhead').innerHTML = all_data[0];
- }
- else if (all_data[0] == "<h5>CNRI Trunk</h5>")
- {
- var evr_data = (all_data[1]).split(",");
- document.getElementById('tab_data').innerHTML = evr_data[0];
- document.getElementById('data_update').innerHTML = evr_data[1];
- document.getElementById('contentboxhead').innerHTML = all_data[0];
- }
- else if (all_data[0] == "<h5>Dial Plan Search</h5>")
- {
- var evr_data = (all_data[1]).split(",");
- document.getElementById('tab_data').innerHTML = evr_data[0];
- document.getElementById('data_update').innerHTML = evr_data[1];
- document.getElementById('contentboxhead').innerHTML = all_data[0];
- // document.getElementById("usersubtype1").style.display = "none";
- // document.getElementById("usersubtype2").style.display = "none";
- }
- else if (all_data[0] == "<h5>Config Flex</h5>")
- {
- var evr_data = (all_data[1]).split(",");
- document.getElementById('tab_data').innerHTML = evr_data[0];
- //document.getElementById('data_update').innerHTML = evr_data[1];
- if(evr_data[1] == 1)
- {
- document.getElementById('contentboxhead').innerHTML = "<h5>Config Flex (Add)</h5>";
- document.getElementById("new3").style.display = "none";
- document.getElementById("new4").style.display = "none";
- document.getElementById("usersubtype1").style.display = "none";
- document.getElementById("usersubtype2").style.display = "none";
- }
- else if(evr_data[1] == 2)
- {
- document.getElementById('contentboxhead').innerHTML = "<h5>Config Flex (Delete)</h5>";
- document.getElementById("new3").style.display = "none";
- document.getElementById("new4").style.display = "none";
- document.getElementById("usersubtype1").style.display = "none";
- document.getElementById("usersubtype2").style.display = "none";
- }
- else if(evr_data[1] == 3)
- {
- //alert("MOdify");
- document.getElementById('contentboxhead').innerHTML = "<h5>Config Flex (Modify)</h5>";
- document.getElementById("usertype1").style.display = "none";
- document.getElementById("usertype2").style.display = "none";
- document.getElementById("sub1").style.display = "none";
- document.getElementById("sub2").style.display = "none";
- document.getElementById("sub3").style.display = "absolute";
- document.getElementById("sub4").style.display = "absolute";
- document.getElementById("new3").style.display = "absolute";
- document.getElementById("new4").style.display = "absolute";
- }
- //document.getElementById("usersubtype1").style.display = "none";
- //document.getElementById("usersubtype2").style.display = "none";
- }
- else if (all_data[0] == "<h5>ACD Group</h5>")
- {
- // alert("sid_acd");
- var evr_data = (all_data[1]).split(",");
- document.getElementById('tab_data').innerHTML = evr_data[0];
- document.getElementById('data_update').innerHTML = evr_data[1];
- document.getElementById('contentboxhead').innerHTML = all_data[0] + "<div><span id='lrfr'><a href='javascript:rfr_sid_fetch_acd()' class='link'>Refresh</a><a href='javascript:update_acd()' class='link'>Update</a></span></div>";
- document.getElementById("type").value = "ACD";
- }
- else if (all_data[0] == "<h5>ACD Group (Member)</h5>")
- {
- // alert("sid_acd");
- // var evr_data = (all_data[1]).split(",");
- document.getElementById('tab_data').innerHTML = all_data[1];
- //document.getElementById('data_update').innerHTML = all_data[2];
- document.getElementById('contentboxhead').innerHTML = all_data[0] + "<div><span id='lrfr' style='display:inline'><a href='javascript:add_acd()' class='link'>Add</a><a href='javascript:rfr_sid_fetch_acd()' class='link'>Refresh</a><a href='javascript:update_acd()' class='link'>Update</a></span></div>";
- $(document).ready(function(){
- $('tbody').addClass("ext"); // Add class "alt-row" to even table rows
- $('#body1 tr:even').addClass("alt-row1");
- $('#body1 tr:odd').addClass("ext");
- $('#body2 tr:even').addClass("alt-row1");
- $('#body2 tr:odd').addClass("ext");
- });
- }
- else if (all_data[0] == "<h5>ACD Group (Member ADD)</h5>")
- {
- // alert("sid_acd");
- // var evr_data = (all_data[1]).split(",");
- //document.getElementById('tab_data').innerHTML = all_data[2];
- document.getElementById('tab_data').innerHTML = all_data[1];
- document.getElementById('contentboxhead').innerHTML = all_data[0] + "<div><span id='lrfr' style='display:inline'><a href='javascript:rfr_sid_fetch_acd()' class='link'>Back</a><a href='javascript:update_acdmem()' class='link'>Update</a></span></div>";
- }
- else if (all_data[0] == "<h5>Boss Group (Member ADD)</h5>")
- {
- // alert("sid_acd");
- // var evr_data = (all_data[1]).split(",");
- //document.getElementById('tab_data').innerHTML = all_data[2];
- document.getElementById('tab_data').innerHTML = all_data[1];
- document.getElementById('contentboxhead').innerHTML = all_data[0] + "<div><span id='lrfr' style='display:inline'><a href='javascript:rfr_sid_fetch_bgrp()' class='link'>Back</a></span></div>"; //| <a href='javascript:update_acd()'>Update</a>
- }
- else if (all_data[0] == "<h5>Boss Group</h5>")
- {
- //alert("Boss Group Called");
- var evr_data = (all_data[1]).split(",");
- document.getElementById('tab_data').innerHTML = evr_data[0];
- document.getElementById('data_update').innerHTML = evr_data[1];
- document.getElementById('contentboxhead').innerHTML = all_data[0] ;
- }
- else if(all_data[0] == "<h5>Boss Group (Access Code)</h5>")
- {
- //alert(all_data[1]);
- var evr_data = all_data[1];
- document.getElementById('tab_data').innerHTML = evr_data;
- //document.getElementById('data_update').innerHTML = evr_data[1];
- document.getElementById('contentboxhead').innerHTML = all_data[0] + "<div><span id='lrfr'><a href='javascript:rfr_sid_fetch_bgrp()' class='link'>Refresh</a><a href='javascript:update_acc()' class='link'>Update</a></span></div>";
- $(document).ready(function(){
- $('tbody').addClass("ext"); // Add class "alt-row" to even table rows
- $('#body1 tr:even').addClass("alt-row1");
- $('#body1 tr:odd').addClass("ext");
- $('#body2 tr:even').addClass("alt-row1");
- $('#body2 tr:odd').addClass("ext");
- });
- }
- else if(all_data[0] == "<h5>Boss Group (Member)</h5>")
- {
- //alert(all_data[1]);
- var evr_data = all_data[1];
- document.getElementById('tab_data').innerHTML = evr_data;
- //document.getElementById('data_update').innerHTML = evr_data[1];
- document.getElementById('contentboxhead').innerHTML = all_data[0] + "<div><span id='lrfr'><a href='javascript:rfr_sid_fetch_bgrp()' class='link'>Refresh</a><a href='javascript:add_bgrp()' class='link'>Add</a></span></div>"; // <a href='javascript:update_acd()'>Update</a> |
- $(document).ready(function(){
- $('tbody').addClass("ext"); // Add class "alt-row" to even table rows
- $('#body1 tr:even').addClass("alt-row1");
- $('#body1 tr:odd').addClass("ext");
- $('#body2 tr:even').addClass("alt-row1");
- $('#body2 tr:odd').addClass("ext");
- });
- }
- else if(all_data[0] == "<h5>ACD Parameters</h5>")
- {
- //alert(all_data[1]);
- var evr_data = all_data[1];
- document.getElementById('tab_data').innerHTML = evr_data;
- //document.getElementById('data_update').innerHTML = evr_data[1];
- document.getElementById('contentboxhead').innerHTML = all_data[0] + "<div><span id='lrfr' style='display:inline'><a href='javascript:rfr_sid_fetch_acd()' class='link'>Refresh</a><a href='javascript:update_acd()' class='link'>Update</a></span></div>";
- select();
- $(document).ready(function(){
- $('tbody').addClass("ext"); // Add class "alt-row" to even table rows
- $('#body1 tr:even').addClass("alt-row1");
- $('#body1 tr:odd').addClass("ext");
- $('#body2 tr:even').addClass("alt-row1");
- $('#body2 tr:odd').addClass("ext");
- });
- }
- else if (all_data[0] == "<h5>NTP</h5>")
- {
- document.getElementById("conff").innerHTML = null;
- var evr_data = all_data[1].split('*');
- document.getElementById("configtab").innerHTML = evr_data[0];
- process = evr_data[1].replace(/^\s+|\s+$/g,'');
- document.getElementById("lich").innerHTML = evr_data[2];
- if(ntpval)
- {
- var val = ntpval.split(':');
- for(i=0;i<10;i++)
- document.getElementById("net_"+i).value = val[i];
- }
- else
- {
- ntpoldval = null;
- for(i=0;i<10;i++)
- {
- if(ntpoldval == null)
- ntpoldval = document.getElementById("net_"+i).value;
- else
- ntpoldval += "|"+document.getElementById("net_"+i).value;
- }
- }
- }
- else if( all_data[0] == "<h5>Getstart</h5>")
- {
- document.getElementById("conff").innerHTML = null;
- document.getElementById("configtab").innerHTML = all_data[1];
- }
- else if( all_data[0] == "<h5>HA Confstart</h5>")
- {
- document.getElementById("conff").innerHTML = null;
- document.getElementById("configtab").innerHTML = all_data[1];
- }
- else if(all_data[0] == "<h5>allsetin</h5>")
- {
- document.getElementById("confirmdata").innerHTML = all_data[1];
- document.getElementById("close").style.display = "none";
- document.getElementById("confirmtab").style.display = "inline";
- select();
- }
- else if(all_data[0] == "<h5>ACD Resource</h5>")
- {
- //alert(all_data[1]);
- var evr_data = all_data[1];
- document.getElementById('tab_data').innerHTML = evr_data;
- //document.getElementById('data_update').innerHTML = evr_data[1];
- document.getElementById('contentboxhead').innerHTML = all_data[0] + "<div><span id='lrfr' style='display:inline'><a href='javascript:rfr_sid_fetch_acd()' class='link'>Refresh</a><a href='javascript:update_res()' class='link'>Update</a></span></div>";
- $(document).ready(function(){
- $('tbody').addClass("ext"); // Add class "alt-row" to even table rows
- $('#body1 tr:even').addClass("alt-row1");
- $('#body1 tr:odd').addClass("ext");
- $('#body2 tr:even').addClass("alt-row1");
- $('#body2 tr:odd').addClass("ext");
- });
- }
- else if(all_data[0] == "<h5>DCMD Configuration</h5>")
- {
- //alert(all_data[1]);
- var evr_data = all_data[1];
- document.getElementById('tab_data').innerHTML = evr_data;
- //document.getElementById('data_update').innerHTML = evr_data[1];
- document.getElementById('contentboxhead').innerHTML = all_data[0] + "<div><span id='lrfr' style='display:inline'><a href='javascript:get_dcmd()' class='link'>Refresh</a><a href='javascript:update()' class='link'>Update</a></span></div>";
- $(document).ready(function(){
- $('tbody').addClass("ext"); // Add class "alt-row" to even table rows
- $('#body1 tr:even').addClass("alt-row1");
- $('#body1 tr:odd').addClass("ext");
- $('#body2 tr:even').addClass("alt-row1");
- $('#body2 tr:odd').addClass("ext");
- });
- }
- else if(all_data[0] == "<h5>TDM Interface</h5>")
- {
- //alert(all_data[0]);
- //alert(all_data[1]);
- var evr_data = all_data[1];
- document.getElementById('tab_data').innerHTML = evr_data;
- document.getElementById('contentboxhead').innerHTML = all_data[0] +
- "<div><span id='lrfr' style='display:inline'> "
- + "<a href='javascript:get_card()' class='link'>Refresh</a> "
- + "</span></div>";
- $(document).ready(function(){
- $('tbody').addClass("ext"); // Add class "alt-row" to even table rows
- $('#body1 tr:even').addClass("alt-row1");
- $('#body1 tr:odd').addClass("ext");
- $('#body2 tr:even').addClass("alt-row1");
- $('#body2 tr:odd').addClass("ext");
- });
- }
- else if (all_data[0] == "<h5>tdm_card</h5>") // Showing Card Details, i.e. Ports of the card.
- {
- //var evr_data = (all_data[1]).split(",");
- var evr_data = all_data[1];
- //var cardSelected = document.getElementById('nsbCardNo');Card Number
- //alert(cardSelected);
- document.getElementById('tab_data').innerHTML = evr_data;
- document.getElementById('contentboxhead').innerHTML = "<H5>Card Number</H5>" +
- "<div> "
- //+ links
- + "<a href=\"javascript:getCard();\" class='link'>Back</a>"
- + "</div>";
- $(document).ready(function(){
- $('tbody').addClass("ext"); // Add class "alt-row" to even table rows
- $('#body1 tr:even').addClass("alt-row1");
- $('#body1 tr:odd').addClass("ext");
- $('#body2 tr:even').addClass("alt-row1");
- $('#body2 tr:odd').addClass("ext");
- });
- }
- else if (all_data[0] == "<h5>Card Number</h5>") // Show Card Page
- {
- //alert(all_data[1]);
- var evr_data = (all_data[1]).split(",");
- // var data = "<div><h5>Card Number</h5></div>"
- document.getElementById('tab_data').innerHTML = evr_data[0];
- document.getElementById('data_update').innerHTML = evr_data[1];
- document.getElementById('contentboxhead').innerHTML = "<H5>Card Number</H5>" +
- "<div> "
- //+ links
- + "<a href=\"javascript:add_card()\" class='link'>New Card</a>"
- + "<a href=\"javascript:getCard()\" class='link'>Refresh</a>"
- + "</div>";
- }
- else if (all_data[0] == "tdm_port")
- {
- document.getElementById("tab_data").innerHTML = all_data[1];
- select();
- $(document).ready(function(){
- $('tbody').addClass("ext"); // Add class "alt-row" to even table rows
- $('#body1 tr:even').addClass("alt-row1");
- $('#body1 tr:odd').addClass("ext");
- $('#body2 tr:even').addClass("alt-row1");
- $('#body2 tr:odd').addClass("ext");
- });
- }
- else if (all_data[0] == "<h5>Backup</h5>")
- {
- var evr_data = (all_data[1]).split(",");
- // alert(evr_data[1]);
- document.getElementById('tab_data').innerHTML = evr_data[0];
- document.getElementById('data_update').innerHTML = evr_data[1];
- //document.getElementById('contentboxhead').innerHTML = all_data[0];
- }
- else if (all_data[0] == "<h5>Restore</h5>")
- {
- //alert(all_data[1]);
- var evr_data = (all_data[1]).split(",");
- // alert(evr_data[1]);
- if(all_data[1] == "")
- {
- document.getElementById('tab_data').innerHTML = "Backup file not fond!!!";
- }
- else
- {
- document.getElementById('tab_data').innerHTML = all_data[1];
- }
- }
- else if(all_data[0] == "<h5>CCMD Configuration</h5>")
- {
- //alert(all_data[1]);
- var evr_data = all_data[1];
- document.getElementById('tab_data').innerHTML = evr_data;
- //document.getElementById('data_update').innerHTML = evr_data[1];
- document.getElementById('contentboxhead').innerHTML = all_data[0] + "<div><span id='lrfr' style='display:inline'><a href='javascript:get_ccmd()' class='link'>Refresh</a><a href='javascript:update()' class='link'>Update</a></span></div>";
- $(document).ready(function(){
- $('tbody').addClass("ext"); // Add class "alt-row" to even table rows
- $('#body1 tr:even').addClass("alt-row1");
- $('#body1 tr:odd').addClass("ext");
- $('#body2 tr:even').addClass("alt-row1");
- $('#body2 tr:odd').addClass("ext");
- });
- }
- else if(all_data[0] == "confirmshow")
- {
- //alert(httpObject.responseText);
- //document.getElementById("contentconfig").style.opacity = "0.7";
- //document.getElementById("contentconfig").style.filter= "alpha(opacity=70)";
- //salert(all_data[1]);
- var evr_data = (all_data[1]).split("*");
- visible = null;
- visible = evr_data[1];
- document.getElementById("confirmdata").innerHTML = evr_data[0];
- document.getElementById("close").style.display = "none";
- document.getElementById("confirmtab").style.display = "inline";
- //alert(rsuchange[1]);
- for(i=0;i<64;i++)
- {
- if(rsuchange[i])
- {
- document.getElementById(rsuchange[i]).style.opacity = "1.0";
- }
- }
- select();
- if(process == "i686")
- {
- if(visible == 1)
- {
- var old = ntpoldval+"|"+licoldval+"|"+pmoldval;
- var oldval = old.split("|");
- for(i=0;i<18;i++)
- {
- var s = document.getElementById("conf_"+(i+2));
- if(s.value == oldval[i])
- { s.name = "nochnge"; }
- else
- { s.name = "changed"; }
- }
- }
- else if(visible == 0)
- {
- var old = ntpoldval;
- var oldval = old.split("|");
- for(i=0;i<10;i++)
- {
- var s = document.getElementById("conf_"+(i+2));
- if(s.value == oldval[i])
- { s.name = "nochnge"; }
- else
- { s.name = "changed"; }
- }
- }
- }
- else /*if(process == "ppc")*/
- {
- var old = ntpoldval+"|"+pmoldval;
- var oldval = old.split("|");
- for(i=0;i<14;i++)
- {
- if(i<10)
- var s = document.getElementById("conf_"+(i+2));
- else
- var s = document.getElementById("conf_"+(i+6));
- if(s.value == oldval[i])
- {
- s.name = "nochnge";
- }
- else
- {
- s.name = "changed";
- }
- }
- }
- }
- else if (all_data[0] == "fghan_cos")
- {
- document.getElementById("tab_data").innerHTML = all_data[1];
- $(document).ready(function(){
- $('tbody').addClass("ext"); // Add class "alt-row" to even table rows
- $('#body1 tr:even').addClass("alt-row1");
- $('#body1 tr:odd').addClass("ext");
- $('#body2 tr:even').addClass("alt-row1");
- $('#body2 tr:odd').addClass("ext");
- });
- }
- else if (all_data[0] == "<h5>Protocol Configuration</h5>")
- {
- document.getElementById("tab_data").innerHTML = all_data[1];
- document.getElementById('contentboxhead').innerHTML = all_data[0] + "<div><span id='lrfr' style='display:inline'><a href='javascript:rfr_proto()' class='link'>Refresh</a><a href='javascript:updateproto()' class='link'>Update</a></span></div>";
- select();
- $(document).ready(function(){
- $('tbody').addClass("ext"); // Add class "alt-row" to even table rows
- $('#body1 tr:even').addClass("alt-row1");
- $('#body1 tr:odd').addClass("ext");
- $('#body2 tr:even').addClass("alt-row1");
- $('#body2 tr:odd').addClass("ext");
- });
- }
- else if (all_data[0] == "<h5>Protocol Timers</h5>")
- {
- document.getElementById("tab_data").innerHTML = all_data[1];
- document.getElementById('contentboxhead').innerHTML = all_data[0] + "<div><span id='lrfr' style='display:inline'><a href='javascript:rfr_proto()' class='link'>Refresh</a><a href='javascript:updateTimer()' class='link'>Update</a></span></div>";
- $(document).ready(function(){
- $('tbody').addClass("ext"); // Add class "alt-row" to even table rows
- $('#body1 tr:even').addClass("alt-row1");
- $('#body1 tr:odd').addClass("ext");
- $('#body2 tr:even').addClass("alt-row1");
- $('#body2 tr:odd').addClass("ext");
- });
- }
- else if (all_data[0] == "set_cos")
- {
- document.getElementById("tab_data").innerHTML = "";
- if(all_data[1])
- sucs_notify(all_data[1])
- else
- {
- var err = all_data[1].split(",");
- var errn = null;
- for(i =0 ; i < err.length; i++)
- {
- if(errn == null)
- errn = "Set operation failed for "+err[i]+"\n";
- else
- errn = errn+"|"+"Set operation failed for "+err[i]+"\n";
- }
- //alert(errn);
- }
- g_cos();
- $(document).ready(function(){
- $('tbody').addClass("ext"); // Add class "alt-row" to even table rows
- $('#body1 tr:even').addClass("alt-row1");
- $('#body1 tr:odd').addClass("ext");
- $('#body2 tr:even').addClass("alt-row1");
- $('#body2 tr:odd').addClass("ext");
- });
- }
- else if (all_data[0] == "set_grp")
- {
- document.getElementById("tab_data").innerHTML = "";
- if(all_data[1].length < 1)
- sucs_notify("COS tables have been updated successfully!");
- else
- {
- var err = all_data[1].split(",");
- var errn = null;
- for(i =0 ; i < err.length; i++)
- {
- if(errn == null)
- errn = "Set operation failed for "+err[i]+"\n";
- else
- errn = errn+"|"+"Set operation failed for "+err[i]+"\n";
- }
- //alert(errn);
- //alert(all_data[1]);
- }
- g_net();
- }
- else if (all_data[0] == "<h5>Feature Numbering Plan</h5>")
- {
- var evr_data = (all_data[1]).split(",");
- document.getElementById('tab_data').innerHTML = evr_data[0];
- document.getElementById('data_update').innerHTML = evr_data[1];
- document.getElementById('contentboxhead').innerHTML = all_data[0] + "<div><span id='lrfrfeat' style='display:none'><a href='javascript:rfr_sid_fetch_feat()' class='link'>Refresh</a><a href='javascript:go_feat()' class='link'>Update</a></span></div>";
- }
- else if (all_data[0] == "fsid_feat")
- {
- var evr_data = (all_data[1]).split(",");
- document.getElementById("tab_data").innerHTML = evr_data[0];
- document.getElementById('data_update').innerHTML = evr_data[1];
- document.getElementById('contentboxhead').innerHTML = "<h5>Feature Numbering Plan</h5>" + "<div><span id='lrfrfeat' ><a href='javascript:sid_feat()' class='link'>Refresh</a><a href='javascript:go_feat()' class='link'>Update</a></span></div>";
- $(document).ready(function(){
- $('tbody').addClass("ext"); // Add class "alt-row" to even table rows
- $('#body1 tr:even').addClass("alt-row1");
- $('#body1 tr:odd').addClass("ext");
- $('#body2 tr:even').addClass("alt-row1");
- $('#body2 tr:odd').addClass("ext");
- });
- }
- else if (all_data[0] == "<h5>Duplicate Numbering Plan</h5>")
- {
- var evr_data = (all_data[1]).split("`");
- document.getElementById('tab_data').innerHTML = evr_data[0];
- document.getElementById('data_update').innerHTML = evr_data[1];
- document.getElementById('contentboxhead').innerHTML = all_data[0] + "<div><span id='lrfr'><a href='javascript:rfr_sid_fetch_dup()' class='link'>Refresh</a><a href='javascript:show_add()' class='link'>Add</a></span></div>";
- $(document).ready(function(){
- $('tbody').addClass("ext"); // Add class "alt-row" to even table rows
- $('#body1 tr:even').addClass("alt-row1");
- $('#body1 tr:odd').addClass("ext");
- $('#body2 tr:even').addClass("alt-row1");
- $('#body2 tr:odd').addClass("ext");
- });
- }
- else if (all_data[0] == "<h5>Enblock Table</h5>")
- {
- var evr_data = (all_data[1]).split("`");
- document.getElementById('tab_data').innerHTML = evr_data[0];
- document.getElementById('data_update').innerHTML = evr_data[1];
- document.getElementById('contentboxhead').innerHTML = all_data[0] + "<div><span id='lrfr'><a href='javascript:get_enblock()' class='link'>Refresh</a><a href='javascript:show_add()' class='link'>Add</a></span></div>";
- $(document).ready(function(){
- $('tbody').addClass("ext"); // Add class "alt-row" to even table rows
- $('#body1 tr:even').addClass("alt-row1");
- $('#body1 tr:odd').addClass("ext");
- $('#body2 tr:even').addClass("alt-row1");
- $('#body2 tr:odd').addClass("ext");
- });
- }
- else if (all_data[0] == "GODUP")
- {
- //alert("i am in set output duplicate!");
- if(all_data[1] == "No Changes Encountered!")
- {
- info_notify(all_data[1]);
- sid_dup();
- }
- else
- {
- sucs_notify(all_data[1]);
- sid_dup();
- }
- }
- else if (all_data[0] == "<h5>Backup</h5>")
- {
- var evr_data = (all_data[1]).split(",");
- // alert(evr_data[1]);
- document.getElementById('tab_data').innerHTML = evr_data[0];
- document.getElementById('data_update').innerHTML = evr_data[1];
- //document.getElementById('contentboxhead').innerHTML = all_data[0];
- }
- else if (all_data[0] == "<h5>Restore</h5>")
- {
- //alert(all_data[1]);
- var evr_data = (all_data[1]).split(",");
- // alert(evr_data[1]);
- if(all_data[1] == "")
- {
- document.getElementById('tab_data').innerHTML = "Backup file not fond!!!";
- }
- else
- {
- document.getElementById('tab_data').innerHTML = all_data[1];
- }
- }
- else if (all_data[0] == "<h5>DID Group</h5>")
- {
- var evr_data = (all_data[1]).split(",");
- document.getElementById('tab_data').innerHTML = evr_data[0];
- document.getElementById('data_update').innerHTML = evr_data[1];
- document.getElementById('contentboxhead').innerHTML = all_data[0] + "<div><span id='lrfr'><a href='javascript:rfr_sid_fetch_did()' class='link'>Refresh</a><a href='javascript:go_did()' class='link'>Update</a></span></div>";
- }
- else if (all_data[0] == "fsid_did")
- {
- document.getElementById("tab_data").innerHTML = all_data[1];
- select();
- $(document).ready(function(){
- $('tbody').addClass("ext"); // Add class "alt-row" to even table rows
- $('#body1 tr:even').addClass("alt-row1");
- $('#body1 tr:odd').addClass("ext");
- $('#body2 tr:even').addClass("alt-row1");
- $('#body2 tr:odd').addClass("ext");
- });
- }
- else if (all_data[0] == "<h5>DID Members</h5>")
- {
- document.getElementById("tab_data").innerHTML = all_data[1];
- $(document).ready(function(){
- $('tbody').addClass("ext"); // Add class "alt-row" to even table rows
- $('#body1 tr:even').addClass("alt-row1");
- $('#body1 tr:odd').addClass("ext");
- $('#body2 tr:even').addClass("alt-row1");
- $('#body2 tr:odd').addClass("ext");
- });
- }
- else if (all_data[0] == "<h5>DOD Members</h5>")
- {
- document.getElementById("tab_data").innerHTML = all_data[1];
- //document.getElementById("contentboxhead").innerHTML = all_data[0];
- $(document).ready(function(){
- $('tbody').addClass("ext"); // Add class "alt-row" to even table rows
- $('#body1 tr:even').addClass("alt-row1");
- $('#body1 tr:odd').addClass("ext");
- $('#body2 tr:even').addClass("alt-row1");
- $('#body2 tr:odd').addClass("ext");
- });
- }
- else if(all_data[0] == "SETDID")
- {
- //alert(httpObject.responseText);
- if(all_data[1] == "No Changes Encountered!")
- {
- info_notify(all_data[1]);
- rfr_sid_fetch_did();
- }
- else
- {
- sucs_notify(all_data[1]);
- rfr_sid_fetch_did();
- }
- }
- else if(all_data[0] == "SETGAIN")
- {
- //alert(httpObject.responseText);
- if(all_data[1] == "No Changes Encountered!")
- {
- info_notify(all_data[1]);
- //get_gain();
- }
- else
- {
- info_notify(all_data[1]);
- //sucs_notify_gain(all_data[1]);
- //get_gain();
- }
- }
- else if(all_data[0] == "SETDOD")
- {
- //alert(httpObject.responseText);
- if(document.getElementById("type").value == "DOD")
- gobj = 0;
- else if(document.getElementById("type").value == "VOIP")
- gobj = 1;
- else if(document.getElementById("type").value == "H")
- gobj = 2;
- if(all_data[1] == "No Changes Encountered!")
- {
- info_notify(all_data[1]);
- col_medod(gobj);
- }
- else
- {
- sucs_notify(all_data[1]);
- col_medod(gobj);
- }
- }
- else if (all_data[0] == "maskval")
- {
- var evr_data = all_data[1].split('^');
- var valid = evr_data[1].replace(/^\s+|\s+$/g,'');
- if(valid == "false")
- {
- document.getElementById(evr_data[0]).style.border = "1px solid #FF0000";
- document.getElementById("cross"+evr_data[0]).style.display="inline";
- document.getElementById(evr_data[0]).name = "no";
- }
- else
- {
- document.getElementById(evr_data[0]).style.border = "0px solid";
- document.getElementById('cross'+evr_data[0]).style.display = "none";
- document.getElementById(evr_data[0]).title = document.getElementById(evr_data[0]).value;
- document.getElementById(evr_data[0]).name = "ok";
- }
- }
- else if (all_data[0] == $)
- {
- alert(all_data[1]);
- }
- else if(all_data[0] == "LicRead")
- {
- var evr_data = all_data[1].split('*');
- if(evr_data[0] == 0)
- {
- alert("licence not found");
- }
- else if(evr_data[0] == 1)
- {
- alert("Dongle not connected");
- document.getElementById("confirmrsu").innerHTML = evr_data[1];
- document.getElementById("confirmrsu").style.display = "inline";
- }
- else if(evr_data[0] == 2)
- {
- alert("Licence expired");
- document.getElementById("confirmrsu").innerHTML = evr_data[1];
- document.getElementById("confirmrsu").style.display = "inline";
- }
- }
- else if(all_data[0] == "clockset")
- {
- document.getElementById("setclk").style.display = "none";
- }
- else if(all_data[0] == "NTPCONF")
- {
- apply_notify(all_data[1]);
- if(visible == 0)
- waittorestart();
- else if(visible == 1)
- licence_apply();
- }
- else if(all_data[0] == "NETCONF")
- {
- apply_notify(all_data[1]);
- ntpd_apply();
- }
- else if(all_data[0] == "endrestart")
- {
- apply_notify(all_data[1]);
- }
- else if (all_data[0] == "STARTSET")
- {
- apply_notify(all_data[1]);
- }
- else if (all_data[0] == "ipCheck")
- { var sh_data = (all_data[1]).split(",");
- document.getElementById(sh_data[1]).style.border = "1px solid #FF0000";
- document.getElementById("cross"+sh_data[1]).style.display="inline";
- document.getElementById(sh_data[1]).name = "no";
- }
- else if (all_data[0] == "valtoname")
- {
- //alert(all_data[1]);
- var x = all_data[1].replace(/^\s+|\s+$/g,'');
- document.getElementById(x).title = document.getElementById(x).value;
- document.getElementById(x).name = "ok";
- document.getElementById(x).style.border = "0px solid";
- document.getElementById('cross'+x).style.display = "none";
- }
- else if(all_data[0] == "Restart")
- {
- apply_restart(all_data[1],"System needs to reboot! reboot now");
- }
- else if(all_data[0] == "sys_reboot")
- {
- //apply_restart(all_data[1],"STSTEM REBOOT REQUEST");
- document.getElementById("tab_data").innerHTML = all_data[1];
- defaultstart();
- }
- else if(all_data[0] == "sys_commit_wait")
- {
- //apply_restart(all_data[1],"STSTEM REBOOT REQUEST");
- document.getElementById("tab_data").innerHTML = all_data[1];
- defaultstart();
- }
- else if (all_data[0] == "Liceexp")
- {
- document.getElementById("licinfo").style.display = "inline";
- }
- else if (all_data[0] == "fsid_dod")
- {
- //all_data[0] = null;
- document.getElementById("tab_data").innerHTML = all_data[1];
- //document.getElementById('contentboxhead').innerHTML += "<div class='link'><span id='lrfr' style='display:none'><a href='javascript:rfr_sid_fetch_dod()'>Refresh</a> | <a href='javascript:go_dod()'>Update</a></span></div>";
- select();
- $(document).ready(function(){
- $('tbody').addClass("ext"); // Add class "alt-row" to even table rows
- $('#body1 tr:even').addClass("alt-row1");
- $('#body1 tr:odd').addClass("ext");
- $('#body2 tr:even').addClass("alt-row1");
- $('#body2 tr:odd').addClass("ext");
- });
- }
- else if (all_data[0] == "<h5>DOD Group</h5>")
- {
- //alert(all_data[0]);
- var evr_data = (all_data[1]).split(",");
- document.getElementById('tab_data').innerHTML = evr_data[0];
- document.getElementById('data_update').innerHTML = evr_data[1];
- document.getElementById('contentboxhead').innerHTML = all_data[0] + "<div><span id='lrfr'><a href='javascript:rfr_sid_fetch_dod()' class='link'>Refresh</a><a href='javascript:go_dod()' class='link'>Update</a></span></div>";
- }
- else if (all_data[0] == "<h5>Allowed Table</h5>")
- {
- var evr_data = (all_data[1]).split(",");
- document.getElementById('tab_data').innerHTML = evr_data[0];
- document.getElementById('data_update').innerHTML = evr_data[1];
- document.getElementById('contentboxhead').innerHTML = all_data[0] + "<div><span id='lrfr'><a href='javascript:rfr_allwdtable()' class='link'>Refresh</a><a href='javascript:add_allwd()' class='link'>Add</a></span></div>";
- $(document).ready(function(){
- $('tbody').addClass("ext"); // Add class "alt-row" to even table rows
- $('#body1 tr:even').addClass("alt-row1");
- $('#body1 tr:odd').addClass("ext");
- $('#body2 tr:even').addClass("alt-row1");
- $('#body2 tr:odd').addClass("ext");
- });
- }
- else if (all_data[0] == "<h5>Set Allowed Table</h5>")
- {
- //alert("__"+all_data[1]);
- //var evr_data = (all_data[1]).split(",");
- //document.getElementById('tab_data').innerHTML = evr_data[0];
- //document.getElementById('data_update').innerHTML = evr_data[1];
- //document.getElementById('contentboxhead').innerHTML = all_data[0] + "<div class='link'><span id='lrfr' style='display:none'><a href='javascript:rfr_allwdtable()' >Refresh</a> | <a href='javascript:add_allwd()'>Add</a></span></div>";
- fetch_allwdnum();
- }
- else if (all_data[0] == "<h5>Allowed Table Configuration</h5>")
- {
- //alert(all_data[1]);
- //var evr_data = (all_data[1]).split(",");
- //document.getElementById('tab_data').innerHTML = evr_data[0];
- document.getElementById('tab_data').innerHTML = all_data[1];
- document.getElementById('contentboxhead').innerHTML = all_data[0] + "<div><span id='lrfr' style='display:inline'><a href='javascript:fetch_allwdnum()' class='link'>Refresh</a><a href='javascript:add_allwd()' class='link'>Add</a></span></div>";
- //alert("done");
- $(document).ready(function(){
- $('tbody').addClass("ext"); // Add class "alt-row" to even table rows
- $('#body1 tr:even').addClass("alt-row1");
- $('#body1 tr:odd').addClass("ext");
- $('#body2 tr:even').addClass("alt-row1");
- $('#body2 tr:odd').addClass("ext");
- });
- }
- else if (all_data[0] == "<h5>Denied Table</h5>")
- {
- var evr_data = (all_data[1]).split(",");
- document.getElementById('tab_data').innerHTML = evr_data[0];
- document.getElementById('data_update').innerHTML = evr_data[1];
- document.getElementById('contentboxhead').innerHTML = all_data[0] + "<div><span id='lrfr' style='display:none'><a href='javascript:rfr_allwdtable()' class='link'>Refresh</a><a href='javascript:add_allwd()' class='link'>Add</a></span></div>";
- $(document).ready(function(){
- $('tbody').addClass("ext"); // Add class "alt-row" to even table rows
- $('#body1 tr:even').addClass("alt-row1");
- $('#body1 tr:odd').addClass("ext");
- $('#body2 tr:even').addClass("alt-row1");
- $('#body2 tr:odd').addClass("ext");
- });
- }
- else if (all_data[0] == "<h5>Set Denied Table</h5>")
- {
- //alert("__"+all_data[1]);
- //var evr_data = (all_data[1]).split(",");
- //document.getElementById('tab_data').innerHTML = evr_data[0];
- //document.getElementById('data_update').innerHTML = evr_data[1];
- //document.getElementById('contentboxhead').innerHTML = all_data[0] + "<div class='link'><span id='lrfr' style='display:none'><a href='javascript:rfr_allwdtable()' >Refresh</a> | <a href='javascript:add_allwd()'>Add</a></span></div>";
- fetch_dendnum();
- }
- else if (all_data[0] == "<h5>Denied Table Configuration</h5>")
- {
- //alert("i am an idiot");
- //var evr_data = (all_data[1]).split(",");
- //document.getElementById('tab_data').innerHTML = evr_data[0];
- document.getElementById('tab_data').innerHTML = all_data[1];
- document.getElementById('contentboxhead').innerHTML = all_data[0] + "<div><span id='lrfr' style='display:inline'><a href='javascript:fetch_dendnum()' class='link'>Refresh</a><a href='javascript:add_dend()' class='link'>Add</a></span></div>";
- $(document).ready(function(){
- $('tbody').addClass("ext"); // Add class "alt-row" to even table rows
- $('#body1 tr:even').addClass("alt-row1");
- $('#body1 tr:odd').addClass("ext");
- $('#body2 tr:even').addClass("alt-row1");
- $('#body2 tr:odd').addClass("ext");
- });
- //alert("done");
- }
- else if (all_data[0] == "<h5>nochange</h5>")
- {
- document.getElementById("con").style.display = "none";
- alert(all_data[1]);
- }
- //Added by Anuja
- else if(all_data[0] == "<h5>Date And Time</h5>")
- {
- /*var evr_data = (all_data[1]).split(",");
- document.getElementById('tab_data').innerHTML = evr_data[0];
- document.getElementById('data_update').innerHTML = evr_data[1];
- document.getElementById('contentboxhead').innerHTML = all_data[0] + "<div class='link'><span id='lrfrfeat' style='display:none'><a href='javascript:rfr_sid_fetch_feat()' >Refresh</a> | <a href='javascript:go_feat()'>Update</a></span></div>";
- */
- document.getElementById('data_update').innerHTML = "<span> </span>";
- //alert(all_data[1]);
- document.getElementById('tab_data').innerHTML = all_data[1];
- document.getElementById('contentboxhead').innerHTML = all_data[0]+"<div><a href='javascript:date_time()' class='link'>Refresh</a><a href='javascript:set_time_zone()' class='link'>Update</a></div>";
- $(document).ready(function(){
- $('tbody').addClass("ext"); // Add class "alt-row" to even table rows
- $('#body1 tr:even').addClass("alt-row1");
- $('#body1 tr:odd').addClass("ext");
- $('#body2 tr:even').addClass("alt-row1");
- $('#body2 tr:odd').addClass("ext");
- });
- }
- else if(all_data[0] == "setDateTime")
- {
- //alert(all_data[1]);
- date_time();
- }
- else if(all_data[0] == "set_lic_conf_out")
- {
- //alert(all_data[1]);
- lic_conf();
- }
- else if(all_data[0] == "ipCheck_sys")
- {
- var sh_data = (all_data[1]).split(",");
- //alert(sh_data[1]);
- document.getElementById("lic_1").style.border = "1px solid #FF0000";
- document.getElementById("cross"+sh_data[1]).style.display="inline";
- document.getElementById(sh_data[1]).name = "no";
- }
- else if(all_data[0] == "valtoname_sys")
- {
- var x = all_data[1].replace(/^\s+|\s+$/g,'');
- document.getElementById(x).title = document.getElementById(x).value;
- document.getElementById(x).name = "ok";
- document.getElementById(x).style.border = "0px solid";
- document.getElementById('cross'+x).style.display = "none";
- }
- else if(all_data[0] == "<h5>Configuration</h5>")
- {
- document.getElementById('data_update').innerHTML = "<span> </span>";
- document.getElementById('tab_data').innerHTML = all_data[1];
- document.getElementById('contentboxhead').innerHTML = all_data[0]+"<div><a href='javascript:ip_conf()' class='link'>Refresh</a><a href='javascript:set_ip_conf()' class='link'>Update</a></div>";
- $(document).ready(function(){
- $('tbody').addClass("ext"); // Add class "alt-row" to even table rows
- $('#body1 tr:even').addClass("alt-row1");
- $('#body1 tr:odd').addClass("ext");
- $('#body2 tr:even').addClass("alt-row1");
- $('#body2 tr:odd').addClass("ext");
- });
- }
- else if(all_data[0] == "<h5>System Settings</h5>")
- {
- document.getElementById('data_update').innerHTML = all_data[1];
- document.getElementById('tab_data').innerHTML = all_data[2];
- document.getElementById('contentboxhead').innerHTML = all_data[0]+"<div><a href='javascript:ip_conf()' class='link'>Refresh</a><a href='javascript:set_ip_conf()' class='link'>Update</a></div>";
- $(document).ready(function(){
- $('tbody').addClass("ext"); // Add class "alt-row" to even table rows
- $('#body1 tr:even').addClass("alt-row1");
- $('#body1 tr:odd').addClass("ext");
- $('#body2 tr:even').addClass("alt-row1");
- $('#body2 tr:odd').addClass("ext");
- });
- }
- else if(all_data[0] == "<h5>Clocking</h5>")
- {
- document.getElementById('data_update').innerHTML = "<span> </span>";
- document.getElementById('tab_data').innerHTML = all_data[1];
- document.getElementById('contentboxhead').innerHTML = all_data[0]+"<div><a href='javascript:ip_conf()' class='link'>Refresh</a></div>";
- $(document).ready(function(){
- $('tbody').addClass("ext"); // Add class "alt-row" to even table rows
- $('#body1 tr:even').addClass("alt-row1");
- $('#body1 tr:odd').addClass("ext");
- $('#body2 tr:even').addClass("alt-row1");
- $('#body2 tr:odd').addClass("ext");
- });
- }
- else if(all_data[0] == "<h5>IPCore Settings</h5>")
- {
- document.getElementById('data_update').innerHTML = "<span> </span>";
- document.getElementById('tab_data').innerHTML = all_data[1];
- document.getElementById('contentboxhead').innerHTML = all_data[0]+"<div><a href='javascript:ip_conf()' class='link'>Refresh</a><a href='javascript:set_ip_conf()' class='link'>Update</a></div>";
- $(document).ready(function(){
- $('tbody').addClass("ext"); // Add class "alt-row" to even table rows
- $('#body1 tr:even').addClass("alt-row1");
- $('#body1 tr:odd').addClass("ext");
- $('#body2 tr:even').addClass("alt-row1");
- $('#body2 tr:odd').addClass("ext");
- });
- }
- else if(all_data[0] == "<h5>IP Core Settings</h5>")
- {
- //alert(all_data[1]);
- ip_conf();
- }
- else if(all_data[0] == "<h5>Version</h5>")
- {
- document.getElementById('data_update').innerHTML = "<span> </span>";
- document.getElementById('tab_data').innerHTML = all_data[1];
- document.getElementById('contentboxhead').innerHTML = all_data[0]+"<div><a href='javascript:doWork(true,\"show_ver\",\"systemConf\")' class='link'>Refresh</a></div>";
- $(document).ready(function(){
- $('tbody').addClass("ext"); // Add class "alt-row" to even table rows
- $('#body1 tr:even').addClass("alt-row1");
- $('#body1 tr:odd').addClass("ext");
- $('#body2 tr:even').addClass("alt-row1");
- $('#body2 tr:odd').addClass("ext");
- });
- }
- else if(all_data[0] == "<h5>Home</h5>")
- {
- document.getElementById('tab_data').innerHTML = all_data[1];
- document.getElementById('contentboxhead').innerHTML = all_data[0];
- document.getElementById('data_update').innerHTML = "<span> </span>";
- $(document).ready(function(){
- $('tbody').addClass("ext"); // Add class "alt-row" to even table rows
- $('#body1 tr:even').addClass("alt-row1");
- $('#body1 tr:odd').addClass("ext");
- $('#body2 tr:even').addClass("alt-row1");
- $('#body2 tr:odd').addClass("ext");
- });
- }
- else if(all_data[0] == "<h5>Date and Time</h5>")
- {
- document.getElementById('tab_data').innerHTML = all_data[1];
- document.getElementById('contentboxhead').innerHTML = all_data[0];
- document.getElementById('data_update').innerHTML = "<span> </span>";
- $(document).ready(function(){
- $('tbody').addClass("ext"); // Add class "alt-row" to even table rows
- $('#body1 tr:even').addClass("alt-row1");
- $('#body1 tr:odd').addClass("ext");
- $('#body2 tr:even').addClass("alt-row1");
- $('#body2 tr:odd').addClass("ext");
- });
- }
- else if(all_data[0] == "<h5>Memory</h5>")
- {
- document.getElementById('tab_data').innerHTML = all_data[1];
- document.getElementById('contentboxhead').innerHTML = all_data[0];
- document.getElementById('data_update').innerHTML = "<span> </span>";
- $(document).ready(function(){
- $('tbody').addClass("ext"); // Add class "alt-row" to even table rows
- $('#body1 tr:even').addClass("alt-row1");
- $('#body1 tr:odd').addClass("ext");
- $('#body2 tr:even').addClass("alt-row1");
- $('#body2 tr:odd').addClass("ext");
- });
- }
- else if(all_data[0] == "<h5>Network Configuration</h5>")
- {
- document.getElementById('data_update').innerHTML = "<span> </span>";
- document.getElementById('tab_data').innerHTML = all_data[1];
- document.getElementById('contentboxhead').innerHTML = all_data[0]+"<div><a href='javascript:network_conf()' class='link'>Refresh</a><a href='javascript:set_network_conf()' class='link'>Update</a></div>";
- $(document).ready(function(){
- $('tbody').addClass("ext"); // Add class "alt-row" to even table rows
- $('#body1 tr:even').addClass("alt-row1");
- $('#body1 tr:odd').addClass("ext");
- $('#body2 tr:even').addClass("alt-row1");
- $('#body2 tr:odd').addClass("ext");
- });
- }
- /*
- else if(all_data[0] == "<h5>Utils Configuration</h5>")
- {
- //alert(all_data[1]);
- document.getElementById('data_update').innerHTML = "<span> </span>";
- document.getElementById('tab_data').innerHTML = all_data[1];
- document.getElementById('contentboxhead').innerHTML = all_data[0]+"<div class='link'></div>";
- $(document).ready(function(){
- $('tbody').addClass("ext"); // Add class "alt-row" to even table rows
- $('#body1 tr:even').addClass("alt-row1");
- $('#body1 tr:odd').addClass("ext");
- $('#body2 tr:even').addClass("alt-row1");
- $('#body2 tr:odd').addClass("ext");
- });
- }
- */
- else if(all_data[0] == "set_network_conf")
- {
- //alert(all_data[1]);
- network_conf();
- }
- else if(all_data[0] == "<h5>IVR LEVELS</h5>")
- {
- document.getElementById('data_update').innerHTML = "";
- document.getElementById('tab_data').innerHTML = all_data[1];
- document.getElementById('contentboxhead').innerHTML = all_data[0]+"<div><a href='javascript:ivr_levels()' class='link'>Refresh</a></div>";
- $(document).ready(function(){
- $('tbody').addClass("ext"); // Add class "alt-row" to even table rows
- $('#body1 tr:even').addClass("alt-row1");
- $('#body1 tr:odd').addClass("ext");
- $('#body2 tr:even').addClass("alt-row1");
- $('#body2 tr:odd').addClass("ext");
- });
- }
- else if(all_data[0] == "ivr_fetch_levels")
- {
- //document.getElementById('tab_data').innerHTML = all_data[1];
- }
- else if(all_data[0] == "update_ivr_levels")
- {
- //alert(all_data[1]);
- document.getElementById("ivrAdd").style.display = "none";
- ivr_levels();
- }
- else if(all_data[0] == "<h5>VMAIL USERS</h5>")
- {
- document.getElementById('data_update').innerHTML = "";
- document.getElementById('tab_data').innerHTML = all_data[1];
- document.getElementById('contentboxhead').innerHTML = all_data[0]+"<div><a href='javascript:vmail_users()' class='link'>Refresh</a><a href='javascript:addUser()' class='link'>Add</a></div>";
- $(document).ready(function(){
- $('tbody').addClass("ext"); // Add class "alt-row" to even table rows
- $('#body1 tr:even').addClass("alt-row1");
- $('#body1 tr:odd').addClass("ext");
- $('#body2 tr:even').addClass("alt-row1");
- $('#body2 tr:odd').addClass("ext");
- });
- }
- else if(all_data[0] == "add_user")
- {
- document.getElementById('tab_data').innerHTML = all_data[1];
- }
- else if(all_data[0] == "add_vmail_user")
- {
- //alert(all_data[1]);
- vmail_users();
- }
- else if(all_data[0] == "<h5>Vmail Prompts</h5>")
- {
- document.getElementById('data_update').innerHTML = "";
- document.getElementById('tab_data').innerHTML = all_data[1];
- document.getElementById('contentboxhead').innerHTML = all_data[0];
- $(document).ready(function(){
- $('tbody').addClass("ext"); // Add class "alt-row" to even table rows
- $('#body1 tr:even').addClass("alt-row1");
- $('#body1 tr:odd').addClass("ext");
- $('#body2 tr:even').addClass("alt-row1");
- $('#body2 tr:odd').addClass("ext");
- });
- }
- else if(all_data[0] == "set_timer")
- {
- sucs_notify(all_data[1]);
- rfr_protim();
- }
- else if(all_data[0] == "VmailFileUpdate")
- {
- //alert(all_data[1]);
- //alert("NO Action ...");
- }
- else if(all_data[0] == "default_timer")
- {
- //alert(all_data[1]);
- get_timer();
- }
- else if(all_data[0] == "<h5>Upload Music File</h5>")
- {
- document.getElementById('data_update').innerHTML = "";
- document.getElementById('tab_data').innerHTML = all_data[1];
- document.getElementById('contentboxhead').innerHTML = all_data[0];
- $(document).ready(function(){
- $('tbody').addClass("ext"); // Add class "alt-row" to even table rows
- $('#body1 tr:even').addClass("alt-row1");
- $('#body1 tr:odd').addClass("ext");
- $('#body2 tr:even').addClass("alt-row1");
- $('#body2 tr:odd').addClass("ext");
- });
- }
- else if(all_data[0] == "CHANGECARDPROP")
- {
- var displayData = all_data[1].split(',');
- var cardinfo = displayData[1].split('^');
- var cardDet = cardinfo[0]+"^"+cardinfo[1]+"^"+cardinfo[2]+"^"+cardinfo[3]+"^"+cardinfo[4];
- if(all_data[1] == "No Changes Encountered!")
- {
- info_notify(displayData[0]);
- }
- else
- {
- sucs_notify(displayData[0]);
- nsb_fetch_card(cardDet);
- }
- }
- else if(all_data[0] == "<h5>Sip Subscriber Properties</h5>")
- {
- //alert(all_data[1]);
- var evr_data = all_data[1];
- document.getElementById('tab_data').innerHTML = (evr_data);
- var sip_num = document.getElementById('port_num1').value;
- sip_num= sip_num.trim();
- // alert(sip_num);
- //document.getElementById('data_update').innerHTML = evr_data[1];
- document.getElementById('contentboxhead').innerHTML = all_data[0] + "<div align='right' class='link' ><span id='lrfr' style='display:inline'>"
- + " <a href='javascript:sip_ext_show()'>Back</a> | "
- + " <a href=\"javascript:getCard();\">Cards</a> | "
- +"<a href='javascript:rfr_sip_ext()' >Refresh</a> | <a href='javascript:updatsipext()'>Update</a></span></div>";
- select();
- // mail();
- $(document).ready(function(){
- $('tbody').addClass("ext"); // Add class "alt-row" to even table rows
- $('#body1 tr:even').addClass("alt-row1");
- $('#body1 tr:odd').addClass("ext");
- $('#body2 tr:even').addClass("alt-row1");
- $('#body2 tr:odd').addClass("ext");
- });
- }
- else if(all_data[0] == "SETSIPEXT")
- {
- //alert(httpObject.responseText);
- if(all_data[1] == "No Changes Encountered!")
- {
- var val = all_data[1].split("^");
- info_notify(all_data[1]);
- rfr_sip_ext(val[1]);
- }
- else
- {
- var val = all_data[1].split("^");
- sucs_notify(val[0]);
- rfr_sip_ext1(val[1]);
- }
- }
- else if(all_data[0] == "SETSIPTRK")
- {
- if(all_data[1] == "No Changes Encountered!")
- {
- var val = all_data[1].split("^");
- info_notify(all_data[1]);
- rfr_sip_trk(val[1]);
- }
- else
- {
- var val = all_data[1].split("^");
- sucs_notify(val[0]);
- rfr_sip_trk1(val[1]);
- }
- }
- else if(all_data[0] == "<h5>Sip Trunk Properties</h5>")
- {
- //alert(all_data[1]);
- var evr_data = all_data[1];
- document.getElementById('tab_data').innerHTML = evr_data;
- var sip_hint = document.getElementById('sip_hint').value;
- sip_hint= sip_hint.trim();
- //document.getElementById('data_update').innerHTML = evr_data[1];
- document.getElementById('contentboxhead').innerHTML = all_data[0] + "<div align='right' class='link'><span id='lrfr' style='display:inline'>"
- + " <a href='javascript:sip_trunk_show()'>Back</a> | "
- + " <a href=\"javascript:getCard();\">Cards</a> | "
- + " <a href='javascript:rfr_sip_trk()'>Refresh</a> | "
- + " <a href='javascript:updatsiptrk()'>Update</a></span></div>";
- select();
- $(document).ready(function(){
- $('tbody').addClass("ext"); // Add class "alt-row" to even table rows
- $('#body1 tr:even').addClass("alt-row1");
- $('#body1 tr:odd').addClass("ext");
- $('#body2 tr:even').addClass("alt-row1");
- $('#body2 tr:odd').addClass("ext");
- });
- }
- else if(all_data[0] == "<h5>Select Sip Trunk</h5>")
- {
- document.getElementById('data_update').innerHTML = "";
- document.getElementById('tab_data').innerHTML = all_data[1];
- document.getElementById('contentboxhead').innerHTML = all_data[0];
- $(document).ready(function(){
- $('tbody').addClass("ext"); // Add class "alt-row" to even table rows
- $('#body1 tr:even').addClass("alt-row1");
- $('#body1 tr:odd').addClass("ext");
- $('#body2 tr:even').addClass("alt-row1");
- $('#body2 tr:odd').addClass("ext");
- });
- }
- else if(all_data[0] == "<h5>ISP Trunk Configuration</h5>")
- {
- //alert("i am in System features");
- document.getElementById('data_update').innerHTML = "<span> </span>";
- //alert(all_data[1]);
- document.getElementById('tab_data').innerHTML = all_data[1];
- document.getElementById('contentboxhead').innerHTML = all_data[0]+"<div><a href='javascript:ispShow()' class='link'>Refresh</a><a href='javascript:set_isp()' class='link'>Update</a></div>";
- select();
- $(document).ready(function(){
- $('tbody').addClass("ext"); // Add class "alt-row" to even table rows
- $('#body1 tr:even').addClass("alt-row1");
- $('#body1 tr:odd').addClass("ext");
- $('#body2 tr:even').addClass("alt-row1");
- $('#body2 tr:odd').addClass("ext");
- });
- }
- }
- }
- function nsbAlert(msg,duration)
- {
- var el = document.createElement("div");
- el.setAttribute("style","position:absolute;top:50%;left:40%;background-color:darkgrey;");
- el.setAttribute("class","notification success png_bg");
- el.setAttribute("id","notify_s");
- var tempMsg = "<br/><b> Update Report </b> <a href='#' class='close' ><img src='resources/images/icons/cross_grey_small.png' title='Close this notification' alt='close/></a> <div id='notify_subx'> <div id='notify_sub1'>"+ msg +"</div> </div>";
- alert(tempMsg);
- el.innerHTML = tempMsg;
- setTimeout(function(){ el.parentNode.removeChild(el); },duration);
- document.body.appendChild(el);
- }
- function sucs_notify(data)
- {
- document.getElementById("notify_s").style.position = "absolute";
- document.getElementById("notify_sub1").innerHTML = data;
- document.getElementById("notify_s").style.display = "block";
- document.getElementById("notify_s").style.opacity = "1";
- //get_timer();
- }
- function sucs_notify_gain(data)
- {
- document.getElementById("notify_s").style.position = "absolute";
- document.getElementById("notify_sub1").innerHTML = data;
- document.getElementById("notify_s").style.display = "block";
- document.getElementById("notify_s").style.opacity = "1";
- }
- function info_notify(data)
- {
- document.getElementById("notify_i").style.position = "absolute";
- document.getElementById("notify_sub2").innerHTML = data;
- document.getElementById("notify_i").style.display = "block";
- document.getElementById("notify_i").style.opacity = "1";
- }
- function apply_notify(data)
- {
- document.getElementById("notify_conf").style.display = "inline";
- document.getElementById("notify_conf").style.position = "absolute";
- document.getElementById("notify_conf3").innerHTML = data;
- document.getElementById("notify_conf").style.display = "block";
- document.getElementById("notify_conf").style.marginLeft = "220px";
- document.getElementById("notify_conf").style.marginTop = "150px";
- document.getElementById("notify_conf").style.opacity = "1";
- }
- function apply_restart(data,mess)
- {
- document.getElementById("notify_conf").style.display = "inline";
- document.getElementById("notify_conf").style.position = "absolute";
- document.getElementById("notify_conf3").innerHTML = mess;
- document.getElementById("notify_conf2").innerHTML = data;
- document.getElementById("notify_conf").style.display = "block";
- document.getElementById("notify_conf").style.marginLeft = "220px";
- document.getElementById("notify_conf").style.marginTop = "150px";
- document.getElementById("notify_conf").style.opacity = "1";
- document.getElementById("wait").style.display = "none";
- }
- function restartmsg(data)
- {
- document.getElementById("notify_conf").style.display = "inline";
- document.getElementById("notify_conf").style.position = "absolute";
- document.getElementById("notify_conf3").innerHTML = data;
- document.getElementById("notify_conf").style.display = "block";
- document.getElementById("notify_conf").style.marginLeft = "220px";
- document.getElementById("notify_conf").style.marginTop = "150px";
- document.getElementById("notify_conf").style.opacity = "1";
- document.getElementById("wait").style.display = "none";
- }
- function foc_me(obj)
- {
- for(i = 0; i < 80; i++)
- {
- if(obj == i)
- document.getElementById("sid_"+i).style.border = "1px outset #FF0000";
- else
- document.getElementById("sid_"+i).style.border = "0px";
- }
- }
- function timers_onchange(obj)
- {
- var num = (obj.id).split("_");
- if(parseInt(obj.value) > 255)
- {
- document.getElementById("img_"+num[1]).innerHTML = " <img src='resources/images/icons/cross.png' title='Out Of Range' width='14px' height='12px'></img>";
- document.getElementById("img_"+num[1]).style.display = "inline";
- document.getElementById("img_"+num[1]).style.visibility = "visible";
- document.getElementById("img").innerHTML = " ";
- document.getElementById("img").style.display = "inline";
- document.getElementById("img").style.visibility = "visible";
- if(wrong_entrytmrs == null)
- wrong_entrytmrs = "Timer No. "+(num[1])+" is not successfully updated!";
- else
- wrong_entrytmrs = wrong_entrytmrs+"<br/>"+("Timer No. "+(num[1])+" is not successfully updated!");
- }
- else if(parseInt(obj.value) <= 255)
- {
- document.getElementById("img_"+num[1]).innerHTML = " <img src='resources/images/icons/tick.gif' title='Correct Entry' width='14px' height='14px'> </img>";
- document.getElementById("img_"+num[1]).style.display = "inline";
- document.getElementById("img_"+num[1]).style.visibility = "visible";
- document.getElementById("img").style.display = "inline";
- document.getElementById("img").style.visibility = "visible";
- obj.name = "timer_changed";
- }
- }
- function anti_design()
- {
- doWork(true,"writetmpngx","config");
- document.getElementById("contentconfig").style.display = "none";
- document.getElementById("confirmtab").style.display = "none";
- document.getElementById("confirmdata").innerHTML = null;
- document.getElementById("confwin").style.display = "none";
- document.getElementById("openimg").style.display = "none";
- document.getElementById("dt").style.opacity = 0.6;
- document.getElementById("pm").style.opacity = 0.6;
- document.getElementById("ha").style.opacity = 0.6;
- document.getElementById("rsu").style.opacity = 0.6;
- document.getElementById("licence").style.opacity = 0.6;
- ntpval = null;
- pmval = null;
- haval = null;
- licval = null;
- sid_feat();
- }
- function scrollin(obj)
- {
- obj.style.direction = "rtl";
- obj.style.overflowY = "scroll";
- obj.style.overflowX = "hidden";
- }
- function scrollout(obj)
- {
- obj.style.overflow = "hidden";
- }
- function design(obj)
- {
- //alert("IN DESIGN FUNC");
- doWork(true,'show_home','systemConf')
- if(obj)
- {
- // document.getElementById("contentconfig").style.display = "none";
- document.getElementById("confwin").style.display = "none";
- // document.getElementById("openimg").style.display = "none";
- // sid_feat();
- // welcome();
- }
- //document.getElementById("closeimg").style.display = "none";
- //document.getElementById("openimg").style.display = "none";
- //document.getElementById("openimg").style.display = "none";
- }
- function basic_config()
- {
- document.getElementById("openimg").style.display = "none";
- document.getElementById("contentconfig").style.display = "inline";
- document.getElementById("confwin").style.display = "inline";
- document.getElementById("configtab").innerHTML = null;
- document.getElementById("lich").innerHTML = null;
- rsuchange = new Array(63);
- ntpval = null;
- pmval = null;
- haval = null;
- licval = null;
- get_dt();
- }
- function sip_config()
- {
- window.open("./sipfw/index.php");
- }
- function desg()
- {
- document.getElementById("closeimg").style.display = "none";
- document.getElementById("openimg").style.display = "inline";
- document.getElementById("closeimg").style.display = "none";
- }
- function dess()
- {
- document.getElementById("closeimg").style.display = "inline";
- document.getElementById("openimg").style.display = "none";
- }
- function check_s(obj,name)
- {
- //alert(obj + " == " + name);
- document.getElementById(obj.id).name = name;
- }
- function col_me(obj)
- {
- //alert(obj);
- if(obj == 0)
- {
- document.getElementById(0).style.color = "#ED1B03";
- document.getElementById(1).style.color = "#757575";
- }
- else if(obj == 1)
- {
- document.getElementById(0).style.color = " #757575";
- document.getElementById(1).style.color = "#ED1B03";
- }
- }
- function col_me_proto(obj)
- {
- //alert(obj);
- if(obj == 0)
- {
- document.getElementById("proto_type").value = "P";
- document.getElementById(0).style.color = "#ED1B03";
- document.getElementById(1).style.color = "#757575";
- }
- else if(obj == 1)
- {
- document.getElementById("proto_type").value = "T";
- document.getElementById(0).style.color = " #757575";
- document.getElementById(1).style.color = "#ED1B03";
- }
- }
- function col_acd(obj)
- {
- //alert(obj);
- if(obj == 0)
- {
- document.getElementById(0).style.color = "#ED1B03";
- document.getElementById(1).style.color = "#757575";
- document.getElementById(2).style.color = "#757575";
- g_param();
- }
- else if(obj == 1)
- {
- document.getElementById(0).style.color = " #757575";
- document.getElementById(1).style.color = "#ED1B03";
- document.getElementById(2).style.color = "#757575";
- g_res();
- }
- else if(obj == 2)
- {
- document.getElementById(0).style.color = " #757575";
- document.getElementById(1).style.color = "#757575";
- document.getElementById(2).style.color = "#ED1B03";
- g_amem();
- }
- }
- function def_do(obj)
- {
- //alert(obj);
- // Must add something to page, to be used as link
- }
- function col_medod(obj)
- {
- //alert(obj);
- if(obj == 0)
- {
- document.getElementById("type").value = "DOD";
- document.getElementById(0).style.color = "#ED1B03";
- document.getElementById(1).style.color = "#757575";
- //document.getElementById(2).style.color = "#757575";
- document.getElementById(3).style.color = "#757575";
- g_dod();
- }
- else if(obj == 1)
- {
- document.getElementById("type").value = "VOIP";
- document.getElementById(0).style.color = " #757575";
- document.getElementById(1).style.color = "#ED1B03";
- //document.getElementById(2).style.color = "#757575";
- document.getElementById(3).style.color = "#757575";
- sid_voip();
- }
- else if(obj == 2)
- {
- document.getElementById("type").value = "H";
- document.getElementById(0).style.color = " #757575";
- document.getElementById(1).style.color = "#757575";
- //document.getElementById(2).style.color = "#ED1B03";
- document.getElementById(3).style.color = "#757575";
- sid_h();
- }
- else if(obj == 3)
- {
- document.getElementById("type").value = "Mem";
- document.getElementById(0).style.color = " #757575";
- document.getElementById(1).style.color = "#757575";
- //document.getElementById(2).style.color = "#757575";
- document.getElementById(3).style.color = "#ED1B03";
- dod_mem();
- }
- }
- function flex_onchange(obj)
- {
- var num = (obj.id).split("_");
- if((obj.value) != (obj.title) || (obj.value) == null)
- {
- document.getElementById("img_"+num[1]).innerHTML = " <img src='resources/images/icons/pencil.png' title='Edited' width='14px' height='14px'></img>";
- document.getElementById("img_"+num[1]).style.display = "inline";
- document.getElementById("img_"+num[1]).style.visibility = "visible";
- document.getElementById("img").style.display = "inline";
- document.getElementById("img").style.visibility = "visible";
- // alert(obj.name);
- obj.name = "flex_changed";
- // alert(obj.name);
- }
- else if((obj.value) = (obj.title))
- {
- document.getElementById("img_"+num[1]).innerHTML = " <img src='resources/images/icons/pencil.png' title='Edited' width='14px' height='14px'> </img>";
- document.getElementById("img_"+num[1]).style.display = "inline";
- document.getElementById("img_"+num[1]).style.visibility = "hidden";
- document.getElementById("img").style.display = "inline";
- document.getElementById("img").style.visibility = "hidden";
- }
- // alert(obj.name);
- }
- function delete_it(obj)
- {
- var r=confirm("Are you sure to proceed!");
- if (r==true)
- {
- var delval = null;
- delval = document.getElementById("dupnum_"+obj).value;
- // alert(delval);
- doWork(delval,"delete","dup");
- // alert("You pressed OK!");
- }
- else
- {
- // alert("You pressed Cancel!");
- }
- }
- function dup_onchange(obj)
- {
- if(document.getElementById("rtype_"+obj).title != document.getElementById("rtype_"+obj).value)
- document.getElementById("dupnum_"+obj).name = "changed_dup";
- // alert(document.getElementById("dupnum_"+obj).name);
- }
- function getTime()
- {
- doWork(true,'show_home','systemConf');
- }
- function showMem()
- {
- doWork(true,'show_mem','systemConf');
- }
- function getCard()
- {
- doWork(true,'tdm_header','search');
- }
- function getExt()
- {
- doWork('Sub','get_search','search');
- }
- function getTrk()
- {
- doWork('Trk','get_search','search');
- }
- function showVersion()
- {
- doWork(true,'show_ver','systemConf');
- }
- function did_change(obj)
- {
- if(obj.title != obj.value)
- document.getElementById(obj.id).name = "changed_did";
- }
- function dod_change(obj)
- {
- // alert(obj);
- if(obj.title != obj.value)
- document.getElementById(obj.id).name = "changed_dod";
- }
- function ext_change(obj)
- {
- var name = (obj.name).split(",");
- if(name[1] == "nochange" && obj.title != obj.value)
- document.getElementById(obj.id).name = name[0]+",changed";
- // alert(obj.name);
- }
- function ext_change1(obj)
- {
- var x = document.getElementById("ext_"+obj);
- var name = (x.name).split(",");
- if(name[1] == "nochange")
- document.getElementById(x.id).name = name[0]+",changed";
- }
- function acd_change(obj)
- {
- //alert("yo");
- var name = (obj.name).split(",");
- //alert(obj.value);
- var value = obj.value;
- if(value != "reset" && value != "RESET")
- {
- //alert("not reset");
- var valueSplit = value.split(',');
- if(valueSplit.length != 2)
- {
- alert("Input Should be in this format : (cardNo,portNo)");
- document.getElementById(obj.id).value = "";
- return;
- }
- //alert(valueSplit[0]+"___"+valueSplit[1]);
- if((valueSplit[0] >= 0 && valueSplit[0] <= 9) && (valueSplit[1] >= 0 && valueSplit[1] <=31))
- {
- //alert("Valid value");
- if(name[1] == "nochange" && obj.title != obj.value)
- document.getElementById(obj.id).name = name[0]+",changed";
- }
- else
- {
- document.getElementById(obj.id).name = name[0]+",invalidValue";
- //alert("Invalid value");
- }
- }
- else
- {
- if(name[1] == "nochange" && obj.title != obj.value)
- document.getElementById(obj.id).name = name[0]+",changed";
- }
- }
- function acd_changeChk(obj)
- {
- var name = (obj.name).split(",");
- if(name[1] == "nochange" && obj.title != obj.value)
- document.getElementById(obj.id).name = name[0]+",changed";
- }
- function acc_change(obj)
- {
- var name = (obj.name).split(",");
- if(name[1] == "nochange" && obj.title != obj.value)
- document.getElementById(obj.id).name = name[0]+",changed";
- }
- function trk_change(obj)
- {
- var name = (obj.name).split(",");
- if(name[1] == "nochange" && obj.title != obj.value)
- obj.name = name[0]+",changed";
- }
- function cnri_change(obj)
- {
- var name = (obj.name).split(",");
- var val = null;
- if(obj.type == "select-one")
- val = obj.options[obj.selectedIndex].text;
- else
- val = obj.value;
- if(name[1] == "nochange" && obj.title != val)
- obj.name = name[0]+",changed";
- if((obj.id == "cnri_21") && (obj.checked == true))
- document.getElementById("cnri_22").disabled = false;
- else if((obj.id == "cnri_21") && (obj.checked == false))
- document.getElementById("cnri_22").disabled = true;
- }
- function sysmgw_change(obj,name)
- {
- //alert(name + " >>>> " + obj.value + " >>>> " + obj.title + " >>>> " + obj.name);
- var name1 = (obj.name).split(",");
- if(obj.title != obj.value)
- document.getElementById(obj.id).name = name;
- //alert(document.getElementById(obj.id));
- }
- function sysChange(obj)
- {
- //alert("Here in sys change");
- //alert(obj.checked+"___"+obj.value);
- if(obj.checked == true)
- document.getElementById(obj.id).value ="1";
- else
- document.getElementById(obj.id).value ="0";
- }
- function dhcpChange(obj)
- {
- //alert("Here in dhcp change");
- //alert(obj.checked+"___"+obj.value);
- if(obj.checked == true)
- {
- document.getElementById(obj.id).value ="1";
- document.getElementById("net_1").disabled = true;
- document.getElementById("net_2").disabled = true;
- document.getElementById("net_3").disabled = true;
- document.getElementById("net_4").disabled = true;
- document.getElementById("net_5").disabled = true;
- document.getElementById("net_1").style.background = "#D3D3D3";
- document.getElementById("net_1").style.color = "white";
- document.getElementById("net_2").style.background = "#D3D3D3";
- document.getElementById("net_2").style.color = "white";
- document.getElementById("net_3").style.background = "#D3D3D3";
- document.getElementById("net_3").style.color = "white";
- document.getElementById("net_4").style.background = "#D3D3D3";
- document.getElementById("net_4").style.color = "white";
- document.getElementById("net_5").style.background = "#D3D3D3";
- document.getElementById("net_5").style.color = "white";
- }
- else
- {
- document.getElementById(obj.id).value ="0";
- //alert(document.getElementById("net_1").value);
- document.getElementById("net_1").disabled = false;
- document.getElementById("net_2").disabled = false;
- document.getElementById("net_3").disabled = false;
- document.getElementById("net_4").disabled = false;
- document.getElementById("net_5").disabled = false;
- document.getElementById("net_1").style.background = "#FFFFFF";
- document.getElementById("net_1").style.color = "black";
- document.getElementById("net_2").style.background = "#FFFFFF";
- document.getElementById("net_2").style.color = "black";
- document.getElementById("net_3").style.background = "#FFFFFF";
- document.getElementById("net_3").style.color = "black";
- document.getElementById("net_4").style.background = "#FFFFFF";
- document.getElementById("net_4").style.color = "black";
- document.getElementById("net_5").style.background = "#FFFFFF";
- document.getElementById("net_5").style.color = "black";
- }
- }
- function usertype(obj)
- {
- if(obj.value == 0)
- {
- document.getElementById("subtypet").style.display = "inline";
- document.getElementById("subtypee").style.display = "none";
- }
- else if(obj.value == 1)
- {
- document.getElementById("subtypee").style.display = "inline";
- document.getElementById("subtypet").style.display = "none";
- }
- else
- {
- document.getElementById("subtypee").style.display = "none";
- document.getElementById("subtypet").style.display = "none";
- document.getElementById("ext").style.display = "none";
- }
- }
- function text(obj)
- {
- if(obj.value == 7)
- {
- document.getElementById("ext").style.display = "none";
- }
- else
- document.getElementById("ext").style.display = "inline";
- }
- function searchon(obj)
- {
- var data = null;
- var type = null;
- type = document.getElementById('usertype').value;
- if(type == 0)
- var subtype = document.getElementById('subtypet').value;
- else if(type == 1)
- var subtype = document.getElementById('subtypee').value;
- var number = document.getElementById('ext').value;
- data = type+":"+subtype+"|"+number;
- doWork(data,"getnum","search");
- }
- function get_propext(data)
- {
- //alert(data);
- var elementExists = document.getElementById("nsb_div_port");
- if(elementExists)
- document.getElementById("nsb_div_port").style.display = "inline";
- document.getElementById("nsb_div_login").style.display = "inline";
- document.getElementById("nsb_div_logout").style.display = "inline";
- var elementExists = document.getElementById("nsb_div_cardD");
- if(elementExists)
- document.getElementById("nsb_div_cardD").style.display = "inline";
- var port = (data).split("^");
- document.getElementById("number").value =port[0];;
- doWork(data,"getext","search");
- }
- function get_proptrk(data)
- {
- var elementExists = document.getElementById("nsb_div_port");
- if(elementExists)
- document.getElementById("nsb_div_port").style.display = "inline";
- var elementExists = document.getElementById("nsb_div_cardD");
- if(elementExists)
- document.getElementById("nsb_div_cardD").style.display = "inline";
- var data = (data).split("^");
- var add = data[1];
- //alert(data[0]);
- document.getElementById("number").value = data[0];
- var data = data[0]+"|"+add;
- doWork(data,"gettrk","search");
- }
- function get_propcnri(data)
- {
- document.getElementById("number").value = data;
- doWork(data+"|cnri","getcnri","search");
- }
- function get_defcnri(data)
- {
- //alert(data);
- if(data == setradioval)
- {
- // alert("found previous");
- document.getElementById("tab_data").innerHTML = setradiopg;
- select();
- }
- else
- {
- if(data == 3)
- valu = 2
- else if(data == 4)
- valu = 3
- else if(data == 7)
- valu = 1
- else
- valu = 0;
- if(defvalues[valu])
- {
- //alert("found default");
- document.getElementById("tab_data").innerHTML = defvalues[valu];
- select();
- document.getElementById("cnri_2").options[data].selected = true;
- document.getElementById("cnri_2").name = "slctd,changed";
- //alert(document.getElementById("cnri_2").name);
- }
- else
- {
- //alert("going to create");
- doWork(data+"|"+valu,"getcnri","search");
- }
- }
- }
- function set_gain(obj)
- {
- //alert(obj.name);
- value = (obj.id+"|"+obj.value);
- //alert(value);
- doWork(value,"set_gain","gain");
- }
- function net_change(obj)
- {
- var date = document.getElementById("theDate").value;
- var time = document.getElementById("date_1").value;
- var dt = date+"|"+time;
- doWork(value,"set_dt","config");
- }
- function pm_change(obj)
- {
- var x = document.getElementById("pm_1");
- var y = document.getElementById("pm_2");
- var z = document.getElementById("pm_3");
- x.style.border = "0px solid";
- y.style.border = "0px solid";
- z.style.border = "0px solid";
- document.getElementById("crosspm_1").style.display = "none";
- document.getElementById("crosspm_2").style.display = "none";
- document.getElementById("crosspm_3").style.display = "none";
- if(obj.value == 0)
- {
- var val = ntpval.split(":");
- x.readOnly = true;
- x.value = val[3];
- y.readOnly = true;
- y.value = val[4];
- z.readOnly = true;
- z.value = val[7];
- }
- else if(obj.value == 1)
- {
- x.readOnly = false;
- x.value = x.title;
- y.readOnly = false;
- y.value = y.title;
- z.readOnly = false;
- z.value = z.title;
- }
- }
- function readwrite(obj)
- {
- if(document.getElementById("pm_0").value == 1)
- {
- document.getElementById(obj.id).readOnly = false;
- }
- else
- {
- document.getElementById(obj.id).readOnly = true;
- }
- }
- function rsu_change(obj,data)
- {
- var pattern = /^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/;
- var x = pattern.test(obj.value) ? true : false;
- if(x == false)
- {
- document.getElementById(obj.id).style.border = "1px solid #FF0000";
- document.getElementById("cross"+obj.id).style.display="inline";
- document.getElementById(obj.id).title = "no";
- }
- else if(x == true)
- {
- var cmnum = document.getElementById("cmnum");
- var value = (obj.name+"|"+obj.id+"|"+obj.value);
- document.getElementById(obj.id).style.border = "0px solid";
- document.getElementById("cross"+obj.id).style.display="none";
- document.getElementById(obj.id).title = "ok";
- rsuchange[data] = (data+1);
- doWork(value,"set_rsu","config");
- }
- }
- function rsu_change1(obj,data)
- {
- var cmnum = document.getElementById("cmnum");
- var value = (obj.name+"|"+obj.id+"|"+obj.value);
- if(obj.id == "rsu_9")
- {
- if((document.getElementById("rsu_9").checked==true))
- value = (obj.name+"|"+obj.id+"|"+1)
- else if((document.getElementById("rsu_9").checked==false))
- value = (obj.name+"|"+obj.id+"|"+0)
- }
- rsuchange[data] = (data+1);
- //alert(rsuchange.length);
- //alert(rsuchange[data]);
- doWork(value,"set_rsu","config");
- }
- function check_rsu_change(obj,data)
- {
- var pattern = /^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/;
- var x = pattern.test(obj.value) ? true : false;
- if(x == false)
- {
- document.getElementById(obj.id).style.border = "1px solid #FF0000";
- document.getElementById("cross"+obj.id).style.display="inline";
- document.getElementById(obj.id).title = "no";
- }
- }
- function apply_rsu()
- {
- //document.getElementById("contentconfig").style.display = "none";
- //document.getElementById("confwin").style.display = "none";
- }
- function show_sid()
- {
- //alert(document.getElementById("sid"));
- //document.getElementById("sid").style.border = "4px solid #FF0000";
- document.window.open("sid").style.display = "block";
- document.getElementById("sid").style.zIndex = "100";
- }
- function apply_licence()
- {
- document.getElementById("contentconfig").style.display = "none";
- document.getElementById("confwin").style.display = "none";
- sid_feat();
- }
- function add_enblock()
- {
- var len = document.getElementById("length").value;
- if(len < 0 || len >30)
- {
- alert("Length should be between 0 to 30");
- return;
- }
- var value = (document.getElementById("flex").value+"|"+len);
- //alert(value);
- doWork(value,"set_enblock","enblock");
- }
- function delete_enblock(obj)
- {
- var r=confirm("Are you sure to proceed!");
- if (r==true)
- {
- var flex = document.getElementById("flex_"+obj).value;
- //alert(flex);
- var length = document.getElementById("length_"+obj).value;
- var value = flex+"|"+length;
- doWork(value,"delete_enblock","enblock");
- //alert("You pressed OK!");
- }
- else
- {
- //alert("You pressed Cancel!");
- }
- }
- function fetch_allwdnum()
- {
- var allwdgrp = document.getElementById("allwdgrp").value;
- //alert(allwdgrp);
- doWork(allwdgrp,"get_allwdgrp","ulsta");
- }
- function fetch_dendnum()
- {
- var dendgrp = document.getElementById("dendgrp").value;
- //alert(allwdgrp);
- doWork(dendgrp,"get_denied","ulstd");
- }
- function set_allwdnum()
- {
- var tnum = document.getElementById("flex").value;
- var allwdgrp = document.getElementById("allwdgrp").value;
- //alert(tnum+","+allwdgrp);
- doWork(tnum+","+allwdgrp,"set_allwdgrp","ulsta");
- hide_add();
- }
- function del_allwdnum(obj)
- {
- var r=confirm("Are you sure to proceed!");
- if (r==true)
- {
- var tnum = document.getElementById("anum_"+obj).value;
- var allwdgrp = document.getElementById("allwdgrp").value;
- //alert(tnum+"_"+allwdgrp);
- doWork(tnum+","+allwdgrp,"del_allwdgrp","ulsta");
- hide_add();
- }
- else
- {
- //alert("You pressed Cancel!");
- }
- }
- function del_dendnum(obj)
- {
- var r=confirm("Are you sure to proceed!");
- if (r==true)
- {
- var tnum = document.getElementById("dnum_"+obj).value;
- var dendgrp = document.getElementById("dendgrp").value;
- //alert(tnum+"_"+allwdgrp);
- doWork(tnum+","+dendgrp,"del_dendgrp","ulstd");
- hide_add();
- }
- else
- {
- //alert("You pressed Cancel!");
- }
- }
- function set_denied()
- {
- var tnum = document.getElementById("flex").value;
- var dendgrp = document.getElementById("dendgrp").value;
- //alert(tnum+","+allwdgrp);
- doWork(tnum+","+dendgrp,"set_dendgrp","ulstd");
- hide_add();
- }
- function apply_haconfig()
- {
- if(document.getElementById("ha_0").value || document.getElementById("ha_1").value || document.getElementById("ha_2").value || document.getElementById("ha_3").value ||document.getElementById("ha_4").value)
- {
- var a = document.getElementById("ha_0").value;
- var b = document.getElementById("ha_1").value;
- var c = document.getElementById("ha_2").value;
- var d = document.getElementById("ha_3").value;
- var e = document.getElementById("ha_4").value;
- }
- else
- {
- alert("Filling all fields are mandatory");
- }
- doWork(a+"|"+b+"|"+c+"|"+d+"|"+e,"set_ha","config");
- }
- function add_card()
- {
- document.getElementById("slotno").value = "";
- document.getElementById("cardid").value = "";
- document.getElementById("addcard").style.display = "inline";
- }
- function nsb_add_card()
- {
- var slotnum = document.getElementById("slotno").value;
- var cardid = document.getElementById("cardid").value;
- //alert(slotnum+","+cardid);
- if(slotnum <= 1 || slotnum >= 10)
- {
- alert("CARD NUMBER SHOULD BE BETWEEN 2 to 9.");
- return;
- }
- else
- doWork(slotnum +"^"+cardid,"add_card","search");
- //hide_addcard();
- }
- function add_allwd()
- {
- document.getElementById("flex").value = "";
- document.getElementById("add").style.display = "inline";
- }
- function add_dend()
- {
- document.getElementById("flex").value = "";
- document.getElementById("add").style.display = "inline";
- }
- function typ_change(obj)
- {
- //alert (obj.value);
- if(obj.value == "EXT")
- {
- document.getElementById("usersubtype1").style.display = "inline";
- document.getElementById("usersubtype2").style.display = "none";
- }
- else if(obj.value == "TRK")
- {
- document.getElementById("usersubtype2").style.display = "inline";
- document.getElementById("usersubtype1").style.display = "none";
- }
- else
- {
- document.getElementById("usersubtype1").style.display = "none";
- document.getElementById("usersubtype2").style.display = "none";
- }
- }
- function isNumber(evt)
- {
- evt = (evt) ? evt : window.event;
- var charCode = (evt.which) ? evt.which : evt.keyCode;
- //alert(charCode);
- if (charCode > 31 && (charCode != 35) && (charCode != 42) && (charCode < 48 || charCode > 57))
- {
- //alert ("first case");
- return false;
- }
- //alert ("final case");
- return true;
- }
- function isNumberWithAt(evt)
- {
- evt = (evt) ? evt : window.event;
- var charCode = (evt.which) ? evt.which : evt.keyCode;
- //alert(charCode);
- if (charCode > 31 && (charCode != 64) && (charCode != 35) && (charCode != 42) && (charCode < 48 || charCode > 57))
- {
- //alert ("first case");
- return false;
- }
- //alert ("final case");
- return true;
- }
- function add_flex(obj)
- {
- doWork(obj,"add-mod-del","feat");
- }
- function doit(obj)
- {
- //alert(obj);
- if(obj == 1)
- {
- var usrtyp = document.getElementById("usertype").value;
- var subusrtyp = "SIP";
- /*
- if(usrtyp == "EXT")
- var subusrtyp = document.getElementById("usersubtype1").value;
- else if(usrtyp == "TRK")
- var subusrtyp = document.getElementById("usersubtype2").value;
- else
- {
- alert("Please select User Type!");
- return;
- }
- alert(subusrtyp);
- if(subusrtyp == "-1")
- {
- alert("Please select User Sub Type!");
- return;
- }
- */
- var start = document.getElementById("start").value;
- var end = document.getElementById("end").value;
- if(start == "")
- {
- alert("Start Number is mandatory!");
- return;
- //doWork(obj,"add-mod-del","feat");
- }
- else if(end && start > end)
- {
- alert("Start value should be smaller than End value!");
- return;
- //doWork(obj,"add-mod-del","feat");
- }
- else if(usrtyp == "-1" || subusrtyp == "-1")
- {
- alert("Filling all fields is mandatory!");
- return;
- //doWork(obj,"add-mod-del","feat");
- }
- else if((end - start) > 50)
- {
- alert("Max Range is 50!");
- return;
- //doWork(obj,"add-mod-del","feat");
- }
- else
- {
- var value = (obj+"|"+usrtyp+"|"+subusrtyp+"|"+start+"|"+end);
- //alert(value);
- doWork(value,"doit","feat");
- }
- }
- else if(obj == 2)
- {
- var usrtyp = document.getElementById("usertype").value;
- var subusrtyp = "SIP";
- /*
- if(usrtyp == "EXT")
- {
- var subusrtyp = document.getElementById("usersubtype1").value;
- }
- else if(usrtyp == "TRK")
- {
- var subusrtyp = document.getElementById("usersubtype2").value;
- }
- else
- {
- alert("Please select User Type!");
- return;
- }
- if(subusrtyp == "-1")
- {
- alert("Please select Sub User Type");
- return;
- }
- */
- var start = document.getElementById("start").value;
- var end = document.getElementById("end").value;
- if(start == "")
- {
- alert("Start Number is mandatory!");
- return;
- //doWork(obj,"add-mod-del","feat");
- }
- else if(end && start > end)
- {
- alert("Start value should be smaller than End value!");
- return;
- //doWork(obj,"add-mod-del","feat");
- }
- else if(usrtyp == "-1" || subusrtyp == "-1")
- {
- alert("Filling all fields is mandatory!");
- return;
- //doWork(obj,"add-mod-del","feat");
- }
- else if((end - start) > 50)
- {
- alert("Max Range is 50!");
- return;
- //doWork(obj,"add-mod-del","feat");
- }
- else
- {
- var value = obj+"|"+usrtyp+"|"+subusrtyp+"|"+start+"|"+end;
- //alert(value);
- doWork(value,"doit","feat");
- }
- }
- else if(obj == 3)
- {
- var start = document.getElementById("start").value;
- var end = document.getElementById("end").value;
- var startnew = document.getElementById("startnewtxt").value;
- //alert("i am in modify"+start+"_"+end+"-"+startnew);
- // var endnew = document.getElementById("endnewtxt").value;
- if(start == "")
- {
- alert("Start Number is mandatory!");
- return;
- //doWork(obj,"add-mod-del","feat");
- }
- else if(end && start > end)
- {
- alert("Start value should be smaller than End value!");
- return;
- //doWork(obj,"add-mod-del","feat");
- }
- else if((end - start) > 50)
- {
- alert("Max Range is 50!");
- return;
- //doWork(obj,"add-mod-del","feat");
- }
- else
- {
- var value = escape(obj+"|"+start+"|"+end+"|"+startnew);
- //alert(value);
- doWork(value,"doit","feat");
- }
- }
- }
- function did_mem()
- {
- if(document.getElementById("didnum").value == "Select")
- {
- alert("Please select DIDG Group Number");
- return;
- }
- var didnum = document.getElementById("didnum").value;
- document.getElementById(1).style.color = "#ED1B03";
- document.getElementById(0).style.color = "#757575";
- //alert(didnum);
- doWork(didnum,"did_mem","didg");
- }
- function dod_mem()
- {
- var dodnum = document.getElementById("dodnum").value;
- document.getElementById(3).style.color = "#ED1B03";
- //document.getElementById(2).style.color = "#757575";
- document.getElementById(1).style.color = "#757575";
- document.getElementById(0).style.color = "#757575";
- doWork(dodnum,"dod_mem","dodg");
- }
- function add_acd()
- {
- doWork(null,"add_acd","acd");
- }
- function add_bgrp()
- {
- doWork(null,"add_bgrp","bgrp");
- }
- function delete_acd(obj)
- {
- var r=confirm("Are you sure to proceed!");
- if (r==true)
- {
- var acdno = document.getElementById("acdno").value;
- var memnum = document.getElementById("acdnum_"+obj).value;
- var value = acdno+"|"+memnum;
- doWork(value,"del_acd","acd");
- }
- else
- {
- //alert("You pressed Cancel!");
- }
- }
- function delete_bgrp(obj)
- {
- var r=confirm("Are you sure to proceed!");
- if (r==true)
- {
- var bgrpno = document.getElementById("bgrpno").value;
- var memnum = document.getElementById("acc_"+obj).value;
- var value = bgrpno+"|"+memnum;
- //alert(value);
- doWork(value,"del_bgrp","bgrp");
- }
- else
- {
- //alert("You pressed Cancel!");
- }
- }
- function update_acdmem()
- {
- var acdno = document.getElementById("acdno").value;
- if(acdno == "Select")
- {
- alert("Please select ACD group number");
- return;
- }
- var memnum = document.getElementById("addnum").value;
- var value = acdno+"|"+memnum;
- doWork(value,"add_member","acd");
- }
- function delete_flex(obj)
- {
- var r=confirm("Are you sure to proceed!");
- if (r==true)
- {
- doWork(obj,"delete_flex","feat");
- }
- else
- {
- //alert("You pressed Cancel!");
- }
- //alert("done");
- }
- function proto_change(obj)
- {
- //alert(obj.name);
- var name = (obj.name).split("_");
- if(name[1] == "nochange" && obj.title != obj.value)
- document.getElementById(obj.id).name = name[0]+"_changed";
- //alert(obj.name);
- }
- //Added by AJ
- function timer_change(obj)
- {
- //alert(obj.name);
- var name = (obj.name).split(",");
- if(name[1] == "nochange" && obj.title != obj.value)
- {
- document.getElementById(obj.id).name = name[0]+",changed";
- }
- }
- function updateTimer()
- {
- var data = null;
- data = document.getElementById("prino").value;
- var all_values = null;
- //alert("Here in update");
- for(jdx = 1; jdx < 6; jdx++)
- {
- var ele = document.getElementById("tim_"+jdx);
- var name = (ele.name).split(",");
- //alert(name[1]+"_"+name[0]);
- if(name[1] == "changed")
- {
- if(all_values == null)
- all_values = ele.value+"_"+jdx;
- else
- all_values = all_values+":"+ele.value+"_"+jdx;
- }
- }
- for(jdx = 6; jdx < 11; jdx++)
- {
- var ele = document.getElementById("tim_"+jdx);
- var name = (ele.name).split(",");
- //alert(name[1]+"_"+name[0]);
- if(name[1] == "changed")
- {
- if(all_values == null)
- all_values = ele.value+"_"+jdx;
- else
- all_values = all_values+":"+ele.value+"_"+jdx;
- }
- }
- for(jdx = 11; jdx < 38; jdx++)
- {
- var ele = document.getElementById("tim_"+jdx);
- var name = (ele.name).split(",");
- //alert(name[1]+"_"+name[0]);
- if(name[1] == "changed")
- {
- if(all_values == null)
- all_values = ele.value+"_"+jdx;
- else
- all_values = all_values+":"+ele.value+"_"+jdx;
- }
- }
- if(all_values != null)
- {
- all_values += ","+data;
- //alert(all_values);
- all_values = escape(all_values);
- doWork(all_values,"set_timer","protocol");
- }
- else
- alert("No Change Encountered!");
- }
- //till here
- function updateproto()
- {
- var data = null;
- data = document.getElementById("prino").value;
- var all_values = null;
- var err_flag = 0;
- var all_values = null;
- for(jdx = 1; jdx < 52; jdx++)
- {
- var ele = document.getElementById("proto_"+jdx);
- var name = (ele.name).split("_");
- //alert(name[1]+"_"+name[0]);
- if(name[1] == "changed")
- {
- switch(name[0])
- {
- case "chk":
- {
- //alert(ele.value+"__"+ele.type+"__"+jdx);
- if(all_values == null)
- all_values = (ele.checked+"_"+ele.type+"_"+jdx);
- else
- all_values = all_values+":"+(ele.checked+"_"+ele.type+"_"+jdx);
- //alert(all_values);
- break;
- }
- case "slct":
- {
- if(name[1] == "changed")
- {
- // alert(all_values);
- if(all_values == null)
- {
- all_values = (ele.value+"_"+ele.type+"_"+jdx);
- // alert(ele.type);
- }
- else
- {
- all_values = all_values+":"+(ele.value+"_"+ele.type+"_"+jdx);
- }
- //break;
- //alert(all_values);
- }
- else
- break;
- }
- }
- }
- }
- if(all_values != null)
- {
- all_values += ","+data;
- //alert(all_values);
- all_values = escape(all_values);
- doWork(all_values,"set_proto","protocol");
- }
- else
- alert("No Change Encountered!");
- }
- function add_bgrp_now()
- {
- var Bossmem = document.getElementById("bossmem").value;
- var Bossring = document.getElementById("ringboss").value;
- var Bgrpno = document.getElementById("bgrpno").value;
- var stuff = Bossmem+"_"+Bossring+"_"+Bgrpno;
- doWork(stuff,"add_boss_mem","bgrp");
- }
- function checkDomain(nname)
- {
- var arr = new Array(
- '.com','.net','.org','.biz','.coop','.info','.museum','.name',
- '.pro','.edu','.gov','.int','.mil','.ac','.ad','.ae','.af','.ag',
- '.ai','.al','.am','.an','.ao','.aq','.ar','.as','.at','.au','.aw',
- '.az','.ba','.bb','.bd','.be','.bf','.bg','.bh','.bi','.bj','.bm',
- '.bn','.bo','.br','.bs','.bt','.bv','.bw','.by','.bz','.ca','.cc',
- '.cd','.cf','.cg','.ch','.ci','.ck','.cl','.cm','.cn','.co','.cr',
- '.cu','.cv','.cx','.cy','.cz','.de','.dj','.dk','.dm','.do','.dz',
- '.ec','.ee','.eg','.eh','.er','.es','.et','.fi','.fj','.fk','.fm',
- '.fo','.fr','.ga','.gd','.ge','.gf','.gg','.gh','.gi','.gl','.gm',
- '.gn','.gp','.gq','.gr','.gs','.gt','.gu','.gv','.gy','.hk','.hm',
- '.hn','.hr','.ht','.hu','.id','.ie','.il','.im','.in','.io','.iq',
- '.ir','.is','.it','.je','.jm','.jo','.jp','.ke','.kg','.kh','.ki',
- '.km','.kn','.kp','.kr','.kw','.ky','.kz','.la','.lb','.lc','.li',
- '.lk','.lr','.ls','.lt','.lu','.lv','.ly','.ma','.mc','.md','.mg',
- '.mh','.mk','.ml','.mm','.mn','.mo','.mp','.mq','.mr','.ms','.mt',
- '.mu','.mv','.mw','.mx','.my','.mz','.na','.nc','.ne','.nf','.ng',
- '.ni','.nl','.no','.np','.nr','.nu','.nz','.om','.pa','.pe','.pf',
- '.pg','.ph','.pk','.pl','.pm','.pn','.pr','.ps','.pt','.pw','.py',
- '.qa','.re','.ro','.rw','.ru','.sa','.sb','.sc','.sd','.se','.sg',
- '.sh','.si','.sj','.sk','.sl','.sm','.sn','.so','.sr','.st','.sv',
- '.sy','.sz','.tc','.td','.tf','.tg','.th','.tj','.tk','.tm','.tn',
- '.to','.tp','.tr','.tt','.tv','.tw','.tz','.ua','.ug','.uk','.um',
- '.us','.uy','.uz','.va','.vc','.ve','.vg','.vi','.vn','.vu','.ws',
- '.wf','.ye','.yt','.yu','.za','.zm','.zw');
- var mai = nname;
- var val = true;
- var dot = mai.lastIndexOf(".");
- var dname = mai.substring(0,dot);
- var ext = mai.substring(dot,mai.length);
- //alert(ext);
- if(dot>2 && dot<57)
- {
- for(var i=0; i<arr.length; i++)
- {
- if(ext == arr[i])
- {
- val = true;
- break;
- }
- else
- val = false;
- }
- if(val == false)
- return false;
- else
- {
- for(var j=0; j<dname.length; j++)
- {
- var dh = dname.charAt(j);
- var hh = dh.charCodeAt(0);
- if((hh > 47 && hh<59) || (hh > 64 && hh<91) || (hh > 96 && hh<123) || hh==45 || hh==46)
- {
- if((j==0 || j==dname.length-1) && hh == 45)
- return false;
- }
- else
- return false;
- }
- }
- }
- else
- return false;
- return true;
- }
- function nam_change(obj)
- {
- var z = checkDomain(obj.value);
- if(z == false)
- {
- var data = obj.id+"^"+obj.value;
- doWork(data,"ip_validate","config");
- obj.name = "no";
- }
- else
- {
- document.getElementById(obj.id).style.border = "0px solid";
- document.getElementById('cross'+obj.id).style.display = "none";
- obj.title =obj.value;
- obj.name = "ok";
- }
- }
- function clkcheck(obj)
- {
- if(obj.value == "")
- {
- document.getElementById(obj.id).style.border = "1px solid #FF0000";
- document.getElementById("cross"+obj.id).style.display = "inline";
- obj.value = "";
- }
- else if(obj.value)
- {
- var n = obj.value.indexOf(":");
- var l = obj.value.length;
- if(n != "2" || l!= "5")
- {
- document.getElementById(obj.id).style.border = "1px solid #FF0000";
- document.getElementById("cross"+obj.id).style.display = "inline";
- obj.value = "";
- alert(" Fill date in HH:MM formet") ;
- }
- else
- {
- var h = obj.value.split(":");
- if(h[0][0]=="0" || h[0][0]=="1"|| h[0][0]=="2")
- {
- if(h[0][0] == "2")
- {
- //if(h[0][1]=="0" || h[0][1]=="1"|| h[0][1]=="2" || h[0][1]=="3")
- if(h[0][1]>4)
- {
- document.getElementById(obj.id).style.border = "1px solid #FF0000";
- document.getElementById("cross"+obj.id).style.display = "inline";
- obj.value = "";
- alert("Fill HH(0-23)");
- }
- }
- else if((h[1][0]>5))
- {
- document.getElementById(obj.id).style.border = "1px solid #FF0000";
- document.getElementById("cross"+obj.id).style.display = "inline";
- obj.value = "";
- alert("Fill MM(0-59)");
- }
- else
- document.getElementById("setclk").style.display = "inline";
- }
- else
- {
- document.getElementById(obj.id).style.border = "1px solid #FF0000";
- document.getElementById("cross"+obj.id).style.display = "inline";
- obj.value = "";
- alert("Fill HH(0-23)");
- }
- }
- }
- }
- function datech()
- {
- document.getElementById("setclk").style.display = "inline";
- }
- function go_conf()
- {
- if(document.getElementById("cmnum").value != "select")
- {
- for(i=0;i<9;i++)
- {
- var s = document.getElementById("rsu_"+i);
- if(s.value == "")
- {
- s.style.border = "1px solid #FF0000";
- document.getElementById("crossrsu_"+i).style.display = "inline";
- alert("Fill empty red shaded field correctly");
- break;
- }
- else
- {
- if(s.title == "no")
- {
- alert("Fill empty red shaded field correctly");
- break;
- }
- else if(i==8)
- {
- document.getElementById("rsu").style.opacity = 0.6;
- document.getElementById("rsu").style.filter= "alpha(opacity=60)";
- go_confirm();
- }
- }
- }
- }
- else
- go_confirm();
- }
- function go_confirm()
- {
- settingval = ntpval+"_"+licval+"_"+pmval+"_"+haval;
- //alert(settingval);
- document.getElementById("confirmrsu").style.display = "none";
- doWork(settingval,"set_confirm","config");
- }
- function ntp_title(obj)
- {
- if(obj.name != "no")
- {
- document.getElementById(obj.id).style.border = "0px solid";
- //document.getElementById('cross'+obj.id).style.display = "none";
- }
- }
- function ntp_title1(obj)
- {
- if(obj.title != "no")
- {
- document.getElementById(obj.id).style.border = "0px solid";
- document.getElementById('cross'+obj.id).style.display = "none";
- }
- }
- function ha_typ()
- {
- if(document.getElementById("conf_16").value == "1")
- {
- for(i=0;i<8;i++)
- document.getElementById("ha_ty"+i).style.display = "inline";
- }
- else
- {
- for(i=0;i<8;i++)
- document.getElementById("ha_ty"+i).style.display = "none";
- }
- }
- function rsuconf(obj)
- {
- var data = null;
- //alert(obj.id);
- data = obj.id;
- doWork(data,"get_confrsu","config");
- }
- function edit_ntp()
- {
- document.getElementById("rsu").style.opacity = 0.6;
- document.getElementById("rsu").style.filter= "alpha(opacity=60)";
- document.getElementById("confirmtab").style.display = "none";
- get_dt();
- }
- function cancel_setting()
- {
- document.getElementById("rsu").style.opacity = 0.6;
- document.getElementById("rsu").style.filter= "alpha(opacity=60)";
- document.getElementById("confirmtab").style.display = "none";
- //basic_config();
- }
- function edit_lic()
- {
- document.getElementById("rsu").style.opacity = 0.6;
- document.getElementById("rsu").style.filter= "alpha(opacity=60)";
- document.getElementById("confirmtab").style.display = "none";
- get_licence();
- }
- function edit_pm()
- {
- document.getElementById("rsu").style.opacity = 0.6;
- document.getElementById("rsu").style.filter= "alpha(opacity=60)";
- document.getElementById("confirmtab").style.display = "none";
- get_pm();
- }
- function ntpd_apply()
- {
- ntpdchange = null;
- for(vdx=2;vdx<5;vdx++)
- {
- if(document.getElementById("conf_"+vdx).name == "changed")
- {
- ntpdchange = 1;
- var setvalue = null;
- for(jdx = 2;jdx<5;jdx++)
- {
- var z = document.getElementById("conf_"+jdx);
- if(setvalue == null)
- setvalue = z.value;
- else
- setvalue += "|"+z.value;
- }
- doWork(setvalue,"apply_set","config");
- break;
- }
- else
- {
- if(vdx == "4")
- {
- ntpdchange = 0;
- if(visible == 0)
- {
- waittorestart();
- break;
- }
- else
- {
- licence_apply();
- break;
- }
- }
- }
- }
- }
- function network_apply()
- {
- document.getElementById("con").style.display="inline";
- apply_notify(null);
- networkchange = null;
- for(vdx = 5;vdx<12;vdx++)
- {
- // alert(vdx);
- if(document.getElementById("conf_"+vdx).name == "changed")
- {
- networkchange = 1;
- var setvalue = null;
- for(jdx = 5;jdx<12;jdx++)
- {
- var z = document.getElementById("conf_"+jdx);
- if(!z.value)
- {
- z.value = "0";
- }
- if(setvalue == null)
- setvalue = z.value;
- else
- setvalue += "|"+z.value;
- }
- doWork(setvalue,"network_set","config");
- break;
- }
- else
- {
- if(vdx == "11")
- {
- ntpd_apply();
- break;
- }
- }
- }
- }
- function lic_ip(obj)
- {
- var data = obj.id+"^"+obj.value;
- if(obj.value != "localhost")
- doWork(data,"ip_validate","config");
- }
- function ip_check(obj)
- {
- var data = obj.id+"^"+obj.value;
- if(obj.id == "pm_1")
- {
- if(obj.value == ntpval.split(':')[3])
- {
- document.getElementById(obj.id).style.border = "1px solid #FF0000";
- document.getElementById("cross"+obj.id).style.display="inline";
- obj.name = "no";
- alert("Pm address should be different than eth0");
- }
- else
- doWork(data,"ip_validate","config");
- }
- else if(obj.id == "net_9")
- {
- if((obj.value != "")||(obj.value == "NULL"))
- doWork(data,"ip_validate","config");
- else
- {
- document.getElementById(obj.id).style.border = "0px solid";
- document.getElementById('cross'+obj.id).style.display = "none";
- obj.name = "ok";
- }
- }
- else
- doWork(data,"ip_validate","config");
- }
- function validateEmail( obj ) // validation of email address in dongle
- {
- if(document.getElementById(obj.id).value)
- {
- var pattern = /^[a-z\d]+(?:[\-\.\_][a-z\d]+)*[a-z\d]+@[\w\d]+(?:[-\.][a-z\d][a-z\d\-]*[a-z\d])*[a-z\d]+\.([a-z]{2,4})(\.([a-z]{2,4}))*$/i;
- var x = pattern.test(obj.value) ? true : false;
- if(x == false)
- {
- document.getElementById(obj.id).style.border = "1px solid #FF0000";
- document.getElementById("cross"+obj.id).style.display="inline";
- obj.name = "no";
- }
- else
- {
- document.getElementById(obj.id).style.border = "0px solid";
- document.getElementById('cross'+obj.id).style.display = "none";
- obj.name = "ok";
- }
- }
- }
- function validateoffset(obj)
- {
- if(obj.value>4096 || obj.value<0 || obj.value == "")
- {
- document.getElementById(obj.id).style.border = "1px solid #FF0000";
- document.getElementById("cross"+obj.id).style.display="inline";
- obj.name = "no";
- }
- else
- {
- document.getElementById(obj.id).style.border = "0px solid";
- document.getElementById('cross'+obj.id).style.display = "none";
- obj.name = "ok";
- }
- }
- function idcheck(obj)
- {
- if(obj.value == "")
- {
- document.getElementById(obj.id).style.border = "1px solid #FF0000";
- document.getElementById("cross"+obj.id).style.display="inline";
- obj.name == "no";
- }
- else
- {
- document.getElementById(obj.id).style.border = "0px solid";
- document.getElementById('cross'+obj.id).style.display = "none";
- obj.name == "ok";
- }
- }
- function apply_last(data)
- { document.getElementById("notify_conf").style.display = "inline";
- document.getElementById("notify_conf").style.position = "absolute";
- document.getElementById("notify_conf3").innerHTML = data;
- document.getElementById("notify_conf").style.display = "block";
- document.getElementById("notify_conf").style.marginLeft = "220px";
- document.getElementById("notify_conf").style.marginTop = "150px";
- document.getElementById("notify_conf").style.opacity = "1";
- setTimeout("waittorestart()", 3000);
- }
- function waittorestart()
- {
- //var data = networkchange+"^"+ntpdchange+"^"+licchange+"^"+pmchange+"^"+rsucha;
- var data;
- if(networkchange)
- data = networkchange;
- if(ntpdchange)
- data += "^"+ntpdchange;
- if(licchange)
- data += "^"+licchange;
- if(pmchange)
- data += "^"+pmchange;
- if(rsucha)
- data += "^"+rsucha;
- document.getElementById("notify_conf").style.display = "none";
- if(!data)
- {
- alert("No change encountered in previous settings");
- document.getElementById("con").style.display = "none";
- edit_ntp();
- }
- else
- {
- doWork(data,"restart","config");
- }
- }
- function restart()
- {
- //alert(data);
- document.getElementById("con").style.display = "none";
- document.getElementById("notify_conf").style.display = "none";
- restartmsg("System will reboot now ! Please wait...");
- //doWork(true,"go_restart","config");
- }
- function norestart()
- {
- document.getElementById("notify_conf").style.display = "none";
- document.getElementById("con").style.display = "none";
- cancel_setting();
- }
- function replaceall(str,replace,with_this)
- {
- var str_hasil ="";
- for(var i=0;i<str.length;i++)
- {
- if (str[i] == replace)
- {
- var temp = with_this;
- }
- else
- {
- var temp = str[i];
- }
- str_hasil += temp;
- }
- return str_hasil;
- }
- function applyclock()
- {
- var setvalue = null;
- for(jdx = 10;jdx<12;jdx++)
- {
- var z = document.getElementById("net_"+jdx);
- if(setvalue == null)
- setvalue = z.value;
- else
- setvalue += "|"+z.value;
- }
- setvalue = replaceall(setvalue,"/","-");
- doWork(setvalue,"apply_clock","config");
- }
- function yocheck(obj)
- {
- var data = obj.id+"^"+obj.value;
- doWork(data,"maskcheck","config");
- }
- function exit_lic()
- {
- document.getElementById("confirmrsu").style.display = "none";
- }
- //Functions Added by Anuja
- function date_time()
- {
- //alert("Here in function date_time");
- doWork(true,"date_time","systemConf");
- }
- function ip_conf()
- {
- doWork(true,"ip_conf","systemConf");
- }
- function set_date_time()
- {
- /*
- var a = document.getElementById("net_0").value;
- var b = document.getElementById("net_1").value;
- var c = document.getElementById("net_2").value;
- if((a==b)||(a==c)||(b==c))
- {
- alert("Server addresses cannot be same.Please fill different server address");
- }
- var setvalue = null;
- for(jdx = 10;jdx<12;jdx++)
- {
- var z = document.getElementById("net_"+jdx);
- if(setvalue == null)
- setvalue = z.value;
- else
- setvalue += "|"+z.value;
- }
- setvalue = replaceall(setvalue,"/","-");
- setvalue += "|"+a+"|"+b+"|"+c;
- */
- //alert("DT Called");
- var a = document.getElementById("net_10").value;
- var b = document.getElementById("net_11").value;
- var setvalue = a+"|"+b;
- //alert(setvalue);
- doWork(setvalue,"apply_clock","systemConf");
- }
- function ip_val(obj)
- {
- //alert(obj.value+"---"+obj.title+"___"+obj.id+"__"+document.getElementById(Id));
- var IPvalue = obj.value;
- var Id = obj.id;
- if(IPvalue == "0.0.0.0")
- {
- errorString = "";//errorString + theName + ': '+IPvalue+' is a special IP address and cannot be used here.';
- }
- else
- {
- var ip = IPvalue.split(".", 4);
- val = IPvalue.indexOf("0");
- if(ip[0] > 255 || ip[1] > 255 || ip[2] > 255 || ip[3] > 255)
- {
- // alert(Id);
- document.getElementById(Id).style.border = "1px solid #FF0000";
- document.getElementById("cross"+Id).style.display="inline";
- document.getElementById(Id).name = "no";
- return false;
- }
- errorString = "";
- theName = "IPaddress";
- var ipPattern = /^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/;
- var ipArray = IPvalue.match(ipPattern);
- if(ipArray == null)
- errorString = errorString + theName + ': '+IPvalue+' is not a valid IP address.';
- else
- {
- for (i = 0; i < 4; i++)
- {
- thisSegment = ipArray[i];
- if(thisSegment > 255)
- {
- errorString = errorString + theName + ': '+IPvalue+' is not a valid IP address.';
- i = 4;
- }
- if((i == 0) && (thisSegment > 255))
- {
- errorString = errorString + theName + ': '+IPvalue+' is a special IP address and cannot be used here.';
- i = 4;
- }
- }
- }
- }
- if(errorString == "")
- {
- document.getElementById(Id).style.color = "#000000";
- document.getElementById(Id).name = "Right";
- return true;
- }
- else
- {
- document.getElementById(Id).style.border = "1px solid #FF0000";
- document.getElementById("cross"+Id).style.display="inline";
- document.getElementById(Id).name = "no";
- }
- }
- function sys_set(obj)
- {
- //alert(obj);
- val = obj;
- //alert(val);
- doWork(val,"sys_set","systemConf");
- }
- function sysIPchange(obj)
- {
- //alert(obj.value+"---"+obj.id+"---");//+document.getElementById("hiddenShelfVal").value);
- var IPvalue = obj.value;
- var Id = obj.id;
- if(IPvalue == "0.0.0.0")
- errorString = "";//errorString + theName + ': '+IPvalue+' is a special IP address and cannot be used here.';
- else
- {
- var ip = IPvalue.split(".", 4);
- val = IPvalue.indexOf("0");
- if(ip[0] > 255 || ip[1] > 255 || ip[2] > 255 || ip[3] > 255)
- {
- // alert(Id);
- document.getElementById(Id).style.border = "1px solid #FF0000";
- document.getElementById("cross"+Id).style.display="inline";
- document.getElementById(Id).name = "no";
- return false;
- }
- errorString = "";
- theName = "IPaddress";
- var ipPattern = /^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/;
- var ipArray = IPvalue.match(ipPattern);
- if(ipArray == null)
- errorString = errorString + theName + ': '+IPvalue+' is not a valid IP address.';
- else
- {
- for (i = 0; i < 4; i++)
- {
- thisSegment = ipArray[i];
- if(thisSegment > 255)
- {
- errorString = errorString + theName + ': '+IPvalue+' is not a valid IP address.';
- i = 4;
- }
- if((i == 0) && (thisSegment > 255))
- {
- errorString = errorString + theName + ': '+IPvalue+' is a special IP address and cannot be used here.';
- i = 4;
- }
- }
- }
- }
- if(errorString == "")
- {
- document.getElementById(Id).style.border = "#d5d5d5";
- document.getElementById(Id).name = "Right";
- document.getElementById("cross"+Id).style.display="none";
- return true;
- }
- else
- {
- document.getElementById(Id).style.border = "1px solid #FF0000";
- document.getElementById("cross"+Id).style.display="inline";
- document.getElementById(Id).name = "no";
- }
- }
- function set_ip_conf()
- {
- //alert("Here in function set_ip_conf");
- var val = '';
- var k = '';
- var priority0 = document.getElementById("prio0").value;
- var priority1 = document.getElementById("prio1").value;
- var priority2 = document.getElementById("prio2").value;
- var priority3 = document.getElementById("prio3").value;
- if((priority0 != priority1) && (priority0 != priority2) && (priority0 != priority3))
- {
- if((priority1 != priority2) && (priority1 != priority3))
- {
- if(priority2 != priority3)
- {
- k = priority0 + priority1 + priority2 + priority3;
- }
- else
- {
- alert("Clock Priority cannot contain same values");
- return;
- }
- }
- else
- {
- alert("Clock Priority cannot contain same values");
- return;
- }
- }
- else
- {
- alert("Clock Priority cannot contain same values");
- return;
- }
- /*
- for(i=0;i<4;i++)
- {
- k += document.getElementById("prio"+i).value;
- }
- */
- document.getElementById("sys_10").value = k;
- //alert(k);
- for(i=1;i<=11; i++)
- {
- if(document.getElementById("sys_"+i).name == "no")
- {
- alert("The field marked red contains invalid value, Please enter correctly ");
- return;
- }
- val += document.getElementById("sys_"+i).value;
- val += "|";
- }
- // alert(document.getElementById("sys_9").value);
- doWork(val,"ipCore_set","systemConf");
- }
- function showHome()
- {
- //alert("Here in function showHome()");
- doWork(true,"show_home","systemConf");
- }
- function network_conf()
- {
- //alert("here in function network_conf()")
- doWork(true,"network_conf","systemConf");
- }
- function set_network_conf()
- {
- if (confirm('WARNING !! Changing IP Address will stop all communicaton with the device, You need to reconnect the device with NEW IP. \n Are you sure to CONTINUE ???'))
- {
- // NSB :: Field Count is changed from 9 to 6, as Eth2 is removed
- for(i=1;i<6;i++)
- {
- if(document.getElementById("net_"+i).name == "no")
- {
- alert("Please fill red marked values correctly");
- return;
- }
- }
- var val = '';
- for(i=1;i<6;i++)
- {
- val += document.getElementById("net_"+i).value + "|";
- }
- doWork(val,"set_network_conf","systemConf");
- }
- }
- //Till here
- //Functions added for Vmail/IVR page
- /*function ivr_levels()
- {
- alert("Here in function ivr_levels");
- doWork(true,"ivr_levels","vmailIVRConf");
- }
- function fetch_IVR_level_value()
- {
- alert(document.getElementById("ivrL").value);
- var level = document.getElementById("ivrL").value;
- if(level != "Select")
- {
- doWork(level,"ivr_fetch_levels","vmailIVRConf");
- }
- }*/
- function ivr_levels()
- {
- //alert("Here in function ivr_levels");
- doWork(true,"ivr_fetch_levels","vmailIVRConf");
- }
- function editIvrLevel(obj)
- {
- //alert("here in editIvrLevel()"+obj);
- //alert(document.getElementById("ivr1_0").innerText);
- var element1 = document.getElementById("ivr1_"+obj);
- var accessCode = (element1.innerText || element1.textContent).trim();
- var element2 = document.getElementById("ivr2_"+obj);
- var actionType = (element2.innerText || element2.textContent).trim();
- var element3 = document.getElementById("ivr3_"+obj);
- var fileName = (element3.innerText || element3.textContent).trim();
- var element4 = document.getElementById("ivr4_"+obj);
- var fileIndex = (element4.innerText || element4.textContent).trim();
- var element5 = document.getElementById("ivr5_"+obj);
- var userNumber = (element5.innerText || element5.textContent).trim();
- var editMenu = '';
- editMenu += '<div style="width:60%; height:60%; margin-top:80px;">';
- editMenu += '<div style="width:100%; height:10%;font-size:20px;font-weight:bold;">IVR Level Configuration</div>';
- editMenu += '<div style="width:100%;height:100%;">';
- editMenu += '<table width="70%" height="70%" style="margin-top:2%;">';
- editMenu += '<tbody>';
- editMenu += '<tr>';
- editMenu += '<td>IVR Level</td><td><input id="ivr_lvl" readonly style="width:50px;text-align:center;background-color:#C0C0C0;cursor:default;" type="text" value='+obj+'></td>';
- editMenu += '</tr>';
- editMenu += '<tr id="accessCodeTR">';
- editMenu += '<td >Access Code</td><td><input id="access_code" style="width:50px;text-align:center;" type="text" onKeyPress="return checkIt(event)" value='+accessCode+'></td>';
- editMenu += '</tr>';
- editMenu += '<tr>';
- editMenu += '<td>Action type</td>';
- editMenu += '<td><select id="action_type" style="width:90px;" onchange="enaDisValues(this.value)">';
- /* if(actionType != "-")
- {
- editMenu += '<option value="'+actionType+'" selected>'+actionType+'</option>';
- }
- else
- {
- editMenu += '<option selected>Select</option>';
- }
- */ editMenu += '<option >Select</option>';
- editMenu += '<option value="NO_ACTION">NO_ACTION</option>';
- editMenu += '<option value="FILE_PLAY">FILE_PLAY</option>';
- editMenu += '<option value="SUBSCRIBER">SUBSCRIBER</option>';
- editMenu += '<option value="HANGUP">HANGUP</option>';
- editMenu += '<option value="MAIN_MENU">MAIN_MENU</option>';
- editMenu += '<option value="PREV_MENU">PREV_MENU</option>';
- editMenu += '<option value="LAST_PLAY">LAST_PLAY</option>';
- editMenu += '<option value="START_RECORDING">START_RECORDING</option>';
- editMenu += '<option value="VMAIL_ACCS">VMAIL_ACCS</option>';
- editMenu += '<option value="DISABLE">DISABLE</option>';
- editMenu += '</select></td>';
- editMenu += '</tr>';
- editMenu += '<tr id="fileNameTR" style="display:none;">'; //style="visibility: hidden;">';
- editMenu += '<td>File Name</td><td><input id="ivrFileName" style="width:50px;text-align:center;" type="text" value='+fileName+'></td>';
- editMenu += '</tr>';
- /* editMenu += '<tr>';
- editMenu += '<td>File Index</td><td><input id="ivrFileIndex" style="width:50px;text-align:center;" type="text" value='+fileIndex+'></td>';
- editMenu += '</tr>';
- */ editMenu += '<tr id="userNoTR" style="display:none;">';
- editMenu += '<td>User Number</td><td><input id="ivrUserNum" style="width:50px;text-align:center;" type="text" value='+userNumber+'></td>';
- editMenu += '</tr>';
- editMenu += '<tr><td><input type="button" value="submit" onclick="updateIvrLevel()"/></td>';
- editMenu += '<td><input type="button" value="cancel" onclick="close_ivr()"/></td></tr>';
- editMenu += '</tbody>';
- editMenu += '</table>';
- editMenu += '</div>';
- editMenu += '</div>';
- document.getElementById("ivrAdd").innerHTML = editMenu;
- document.getElementById("ivrAdd").style.display = "inline";
- if(actionType != "-")
- {
- document.getElementById("action_type").value = actionType;
- }
- else
- {
- document.getElementById("action_type").value = "Select";
- }
- if(actionType == "FILE_PLAY")
- {
- //document.getElementById("ivrUserNum").readOnly = true;
- document.getElementById("fileNameTR").style.display = "table-row" ;
- }
- else if(actionType == "SUBSCRIBER")
- {
- //document.getElementById("ivrFileName").readOnly = true;
- //document.getElementById("ivrFileIndex").readOnly = true;
- document.getElementById("userNoTR").style.display = "table-row";
- }
- else if(actionType == "DISABLE")
- {
- document.getElementById("access_code").readOnly = true;
- document.getElementById("access_code").style.backgroundColor = "#C0C0C0";
- document.getElementById("access_code").style.cursor = "default";
- }
- else
- {
- //document.getElementById("ivrUserNum").readOnly = true;
- //document.getElementById("ivrFileName").readOnly = true;
- //document.getElementById("ivrFileIndex").readOnly = true;
- }
- }
- function enaDisValues(obj)
- {
- //alert("Here in enaDisValues()__"+obj);
- if(obj == "FILE_PLAY")
- {
- //document.getElementById("ivrUserNum").readOnly = true;
- //document.getElementById("ivrFileName").readOnly = false;
- //document.getElementById("ivrFileIndex").readOnly = false;
- document.getElementById("fileNameTR").style.display = "table-row";
- document.getElementById("userNoTR").style.display = "none";
- document.getElementById("access_code").readOnly = false;
- document.getElementById("access_code").style.backgroundColor = "White";
- document.getElementById("access_code").style.cursor = "initial";
- }
- else if(obj == "SUBSCRIBER")
- {
- //document.getElementById("ivrUserNum").readOnly = false;
- //document.getElementById("ivrFileName").readOnly = true;
- //document.getElementById("ivrFileIndex").readOnly = true;
- document.getElementById("fileNameTR").style.display = "none";
- document.getElementById("userNoTR").style.display = "table-row";
- document.getElementById("access_code").readOnly = false;
- document.getElementById("access_code").style.backgroundColor = "White";
- document.getElementById("access_code").style.cursor = "initial";
- }
- else if(obj == "DISABLE")
- {
- document.getElementById("access_code").readOnly = true;
- document.getElementById("access_code").style.backgroundColor = "#C0C0C0";
- document.getElementById("access_code").style.cursor = "default";
- document.getElementById("fileNameTR").style.display = "none";
- document.getElementById("userNoTR").style.display = "none";
- }
- else
- {
- //document.getElementById("ivrUserNum").readOnly = true;
- //document.getElementById("ivrFileName").readOnly = true;
- //document.getElementById("ivrFileIndex").readOnly = true;
- document.getElementById("fileNameTR").style.display = "none";
- document.getElementById("userNoTR").style.display = "none";
- document.getElementById("access_code").readOnly = false;
- document.getElementById("access_code").style.backgroundColor = "White";
- document.getElementById("access_code").style.cursor = "initial";
- }
- }
- function close_ivr()
- {
- document.getElementById("ivrAdd").style.display = "none";
- }
- function updateIvrLevel()
- {
- //alert("Here in updateIvrLevel()");
- var val='';
- val += document.getElementById("ivr_lvl").value+"|";
- val += document.getElementById("access_code").value+"|";
- val += document.getElementById("action_type").value+"|";
- val += document.getElementById("ivrFileName").value+"|";
- //val += document.getElementById("ivrFileIndex").value+"|";
- val += document.getElementById("ivrUserNum").value;
- //alert(val);
- doWork(val,"update_ivr_levels","vmailIVRConf");
- }
- function ivr_options()
- {
- alert("Here in function ivr_options");
- }
- function vmail_users()
- {
- //alert("Here in function vmail_users");
- doWork(true,"vmail_users","vmailIVRConf");
- }
- function addUser()
- {
- //alert("Here in addUser");
- doWork(true,"add_user","vmailIVRConf");
- }
- function addVmailUser()
- {
- //alert("Here in addVmailUser");
- if(document.getElementById("ext_no").value == '')
- {
- alert("Please fill the extension no correctly.")
- return;
- }
- var val= '';
- val += document.getElementById("ext_no").value+"|";
- val += document.getElementById("on_busy").value+"|";
- val += document.getElementById("on_no_answer").value;
- //alert(val);
- doWork(val,"add_vmail_user","vmailIVRConf");
- }
- function vmailCheck(obj)
- {
- //alert(obj.id+"---"+obj.value+"---"+obj.checked);
- var id = obj.id;
- if(obj.checked == true)
- {
- document.getElementById(id).value = '1';
- }
- else
- {
- document.getElementById(id).value = '0';
- }
- }
- function editVmailUser(obj)
- {
- var element1 = document.getElementById("user1_"+obj);
- var extnNo = (element1.innerText || element1.textContent).trim();
- var element2 = document.getElementById("user2_"+obj);
- var onBusy = (element2.innerText || element2.textContent).trim();
- var element3 = document.getElementById("user3_"+obj);
- var onNoAns = (element3.innerText || element3.textContent).trim();
- //alert("Here in editVmailUser__"+obj+"___"+extnNo+"____"+onBusy+"____"+onNoAns);
- var editData = '';
- editData += '<div style="margin-top:50px;">';
- editData += '<table width="40% border="1">';
- editData += '<tr><td colspan="2" style="text-align:center;font-weight:bold;font-size:14px;">Edit Vmail User</td></tr>';
- editData += '<tr><td> </td></tr>';
- editData += '<tr><td>Extension No</td><td>'+extnNo+'</td>';
- editData += '<tr><td>On Busy</td>';
- if(onBusy == "No")
- editData += '<td><input type="checkbox" id="valOnBusy" value="0" unchecked onclick="changeVal(this)"></td>';
- else
- editData += '<td><input type="checkbox" id="valOnBusy" value="1" checked onclick="changeVal(this)"></td>';
- editData += '</tr>';
- editData += '<tr><td>On No Answer</td>';
- if(onNoAns == "No")
- editData += '<td><input type="checkbox" id="valOnAns" value="0" unchecked onclick="changeVal(this)"></td>';
- else
- editData += '<td><input type="checkbox" id="valOnAns" value="1" checked onclick="changeVal(this)"></td>';
- editData += '</tr>';
- editData += '<tr><td> </td></tr>';
- editData += '<tr><td><input type="button" value="Update" onclick="updateUser('+extnNo+')"></td><td><input type="button" value="Cancel" onclick="vmail_users()"></td></tr>';
- editData += '</table>';
- editData += '</div>';
- document.getElementById('tab_data').innerHTML = editData;
- }
- function changeVal(obj)
- {
- //alert(obj.id+"__"+obj.value+"__"+obj.checked);
- if(obj.checked == true)
- document.getElementById(obj.id).value = '1';
- else
- document.getElementById(obj.id).value = '0';
- }
- function updateUser(val)
- {
- //alert(val);
- var updateVal = '';
- updateVal += val+"|";
- updateVal += document.getElementById("valOnBusy").value+"|";
- updateVal += document.getElementById("valOnAns").value;
- //alert(updateVal);
- doWork(updateVal,"update_vmail_user","vmailIVRConf");
- }
- function deleteVmailUser(obj)
- {
- //alert("Here in deleteVmailUser");
- var element = document.getElementById("user1_"+obj);
- var extnNo = (element.innerText || element.textContent).trim();
- //alert(extnNo);
- doWork(extnNo,"delete_vmail_user","vmailIVRConf");
- }
- function vmail_options()
- {
- //alert("Here in function vmail_options");
- }
- function vmail_prompts()
- {
- //alert("Here in function vmail_prompts");
- doWork(true,"vmail_prompts","vmailConf");
- }
- function hide_add_bgrp()
- {
- rfr_sid_fetch_bgrp();
- }
- function updateVmailPrompts(obj,objPrevName)
- {
- //alert("updateVmailPrompts()" + obj);
- var id = obj.id;
- var newFileName = document.getElementById(id).files[0].name;
- var idArr = id.split('-');
- var prevFileName = objPrevName;
- //alert(newFileName+"____"+prevFileName);
- var idNum = idArr[0].split('_');
- {
- document.getElementById("updateVmailButton_"+idNum[1]).disabled = false;
- alert("New File Selected, Click on UPDATE to Upload the FILE");
- }
- }
- function updateVmailPrompts1(obj)
- {
- alert("updateVmailPrompts()" + obj.id);
- alert("File Selected = " + document.getElementById(obj.id).files[0].name);
- }
- function BackupAll()
- {
- doWork(true,'get_backup_name','search');
- }
- function get_backup()
- {
- //alert("i am here");
- //alert(document.getElementById("number").value);
- //var file_name = document.getElementById("number").value;
- if(document.getElementById("number").value)
- {
- var file_name = document.getElementById("number").value;
- var val = file_name+".tar.gz";
- //alert(val);
- doWork(val,'BackupAll','search');
- }
- else
- info_notify("No Value Entered!");
- }
- function export_backup()
- {
- doWork(true,'export_backup','search');
- }
- function RestoreAll()
- {
- doWork(true,'get_restore_name','search');
- }
- function get_restore()
- {
- //alert("i am here");
- //alert(document.getElementById("number").value);
- //var file_name = document.getElementById("number").value;
- if(document.getElementById("number").value)
- {
- var file_name = document.getElementById("number").value;
- var val = file_name+".tar.gz";
- //alert(val);
- doWork(val,'RestoreAll','search');
- }
- else
- info_notify("No Value Entered!");
- }
- function getKtsNumber()
- {
- doWork(true,'getKtsNum','search');
- }
- function change_in_master(cardnum)
- {
- val=+cardnum;
- doWork(val,'change_in_master','search');
- }
- function change_in_slave(cardnum)
- {
- val=+cardnum;
- doWork(val,'change_in_slave','search');
- }
- function set_time_zone()
- {
- var a = document.getElementById("selecttimezone").value;
- var b = document.getElementById("net_10").value;
- var c = document.getElementById("net_11").value;
- if(a =="please select timezone")
- {
- alert("please select timezone");
- }
- var timezone = a.split("(");
- alert(timezone[1]);
- var setvalue = b+"|"+c+"|"+timezone[1];
- doWork(setvalue,"apply_timezone","systemConf");
- }
- function nsb_soft_reset_card(obj)
- {
- val=+obj
- var ret=confirm("WARNING! CARD RESTART MAY DROP RUNNING CALLS of SYSTEM. \n Are you sure to Proceed! ?? ");
- if (ret==true)
- {
- doWork(val,'soft_reset_card','search');
- }
- }
- function acd_login()
- {
- var c = document.getElementById("port_num1").value;
- doWork(c,'acd_login','search');
- }
- function acd_logout()
- {
- var c = document.getElementById("port_num1").value;
- doWork(c,'acd_logout','search');
- }
- function change_db(obj)
- {
- var val=+obj
- db = document.getElementById("db_"+ val).value;
- var setvalue = val+"|"+db;
- //alert(setvalue);
- doWork(setvalue,'change_database','search');
- }
- function displaycdr()
- {
- doWork(true,'display_cdr','search');
- }
- function sip_trunk_show()
- {
- var hintnum = "";
- var type = "sip-trk";
- var num_type = 3;
- var pass = hintnum+"|"+type+"|"+num_type;
- doWork(pass,'get_nums','search');
- }
- function sip_ext_show()
- {
- var hintnum = "";
- var type = "sip-ext";
- var num_type = "3";
- var pass = hintnum+"|"+type+"|"+num_type;
- doWork(pass,'get_nums','search');
- }
- function modify_sipnum()
- {
- document.getElementById("addwin").style.display = "none";
- document.getElementById("delwin").style.display = "none";
- document.getElementById("modifywin").style.display = "inline";
- }
- function delete_sipnum()
- {
- document.getElementById("addwin").style.display = "none";
- document.getElementById("modifywin").style.display = "none";
- document.getElementById("delwin").style.display = "inline";
- }
- function add_sipnum()
- {
- document.getElementById("delwin").style.display = "none";
- document.getElementById("modifywin").style.display = "none";
- document.getElementById("addwin").style.display = "inline";
- }
- function cancel_tab()
- {
- document.getElementById("delwin").style.display = "none";
- document.getElementById("modifywin").style.display = "none";
- document.getElementById("addwin").style.display = "none";
- }
- function modify_sip_num(data)
- {
- var temp = "";
- var obj= 3;
- var subusrtyp = "SIP";
- if(data == "sip-trk")
- {
- //alert("in sip trunk");
- var id ="sip-trk";
- var usrtyp ="TRK";
- }
- else
- {
- //alert("in sip ext");
- var id ="sip-ext";
- var usrtyp = "EXT";
- }
- var start = document.getElementById("md_ser_start").value;
- var end = document.getElementById("md_ser_end").value;
- var startnew = document.getElementById("strt_new_ser").value;
- if(start == "")
- {
- alert("Start Number is mandatory!");
- return;
- //doWork(obj,"add-mod-del","feat");
- }
- else if(end && start > end)
- {
- alert("Start value should be smaller than End value!");
- return;
- //doWork(obj,"add-mod-del","feat");
- }
- else if((end - start) > 50)
- {
- alert("Max Range is 50!");
- return;
- //doWork(obj,"add-mod-del","feat");
- }
- else
- {
- var value = escape(obj+"|"+start+"|"+end+"|"+startnew+"|"+temp+"|"+id);
- //alert(value);
- doWork(value,"doit","feat");
- }
- }
- function add_sip_num(data)
- {
- var obj= 1;
- var subusrtyp = "SIP";
- if(data == "sip-trk")
- {
- //alert("in sip trunk");
- var id ="sip-trk";
- var usrtyp ="TRK";
- }
- else
- {
- //alert("in sip ext");
- var id ="sip-ext";
- var usrtyp = "EXT";
- }
- var start = document.getElementById("start").value;
- var end = document.getElementById("end").value;
- if(start == "")
- {
- alert("Start Number is mandatory!");
- return;
- //doWork(obj,"add-mod-del","feat");
- }
- else if(end && start > end)
- {
- alert("Start value should be smaller than End value!");
- return;
- //doWork(obj,"add-mod-del","feat");
- }
- else if(usrtyp == "-1" || subusrtyp == "-1")
- {
- alert("Filling all fields is mandatory!");
- return;
- //doWork(obj,"add-mod-del","feat");
- }
- else
- {
- var value = (obj+"|"+usrtyp+"|"+subusrtyp+"|"+start+"|"+end+"|"+id);
- //alert(value);
- doWork(value,"doit","feat");
- }
- }
- function del_sip_num(data)
- {
- var obj= 2;
- var subusrtyp = "SIP";
- if(data == "sip-trk")
- {
- //alert("in sip trunk");
- var id ="sip-trk";
- var usrtyp ="TRK";
- }
- else
- {
- //alert("in sip ext");
- var id ="sip-ext";
- var usrtyp = "EXT";
- }
- var start = document.getElementById("md_ser_start1").value;
- var end = document.getElementById("md_ser_end1").value;
- if(start == "")
- {
- alert("Start Number is mandatory!");
- return;
- //doWork(obj,"add-mod-del","feat");
- }
- else if(end && start > end)
- {
- alert("Start value should be smaller than End value!");
- return;
- //doWork(obj,"add-mod-del","feat");
- }
- else if(usrtyp == "-1" || subusrtyp == "-1")
- {
- alert("Filling all fields is mandatory!");
- return;
- //doWork(obj,"add-mod-del","feat");
- }
- else
- {
- var value = obj+"|"+usrtyp+"|"+subusrtyp+"|"+start+"|"+end+"|"+id;
- //alert(value);
- doWork(value,"doit","feat");
- }
- }
- function modify_card_num(data)
- {
- var id = "Trk";
- var pass = data+"^"+id;
- var value = data.split("^");
- var temp = "";
- var obj= 3;
- var subusrtyp = "SIP";
- var start = document.getElementById("md_ser_start").value;
- var end = document.getElementById("md_ser_end").value;
- var startnew = document.getElementById("strt_new_ser").value;
- if(start == "")
- {
- alert("Start Number is mandatory!");
- return;
- //doWork(obj,"add-mod-del","feat");
- }
- else if(end && start > end)
- {
- alert("Start value should be smaller than End value!");
- return;
- //doWork(obj,"add-mod-del","feat");
- }
- else
- {
- var value = escape(obj+"|"+start+"|"+end+"|"+startnew+"|"+temp+"|"+pass);
- //alert(value);
- doWork(value,"doit","feat");
- }
- }
- function upload_snd()
- {
- doWork(true,'upload_music','search');
- }
- function updatemusic(obj,objPrevName)
- {
- //alert("updateVmailPrompts()" + obj);
- var id = obj.id;
- //alert(id);
- var newFileName = document.getElementById(id).files[0].name;
- //alert(newFileName);
- var prevFileName = objPrevName;
- //alert(prevFileName);
- if(id == "moh2")
- {
- document.getElementById("update_moh").disabled = false;
- alert("New File Selected, Click on UPDATE to Upload the FILE");
- }
- else if(id == "rbt_1")
- {
- document.getElementById("update_rbt").disabled = false;
- alert("New File Selected, Click on UPDATE to Upload the FILE");
- }
- else if(id == "dtm2")
- {
- document.getElementById("update_dt_musc").disabled = false;
- alert("New File Selected, Click on UPDATE to Upload the FILE");
- }
- else
- {
- document.getElementById("update_musc").disabled = false;
- alert("New File Selected, Click on UPDATE to Upload the FILE");
- }
- }
- function bulk_prog(obj)
- {
- if(obj >= 16 && obj <= 31)
- {
- document.getElementById("delwin").style.display = "none";
- document.getElementById("modifywin").style.display = "none";
- document.getElementById("addwin").style.display = "inline";
- }
- else
- {
- document.getElementById("delwin").style.display = "inline";
- document.getElementById("modifywin").style.display = "none";
- document.getElementById("addwin").style.display = "none";
- }
- }
- function display_submenu()
- {
- var data = document.getElementById("selct_prop").value;
- if(data == "Select")
- {
- alert("please select valid option");
- }
- switch(data)
- {
- case "Active":
- document.getElementById("select_me").style.display = "inline";
- document.getElementById("textme").style.display = "none";
- document.getElementById("select_lvl").value = "select";
- document.getElementById("select_lvl").style.display = "none";
- break;
- case "Dialing Rights Day":
- document.getElementById("select_lvl").style.display = "inline";
- document.getElementById("select_me").style.display = "none";
- document.getElementById("textme").style.display = "none";
- break;
- case "Dialing Rights Night":
- document.getElementById("select_lvl").style.display = "inline";
- document.getElementById("select_me").style.display = "none";
- document.getElementById("textme").style.display = "none";
- break;
- case "PCOS":
- document.getElementById("textme").style.display = "inline";
- document.getElementById("select_me").style.display = "none";
- document.getElementById("select_lvl").value = "select";
- document.getElementById("select_lvl").style.display = "none";
- break;
- case "SCOS":
- document.getElementById("textme").style.display = "inline";
- document.getElementById("select_me").style.display = "none";
- document.getElementById("select_lvl").value = "select";
- document.getElementById("select_lvl").style.display = "none";
- break;
- case "Call Waiting":
- document.getElementById("select_me").style.display = "inline";
- document.getElementById("textme").style.display = "none";
- document.getElementById("select_lvl").value = "select";
- document.getElementById("select_lvl").style.display = "none";
- break;
- case "Hot Line":
- document.getElementById("select_me").style.display = "inline";
- document.getElementById("textme").style.display = "none";
- document.getElementById("select_lvl").value = "select";
- document.getElementById("select_lvl").style.display = "none";
- case "Second Trunk Selection Rights":
- document.getElementById("select_me").style.display = "inline";
- document.getElementById("textme").style.display = "none";
- document.getElementById("select_lvl").style.display = "none";
- break;
- case "Enable * key as On Off hook":
- document.getElementById("select_me").style.display = "inline";
- document.getElementById("textme").style.display = "none";
- document.getElementById("select_lvl").value = "select";
- document.getElementById("select_lvl").style.display = "none";
- break;
- case "BackGround Music":
- document.getElementById("select_me").style.display = "inline";
- document.getElementById("textme").style.display = "none";
- document.getElementById("select_lvl").value = "select";
- document.getElementById("select_lvl").style.display = "none";
- break;
- case "Send CLI On Out Calls":
- document.getElementById("select_me").style.display = "inline";
- document.getElementById("textme").style.display = "none";
- document.getElementById("select_lvl").value = "select";
- document.getElementById("select_lvl").style.display = "none";
- break;
- case "Day Mode":
- document.getElementById("select_me").style.display = "none";
- document.getElementById("textme").style.display = "none";
- document.getElementById("select_dnmode").value = "select";
- document.getElementById("select_dnmode").style.display = "inline";
- break;
- case "Night Mode":
- document.getElementById("select_me").style.display = "none";
- document.getElementById("textme").style.display = "none";
- document.getElementById("select_dnmode").value = "select";
- document.getElementById("select_dnmode").style.display = "inline";
- break;
- }
- }
- function display_trk_submenu()
- {
- var data = document.getElementById("selct_trk_prop").value;
- if(data == "Select")
- {
- alert("please select valid option");
- }
- switch(data)
- {
- case "Active":
- document.getElementById("trk_select_me").style.display = "inline";
- document.getElementById("trk_textme").style.display = "none";
- document.getElementById("select_dnmode").value = "Select";
- document.getElementById("select_dnmode").style.display = "none";
- document.getElementById("destnum_text").style.display = "none";
- break;
- case "Day Mode":
- document.getElementById("trk_select_me").style.display = "none";
- document.getElementById("trk_textme").style.display = "none";
- document.getElementById("select_dnmode").value = "Select";
- document.getElementById("select_dnmode").style.display = "inline";
- document.getElementById("destnum_text").style.display = "none";
- break;
- case "Night Mode":
- document.getElementById("trk_select_me").style.display = "none";
- document.getElementById("trk_textme").style.display = "none";
- document.getElementById("select_dnmode").value = "Select";
- document.getElementById("select_dnmode").style.display = "inline";
- document.getElementById("destnum_text").style.display = "none";
- break;
- case "PCOS":
- document.getElementById("trk_select_me").style.display = "none";
- document.getElementById("trk_textme").style.display = "inline";
- document.getElementById("select_dnmode").value = "Select";
- document.getElementById("select_dnmode").style.display = "none";
- document.getElementById("destnum_text").style.display = "none";
- break;
- case "SCOS":
- document.getElementById("trk_select_me").style.display = "none";
- document.getElementById("trk_textme").style.display = "inline";
- document.getElementById("select_dnmode").value = "Select";
- document.getElementById("select_dnmode").style.display = "none";
- document.getElementById("destnum_text").style.display = "none";
- break;
- case "DID Group":
- document.getElementById("trk_select_me").style.display = "none";
- document.getElementById("trk_textme").style.display = "inline";
- document.getElementById("select_dnmode").value = "Select";
- document.getElementById("select_dnmode").style.display = "none";
- break;
- case "DOD Group":
- document.getElementById("trk_select_me").style.display = "none";
- document.getElementById("trk_textme").style.display = "inline";
- document.getElementById("select_dnmode").value = "Select";
- document.getElementById("select_dnmode").style.display = "none";
- break;
- case "Silent Dialing":
- document.getElementById("trk_select_me").style.display = "inline";
- document.getElementById("trk_textme").style.display = "none";
- document.getElementById("select_dnmode").value = "Select";
- document.getElementById("select_dnmode").style.display = "none";
- break;
- case "ISD Redial":
- document.getElementById("trk_select_me").style.display = "inline";
- document.getElementById("trk_textme").style.display = "none";
- document.getElementById("select_dnmode").value = "Select";
- document.getElementById("select_dnmode").style.display = "none";
- document.getElementById("destnum_text").style.display = "none";
- break;
- case "Local Redial":
- document.getElementById("trk_select_me").style.display = "inline";
- document.getElementById("trk_textme").style.display = "none";
- document.getElementById("select_dnmode").value = "Select";
- document.getElementById("select_dnmode").style.display = "none";
- document.getElementById("destnum_text").style.display = "none";
- break;
- case "STD Redial":
- document.getElementById("trk_select_me").style.display = "inline";
- document.getElementById("trk_textme").style.display = "none";
- document.getElementById("select_dnmode").value = "Select";
- document.getElementById("select_dnmode").style.display = "none";
- document.getElementById("destnum_text").style.display = "none";
- break;
- }
- }
- function display_childmenu()
- {
- var data = document.getElementById("select_dnmode").value;
- if(data == "Select")
- {
- alert("please select valid option");
- }
- switch(data)
- {
- case "3":
- document.getElementById("destnum_text").style.display = "inline";
- break;
- case "4":
- document.getElementById("destnum_text").style.display = "inline";
- break;
- }
- }
- function modify_ext_prop(obj)
- {
- var prop = document.getElementById("selct_prop").value;
- var start = document.getElementById("ser_strt").value;
- var end = document.getElementById("ser_end").value;
- var action = document.getElementById("select_me").value;
- var lvl = document.getElementById("select_lvl").value;
- var txt = document.getElementById("textme").value;
- var hint = document.getElementById("select_dnmode").value;
- if(start == "" || end == "")
- {
- alert("Please fill number range !!!");
- }
- else if( prop == "Select" && action == "Select")
- {
- alert("Please select valid property and its action !!!");
- }
- else
- {
- var value = start+"|"+end+"|"+prop+"|"+action+"|"+lvl+"|"+txt;
- value = value+"/"+obj;
- doWork(value,'modify_ext_prop','search');
- }
- }
- function modify_trk_prop(obj)
- {
- var prop = document.getElementById("selct_trk_prop").value;
- var start = document.getElementById("trk_ser_strt").value;
- var end = document.getElementById("trk_ser_end").value;
- var action = document.getElementById("trk_select_me").value;
- var lvl = document.getElementById("select_dnmode").value;
- var txt = document.getElementById("trk_textme").value;
- var txt1 = document.getElementById("destnum_text").value
- var hint = document.getElementById("select_dnmode").value;
- if(start == "" || end == "")
- {
- alert("Please fill number range !!!");
- }
- else if( prop == "Select" && action == "Select")
- {
- alert("Please select valid property and its action !!!");
- }
- else if(txt < 0 && txt > 127)
- {
- alert("Please select between 0 - 127 !!!");
- }
- else
- {
- var value = start+"|"+end+"|"+prop+"|"+action+"|"+lvl+"|"+txt+"|"+hint+"|"+txt1;
- value = value+"/"+obj;
- doWork(value,'modify_trk_prop','search');
- }
- }
- function get_propsipext(data)
- {
- var elementExists = document.getElementById("nsb_div_port");
- if(elementExists)
- document.getElementById("nsb_div_port").style.display = "inline";
- var elementExists = document.getElementById("nsb_div_cardD");
- if(elementExists)
- document.getElementById("nsb_div_cardD").style.display = "inline";
- var port = (data).split("^");
- document.getElementById("number").value = port[0];
- doWork(data,"getsipext","search");
- }
- function rfr_sip_ext(sipnum)
- {
- var data = null;
- data = document.getElementById("number").value;
- doWork(data,"getsipext","search");
- }
- function rfr_sip_ext1(sipnum)
- {
- var data = null;
- data = sipnum;
- doWork(data,"getsipext","search");
- }
- function updatsipext()
- {
- var data = null;
- data = document.getElementById("number").value;
- var all_values = null;
- //doWork("ASDWERGF","set_ext","search");
- var err_flag = 0;
- var all_values = null;
- for(jdx = 1; jdx < 68; jdx++)
- {
- var ele = document.getElementById("ext_"+jdx);
- //alert("NAME="+ele.value+"__"+jdx);
- var name = (ele.name).split(",");
- if(name[1] == "changed")
- {
- switch(name[0])
- {
- case "chk":
- {
- //alert(ele.value+"__"+ele.type+"__"+jdx);
- if(all_values == null)
- all_values = (ele.checked+"_"+ele.type+"_"+jdx);
- else
- all_values = all_values+":"+(ele.checked+"_"+ele.type+"_"+jdx);
- //alert(all_values);
- break;
- }
- case "txt":
- {
- //alert(all_values);
- if(name[1] == "changed")
- {
- if(all_values == null)
- all_values = (ele.value+"_"+ele.type+"_"+jdx);
- else
- all_values = all_values+":"+(ele.value+"_"+ele.type+"_"+jdx);
- //alert(all_values);
- break;
- }
- else
- break;
- }
- case "ssss":
- {
- var ele1 = document.getElementById("ext_"+jdx+"_a");
- var ele2 = document.getElementById("ext_"+jdx+"_b");
- if(ele.title != ele.value || ele1.title != ele1.value || ele2.title != ele2.value)
- if(all_values == null)
- all_values = (ele.value+"'"+ele1.options[ele1.selectedIndex].text+"'"+ele2.options[ele2.selectedIndex].text+"_"+ele.type+"_"+jdx);
- else
- all_values = all_values+":"+(ele.value+"'"+ele1.options[ele1.selectedIndex].text+"'"+ele2.options[ele2.selectedIndex].text+"_"+ele.type+"_"+jdx);
- //alert(all_values);
- break;
- }
- case "cti":
- {
- var ele1 = document.getElementById("ext_"+jdx+"_a");
- //alert(ele.checked)
- if(!ele.checked)
- {
- if(all_values == null)
- all_values = (ele.checked+"'"+ele1.value+"_"+ele.type+"_"+jdx);
- else
- all_values += ":"+(ele.checked+"'"+ele1.value+"_"+ele.type+"_"+jdx);
- //alert(all_values);
- }
- else if(ele1.title != ele1.value && ele.checked)
- {
- if(ele1.value == data && !err_flag)
- {
- alert("Cannot forward calls to self!");
- err_flag = 1;
- }
- else
- {
- if(all_values == null)
- all_values = (ele.checked+"'"+ele1.value+"_"+ele.type+"_"+jdx);
- else
- all_values += ":"+(ele.checked+"'"+ele1.value+"_"+ele.type+"_"+jdx);
- }
- }
- break;
- }
- case "cte":
- {
- var ele1 = document.getElementById("ext_"+jdx+"_a");
- //alert(ele.checked)
- if(!ele.checked)
- {
- if(all_values == null)
- all_values = (ele.checked+"'"+ele1.value+"_"+ele.type+"_"+jdx);
- else
- all_values += ":"+(ele.checked+"'"+ele1.value+"_"+ele.type+"_"+jdx);
- //alert(all_values);
- }
- else if(ele1.title != ele1.value && ele.checked)
- {
- if(ele1.value == data && !err_flag)
- {
- alert("Cannot forward calls to self!");
- err_flag = 1;
- }
- else
- {
- if(all_values == null)
- all_values = (ele.checked+"'"+ele1.value+"_"+ele.type+"_"+jdx);
- else
- all_values += ":"+(ele.checked+"'"+ele1.value+"_"+ele.type+"_"+jdx);
- }
- }
- break;
- }
- case "df":
- {
- var ele1 = document.getElementById("ext_"+jdx+"_a");
- //alert(ele.checked)
- if(!ele.checked)
- {
- if(all_values == null)
- all_values = (ele.checked+"'"+ele1.value+"_"+ele.type+"_"+jdx);
- else
- all_values += ":"+(ele.checked+"'"+ele1.value+"_"+ele.type+"_"+jdx);
- //alert(all_values);
- }
- else if(ele1.title != ele1.value && ele.checked)
- {
- if(ele1.value == data && !err_flag)
- {
- alert("Cannot forward calls to self!");
- err_flag = 1;
- }
- else
- {
- if(all_values == null)
- all_values = (ele.checked+"'"+ele1.value+"_"+ele.type+"_"+jdx);
- else
- all_values += ":"+(ele.checked+"'"+ele1.value+"_"+ele.type+"_"+jdx);
- }
- }
- break;
- }
- case "slctlevel":
- {
- if(jdx == 18)
- ele1 = document.getElementById("ext_"+(jdx+1));
- else if(jdx == 19)
- ele1 = document.getElementById("ext_"+(jdx-1));
- if(name[1] == "changed" && (jdx == 18 || jdx == 19))
- {
- if(all_values == null)
- all_values = (ele.value+"'"+ele1.value+"_"+ele.type+"_"+jdx);
- else
- all_values += ":"+(ele.value+"'"+ele1.value+"_"+ele.type+"_"+jdx);
- //alert(all_values);
- }
- else if(name[1] == "changed")
- {
- if(all_values == null)
- all_values = (ele.value+"_"+ele.type+"_"+jdx);
- else
- all_values += ":"+(ele.value+"_"+ele.type+"_"+jdx);
- }
- break;
- }
- case "slctpcos":
- {
- if(name[1] == "changed")
- {
- if(all_values == null)
- all_values = (ele.value+"_"+ele.type+"_"+jdx);
- else
- all_values = all_values+":"+(ele.value+"_"+ele.type+"_"+jdx);
- break;
- }
- else
- break;
- }
- case "slctscos":
- {
- if(name[1] == "changed")
- {
- if(all_values == null)
- all_values = (ele.value+"_"+ele.type+"_"+jdx);
- else
- all_values = all_values+":"+(ele.value+"_"+ele.type+"_"+jdx);
- break;
- }
- else
- break;
- }
- case "slctdept":
- {
- //alert(name[1]);
- if(name[1] == "changed")
- {
- if(all_values == null)
- all_values = (ele.value+"_"+ele.type+"_"+jdx);
- else
- all_values = all_values+":"+(ele.value+"_"+ele.type+"_"+jdx);
- break;
- }
- else
- break;
- }
- case "slcttnt":
- {
- if(name[1] == "changed")
- {
- if(all_values == null)
- all_values = (ele.value+"_"+ele.type+"_"+jdx);
- else
- all_values = all_values+":"+(ele.value+"_"+ele.type+"_"+jdx);
- break;
- }
- else
- break;
- }
- case "hotln":
- {
- if(name[1] == "changed")
- {
- switch(ele.value)
- {
- case "None":
- {
- var ele1 = document.getElementById("ext_"+jdx+"_a");
- if(all_values == null)
- all_values = (ele.value+"'"+ele1.value+"_"+ele.type+"_"+jdx);
- else
- all_values = all_values+":"+(ele.value+"'"+ele1.value+"_"+ele.type+"_"+jdx);
- break;
- }
- case "Immediate":
- {
- var ele1 = document.getElementById("ext_"+jdx+"_a");
- //if(ele1.title != ele1.value)
- // {
- if(all_values == null)
- all_values = (ele.value+"'"+ele1.value+"_"+ele.type+"_"+jdx);
- else
- all_values = all_values+":"+(ele.value+"'"+ele1.value+"_"+ele.type+"_"+jdx);
- // break;
- // }
- //else
- break;
- }
- case "Delayed":
- {
- var ele1 = document.getElementById("ext_"+jdx+"_a");
- //if(ele1.title != ele1.value)
- //{
- if(all_values == null)
- all_values = (ele.value+"'"+ele1.value+"_"+ele.type+"_"+jdx);
- else
- all_values = all_values+":"+(ele.value+"'"+ele1.value+"_"+ele.type+"_"+jdx);
- //break;
- //}
- // else
- break;
- }
- }
- }
- break;
- }
- case "cuttype":
- {
- if(name[1] == "changed")
- {
- if(all_values == null)
- all_values = (ele.value+"_"+ele.type+"_"+jdx);
- else
- all_values = all_values+":"+(ele.value+"_"+ele.type+"_"+jdx);
- break;
- }
- else
- break;
- }
- case "cuttime":
- {
- if(name[1] == "changed")
- {
- if(all_values == null)
- all_values = (ele.value+"_"+ele.type+"_"+jdx);
- else
- all_values = all_values+":"+(ele.value+"_"+ele.type+"_"+jdx);
- break;
- }
- else
- break;
- }
- case "txtbgt":
- {
- if(all_values == null)
- all_values = (ele.value+"_"+ele.type+"_"+jdx);
- else
- all_values = all_values+":"+(ele.value+"_"+ele.type+"_"+jdx);
- break;
- }
- case "txtdbgt":
- {
- if(all_values == null)
- all_values = (ele.value+"_"+ele.type+"_"+jdx);
- else
- all_values = all_values+":"+(ele.value+"_"+ele.type+"_"+jdx);
- break;
- }
- case "alden":
- {
- if(name[1] == "changed")
- {
- if(all_values == null)
- all_values = (ele.value+"_"+ele.type+"_"+jdx);
- else
- all_values = all_values+":"+(ele.value+"_"+ele.type+"_"+jdx);
- break;
- }
- else
- break;
- }
- case "authid":
- {
- if(name[1] == "changed")
- {
- if(all_values == null)
- all_values = (ele.value+"_"+ele.type+"_"+jdx);
- else
- all_values = all_values+":"+(ele.value+"_"+ele.type+"_"+jdx);
- break;
- }
- else
- break;
- }
- case "authtp":
- {
- if(name[1] == "changed")
- {
- if(all_values == null)
- all_values = (ele.value+"_"+ele.type+"_"+jdx);
- else
- all_values = all_values+":"+(ele.value+"_"+ele.type+"_"+jdx);
- break;
- }
- else
- break;
- }
- case "mini":
- {
- if(name[1] == "changed")
- {
- switch(ele.value)
- {
- case "1":
- {
- if(all_values == null)
- all_values = (ele.value+"_"+ele.type+"_"+jdx);
- else
- all_values = all_values+":"+(ele.value+"_"+ele.type+"_"+jdx);
- break;
- }
- case "2":
- {
- var ele1 = document.getElementById("ext_"+jdx+"_a");
- var ele2 = document.getElementById("ext_"+jdx+"_b");
- if(all_values == null)
- all_values = (ele.value+"_"+ele.type+"_"+jdx+"_"+ele1.value+"_"+ele2.value);
- else
- all_values = all_values+":"+(ele.value+"_"+ele.type+"_"+jdx+"_"+ele1.value+"_"+ele2.value);
- break;
- }
- case "3":
- {
- //if(ele1.title != ele1.value)
- //{
- if(all_values == null)
- all_values = (ele.value+"_"+"_"+ele.type+"_"+jdx);
- else
- all_values = all_values+":"+(ele.value+"_"+"_"+ele.type+"_"+jdx);
- break;
- //}
- //else
- // break;
- }
- case "4":
- {
- //if(ele1.title != ele1.value)
- //{
- if(all_values == null)
- all_values = (ele.value+"_"+ele.type+"_"+jdx);
- else
- all_values = all_values+":"+(ele.value+"_"+ele1.value+"_"+ele.type+"_"+jdx);
- break;
- //}
- //else
- // break;
- }
- case "5":
- {
- var ele1 = document.getElementById("ext_"+jdx+"_c");
- var ele2 = document.getElementById("ext_"+jdx+"_d");
- //if(ele1.title != ele1.value)
- //{
- if(all_values == null)
- all_values = (ele.value+"_"+ele.type+"_"+jdx+"_"+ele1.value+"_"+ele2.value);
- else
- all_values = all_values+":"+(ele.value+"_"+ele.type+"_"+jdx+"_"+ele1.value+"_"+ele2.value);
- break;
- //}
- //else
- // break;
- }
- case "6":
- {
- var ele1 = document.getElementById("ext_"+jdx+"_e");
- //if(ele1.title != ele1.value)
- //{
- if(all_values == null)
- all_values = (ele.value+"_"+ele.type+"_"+jdx+"_"+ele1.value);
- else
- all_values = all_values+":"+(ele.value+"_"+ele.type+"_"+ele1.value);
- break;
- //}
- //else
- // break;
- }
- case "0":
- {
- //if(ele1.title != ele1.value)
- //{
- if(all_values == null)
- all_values = (ele.value+"_"+ele.type+"_"+jdx);
- else
- all_values = all_values+":"+(ele.value+"_"+ele.type+"_"+jdx);
- break;
- //}
- //else
- //break;
- }
- }
- }
- else
- break;
- }
- }
- }
- }
- if(all_values != null)
- {
- all_values += ","+data;
- //all_values = escape(all_values);
- //alert(all_values);
- doWork(all_values,"set_sip_ext","search");
- }
- else
- alert("No Change Encountered!");
- }
- function updatsiptrk()
- {
- var data = null;
- data = document.getElementById("number").value;
- var id = document.getElementById("sip_hint").value;
- var all_values = null;
- var err_flag = 0;
- var all_values = null;
- //alert(data);
- for(jdx = 1; jdx < 33; jdx++)
- {
- var ele = document.getElementById("trk_"+jdx);
- //alert("NAME="+ele.name);
- var name = (ele.name).split(",");
- if(name[1] == "changed")
- {
- switch(name[0])
- {
- case "chk":
- {
- //alert(ele.value+"__"+ele.type+"__"+jdx);
- if(all_values == null)
- all_values = (ele.checked+"_"+ele.type+"_"+jdx);
- else
- all_values += ":"+(ele.checked+"_"+ele.type+"_"+jdx);
- //alert(all_values);
- break;
- }
- case "txt":
- {
- //alert(all_values);
- //if(name[1] == "changed")
- //{
- if(all_values == null)
- all_values = (ele.value+"_"+ele.type+"_"+jdx);
- else
- all_values += ":"+(ele.value+"_"+ele.type+"_"+jdx);
- //alert(all_values);
- //break;
- //}
- //else
- break;
- }
- case "slctd":
- {
- //alert(all_values);
- if(all_values == null)
- all_values = (ele.value+"_"+ele.type+"_"+jdx);
- else
- all_values += ":"+(ele.value+"_"+ele.type+"_"+jdx);
- //alert(all_values);
- break;
- }
- case "slctdid":
- {
- //alert(all_values);
- if(all_values == null)
- all_values = (ele.options[ele.selectedIndex].text+"_"+ele.type+"_"+jdx);
- else
- all_values += ":"+(ele.options[ele.selectedIndex].text+"_"+ele.type+"_"+jdx);
- //alert(all_values);
- break;
- }
- case "slcttnt":
- {
- //alert(all_values);
- if(all_values == null)
- all_values = (ele.options[ele.selectedIndex].text+"_"+ele.type+"_"+jdx);
- else
- all_values += ":"+(ele.options[ele.selectedIndex].text+"_"+ele.type+"_"+jdx);
- //alert(all_values);
- break;
- }
- case "slctpcos":
- {
- //alert(all_values);
- if(all_values == null)
- all_values = (ele.options[ele.selectedIndex].text+"_"+ele.type+"_"+jdx);
- else
- all_values += ":"+(ele.options[ele.selectedIndex].text+"_"+ele.type+"_"+jdx);
- //alert(all_values);
- break;
- }
- case "slctscos":
- {
- //alert(all_values);
- if(all_values == null)
- all_values = (ele.options[ele.selectedIndex].text+"_"+ele.type+"_"+jdx);
- else
- all_values += ":"+(ele.options[ele.selectedIndex].text+"_"+ele.type+"_"+jdx);
- //alert(all_values);
- break;
- }
- case "txtcos":
- {
- //alert(all_values);
- //if(name[1] == "changed")
- //{
- if(all_values == null)
- all_values = (ele.value+"_"+ele.type+"_"+jdx);
- else
- all_values += ":"+(ele.value+"_"+ele.type+"_"+jdx);
- //alert(all_values);
- //break;
- //}
- //else
- break;
- }
- case "slctdtmf":
- {
- //alert(all_values);
- if(all_values == null)
- all_values = (ele.value+"_"+ele.type+"_"+jdx);
- else
- all_values += ":"+(ele.value+"_"+ele.type+"_"+jdx);
- //alert(all_values);
- break;
- }
- case "txtctr":
- {
- //alert(all_values);
- //if(name[1] == "changed")
- //{
- if(all_values == null)
- all_values = (ele.value+"_"+ele.type+"_"+jdx);
- else
- all_values += ":"+(ele.value+"_"+ele.type+"_"+jdx);
- //alert(all_values);
- //break;
- //}
- //else
- break;
- }
- /**case "df":
- {
- //alert(ele.value+"__"+ele.type+"__"+jdx);
- if(all_values == null)
- all_values = (ele.checked+"_"+ele.type+"_"+jdx);
- else
- all_values = all_values+":"+(ele.checked+"_"+ele.type+"_"+jdx);
- //alert(all_values);
- break;
- }**/
- case "slctdlm":
- {
- //alert(all_values);
- if(all_values == null)
- all_values = (ele.value+"_"+ele.type+"_"+jdx);
- else
- all_values += ":"+(ele.value+"_"+ele.type+"_"+jdx);
- //alert(ele.value);
- break;
- }
- }
- }
- }
- if(all_values != null)
- {
- all_values += ","+data;
- //all_values = escape(all_values);
- all_values = all_values+"|"+id;
- doWork(all_values,"set_sip_trk","search");
- }
- else
- alert(" No Change Encountered!");
- }
- function rfr_sip_trk(val)
- {
- var data = null;
- data=document.getElementById("number").value;
- var id = "sip-trk";
- data = data+"|"+id;
- doWork(data,"getsiptrk","search");
- }
- function rfr_sip_trk1(val)
- {
- var data = null;
- data=val;
- var id = "sip-trk";
- data = data+"|"+id;
- doWork(data,"getsiptrk","search");
- }
- function printDiv()
- {
- // Automatically find the table with id 'cdrTable'
- const content = document.getElementById('print').outerHTML;
- // Create a new print window
- const printWindow = window.open('', '', 'height=600,width=800');
- printWindow.document.write('<html><head></head><body>');
- printWindow.document.write('<h2>CDR Display</h2>');
- printWindow.document.write(content);
- printWindow.document.write('</body></html>');
- // Close document to apply styles and open print dialog
- printWindow.document.close();
- printWindow.print();
- }
- function ispShow()
- {
- doWork(true,"ispShow","isp");
- }
- function showSelectedValue(obj)
- {
- var val = obj.value;
- val = "set_"+val;
- //alert(val);
- doWork(val,"showSlctIsp","isp");
- }
- function set_isp(obj)
- {
- //alert("i am in set_sysmgw");
- var qry = null;
- for(c=0; c<=8; c++)
- {
- var cname = document.getElementById("sys_"+(c+1)).name;
- //alert("Loop Count " + c + " name of element = " + cname);
- //var cname = document.getElementById("sys_0").name;
- if(cname != "nochange")
- {
- var e_val = null;
- if(document.getElementById("sys_"+(c+1)).type == 'checkbox')
- {
- var cchkd = 0;
- if(document.getElementById("sys_"+(c+1)).checked)
- cchkd = 1;
- else
- cchkd = 0;
- if(qry == null)
- qry = cchkd+"_"+c;
- else
- qry = qry+"|"+cchkd+"_"+c;
- //alert(qry);
- }
- else
- {
- var cchkd = 0;
- if(document.getElementById("sys_"+(c+1)).value != document.getElementById("sys_"+(c+1)).title)
- {
- cchkd = (document.getElementById("sys_"+(c+1)).value);
- if(qry == null)
- qry = cchkd+"_"+c;
- else
- qry = qry+"|"+cchkd+"_"+c;
- }
- }
- }
- }
- //alert(qry);
- if(qry == null)
- info_notify("No Changes Encountered !");
- else
- {
- //alert(qry);
- qry = qry+"?"+obj;
- doWork(qry,"set_sysisp","isp");
- }
- }
- //Till here
Add Comment
Please, Sign In to add comment