HEX
Server: Apache
System: Linux p3plzcpnl506847.prod.phx3.secureserver.net 4.18.0-553.54.1.lve.el8.x86_64 #1 SMP Wed Jun 4 13:01:13 UTC 2025 x86_64
User: slfopp7cb1df (5698090)
PHP: 8.1.34
Disabled: NONE
Upload Files
File: /home/slfopp7cb1df/www/conradinvestmentgroup.com/pm/app/Views/orders/update_order_status_script.php
<?php
$statuses = array();
foreach ($order_statuses as $status) {
    $statuses[] = array("id" => $status->id, "text" => $status->title);
}
?>

<script type="text/javascript">
    $(document).ready(function () {
        var detailsView = false;
<?php if (isset($details_view)) { ?>
            detailsView = true;
<?php } ?>

        $('body').on('click', '[data-act=update-order-status]', function () {
            var $instance = $(this);

            $(this).appModifier({
                value: $(this).attr('data-value'),
                actionUrl: '<?php echo_uri("orders/save_order_status") ?>/' + $(this).attr('data-id'),
                placement: detailsView ? "right" : "auto",
                select2Option: {data: <?php echo json_encode($statuses) ?>},
                onSuccess: function (response, newValue) {
                    if (response.success) {
                        if (detailsView) {
                            $instance.css("background-color", response.order_status_color);
                        } else {
                            $(".dataTable:visible").appTable({newData: response.data, dataId: response.id});
                        }
                    }
                }
            });

            return false;
        });
    });
</script>