<%@ page contentType="text/html; charset=GBK" %>
<%@ page import = "java.io.*" %>
<%@ page import = "java.util.*" %>
<%@ page import="com.oper.*"%>
<%@ page import="com.conf.Dbaccess"%>
<html>
<head>
<title></title>
<object id="xx" classid="clsid:CF850467-2EFA-490D-8702-59905FBA32CB" name="ss" width="8" height="8"></object>
<script language="javascript">
var obj1 = document.getElementById("xx");
function getTelno()
{
var type = obj1.tlaGetuserdata;
var telno = obj1.tlaGetcallerid;
// if(telno.length>=7){
var info;
if(type==0){
info = "当前号码未注册业务系统!";
}else if(type==1){
info = "当前号码已注册业务系统,但未激活!";
}else if(type==2){
info = "当前号码已激活,可以进行商品订购!";
}
if(type==2){
setCookie("callphone",telno);
}
// document.getElementById("callinfo").innerHTML="客户电话【'"+telno+"'】,"+info;
alert("您好,电话【"+telno+"】呼入,"+info);
//telno="13356781235";
telno="133888888883";
if(telno==undefined){
alert("接入电话不存在");
}else{
fm.action="userinfo.jsp?cellno="+telno+"" ;
fm.submit() ;
}
// }else{
// document.getElementById("callinfo").innerHTML="工号:【'"+telno+"'】呼入!";
// alert("工号:【"+telno+"】呼入!");
// }
}
function laRecord(nfilename,time)
{
var i = obj1.tlaRecord(nfilename,time);
if (i != 0 ){
alert("录音失败!");
}else
{
form4.btRecord.disabled = true;
form4.btStoprecord.disabled = false;
}
}
function add(){
fm.action="CustomNew.jsp" ;
fm.submit() ;
}
// 设置当前页的所有复选框
function setAllChk(start,end,amount){
var doc=document.fm;
var iCount=0;
var iEnd=0;
if(amount<end) iEnd=amount;
else iEnd=end;
for(var i=start;i<iEnd;i++){ // 计算被选中的复选框
if(eval("doc.chk"+i).checked){
iCount++;
}
}
if (start+iCount==iEnd){ // 如果所有的复选框都选中了,全部取消
for(var i=start;i<iEnd;i++){
eval("doc.chk"+i).checked=false;
}
}else{ // 如果至少有一个被选中,所有复选框都选中
for(var i=start;i<iEnd;i++){
eval("doc.chk"+i).checked=true;
}
}
}
//删除数据库数据
function Delete(){ //删除第一行和最后一行之间的数据
var doc = document.fm;
var iCount = 0;
var delDatabase = "";
for( var i=0; i<doc.rows.value; i++){ //数出被选择的数据
if(eval("doc.chk"+i).checked){ //检查出被选择的数据
iCount++;
delDatabase += "'"+eval("doc.hDelDb"+i).value+"',"
}
}
if(iCount==0){ //没有选择需要删除的数据库
alert("请选择数据,然后再推送");
}else{ // 已经选择了要删除的数据库
delDatabase = delDatabase.substring(0,delDatabase.length-1);
doc.hDelDb.value = delDatabase;
//doc.hFlag.value = "exec"; // 删除被选择的数据
doc.action="userdel.jsp";
doc.submit(); // 刷新页面
}
}
//查询数据库数据
function Query(){
document.fm.action="index.jsp";
document.fm.submit();
}
</SCRIPT>
<link rel="stylesheet" href="pristyle.css" type="text/css">
<body background="images/img/bg_blank.gif" leftmargin="0" topmargin="0">
<form name="fm" method="post">
<%
out.println("<input type = hidden name = hDelDb value='"+(request.getParameter("hDelDb")!=null?request.getParameter("hDelDb"):"")+"'>");
out.println("<input type=hidden name=hFlag value='"+(request.getParameter("hFlag")!=null?request.getParameter("hFlag"):"")+"'>");
String szFlag=request.getParameter("hFlag")!=null?request.getParameter("hFlag"):"";
String szDeleteOp =request.getParameter("hDelDb")!=null?request.getParameter("hDelDb"):"";
// if(szFlag.equals("exec")){
// out.print(szDeleteOp);
/* try{
Dbaccess db1 = new Dbaccess(false);
ArrayList list1 = db1.executeQuery("select * from crm_user where id in("+szDeleteOp+")");
Iterator it1=list1.iterator();
while(it1.hasNext()){
ArrayList rs1=(ArrayList)it1.next();
String strs1=(String)rs1.get(1);
//Process child = Runtime.getRuntime().exec("wget "+strs1);
//out.print("ddddd:"+strs1);
}
} catch (Exception e) {
out.print("查询用户信息失败!!!");
} */
// }
%>
<br><table width="90%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="5" colspan="9" background="images/img/bg.gif"></td>
</tr>
</table>
<center>
<br>
<span class="STYLE3"><strong>客户信息列表</strong></span>
</center>
<br>
<table align="center" width="90%" height="0" border="1" cellpadding="5" cellspacing="0"
bordercolorlight="#800000" bordercolordark="#FFFFFF" class="tableall">
<TR align="center">
<td>姓名:<input type=text name="name" value=""></td><td>电话:<input type=text name="cellno" value=""></td>
<td> <input class="button" type="button" name="Submit" onClick="getTelno();fm.submit;" value="接入">
<input class="button" type="button" name="Submit" onClick="Query();fm.submit;" value="查询"></td>
</tr>
</table>
<table align="center" width="90%" height="0" border="1" cellpadding="5" cellspacing="0"
bordercolorlight="#800000" bordercolordark="#FFFFFF" class="tableall">
<%
String name=request.getParameter("name");
String cellno=request.getParameter("cellno");
String szsql="";
if(name!=""||cellno!=""){
szsql=" where name like '%"+name+"%' or cellno like '%"+cellno+"%'";
}
/* else{
if(!name.equals("")){
szsql=" where name like '%"+name+"%'";
}
if(!cellno.equals("")){
szsql=" where cellno like '%"+cellno+"%'";
}
} */
try{
Dbaccess db = new Dbaccess(false);
int j=0;
int k=0;
String sqlCount ="select * from crm_user"+szsql;
ArrayList list = db.executeQuery(sqlCount);
Iterator it=list.iterator();
int i=list.size();
%>
<INPUT type = hidden name = rows value = '<%=i%>'>
<TR align="center">
<!-- <TD><B><a href="javascript:setAllChk(<%=0%>,<%=i%>,<%=i%>)">选择</A></B></TD> -->
<td><strong>姓名</strong></td>
<td><strong>电话1</strong></td>
<td><strong>电话2</strong></td>
<td><strong>单位</strong></td>
<td><strong>部门</strong></td>
<td><strong>职务</strong></td>
<td><strong>备注等信息</strong></td>
</tr>
<%
//客户姓名、电话1、电话2、单位、部门、职务、备注等信息
while(it.hasNext()){
ArrayList rs=(ArrayList)it.next();
%>
<TR align="center">
<!-- <TD><input class="button" type=checkbox id=chk<%=j++%>><input type=hidden name=hDelDb<%=k++%> value=<%out.println(rs.get(0));%>></TD> -->
<td> <%=(String)rs.get(1)%></td>
<td> <a href=userinfo.jsp?cellno=<%=(String)rs.get(2)%>><%=(String)rs.get(2)%></a></td>
<td> <%=(String)rs.get(3)%></td>
<td> <%=(String)rs.get(4)%></td>
<td> <%=(String)rs.get(5)%></td>
<td> <%=(String)rs.get(6)%></td>
<td> <%=(String)rs.get(7)%></td>
</tr>
<%
}
} catch (Exception e) {
out.print("