复制代码 代码如下:
session_start();
if($_SESSION['gh']==''){
header('location:login.php');
}
include("config.php");
$sql="select*frommodule";
$result=mssql_query($sql,$conn);
$num=mssql_num_rows($result);
//echo$num;
?>
//引用以下两个dojo包
dojo.require("dojo.style");
dojo.require("dojo.dnd.*");
functioninit(){
//利用classname取到元素列表,将其注册为dojo.dnd.HtmlDragSour
vararr=dojo.html.getElementsByClass('divdrag')
for(vari=0;i
newdojo.dnd.HtmlDragSource(arr,parentDiv);
}
//定义容器
newdojo.dnd.HtmlDropTarget("container0",["container0",echo'"'.'container'.$p.'"';
if($p!=$num){
echo",";
}
}
echo']);';
for($p=1;$p<=$num;$p++){
echochr(13).'newdojo.dnd.HtmlDropTarget("container'.$p.'",["container0",';
for($o=1;$o<=$num;$o++){
echo'"container'.$o.'"';
if($o!=$num){
echo",";
}
}
echo']);';
}
echochr(13);
?>
}
//增加到window.onload事件中
window.onload=function(){init();}
functionbjsave(){
gr=""
$sql='selectidfrommodule';
$result=mssql_query($sql,$conn);
while($myrow=mssql_fetch_array($result))
echo'if(mokuai'.$myrow['id'].'.parentElement.id!="container0"){'.chr(13).'gr=gr+'.$myrow['id'].'+"|"+mokuai'.$myrow['id'].'.parentElement.id+"$"'.chr(13).'}'.chr(13);
?>
form1.gr.value=gr;
form1.submit();
}