Home php教程 php手册 php+dojo 的数据库保存拖动布局的一个方法dojo 这里下载

php+dojo 的数据库保存拖动布局的一个方法dojo 这里下载

Jun 13, 2016 pm 12:33 PM
dojo download introduce keep study layout drag database method frame of look

看老大介绍的dojo框架,学习着写了下。刚开始学习php 请大家指教下!发现发不了附件。发两个代码大家自己体会了。

复制代码 代码如下:


session_start(); 
if ($_SESSION['gh']==''){ 
header('location:login.php');  

include("config.php"); 
$sql="select * from module";  
$result=mssql_query($sql,$conn); 
$num=mssql_num_rows($result); 
//echo $num; 
?> 
 
<script></script> 
<script> <BR>//引用以下两个dojo包 <BR>dojo.require("dojo.style"); <BR>dojo.require("dojo.dnd.*"); <BR>function init(){ <BR> //利用classname取到元素列表,将其注册为dojo.dnd.HtmlDragSour <BR> var arr=dojo.html.getElementsByClass('divdrag') <BR> for(var i=0;i<arr.length;i++){ <BR> var parentDiv=arr.parentNode.id <BR> new dojo.dnd.HtmlDragSource(arr,parentDiv); <BR> } <BR> //定义容器 <BR>new dojo.dnd.HtmlDropTarget("container0", ["container0",<?php for ( $p = 1 ; $p <= $num ; $p ++) { <BR>echo '"'.'container'.$p.'"'; <BR>if ($p != $num){ <BR> echo ","; <BR>} <BR> } <BR> echo ']); '; <br><br> for ($p =1 ; $p <=$num ;$p++){ <BR> echo chr(13).'new dojo.dnd.HtmlDropTarget("container'.$p.'", ["container0",'; <BR> for ($o =1 ;$o <= $num;$o++){ <BR> echo '"container'.$o.'"'; <BR> if ($o != $num){ <BR> echo ","; <BR> } <BR>} <BR> echo ']); '; <BR> } <BR> echo chr(13); <br><br> ?> <BR>} <BR>//增加到window.onload事件中 <BR>window.onload=function(){init();} <BR>function bjsave() { <BR>gr="" <BR><?php <BR>$sql='select id from module'; <BR>$result=mssql_query($sql,$conn); <BR>while($myrow=mssql_fetch_array($result)) <BR>echo 'if (mokuai'.$myrow['id'].'.parentElement.id !="container0") {'.chr(13).'gr=gr+'.$myrow['id'].'+"|"+ mokuai'.$myrow['id'].'.parentElement.id+ "$"'.chr(13).'}'.chr(13); <BR>?> <BR>form1.gr.value=gr; <BR>form1.submit(); <BR>} <BR></script> 

 
 
$sql='select * from module where id not in (select mokuaiid from geren where gh ='.$_SESSION['gh'].')'; 
$result=mssql_query($sql,$conn); 
while($myrow=mssql_fetch_array($result)) 
echo ''.$myrow['mn'].''; 
?> 
 
 
   
     
      
   
 
for ($p=1; $p  echo '
'; 
  $sql='select mokuaiid from geren where biaogeid='.$p.' and gh ='.$_SESSION['gh']; 
  $result=mssql_query($sql,$conn); 
  while($myrow=mssql_fetch_array($result)){ 
   $sql='select * from module where id='.$myrow['mokuaiid']; 
   $result1=mssql_query($sql,$conn);    
   while($myrow1=mssql_fetch_array($result1)){ 
    echo ''.$myrow1['mn'].''; 
   } 
  }      
  echo '
';  
}   
?>
 
for ($p=2; $p  echo '
'; 
  $sql='select mokuaiid from geren where biaogeid='.$p.' and gh ='.$_SESSION['gh']; 
  $result=mssql_query($sql,$conn); 
  while($myrow=mssql_fetch_array($result)){ 
   $sql='select * from module where id='.$myrow['mokuaiid']; 
   $result1=mssql_query($sql,$conn);    
   while($myrow1=mssql_fetch_array($result1)){ 
    echo ''.$myrow1['mn'].''; 
   } 
  }      
  echo '
';  
}   
?> 
 
 
 
 
 




复制代码 代码如下:


session_start(); 
if ($_SESSION['gh']==''){ 
header('location:login.php');  

include("config.php"); 
$sql='delete from geren where gh='.$_SESSION['gh']; 
mssql_query($sql); 
$gr=str_replace("container","",$_POST['gr']); 
//echo $gr; 
$array = explode("$", $gr); 
for ($i=0;$i$add=explode("|",$array[$i]); 
$sql='insert into geren (mokuaiid,biaogeid,gh) values ("'.$add[0].'","'.$add 
[1].'","'.$_SESSION['gh'].'")'; 
//echo $sql.'
'; 
mssql_query($sql); 

header("location:view.php"); 
?> 


dojo 这里下载 http://download.dojotoolkit.org/release-0.3.1/dojo-0.3.1-ajax.zip
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Repo: How To Revive Teammates
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Tesla Dojo supercomputing debut, Musk: The computing power of AI training by the end of the year will be approximately equal to 8,000 NVIDIA H100 GPUs Tesla Dojo supercomputing debut, Musk: The computing power of AI training by the end of the year will be approximately equal to 8,000 NVIDIA H100 GPUs Jul 24, 2024 am 10:38 AM

According to news from this website on July 24, Tesla CEO Elon Musk (Elon Musk) stated in today’s earnings conference call that the company is about to complete the largest artificial intelligence training cluster to date, which will be equipped with 2 Thousands of NVIDIA H100 GPUs. Musk also told investors on the company's earnings call that Tesla would work on developing its Dojo supercomputer because GPUs from Nvidia are expensive. This site translated part of Musk's speech as follows: The road to competing with NVIDIA through Dojo is difficult, but I think we have no choice. We are now over-reliant on NVIDIA. From NVIDIA's perspective, they will inevitably increase the price of GPUs to a level that the market can bear, but

How to evaluate the cost-effectiveness of commercial support for Java frameworks How to evaluate the cost-effectiveness of commercial support for Java frameworks Jun 05, 2024 pm 05:25 PM

Evaluating the cost/performance of commercial support for a Java framework involves the following steps: Determine the required level of assurance and service level agreement (SLA) guarantees. The experience and expertise of the research support team. Consider additional services such as upgrades, troubleshooting, and performance optimization. Weigh business support costs against risk mitigation and increased efficiency.

Detailed introduction of Samsung S24ai functions Detailed introduction of Samsung S24ai functions Jun 24, 2024 am 11:18 AM

2024 is the first year of AI mobile phones. More and more mobile phones integrate multiple AI functions. Empowered by AI smart technology, our mobile phones can be used more efficiently and conveniently. Recently, the Galaxy S24 series released at the beginning of the year has once again improved its generative AI experience. Let’s take a look at the detailed function introduction below. 1. Generative AI deeply empowers Samsung Galaxy S24 series, which is empowered by Galaxy AI and brings many intelligent applications. These functions are deeply integrated with Samsung One UI6.1, allowing users to have a convenient intelligent experience at any time, significantly improving the performance of mobile phones. Efficiency and convenience of use. The instant search function pioneered by the Galaxy S24 series is one of the highlights. Users only need to press and hold

iOS 18 adds a new 'Recovered' album function to retrieve lost or damaged photos iOS 18 adds a new 'Recovered' album function to retrieve lost or damaged photos Jul 18, 2024 am 05:48 AM

Apple's latest releases of iOS18, iPadOS18 and macOS Sequoia systems have added an important feature to the Photos application, designed to help users easily recover photos and videos lost or damaged due to various reasons. The new feature introduces an album called "Recovered" in the Tools section of the Photos app that will automatically appear when a user has pictures or videos on their device that are not part of their photo library. The emergence of the "Recovered" album provides a solution for photos and videos lost due to database corruption, the camera application not saving to the photo library correctly, or a third-party application managing the photo library. Users only need a few simple steps

How do the lightweight options of PHP frameworks affect application performance? How do the lightweight options of PHP frameworks affect application performance? Jun 06, 2024 am 10:53 AM

The lightweight PHP framework improves application performance through small size and low resource consumption. Its features include: small size, fast startup, low memory usage, improved response speed and throughput, and reduced resource consumption. Practical case: SlimFramework creates REST API, only 500KB, high responsiveness and high throughput

How to handle database connection errors in PHP How to handle database connection errors in PHP Jun 05, 2024 pm 02:16 PM

To handle database connection errors in PHP, you can use the following steps: Use mysqli_connect_errno() to obtain the error code. Use mysqli_connect_error() to get the error message. By capturing and logging these error messages, database connection issues can be easily identified and resolved, ensuring the smooth running of your application.

How does Go WebSocket integrate with databases? How does Go WebSocket integrate with databases? Jun 05, 2024 pm 03:18 PM

How to integrate GoWebSocket with a database: Set up a database connection: Use the database/sql package to connect to the database. Store WebSocket messages to the database: Use the INSERT statement to insert the message into the database. Retrieve WebSocket messages from the database: Use the SELECT statement to retrieve messages from the database.

How to choose the best golang framework for different application scenarios How to choose the best golang framework for different application scenarios Jun 05, 2024 pm 04:05 PM

Choose the best Go framework based on application scenarios: consider application type, language features, performance requirements, and ecosystem. Common Go frameworks: Gin (Web application), Echo (Web service), Fiber (high throughput), gorm (ORM), fasthttp (speed). Practical case: building REST API (Fiber) and interacting with the database (gorm). Choose a framework: choose fasthttp for key performance, Gin/Echo for flexible web applications, and gorm for database interaction.

See all articles