<%@language=vbscript codepage=936 %>
<!--#include file="conn.asp"-->
<!--#include file="admin.asp"-->
<!-- #include file="Inc/Head.asp" -->
<style>
 .new{
  border-left-width:2px;
  border-bottom-width:2px;
  border-top-width:1px;
  border-right-width:1px;
  border-color:black;
  font-size:16px;
 }
 .input1
 {
  border-width:1px;
  border-color:black;
  font-size:20px;color:#F00;
  font-family:"黑体";
 }
  .input2
 {
  border-width:1px;
  border-color:black;
  font-size:16px;
  font-family:"宋体";
 }
</style>
<%
if request("no")="modi" then
newsid=request("newsid")
yylydate=request("yylydategg")
yhfdate=request("yhfdategg")
BigClassName=request("BigClassName")
SmallClassName=request("SmallClassName")
name=request("name")
sfly=request("sfly")
dyname=request("dyname")
zjname=request("zjname")
bz=request("bz")
content=request("content")
llfx=request("llfx")
ltjl=request("ltjl")
qxyy=request("qxyy")
qxyydate=request("qxyydate")
wlybz=request("qxyy")
swxw=request("swxw")
qxyybz=request("qxyybz")
yylydatebz=request("yylydatebz")
'hf=request("hf")
if session("gly")=True then
yyr=request("yyr")
end if
'wxfbz=request("wxfbz")
yyys=request("yyys")
lydate=request("lydate")
lydatecx=request("lydate")
lydate2=year(datetime)&"-"&month(datetime)&"-"&day(datetime)


if content="" then
	response.write "<SCRIPT language=JavaScript>alert('疾病描述不能为空');"
	response.write "this.location.href='vbscript:history.back()';</SCRIPT>"
	response.end
end if

if  yhfdate="" then
	response.write "<SCRIPT language=JavaScript>alert('预回访日期不能为空');"
	response.write "this.location.href='vbscript:history.back()';</SCRIPT>"
	response.end
end if

if zjname="请选择医生" then
	response.write "<SCRIPT language=JavaScript>alert('请选择接诊医生');"
	response.write "this.location.href='vbscript:history.back()';</SCRIPT>"
	response.end
end if

if bz<>"" then
  if not(isnumeric(bz)) then 
     response.write "<SCRIPT language=JavaScript>alert('预约号必须是数字');"
     Response.Write"this.location.href='vbscript:history.back()';</SCRIPT>"
     Response.End
  end if
end if

if smallclassname="" then
	response.write "<SCRIPT language=JavaScript>alert('请选择预约病种');"
	response.write "this.location.href='vbscript:history.back()';</SCRIPT>"
	response.end
end if

set rs=server.createobject("adodb.recordset")
sql="select * from yy_tjxhz where id="&newsid
rs.open sql,conn,1,3

'rs("name")=name
rs("sfly")=sfly
rs("zjname")=zjname
if request("dyname")="请选择导医" then 
rs("dyname")=""
else
rs("dyname")=dyname
end if
if request("yyys")="请选择医生" then 
rs("yyys")=""
else
rs("yyys")=yyys
end if

rs("lydate")=lydate
rs("yhfdate")=yhfdate
rs("lydatecx")=lydatecx 
rs("bz")=bz
rs("content")=content
rs("llfx")=llfx
rs("ltjl")=ltjl
rs("yylydate")=yylydate
rs("qxyy")=qxyy
'if request("qxyy")=True then 
rs("qxyydate")=qxyydate
'else
'rs("qxyydate")=""
'end if
if request("qxyybz")="请选择取消原因" then 
rs("qxyybz")=""
else
rs("qxyybz")=qxyybz
end if
rs("yylydatebz")=yylydatebz
'rs("hf")=hf
rs("swxw")=swxw
if session("gly")=True then 
rs("yyr")=yyr
end if
'rs("wxfbz")=wxfbz
rs("BigClassName")=BigClassName
rs("SmallClassName")=SmallClassName
if rs("sfly")=True then
rs("lydjdate")=now()
end if

rs.update
rs.close
set rs=nothing
response.write "<script language='javascript'>" & chr(13)
		response.write "alert('预约信息修改成功！');" & Chr(13)
		response.write "window.document.location.href='yyxx_wlyManage.asp';"&Chr(13)
		response.write "</script>" & Chr(13)
Response.End
end if%>
<%
dim rs
dim sql
dim count
set rs=server.createobject("adodb.recordset")
sql = "select * from SmallClass_New order by SmallClassID asc"
rs.open sql,conn,1,1
%>
<script language = "JavaScript">
var onecount;
subcat = new Array();
        <%
        count = 0
        do while not rs.eof 
        %>
