回 帖 发 新 帖 刷新版面

主题:多表查询问题!!!!

1,在下面的代码中,一个条件输入就可以找到检索的东西,组合起来就不行,然后是,首先载入的专家列表时空白,然后点击《抽取专家》按钮,实现抽取专家的功能。
2,在专家列表,如何将复选框选中的专家添加在项目的参与专家<expert>表中,专家的分隔符号又怎么实现,添加专家的总实现功能是在《保存并通知》按钮。
3《保存并通知》按钮的点击连接是否直接将专家的某个个人专有比如说《身份证》,直接插入到expert中就行了?
4,上半部分的抽取专家 和下面的专家列表信息是否要两个表单来实现。
代码如下:
<!--#include file="conn.asp"-->
<!--#include file="check.asp"-->

<h3 align="center"><img src="images/w.gif" width="18" height="18" />抽取专家</h3>
<table width="385" height="247" border="1" align="center" cellpadding="0" cellspacing="0">
  <tr>
 [color=FF0000]   <td height="245"><form action="xmzj.asp" method="get">
 <% 
xm=trim(request("xm"))
sex=trim(request("sex"))
sfzhm=trim(request("sfzhm"))
sjhm=trim(request("sjhm"))
gzsd=trim(request("gzsd"))
hylb=trim(request("hylb"))
sql="select id,xm,sex,sfzhm,sjhm,gzdw,hylb,Email from expert where 1=1"
 
  if xm<>""then 
 sql=sql&amp;" xm like '%"&amp;xm&amp;"%' "
end if 
 if sex<>""then
sql=sql&amp;" and sex = '"&amp;sex&amp;"'" 
 end if 
 if shzhm<>"" then
 sql=sql&amp;" and sfzhm = '"&amp;sfzhm&amp;"'"
 end if 
 if gzsd<>"" then 
 sql=sql&amp;" and gzdw like '%"&amp;gzsd&amp;"%'"
 end if 
 if hylb<>"" then
 sql=sql&amp;" and hylb = '"&amp;hylb&amp;"'"
 end if 
 
 sql=sql&amp;" order by id desc" &amp;order  
  
%>[/color] 
<table width="870" height="270" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td height="41"colspan="6" bgcolor="#efeff7"><div align="center">符合条件的专家</div></td>
    </tr>
  <tr>
    <td width="72" height="39">姓名
      <label>:</label></td>
    <td width="129"><label>
      <input name="xm" type="text" id="xm" size="15" />
    </label></td>
    <td width="118"><div align="right">性别:</div></td>
    <td width="261"><label>
      <select name="sex" size="1" id="sex">
        <option>全部</option>
        <option value="男">男</option>
        <option value="女">女</option>
      </select>
    </label></td>
    <td width="80">行业类别</td>
    <td width="185"><label>
      <select name="hylb" size="1" id="hylb">
        <option>全部</option>
      </select>
    </label></td>
  </tr>
  <tr>
    <td height="40"><label></label>
      技术职称</td>
    <td><label>
      <select name="jszc" size="1" id="jszc">
        <option>全部</option>
      </select>
    </label></td>
    <td><div align="right">专业资格</div></td>
    <td><label>
      <select name="zyzg" size="1" id="zyzg">
        <option>全部</option>
      </select>
    </label></td>
    <td>工作属地</td>
    <td><label>
      <select name="dwsd" size="1" id="dwsd">
        <option>全部</option>
      </select>
    </label></td>
  </tr>
  <tr>
    <td height="30" bgcolor="#efeff7">&nbsp;</td>
    <td height="30" bgcolor="#efeff7">&nbsp;</td>
    <td height="30" bgcolor="#efeff7">&nbsp;</td>
    <td height="30" bgcolor="#efeff7">&nbsp;</td>
    <td height="30" bgcolor="#efeff7"><input name="zjcq" type="submit" id="zjcq" value="抽取专家" /></td>
    <td height="30" bgcolor="#efeff7"><div align="center">
      <input type="reset" name="Submit2" value="清空" />
    </div></td>
  </tr>
  <tr>
    <td height="30" bgcolor="#efeff7"><div align="center">选择</div></td>
    <td height="30" bgcolor="#efeff7">姓名</td>
    <td height="30" bgcolor="#efeff7">性别</td>
    <td height="30" colspan="2" bgcolor="#efeff7">工作单位</td>
    <td height="30" bgcolor="#efeff7">Email</td>
  </tr> <%
