AdminAdvSearch.js 1.5 KB

12345678910111213141516171819202122232425262728293031
  1. function toggleadvsearch() {
  2. if (document.getElementById('searchbox').style.visibility=="hidden") {
  3. document.getElementById('searchbox').style.visibility="";
  4. } else {
  5. document.getElementById('searchbox').style.visibility="hidden";
  6. }
  7. }
  8. function populate(o) {
  9. d=document.getElementById('searchfield');
  10. v=o.options[o.selectedIndex].value;
  11. if(!d){return;}
  12. var mitems=new Array();
  13. mitems['clients']=['Client ID','Client Name','Company Name','Email Address','Address 1','Address 2','City','State','Postcode','Country','Phone Number','CC Last Four','Notes'];
  14. mitems['orders']=['Order ID','Order #','Client Name','Order Date','Amount'];
  15. mitems['services']=['Service ID','Domain','Client Name','Product','Billing Cycle','Next Due Date','Status','Username','Dedicated IP','Assigned IPs','Subscription ID','Notes'];
  16. mitems['domains']=['Domain ID','Domain','Client Name','Registrar','Expiry Date','Status','Subscription ID','Notes'];
  17. mitems['invoices']=['Invoice #','Client Name','Line Item','Invoice Date','Due Date','Date Paid','Total Due','Status'];
  18. mitems['tickets']=['Ticket #','Tag','Subject','Client Name','Email Address'];
  19. d.options.length=0;
  20. cur=mitems[o.options[o.selectedIndex].value];
  21. if(!cur){return;}
  22. d.options.length=cur.length;
  23. for(var i=0;i<cur.length;i++) {
  24. d.options[i].text=cur[i];
  25. d.options[i].value=cur[i];
  26. }
  27. if(v == 'services' || v == 'domains' || v == "clients") {
  28. document.getElementById('searchfield').selectedIndex = 1;
  29. }
  30. }