| Server IP : 202.61.199.114 / Your IP : 216.73.217.139 Web Server : nginx/1.22.1 System : Linux de.arni-solutions.de 6.1.0-49-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.174-1 (2026-05-26) x86_64 User : web20 ( 1018) PHP Version : 8.4.23 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /var/www/clients/client1/seaside.pacim.de/web/ |
Upload File : |
<?php
/**
* app-activity-delete.php – löscht die gesamte Statistik/History eines Akteurs
* (Terminal-Login oder Mobile-Ansicht) aus pacim_app_activity. Nur Admins.
* POST: type, key, login
*/
require_once( __DIR__ . '/includes/config.inc.php' );
@ini_set( 'display_errors', '0' );
error_reporting( 0 );
function aad_json( $a ) { while ( ob_get_level() > 0 ) ob_end_clean(); header( 'Content-Type: application/json; charset=utf-8' ); echo json_encode( $a ); exit(); }
if ( ! function_exists( 'is_admin' ) || ! is_admin() ) aad_json( array( 'ok' => false, 'error' => 'Nicht berechtigt.' ) );
$db = new MysqliDb( MYSQL_HOST, MYSQL_USER, MYSQL_PASS, MYSQL_DB );
if ( function_exists( 'pacim_aa_ensure_table' ) ) pacim_aa_ensure_table( $db );
// Alle Web-App-/Terminal-Statistiken zurücksetzen (Stand auf 0). Betrifft NUR pacim_app_activity,
// NICHT die Buchungshistorie (pacim_api_log).
if ( (string) ( $_POST['all'] ?? '' ) === '1' ) {
$db->rawQuery( "DELETE FROM pacim_app_activity" );
aad_json( array( 'ok' => true, 'reset' => true ) );
}
$type = (string) ( $_POST['type'] ?? '' );
$key = (string) ( $_POST['key'] ?? '' );
$login = (int) ( $_POST['login'] ?? 0 );
if ( $type === '' || $key === '' ) aad_json( array( 'ok' => false, 'error' => 'Ungültige Parameter.' ) );
$n = pacim_aa_delete_actor( $db, $type, $key, $login );
aad_json( array( 'ok' => true, 'deleted' => (int) $n ) );