Forum Moderators: open
<table cellpadding="0" cellspacing="0" id="data">
<tbody>
<tr class="ui-state-disabled">
<td><h3><?php if (mysql_num_rows($result1) > 0) { echo "<a href=\"daily.php?vehicle=1&date=$date\">Skip Wagon</a>"; } else { echo "Skip Wagon"; } ?></h3></td>
<td class="w80"> </td>
<td class="w200"> </td>
<td class="w250"> </td>
</tr>
<?php
if (mysql_num_rows($result1) == 0) {
echo "<tr class=\"ui-state-disabled\"><td></td><td colspan=\"3\" class=\"nodata\">No Jobs</td></tr>";
} else {
while($row=mysql_fetch_array($result1)) {
$jobid = $row['diary_id'];
$type = $row['diary_type'];
$status = $row['diary_status'];
?>
<tr id="job_<?php echo $jobid; ?>" <?php if ($status == 1) echo "class=\"complete\""; else if ($status == 2) echo "class=\"inprogress\""; else echo "class=\"incomplete\"";?> onclick="location.href='job.php?id=<?php echo $jobid; ?>'">
<td class="whitebg"></td>
<td><?php echo $type; ?></td>
<td><?php echo $row['diary_name']; ?></td>
<td><?php echo $row['diary_details']; ?></td>
</tr>
<?php }} ?>
</tbody>
</table>
<script type='text/javascript'>
$(document).ready(function() {
var fixHelper = function(e, ui) {
ui.children().each(function() {
$(this).width($(this).width());
});
return ui;
};
$("#data tbody").sortable({
items: 'tr:not(.ui-state-disabled)',
cursor: 'crosshair',
//Placeholder doesn't currently work
placeholder: "ui-state-highlight",
helper: fixHelper
}).disableSelection();
});
</script>
Array
(
[0] => 3141
[1] => 3138
[2] => 3052
[3] => 3142
)