set rs=server.CreateObject("adodb.recordset")
  rs.open sql,conn,1,1
 
   rs.pagesize=10
  If Not (rs.eof and rs.bof) Then
 rs.pagesize=5  '定义每页显示的记录数
 pages=clng(Request("pages"))  '获得当前页数
 If pages<1 Then pages=1
 If pages>rs.recordcount Then pages=rs.recordcount
 showpage rs,pages  '执行分页子程序showpage  
 Sub showpage(rs,pages)  '分页子程序showpage(rs,pages)
 rs.absolutepage=pages   '指定指针所在的当前位置
 For i=1 to rs.pagesize 
  %>
  <tr>
    <td height="30" bgcolor="#efeff7"><label>
      <div align="center">
        <input name="chk_id" type="checkbox" id="chk_id" value="expert" />
        </div>
    </label></td>
    <td height="30" bgcolor="#efeff7"><%=rs("xm")%></td>
    <td height="30" bgcolor="#efeff7"><%=rs("sex")%></td>
    <td height="30" colspan="2" bgcolor="#efeff7"><%=rs("gzdw")%></td>
    <td height="30" bgcolor="#efeff7"><%=rs("Email")%></td>
  </tr>
    <%
  rs.movenext  '指针向下移动
  If rs.eof Then exit for
  Next
  End Sub
End If%>
    <tr>
      <td height="30" colspan="2" bgcolor="#efeff7"><div align="center">
        <input name="chk_all" type="checkbox" id="chk_all" value="checkbox" onclick="CheckAll(this.form.chk_id,this.form.chk_all)"/>
        全选/反选 </div></td>
      <td height="30" bgcolor="#efeff7">&nbsp;</td>
      <td height="30" colspan="2" bgcolor="#efeff7"><div align="center">
        <% 
 if pages<>1 then
  response.Write("&amp;nbsp;&amp;nbsp;<a href="&amp;path&amp;"?pages=1>首页</a>")
  response.Write("&amp;nbsp;&amp;nbsp;<a href="&amp;path&amp;"?pages="&amp;(pages-1)&amp;">上一页</a>")
 end if 
 response.Write("&amp;nbsp;&amp;nbsp;当前 <font color='#FF0000'>"&amp;pages&amp;"/"&amp;rs.pagecount&amp;"</font> 页")
 if pages<>rs.pagecount then
  response.Write("&amp;nbsp;&amp;nbsp;<a href="&amp;path&amp;"?pages="&amp;(pages+1)&amp;">下一页</a>")
  response.Write("&amp;nbsp;&amp;nbsp;<a href="&amp;path&amp;"?pages="&amp;rs.pagecount&amp;">末页</a>")
 end if
    rs.close
    Set rs=Nothing
   %>
      </div></td>
      <td height="30" bgcolor="#efeff7"></td>
    </tr>
    <tr>
    <td height="30" colspan="2" bgcolor="#efeff7"><label>&nbsp;&nbsp;</label>
      <div align="center"></div></td>
    <td height="30" bgcolor="#efeff7">&nbsp;</td>
    <td height="30" colspan="2" bgcolor="#efeff7">&nbsp;</td>
    <td height="30" bgcolor="#efeff7"><label>
      <input name="tz" type="submit" id="tz" value="保存并通知" onclick="location='xmzj.asp'"/>
    </label></td>
  </tr>
</table>
</form>
 
</table>
<script language="javascript">
function CheckAll(elementsA,elementsB)
{
 var len = elementsA;
 if(len.length > 0)
 {
  for(i=0;i<len.length;i++)
  {
   elementsA[i].checked = true;
  }
  if(elementsB.checked ==false)
  {
   for(j=0;j<len.length;j++)
   {
    elementsA[j].checked = false;
   }
  }
 }
 else
 {
  len.checked = true;
  if(elementsB.checked == false)
  {
   len.checked = false;
  }
 }
}
</script>

回复列表 (共1个回复)

沙发

看不见图片

我来回复

您尚未登录,请登录后再回复。点此登录或注册