⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 clientadd.jsp

📁 这是一个法律事务所系统源码
💻 JSP
字号:
<%--
模块名称:客户管理
模块功能:新增客户
版    本:V1.0
著 作 人:蔡静
著作日期:2001-10-08
使用说明:
主要技术说明:
参考文献:法律事务设计书
修改历史:
        = = = = = = = = = = = = = = = = = = = = = = = = = =
	修改日期:
	修 改 人:
	修改理由:
	修改出处:
	= = = = = = = = = = = = = = = = = = = = = = = = = =

--%>
<%@ page contentType= "text/html; charset=gb2312" %>
<%@ page language="java" import="java.sql.*" %>
<%@ page import="system.*" %>
<jsp:useBean id="db" class="dbconnection.DbConnection" scope="page" />
<%
  Security auth = new Security();
  String employee_id = (String)session.getAttribute("employee_id");
  if(employee_id == null || employee_id.equals(""))
  {
    response.sendRedirect(response.encodeRedirectURL("../Error/nonlogin.htm"));
  }
  String modelid = "Cli012";
  int authflag = auth.popedom(employee_id, modelid);
  if(authflag == 0 || authflag == 2 || authflag == -1)
  {
%>
  <jsp:forward page="../inc/noauth.jsp" >
  </jsp:forward>
<%
  }
%>
<%
  GetID gid = new GetID();
  ExtendString es = new ExtendString();
  String cid = "KH" + es.digitToString(gid.getIDNumber("customer_id")+1);
  String str = request.getParameter("save");
  if (str!=null) {
    String customer_id, customer_name, link_man, telephone, mobile_telephone;
    String email, address, customer_type, customer_introduce, fax, enter_date, lawyer_id;
    customer_id = request.getParameter("customer_id");
    customer_name = es.getStr(request.getParameter("customer_name"));
    link_man = es.getStr(request.getParameter("link_man"));
    telephone = es.getStr(request.getParameter("telephone"));
    mobile_telephone = es.getStr(request.getParameter("mobile_telephone"));
    email = es.getStr(request.getParameter("email"));
    address = es.getStr(request.getParameter("address"));
    customer_type = request.getParameter("customer_type");
    customer_introduce = es.getStr(request.getParameter("customer_introduce"));
    fax = es.getStr(request.getParameter("fax"));
    enter_date = request.getParameter("enter_date");
    lawyer_id = request.getParameter("lawyer_id");
    String sql = "insert into t_customer(customer_id,customer_name";
    if (link_man!=null)
      sql = sql + ",link_man";
    if (telephone!=null)
      sql = sql + ",telephone";
    if (mobile_telephone!=null)
      sql = sql + ",mobile_telephone";
    if (email!=null)
      sql = sql + ",email";
    if (address!=null)
      sql = sql + ",address";
    if (customer_type!=null)
      sql = sql + ",customer_type";
    if (customer_introduce!=null)
      sql = sql + ",customer_introduce";
    if (fax!=null)
      sql = sql + ",fax";
    if ((enter_date!=null) && (!enter_date.equals("")))
      sql = sql + ",enter_date";
    if ((lawyer_id!=null) && (!lawyer_id.equals("")))
      sql = sql + ",lawyer_id";
    sql = sql + ") values('"+customer_id+"','"+customer_name+"'";
    if (link_man!=null)
      sql = sql + ",'" + link_man + "'";
    if (telephone!=null)
      sql = sql + ",'" + telephone + "'";
    if (mobile_telephone!=null)
      sql = sql + ",'" + mobile_telephone + "'";
    if (email!=null)
      sql = sql + ",'" + email + "'";
    if (address!=null)
      sql = sql + ",'" + address + "'";
    if (customer_type!=null)
      sql = sql + ",'" + customer_type + "'";
    if (customer_introduce!=null)
      sql = sql + ",'" + customer_introduce + "'";
    if (fax!=null)
      sql = sql + ",'" + fax + "'";
    if ((enter_date!=null) && (!enter_date.equals("")))
      sql = sql + ",'" + enter_date + "'";
    if ((lawyer_id!=null) && (!lawyer_id.equals("")))
      sql = sql + ",'" + lawyer_id + "'";
    sql = sql + ")";
    int num = db.executeUpdate(sql);
    if (num <= 0) {%>  
		<script language="javascript">
  		alert("新增失败!");
		</script>
  	<%}else {
      gid.setIDNumber("customer_id", gid.getIDNumber("customer_id")+1);
      cid = "KH" + es.digitToString(gid.getIDNumber("customer_id")+1);
    }
  }
%>
<html>

<head>
<title>客户增加</title>
<%@ include file="../inc/config.jsp" %>
</head>
<body class="page">
<script language="javascript">
  function checkForm() {
    if (document.form1.customer_id.value=="") {
      alert("请输入客户编码!");
      document.form1.customer_id.focus();
      return false;
    }
    if (document.form1.customer_name.value=="") {
      alert("请输入客户名称!");
      document.form1.customer_name.focus();
      return false;
    }
    return true;
  }