subcat[<%=count%>] = new Array("<%= trim(rs("SmallClassName"))%>","<%= trim(rs("BigClassName"))%>","<%= trim(rs("SmallClassName"))%>");
        <%
        count = count + 1
        rs.movenext
        loop
        rs.close
        %>
onecount=<%=count%>;

function changelocation(locationid)
    {
    document.modinews.SmallClassName.length = 1; 
    var locationid=locationid;
    var i;
    for (i=0;i < onecount; i++)
        {
            if (subcat[i][1] == locationid)
            { 
                document.modinews.SmallClassName.options[document.modinews.SmallClassName.length] = new Option(subcat[i][0], subcat[i][2]);
            }        
        }
    }    
function CheckForm()
{
     document.modinews.cnWords.value = document.frames.cnEditBox.getHTML(true);     
     document.modinews.imageNum.value = document.frames.cnEditBox.document.all("editImageNum").value;
     document.modinews.editFirstImageName.value = document.frames.cnEditBox.document.all("editFirstImageName").value;

	if (document.modinews.title.value.length == 0) {
		alert("资讯标题没有填写.");
		document.modinews.title.focus();
		return false;
	}
		if (document.modinews.user.value.length == 0) {
		alert("新闻发布人没有填写");
		document.modinews.user.focus();
		return false;
	}
	if (document.modinews.hxts.value.length == 0) {
		alert("核心提示没有填写");
		document.modinews.hxts.focus();
		return false;
	}
	return true;
}
</script>
<table width="900" height="100%" border="0" cellpadding="0" cellspacing="0">
  <tr> 
    <td align="center" ><% 
