<?php
ini_set("memory_limit","30000M");
set_time_limit(0);
include('../../../configuracion.php');
include('config.php');
$orden = (isset($_POST["orden"])) ? $_POST["orden"] : NULL;
$p = (isset($_POST["p"])) ? $_POST["p"] : NULL;
$categoria = (isset($_POST["categoria"])) ? $_POST["categoria"] : NULL;
$av = (isset($_POST["av"])) ? $_POST["av"] : NULL;
if($orden){

    foreach($orden as $k => $val){

        $datos = array(
            "orden" => @$val 
        );
        $db->update("productos",$datos,"id='{$k}'");

    }
   
    header('Location:'.MAGO."c/".MODULO."?av=$av&p=$p&ordenar=orden+desc&categoria=$categoria");
    exit;

}else{

    header('Location:'.MAGO."c/".MODULO."?av=$av&p=$p&ordenar=orden+desc&categoria=$categoria");
    exit;

}
?>