var icon = '<img src="tick.png" alt="Analog Phone OK" />';
var html = '';
-
+ var itemcount = 0;
html += '<table align="right" width=600 cellspacing=2>';
html += "<td>" + '<img src="tick.png" />' + "</td>";
// the reception checkbox code
- html += "<td>" + '<input name="selected[]" type="checkbox" ' ;
+ html += "<td>" + '<input name="selected_in[]" type="checkbox" ' ;
// Underscore used instead of forward slash to pass thru html request
if (recept_num.indexOf(analog_ext[i]) != -1) {
}
// save the reception code
- recept_code[iancount++]=ext_code[i-1];
+ recept_code[itemcount++]=ext_code[i-1];
html += "</td>";
html += "<td>" + ip_ext[j] + "</td>";
// the reception checkbox code
- html += "<td>" + '<input name="selected[]" type="checkbox" ' ;
+ html += "<td>" + '<input name="selected_in[]" type="checkbox" ' ;
// Underscore used instead of forward slash to pass thru html request
// save the reception code
- recept_code[iancount++]=ext_code[(i-1)];
+ recept_code[itemcount++]=ext_code[(i-1)];
i++;
html += "</td>";
-
- html += "<td>(Reception)</td>";
html += "<td>" + '<img src="tick.png" />' + "</td>";
html += "</tr>";
html += "<td>" + "0" + "</td>" + "<td>" + "Analog Phone" + "</td>";
html += "<td>Port" + i + "</td>";
html += "<td>" + '<img src="tick.png" />' + "</td>";
- html += "</tr>";
+
+ // the outgoing radiobox code
+/* html += "<td>" + '<input name="selected_out[]" type="radio" ' ;
+
+ if (outgoing_num == i) {
+ html += '" checked/>';
+ }
+ else {
+ html += '" unchecked/>';
+ }
+
+ // save the outgoing code
+
+ outgoing_code[itemcount++]=ext_code[(i-1)];
+
+ html += "</td>";
+
+*/ html += "</tr>";
}
+
+
}
// add a voip line
function onClickUpdateReception() {
- // get the arguments from the form selected[]
+ // get the arguments from the form selected_in[]
///document.myform.elements['fav[]'].checked
var arg ="";
// number of check boxes in the form
- var total = document.phones.elements['selected[]'].length;
+ var total = document.phones.elements['selected_in[]'].length;
- var recept_box = document.phones.elements['selected[]'];
+ var recept_box = document.phones.elements['selected_in[]'];
j=0;
for (i=0;i<total; i++) {
}
}
+
var arg2 = "/cgi-bin/setring.cgi?" + arg;
- downloadUrl(arg2,null);
+ downloadUrl(arg2,GenericReturn);
+
+}
+
+function onClickUpdateOutgoing() {
+
+ // get the arguments from the form selected_out[]
+ ///document.myform.elements['fav[]'].checked
+ var arg ="";
-/*
- // ok looks like static buttons work but my dynamic button line 112 doesnt.
+ // number of check boxes in the form
+ var total = document.phones.elements['selected_out[]'].length;
+
+ var out_box = document.phones.elements['selected_out[]'];
+
+ //j=0;
+ for (i=0;i<total; i++) {
+
+ // construct new arg from selected
+ if(out_box[i].checked) {
+
+ //j++;
+ //if (j>1)
+ // arg = arg+"&";
+
+ // got to make up new codes
+ arg = arg + recept_code[i] + "=on";
+ }
- var ret = downloadUrl("/cgi-bin/setring.cgi?Zap_3=on", GenericReturn);
- if (ret == false) {
- throw new Error("XMLHttpRequest not supported");
}
-*/
+ var arg2 = "/cgi-bin/setoutgoing.cgi?" + arg;
+// downloadUrl(arg2,GenericReturn);
+
+
}