
<div class="modal fade" tabindex="-1" role="dialog" aria-hidden="false" data-backdrop="static" data-keyboard="false"   id="arrangeMainModal" style="min-width:1000px;">
    <div class="modal-dialog  modal-lg wds30">
        <div class="modal-content">

            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button>
                <h4 class="modal-title">  </h4>
            </div>
            <div class="modal-body">
                <div class="portlet-body form">
                    <div class="row">
                        <div class="col-md-12">
                            <div class="portlet blue-hoki box">

                                <div class="portlet-title">
                                    <div class="caption">
                                        <i class="fa fa-cogs"></i> Arrange
                                    </div>
                                </div>
                                <div class="portlet-body">
                                    <div class="scroller"  data-always-visible="1" data-rail-visible="0">

                                        <ul id="sortable" class="list-group ">

                                            {foreach $result as $key=>$value}
                                            <li id="item_{$value.id}" class="ainli" style="text-align: left;">{$value.label}</li>
                                            {/foreach}
                                            <div class="clearfix"></div>
                                        </ul>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="clearfix"></div>
                        <div class="modal-footer">

                            <button type="button" class="btn default" id="closemodel_arrange" data-dismiss="modal"> Close</button>

                        </div>
                    </div>
                </div>
            </div>
        </div>

    </div>
</div>

{literal}
<script>
    var hosturl = $('#hosturl').val();
    $("#sortable").sortable({
        update: function () {
            var datasorted = $("#sortable").sortable('serialize');
            $.ajax({
                url: hosturl + '/controllers/_menu.php?ac=sortable',
                type: "POST",
                data: {datasorted: datasorted},
                success: function (data)  		// A function to be called if request succeeds
                {
                    // alert(data);
                },
                error: function () {
                    alert("There was an error while sending.");
                }
            });
        }
    });
</script>


{/literal}