newsid=request("id")
Set rso=Server.CreateObject("ADODB.RecordSet") 
sql="select * from yy_tjxhz where  id="&newsid
rso.Open sql,conn,1,1
if rso.eof and rso.bof then
response.Write("没有记录")
else
%> 
      <table  width="100%" border="0" cellpadding="2" cellspacing="1" class="table_southidc">
        <form name="modinews" method="post" action="News_modi.asp?no=modi" onSubmit="return CheckForm();">
          <tr align="center"> 
            <td class="back_southidc" height="30" colspan="5"><strong><font color="#000000" size="+1">未来院病号信息</font></strong></td>
          </tr>
          <tr bgcolor="#ECF5FF">
            <td width="180" height="30" align="center">患者姓名：</td>
            <td width="187"><font size="3"><%=rso("name")%></font></td>
            <td width="162"><font size="3">性别：</font></td>
            <td width="354" colspan="2"><font size="3"><%=rso("sex")%></font></td>
          </tr>
          <tr bgcolor="#ECF5FF">
            <td height="30" align="center">联系电话：</td>
            <td><font size="3"><%=rso("tel")%></font></td>
            <td><font size="3">年龄：</font></td>
            <td colspan="2"><font size="3"><%=rso("nl")%></font></td>
          </tr>
            <tr bgcolor="#ECF5FF">
            <td height="30" align="center" >预约途径：<font color="#FF0000" size="3">*</font></td>
            <td><%			
        sql = "select * from BigClass_New"
        rs.open sql,conn,1,1
		if rs.eof and rs.bof then
			response.write "请先添加预约途径。"
		else
		%>
              <select name="BigClassName" class="input2" onChange="changelocation(document.modinews.BigClassName.options[document.modinews.BigClassName.selectedIndex].value)" size="1">
                <%
		    do while not rs.eof
			%>
                <option <% if rs("BigClassName")=rso("BigClassName") then response.Write("selected") end if%> value="<%=trim(rs("BigClassName"))%>"><%=trim(rs("BigClassName"))%></option>
                <%
		        rs.movenext
    	    loop
		end if
        rs.close
			%>
              </select></td>
            <td>预约病种：<font color="#FF0000" size="3">*</font></td>
            <td colspan="2">
              <select name="SmallClassName" class="input2">
                <option value="" selected <%if rso("SmallClassName")="" then response.write "selected"%>>请选择病种</option>
                <%
			sql="select * from SmallClass_New where BigClassName='" & rso("BigClassName") & "'" 
			rs.open sql,conn,1,1 
			if not(rs.eof and rs.bof) then  
				do while not rs.eof %>
                <option value="<%=rs("SmallClassName")%>" <% if rs("SmallClassName")=rso("SmallClassName") then response.Write("selected") end if%>><%=rs("SmallClassName")%></option>
                <%
			    	rs.movenext
				loop
			end if
	        rs.close
			%>
              </select></td>
          </tr>
          <tr bgcolor="#ECF5FF">
            <td height="30" align="center" ><font size="3">预约指定医生：</font></td>
            <td><font color="#FF0000" size="3">
              <%		
        sql = "select * from yy_zxy where ys=true and yxbz=true order by px desc"
        rs.open sql,conn,1,1
		if rs.eof and rs.bof then
			response.write "请先添加栏目。"
		else
		%>
              <select name="yyys" size="1" id="yyys"class="input2" >
                <%
		    do while not rs.eof
			%>
                <option <% if rs("name")=rso("yyys") then response.Write("selected") end if%> value="<%=trim(rs("Name"))%>"><%=trim(rs("Name"))%></option>
                <%
		        rs.movenext
    	    loop
		end if
        rs.close
			%>
              </select>
            </font></td>
            <td><font size="3">预约号</font><font color="#FF0000" size="3">*</font></td>
            <td colspan="2"><input name="bz" type="text" class="input1" id="bz" value="<%=rso("bz")%>
              " size="20"></td>
          </tr>
          <tr bgcolor="#ECF5FF">
            <td height="40" align="center" >疾病描述：<font color="#FF0000" size="3">*</font></td>
            <td colspan="4"><textarea name="content" cols="70" rows="3" class="input1"  id="content" ><%=rso("content")%></textarea></td>
          </tr>
        
         <tr bgcolor="#ECF5FF">
            <td height="100" align="center" ><font size="3">聊天记录：</font></td>
            <td colspan="4"><textarea name="ltjl" cols="70" rows="30" class="input1"  id="ltjl" ><%=rso("ltjl")%></textarea></td>
          </tr>
          <tr bgcolor="#ECF5FF">
            <td height="30" align="center" ><span class="new">回访记录：</span></td>
            <td colspan="4"><textarea name="llfx" cols="70" rows="3" class="input1"  id="llfx" ><%=rso("llfx")%></textarea></td>
          </tr>
          <tr bgcolor="#ECF5FF">
            <td height="20" colspan="5" align="center" >&nbsp;</td>
          </tr>
          <tr bgcolor="#ECF5FF">
            <td height="30" align="center" ><font size="3">预约日期：</font></td>
            <td><font size="3"><%=rso("yydate")%></font><font color="#FF0000">&nbsp;&nbsp;</font></td>
            <td colspan="3"><font size="3">预约来院日期：</font><font size="3">
              <!--#include file="inc/yylydategg.asp" -->
            </font>&nbsp;
            <select name="swxw" id="swxw">
              <option value="<%=rso("swxw")%>" selected><%=rso("swxw")%></option>
              <option value="上午">上午</option>
              <option value="中午">中午</option>
              <option value="下午">下午</option>
            </select>
            <font color="#FF0000">
            <input name="yylydatebz" type="radio" value="True" <%if rso("yylydatebz")=True then Response.Write "checked"%>>
            非精准或未确定&nbsp;&nbsp;
            <input name="yylydatebz" type="radio" value="False" <%if rso("yylydatebz")=False then Response.Write "checked"%>>
            精准</font>        </td>
          </tr>
          <tr bgcolor="#ECF5FF">
            <td height="30" align="center" ><font size="3">预约人：</font></td>
            <td><font color="#FF0000" size="3"><%=rso("yyr")%></font><font size="3">
              <%if session("gly")=True then%>
              <%		
        sql = "select * from yy_zxy where yyr=true and zxb=true and yxbz=true and tsbz=false "
        rs.open sql,conn,1,1
		if rs.eof and rs.bof then
			response.write "请先添加栏目。"
		else
		%>
              <select name="yyr" size="1" id="yyr"class="input2" >
                <%
		    do while not rs.eof
			%>
                <option <% if rs("name")=rso("yyr") then response.Write("selected") end if%> value="<%=trim(rs("Name"))%>"><%=trim(rs("Name"))%></option>
                <%
		        rs.movenext
    	    loop
		end if
        rs.close
			%>
              </select>
              <%end if%>
            </font></td>
            <td colspan="3"><font size="3">预约登记时间:<%=rso("yydjdate")%></font> <font size="3">预回访日期：
              <!--#include file="inc/yhfdategg.asp" -->
            </font>&nbsp;</td>
          </tr>
          <tr bgcolor="#ECF5FF">
            <td height="20" colspan="5" align="center" >&nbsp;</td>
          </tr>   
          <tr bgcolor="#ECF5FF">
            <td height="30" align="center" ><font size="3">预约状态：</font></td>
            <td colspan="2">&nbsp;
              <input name="qxyy" type="radio" value="True" <%if rso("qxyy")=True then Response.Write "checked"%>>
            <font size="3">已取消&nbsp;&nbsp;
            <input name="qxyy" type="radio" value="False"<%if rso("qxyy")=False then Response.Write "checked"%>>
            预约中            </font></td>
            <td colspan="3"><font size="3">取消日期:</font><!--#include file="inc/qxyydate.asp" --></td>
          </tr>
          <tr bgcolor="#ECF5FF">
            <td height="30" align="center" ><font color="#FF0000" size="3">*</font><font size="3">取消原因：</font></td>
            <td colspan="2"><input name="qxyybz1" type="text" class="input1" id="qxyybz1" value="<%=rso("qxyybz")%>
              " size="30" readonly="readonly"></td>
            <td><%		
        sql = "select * from yy_qxyy where  zxb=true and yxbz=true order by px desc"
        rs.open sql,conn,1,1
		if rs.eof and rs.bof then
			response.write "请先添加取消原因。"
		else
		%>
              <select name="qxyybz" size="1" id="qxyybz"class="input2" >
                <%
		    do while not rs.eof
			%>
                <option <% if rs("name")=rso("qxyybz") then response.Write("selected") end if%> value="<%=trim(rs("Name"))%>"><%=trim(rs("Name"))%></option>
                <%
		        rs.movenext
    	    loop
		end if
        rs.close
			%>
            </select></td>
          </tr>
          <tr bgcolor="#ECF5FF">
            <td height="24" colspan="5" align="right" bgcolor="#ECF5FF">&nbsp;</td>
            </tr>
            <%if   session("dyz")<>"True" then %>
          <%end if%>
          <%if session("dyz")=True then%>
          <tr bgcolor="#ECF5FF">
            <td height="30" align="center"><font size="3">来院确定：</font></td>
            <td colspan="4">&nbsp;&nbsp;<input name="sfly" type="radio" value="True" <%if rso("sfly")=True then Response.Write "checked"%>>
