post("ac"); $operation_id=$http->post("operation_id"); $state=$http->post("state"); } catch (Exception $exc) { record_log($exc); return; } $a_module=explode("/",$ac); // stop if user cannot access this module if ($g_user->check_module($a_module[count($a_module)-1]) == 0) { return ; } // var $jr_id must be the JRN.JR_ID $jr_id=str_replace("rd_paid", "", $operation_id); // stop if $jr_id is not a number if (isNumber($jr_id) == 0 ) { return; } // User can access this operation in writing $ledger_id=$cn->get_value("select jr_def_id from jrn where jr_id=$1",[$jr_id]); // stop if user cannot access this ledger if ( $g_user->get_ledger_access($ledger_id) != "W") { return;} if ( $state == "true") { $cn->exec_sql("update jrn set jr_rapt='paid' where jr_id=$1",[$jr_id]); echo 1; } elseif( $state == "false") { $cn->exec_sql("update jrn set jr_rapt=null where jr_id=$1",[$jr_id]); echo 0; } else { echo "ERROR : unknown state [$state]"; }