Insert record into mysql with Jquery drag and drop -
i n need of inserting / updating records when drag , drop list items 1 other. good, list items dragged , dropped around, can't update database record.
can me please? frustrating.
i have 4 <ul>
tags:
<meta http-equiv="x-ua-compatible" content="ie=edge"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.js"></script> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/jquery-ui.js"></script> <script src="https://code.jquery.com/jquery-1.12.4.js"></script> <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script> <style> #sortable0, #sortable1, #sortable2, #sortable3 { list-style-type: none; float: left; padding: 0px; width: 143px; min-height: 60px; text-align: left; } #sortable0 { height: 10px !important; } </style> <script> $( function () { $( "ul.droptrue" ).sortable( { connectwith: "ul", cursor: "move" } ); $( "ul.dropfalse" ).sortable( { connectwith: "ul", droponempty: false } ); $( "#sortable0, #sortable1, #sortable2, #sortable3" ).disableselection(); } ); </script> <!-- html5 shim , respond.js ie8 support of html5 elements , media queries --> <!-- warning: respond.js doesn't work if view page via file:// --> <div id="response"> </div> <table width="100%" border="0" align="center" cellpadding="0" cellspacing="6"> <tr> <td> <?php echo $_post['sortie_id']; ?> </td> </tr> </table> <table width="100%" border="0" cellpadding="4" cellspacing="4"> <form> <tbody> <tr> <td width="65%" nowrap="nowrap">bir sonraki sorti : <strong> <?php echo $nextsortie; ?> </strong> </td> <td width="33%" align="center" nowrap="nowrap">yolcu sayısı : <strong> <?php echo $num_nsortiedetails; ?> </strong> </td> <td width="35%" align="right" nowrap="nowrap"> <?php // print passenger list sortie $pa = new printanything(); $url = ( !isset( $_server[ 'https' ] ) || $_server[ 'https' ] != 'on' ? 'http://' : 'https://' ); $url .= $_server[ 'http_host' ] . dirname( $_server[ 'php_self' ] ); $url = trim( str_replace( '\\', '/', $url ) ); if ( substr( $url, -1 ) != '/' ) { $url .= '/'; } $url .= 'print_sortielist.php'; $printdata3 = printanything::readbody( $url ); $con3 = $pa->addprintcontext( $printdata3 ); $pa->showprintlink( $con3, '<button style="font-size:24px">yazdır <i class="fa fa-print"></i></button>' ); // end print stuff ?> </td> </tr> <tr> <td colspan="3" align="center" nowrap="nowrap"> <hr width="90%" size="1" color="#ffffff"/> </td> </tr> <tr> <td colspan="2" nowrap="nowrap" bgcolor="#ffffff" width="65%" valign="top"> <div id="list"> <?php if($num_nsortiedetails > 0) { ?> <ul id="sortable0" class="droptrue"> <?php { ?> <li class="ui-state-default" id="arrayorder_<?php echo $id ?>"> <span class="noshow"> <?php echo $row_nsortiedetails['id']; ?> </span> <span class="psgr"> <?php echo ucwords(strtolower($row_nsortiedetails['fullname'])); ?> </span> </li> <?php } while($row_nsortiedetails=mysqli_fetch_array($nsortiedetails)); ?> </ul> <?php } // end if recordset has results ?> </div> </td> <td width="35%" valign="top" nowrap="nowrap" bgcolor="#f4cdcd"> <?php echo "pilot out : " . $pilot_out; ?> </td> </tr> <tr> <td colspan="3" nowrap="nowrap" bgcolor="#ffffff" valign="top"> </td> </tr> <tr> <td colspan="3" nowrap="nowrap" bgcolor="#ffffff" valign="top"> <table width="75%" border="0" cellspacing="7" cellpadding="2" align="center"> <tbody> <tr> <td align="center"><strong>ocean team</strong> </td> <td align="center"><strong>dragon team</strong> </td> <td align="center"><strong>albatros team</strong> </td> </tr> <tr> <td align="center" valign="top"> <ul id="sortable1" class="droptrue"> </ul> </td> <td align="center" valign="top"> <ul id="sortable3" class="droptrue"> </ul> </td> <td align="center" valign="top"> <ul id="sortable2" class="droptrue"> </ul> </td> </tr> <tr> <td align="left" valign="top"> <?php $ops->teampilots("1", $db); ?> </td> <td align="left" valign="top"> <?php $ops->teampilots("2", $db); ?> </td> <td align="left" valign="top"> <?php $ops->teampilots("3", $db); ?> </td> </tr> </tbody> </table> </td> </tr> </tbody> </form> </table> <br style="clear:both">
i want drag 'sortable0' either 1 of 3
and want dragged record id update in relevant database.
thanks in advance help
Comments
Post a Comment