13 lines
564 B
PHP
13 lines
564 B
PHP
<?php
|
|
header('Content-Type: application/json');
|
|
$input = json_decode(file_get_contents('php://input'), true);
|
|
if(!$input) { echo json_encode(['success'=>false,'msg'=>'no input']); exit; }
|
|
if($input['action']==='update_status'){
|
|
// contoh sederhana: simpan ke file log (uji saja)
|
|
$log = ['time'=>date('c'),'id'=>$input['id'],'status'=>$input['status']];
|
|
file_put_contents(__DIR__.'/spbu_status.log',json_encode($log)."\n",FILE_APPEND);
|
|
echo json_encode(['success'=>true,'log'=>$log]);
|
|
exit;
|
|
}
|
|
echo json_encode(['success'=>false,'msg'=>'unknown action']);
|