i'm using the sortable javascript from http://farhadi.ir/projects/html5sortable/
The script works fine for me, but when i have no knowlidge of javascript it is a problem how to create the code to get back an array in php with the new order when you have moved a picture.
The code i use now:
<section>
<ul class="sortable grid">
<?php
$i=1;
foreach ($werkbladen as $werkblad) {
$thumbnail = "../groepen/".$werkblad['werkblad'][path].$werkblad['werkblad'][thumbnail];
echo '<li id = "'.$i.'"><img src="'.$thumbnail.'" width="139" height="181" /></li>';
$i++;
}
?>
</ul>
</section>
<script>
$('.sortable').sortable().bind('sortupdate', function() {
//Triggered when the user stopped sorting and the DOM position has changed.
// i will need here the code in javascript that creates a new array in php with the new order
});
</script>
i hope someone can help me out with this.
Maybe some more explaination will help too: This is how my session_array look like
Array
(
[0] => Array
(
[werkblad] => Array
(
[id] => 1105
[database] => 1111
[path] => groep12/1111
[thumbnail] => mensen-kleding-03.jpg
[bestand] =>
)
)
[1] => Array
(
[werkblad] => Array
(
[id] => 5639
[database] => 1111
[path] => groep12/1111/1111/
[thumbnail] => mensen-kleding-1-minder-en-1-meer.jpg
[bestand] => mensen-kleding-1-minder-en-1-meer.pdf
)
)
[2] => Array
(
[werkblad] => Array
(
[id] => 72
[database] => 1111
[path] => groep12/1111/
[thumbnail] => passieve-woordenschat-02.jpg
[bestand] => passieve-woordenschat-02.pdf
)
)
)
What i need is a array back with the sorted images. That array will be send to a php file that creates a pdf from it, so i will need all the information back as the original one.
Kind regards, Sietsko