<span><?php
<span>
</span>
define(<span>
"TEST"
</span>,<span>
'test'
</span>);
<span>
<span>
include_once
</span> <span>
'mysql.func.php'
</span>;
<span>
connectMySQL();
selectDB();
setZiFuJi();
<span>
$q
=
$_GET
[<span>
"q"
</span>];
<span>
<span>
if
</span> (
is_numeric
(
$q
))
{
$q
=
intval
(
$q
);
$hint
=<span>
""
</span>;
$resultDKQ
= queryDB(<span>
"select name from table_dake where id=$q"
</span>);
$hint
= <span>
'科室名字:<select name="ksname" id="ksname" onchange="show(this.options[this.selectedIndex].value)">'
</span>;
<span>
while
</span> (!!
$rowDKQ
= fetchAssoc(
$resultDKQ
))
{
$hint
.= <span>
'<optgroup label='
</span>.
$rowDKQ
[<span>
'name'
</span>].<span>
'>'
</span>;
$resultKSQ
= queryDB(<span>
"select table_dake.id,table_keshi.sid,table_keshi.name from table_dake,table_keshi where table_dake.name='{$rowDKQ['name']}' and table_keshi.sid=table_dake.id"
</span>);
<span>
while
</span>(!!
$rowKSQ
= fetchAssoc(
$resultKSQ
))
{
$hint
.= <span>
'<option>'
name
'</span>].<span>'
>
'</span>.$rowKSQ[<span>'
name
'</span>].<span>'
</option>'</span>;
}
$hint
.= <span>
'</optgroup>'
</span>;
}
}
<span>
<span>
else
</span>
{
$resultDK
= queryDB(<span>
"select table_dake.name from table_dake"
</span>);
$hint
= <span>
'科室名字:<select name="ksname" id="ksname" onchange="show(this.options[this.selectedIndex].value)">'
</span>;
<span>
while
</span> (!!
$rowDK
= fetchAssoc(
$resultDK
))
{
$hint
.= <span>
'<optgroup label='
</span>.
$rowDK
[<span>
'name'
</span>].<span>
'>'
</span>;
$resultKS
= queryDB(<span>
"select table_dake.id,table_keshi.sid,table_keshi.name from table_dake,table_keshi where table_dake.name='{$rowDK['name']}' and table_keshi.sid=table_dake.id"
</span>);
<span>
while
</span>(!!
$rowKS
= fetchAssoc(
$resultKS
))
{
$hint
.= <span>
'<option>'
name
'</span>].<span>'
>
'</span>.$rowKS[<span>'
name
'</span>].<span>'
</option>'</span>;
}
$hint
.= <span>
'</optgroup>'
</span>;
}
}
$response
=
$hint
;
<span>
<span>
echo
</span>
$response
;
?></span>