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?

  • 1 month later...

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.