Jump to content

I am interested in the following


ebchost

Recommended Posts

This is extra example

http://davidwalsh.name/mootools-drag-drop

 

but, i need help,

 

How to organize files

step by step.

 

index.php

<head>   	
<link rel="stylesheet" href="css/template.css" type="text/css" />
</head>

<body>
<?php

$path = $_SERVER['DOCUMENT_ROOT'];
$path .= "/resources/init.php";
include_once($path); 

$query = "SELECT * FROM `a_sort_test` ORDER BY `sort_order` ASC";
$result = mysql_query($query) or die(mysql_error());
if(mysql_num_rows($result)) {

?>
<p>Drag and drop the elements below.  The database gets updated on every drop.</p>

<div id="message-box"><?php echo $message; ?> Waiting for sortation submission...</div>

<form id="dd-form" action="<?php echo $_SERVER['REQUEST_URI']; ?>" method="post">
<p>
<input type="checkbox" value="1" name="autoSubmit" id="autoSubmit" <?php if($_POST['autoSubmit']) { echo 'checked="checked"'; } ?> />
<label for="autoSubmit">Automatically submit on drop event</label>
</p>

<ul id="sortable-list">
<?php 
	$order = array();
	while($item = mysql_fetch_assoc($result)) {
		echo '<li title="',$item['id'],'">',$item['title'],'</li>';
		$order[] = $item['id'];
	}
?>
</ul>
<br />
<input type="hidden" name="sort_order" id="sort_order" value="<?php echo implode(',',$order); ?>" />
<input type="submit" name="do_submit" value="Submit Sortation" class="button" />
</form>
<?php } else { ?>

<p>Sorry!  There are no items in the system.</p>

<?php } ?>
</body>

 

tempalete.css

#sortable-list    { padding:0; }
#sortable-list li  { padding:4px 8px; color:#000; cursor:move; list-style:none; width:500px; background:#ddd; margin:10px 0; border:1px solid #999; }
#message-box    { background:#fffea1; border:2px solid #fc0; padding:4px 8px; margin:0 0 14px 0; width:500px; }

resolt is hiar:

http://www.sportskevesti.co/component/menadzer/sort.php

 

but what next with other part of example ?

 

mootols ? Wer and how?

Link to comment
Share on other sites

  • 1 month later...
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.