'error','message'=>'GET required.']); exit; } try { if ((int)($Response['SESSION']['Active'] ?? 0)!==1 || (int)($Response['SESSION']['AdminID'] ?? 0)<1 || PART_CaseInformationAdmin($PAAPP_CONFIG_DB_LINK,(string)($MySession['SESSION']['PHPSESSID'] ?? ''))!==(int)$Response['SESSION']['AdminID']) { throw new DomainException('Access denied'); } } catch (Throwable $e) { http_response_code(403); echo json_encode(['status'=>'error','message'=>'Sign in to view assignment status.']); exit; } $dashID=filter_var($_GET['did'] ?? null,FILTER_VALIDATE_INT); if (!$dashID || $dashID<1) { http_response_code(400); echo json_encode(['status'=>'error','message'=>'A valid DashID is required.']); exit; } try { // Snapshot reads only: never advance steps, send notices, or touch submitted forms. $PAAPP_CONFIG_DB_LINK->exec('SET TRANSACTION READ ONLY'); $PAAPP_CONFIG_DB_LINK->beginTransaction(); $q=$PAAPP_CONFIG_DB_LINK->prepare('SELECT DashID FROM PART_Dash WHERE DashID=? AND RecordStatus=0'); $q->execute([$dashID]); if (!$q->fetchColumn()) throw new DomainException('Case not found'); $requests=array_values(PART_PIInvitationRequestRecords([$dashID])); $PAAPP_CONFIG_DB_LINK->commit(); echo json_encode(['status'=>'success','data'=>['dashID'=>$dashID,'requests'=>$requests]],JSON_THROW_ON_ERROR|JSON_INVALID_UTF8_SUBSTITUTE); } catch (Throwable $e) { if ($PAAPP_CONFIG_DB_LINK->inTransaction()) $PAAPP_CONFIG_DB_LINK->rollBack(); $missing=$e instanceof DomainException; http_response_code($missing ? 404 : 503); if (!$missing) error_log('Detective assignment status unavailable for case '.$dashID); echo json_encode(['status'=>'error','message'=>$missing ? 'Case not found.' : 'Assignment status is temporarily unavailable.']); }