<font size="3">已来院</font>
<%if rso("sfly")=False then %>
  <input name="sfly" type="radio" value="False"<%if rso("sfly")=False then Response.Write "checked"%> >

<font size="3">未来院</font> 　

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--#include file="inc/lydate.asp" --></td>
          </tr><%end if%>
         
          <tr bgcolor="#ECF5FF">
            <td height="30" align="center"><font size="3">接诊专家：</font></td>
            <td colspan="4">
            <%if rso("sfly")=False then %>
            
			<%		
        sql = "select * from yy_zxy where ys=true and yxbz=true order by px desc"
        rs.open sql,conn,1,1
		if rs.eof and rs.bof then
			response.write "请先添加栏目。"
		else
		%>
              <select  name="zjname" size="1" id="zjname">
                <option  selected value="<%=trim(rs("Name"))%>"><font size="3"><%=trim(rs("Name"))%></font></option>
                <%
			dim selys
		    selys=rs("Name")
        	rs.movenext
		    do while not rs.eof
			%>
                <option value="<%=trim(rs("Name"))%>"><font size="3"><%=trim(rs("Name"))%></font></option>
                <%
		        rs.movenext
    	    loop
		end if
        rs.close
			%>
            </select><%else%><font size="3"><%=rso("zjname") %></font><%end if%>
&nbsp;&nbsp;            <font color="#FF0000" size="3">*必选项</font></td>
          </tr>
          
          <tr bgcolor="#ECF5FF"> 
          
            <td height="30" align="center"><font size="3">接待导医：</font></td>
            <td colspan="4"><p><%if rso("sfly")=False then %>
              <%		
        sql = "select * from yy_zxy where dy=true and yxbz=true "
        rs.open sql,conn,1,1
		if rs.eof and rs.bof then
			response.write "请先添加栏目。"
		else
		%>
              
              
              <select name="dyname" size="1" id="dyname">
                <option selected value="<%=trim(rs("Name"))%>"><font size="3"><%=trim(rs("Name"))%></font></option>
                <%
			dim seldy
		    seldy=rs("Name")
        	rs.movenext
		    do while not rs.eof
			%>
                <option value="<%=trim(rs("Name"))%>"><font size="3"><%=trim(rs("Name"))%></font></option>
                <%
		        rs.movenext
    	    loop
		end if
        rs.close
			%>
              </select>      
              <%else%>
			  <font size="3"><%=rso("dyname") %></font><%end if%>
            &nbsp;&nbsp;<font color="#FF0000" size="3">注意：接待导医录入以后不能修改</font></p></td>
          </tr>
          <%end if%>
          <%end if%>
          <tr align="center" bgcolor="#ECF5FF"> 
            <td height="35" colspan="5"> 
             <input type="submit" name="Submit" value="提交" class="input">
              <input type="hidden" name="newsId" value="<%=newsId%>">
              　 
    
              <!--获取EditBox的内容-->
              <input name=cnWords type=hidden ID="cnWords" value=""> <input name=imageNum type=hidden ID="imageNum" value="<%=mImageNum%>"> 
              <input name=editFirstImageName type=hidden ID="editFirstImageName" value="">
              <!--获取EditBox的内容-->
              <input type="button" onClick="javascript:window.history.go(-1);"value="关闭"> </td>
          </tr>
        </form>
      </table>
    <% 
rso.close
set rso=nothing
 %></td>
  </tr>
</table>
<!-- #include file="Inc/Foot.asp" -->