</script>
<!--显示工具条-->
<table width="98%" align="center" cellspacing="1">
  <tr>
    <td width="90%"><a href="Client.jsp"><img src="../images/all.gif" height="22" border="0" width="88"></a>
    <a href="ClientAdd.jsp"><img src="../images/add.gif" alt="增加内容" width="79" height="22" border="0"  ></a>
    <img src="../images/delete.gif" alt="删除选中的内容" style="cursor:hand" width="79" height="22">
    <a href="ClientSearch.jsp"><img src="../images/query.gif" alt="查询内容"   width="79" height="22" border="0"></a></td>
    <td width="10%" align="right"><img src="../images/back.gif" width="50" height="22" onClick="window.history.back()" style="cursor:hand"></td>
  </tr>
</table>
<table width="98%" background="../images/line.gif" border="0" cellspacing="0" cellpadding="0" height="12" align="center">
  <tr>
    <td>&nbsp;</td>
  </tr>
</table>
<!--显示工具条结束-->
<form name="form1" METHOD="post" action="ClientAdd.jsp">
<table width="98%" align="center" border="0" cellspacing="1" cellpadding="0" class="table_bg">
  <tr>
    <td height="24" width="19%"  align="right" class="title_bg"> 客户编号:</td>
    <td height="24" width="32%" class="tr_bg1">
      <input name="customer_id" size="20" class="input" readOnly value=<%=cid%>>
      <font color="#FF0000">*</font>
    </td>
    <td height="24" width="17%"  align="right" class="title_bg"> 联系人:</td>
    <td height="24" width="32%" class="tr_bg1">
      <input name="link_man" size="20" class="input">
    </td>
  </tr>
  <tr>
    <td align="right"  height="28" width="19%" class="title_bg"> 客户名称:</td>
    <td height="28" width="32%" class="tr_bg1">
      <input name="customer_name" size="20" class="input">
      <font color="#FF0000">*</font>
    </td>
    <td align="right"  height="28" width="17%" class="title_bg">登记时间: </td>
    <td height=28 width=32% class="tr_bg1">
      <input type="text" name="enter_date" maxlength="10" size="16" value="" class="input"  readOnly>
      <img src="../images/datetime.gif" border="0" align="absmiddle"
                  alt="弹出日历下拉菜单" onClick="fPopUpCalendarDlg(enter_date);return false" width="16" height="16">
    </td>
  </tr>
  <tr>
    <td align=right  height=28 width=19% class="title_bg"> 电话:</td>
    <td height=28 width=32% class="tr_bg1">
      <input name="telephone" size="20" class="input">
    </td>
    <td align="right"  height="28" width="17%" class="title_bg"> 手机:</td>
    <td height=28 width=32% class="tr_bg1">
      <input name="mobile_telephone" size="20" class="input" >
    </td>
  </tr>
  <tr>
    <td align=right  height=28 width=19% class="title_bg"> 传真:</td>
    <td height=28 width=32% class="tr_bg1">
      <input name="fax" size="20" class="input">
    </td>
    <td align=right  height=28 width=17% class="title_bg"> E-mail:</td>
    <td  height=28 width=32% class="tr_bg1" >
      <input name="email" size="20" class="input" >
    </td>
  </tr>
  <tr>
    <td align=right  height=28 width=19% class="title_bg"> 客户类型:</td>
    <td height=28 width=32% class="tr_bg1">
      <select name="customer_type" size=1>
          <option value="gq">国企 </option>
          <option value="zf">政府</option>
          <option value="sz">三资</option>
          <option value="my">民营</option>
          <option value="gr">个人</option>
          <option value="qt">其他 </option>
      </select>
    </td>
    <td align=right  height=28 width=17% class="title_bg"> 承办律师:</td>
    <td  height=28 width=32% class="tr_bg1" >
      <select name="lawyer_id" class="select">
        <option value=""></option>
      <%
        ResultSet rs = db.executeQuery("select employee_id, employee_name from t_employee where (duty like '%律师' or duty='主任' or duty='合伙人') and active='1'");
        while (rs.next()) {
      %>
        <option value=<%=rs.getString("employee_id")%>><%=rs.getString("employee_name")%></option>
      <%}%>
      </select>
    </td>
  </tr>
  <tr>
    <td align=right  height=28 width=19% class="title_bg">地址:</td>
    <td height=28 class="tr_bg1" colspan="3">
      <input name="address" size="80" class="input">
    </td>
  </tr>
  <tr>
    <td align=right  height=28 width=19% class="title_bg">客户简介:</td>
    <td colspan=4 height=28 class="tr_bg1">
      <textarea name="customer_introduce" cols="75" class="input" rows="10"></textarea>
    </td>
  </tr>
</table>
<br>
<div align="center">
  <input type="submit" value="保存" name="save" class="button" onClick="return checkForm();">
</div>
</form>
</body>

</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -