var httpData; var m_projcode = ''; var runid = ''; var m_godate = ''; var m_gotime = ''; var m_backdate = ''; var m_backtime = ''; var ticket = ''; if (window.ActiveXObject) { var myreq = new ActiveXObject("Microsoft.XMLHTTP"); } else { var myreq = new XMLHttpRequest(); } function getPar(par){ //获取当前URL var local_url = document.location.href; local_url = decodeURI(local_url); //获取要取得的get参数位置 var get = local_url.indexOf(par +"="); if(get == -1){ return false; } //截取字符串 var get_par = local_url.slice(par.length + get + 1); //判断截取后的字符串是否还有其他get参数 var nextPar = get_par.indexOf("&"); if(nextPar != -1){ get_par = get_par.slice(0, nextPar); } return get_par; } window.onload = function(){ m_projcode = getPar('prodcode'); ticket = getPar('ticket'); runid = getPar('runid'); m_godate = getPar('m_godate'); m_gotime = getPar('m_gotime'); m_backdate = getPar('m_backdate'); m_backtime = getPar('m_backtime'); myreq.open("get", "http://wx.zhizhuchuxing.com/core/customer_list.asp", true); myreq.onreadystatechange = show_user_list; myreq.send(); } function show_user_list() { if (myreq.readyState == 4) { var newstr = myreq.responseText; httpData = JSON.parse(newstr); var c_code = httpData.code; if (c_code == '0'){ show(); }else{ alert(httpData.info); return; } } } function go_edit(user_id, link_name, link_phone, link_id) { if(user_id < 0){ var listURL = "./edit_contacts.html?prodcode="+m_projcode + "&user_id="+user_id; if(!ticket){ }else{ listURL += "&ticket="+ticket; } if(!runid){ }else{ listURL += "&runid="+runid; if(!m_godate || !m_gotime){ }else{ listURL += "&m_godate="+m_godate; listURL += "&m_gotime="+m_gotime; } if(!m_backdate || !m_backtime){ }else{ listURL += "&m_backdate="+m_backdate; listURL += "&m_backtime="+m_backtime; } } listURL = encodeURI(listURL); window.location.href = listURL; }else{ var listURL = "./edit_contacts.html?prodcode="+m_projcode + "&user_id="+user_id+"&link_name="+link_name+"&link_phone="+link_phone+"&link_id="+link_id; if(!ticket){ }else{ listURL += "&ticket="+ticket; } if(!runid){ }else{ listURL += "&runid="+runid; if(!m_godate || !m_gotime){ }else{ listURL += "&m_godate="+m_godate; listURL += "&m_gotime="+m_gotime; } if(!m_backdate || !m_backtime){ }else{ listURL += "&m_backdate="+m_backdate; listURL += "&m_backtime="+m_backtime; } } listURL = encodeURI(listURL); window.location.href = listURL; } } function delete_user_info(link_id){ var c_url = 'http://wx.zhizhuchuxing.com/core/customer_del.asp?cusid=' + link_id; myreq.open("get", c_url, true); myreq.onreadystatechange = delete_account; myreq.send(); } function delete_account(){ if (myreq.readyState == 4) { var newstr = myreq.responseText; httpData = JSON.parse(newstr); var c_code = httpData.code; if (c_code == '0'){ show(); }else{ alert(httpData.info); return; } } } function show(){ var s = ""; for (var i = 0; i < httpData.customer.length; i++) { s += '