Fix pairgoth export

This commit is contained in:
2026-07-05 18:44:30 +02:00
parent 1d5fed6e1f
commit f5b5af5372
3 changed files with 10 additions and 1087 deletions

7
TODO.md Normal file
View File

@@ -0,0 +1,7 @@
in macMahon export -> under country copy clubs.
Edit in delete button in line
make update person per person
Remove update egd data

File diff suppressed because it is too large Load Diff

View File

@@ -16,20 +16,20 @@ header('Content-Disposition: attachment; filename="go-form-' . sanitize_title($f
$output = fopen('php://output', 'w'); $output = fopen('php://output', 'w');
fwrite($output,'{"id":1,"type":"INDIVIDUAL","name":"Template","shortName":"20251111-Template","startDate":"2025-11-11","endDate":"2025-11-11","director":"","country":"si","location":"Template","online":false,"komi":6.5,"rules":"JAPANESE","gobanSize":19,"timeSystem":{"type":"CANADIAN","mainTime":2400,"byoyomi":300,"stones":15},"rounds":5,"pairing":{"type":"MAC_MAHON","base":{"nx1":0.5,"dupWeight":5.0E14,"random":0.0,"deterministic":true,"colorBalanceWeight":1000000.0},"main":{"catWeight":2.0E13,"scoreWeight":1.0E11,"upDownWeight":1.0E8,"upDownCompensate":true,"upDownLowerMode":"MIDDLE","upDownUpperMode":"MIDDLE","maximizeSeeding":5000000.0,"firstSeedLastRound":2,"firstSeed":"SPLIT_AND_RANDOM","secondSeed":"SPLIT_AND_FOLD","firstSeedAddCrit":"RATING","secondSeedAddCrit":"NONE","mmsValueAbsent":0.5,"roundDownScore":true,"sosValueAbsentUseBase":true},"secondary":{"barThreshold":true,"rankThreshold":0,"winsThreshold":true,"secWeight":1.0E11},"geo":{"weight":1.0E11,"mmsDiffCountry":1,"mmsDiffClubGroup":3,"mmsDiffClub":3},"handicap":{"weight":0.0,"useMMS":false,"threshold":8,"correction":2,"ceiling":9},"placement":["MMS","SOSM","SOSOSM"],"mmFloor":-20,"mmBar":0},"players":['); fwrite($output, '{"id":1,"type":"INDIVIDUAL","name":"Template","shortName":"20251111-Template","startDate":"2025-11-11","endDate":"2025-11-11","director":"","country":"si","location":"Template","online":false,"komi":6.5,"rules":"JAPANESE","gobanSize":19,"timeSystem":{"type":"CANADIAN","mainTime":2400,"byoyomi":300,"stones":15},"rounds":5,"pairing":{"type":"MAC_MAHON","base":{"nx1":0.5,"dupWeight":5.0E14,"random":0.0,"deterministic":true,"colorBalanceWeight":1000000.0},"main":{"catWeight":2.0E13,"scoreWeight":1.0E11,"upDownWeight":1.0E8,"upDownCompensate":true,"upDownLowerMode":"MIDDLE","upDownUpperMode":"MIDDLE","maximizeSeeding":5000000.0,"firstSeedLastRound":2,"firstSeed":"SPLIT_AND_RANDOM","secondSeed":"SPLIT_AND_FOLD","firstSeedAddCrit":"RATING","secondSeedAddCrit":"NONE","mmsValueAbsent":0.5,"roundDownScore":true,"sosValueAbsentUseBase":true},"secondary":{"barThreshold":true,"rankThreshold":0,"winsThreshold":true,"secWeight":1.0E11},"geo":{"weight":1.0E11,"mmsDiffCountry":1,"mmsDiffClubGroup":3,"mmsDiffClub":3},"handicap":{"weight":0.0,"useMMS":false,"threshold":8,"correction":2,"ceiling":9},"placement":["MMS","SOSM","SOSOSM"],"mmFloor":-20,"mmBar":0},"players":[');
$count = count($entries); $count = count($entries);
foreach ($entries as $i => $e) { foreach ($entries as $i => $e) {
$rank = $e->rank - 30; $rank = $e->rank - 30;
$id = ($i + 1) * 2; $id = ($i + 1) * 2;
$out = "{\"id\":$id,\"name\":\"$e->first_name\",\"firstname\":\"$e->last_name\",\"rating\":$e->rating,\"rank\":$rank,\"country\":\"$e->country\",\"club\":\"$e->club\",\"final\":false,\"egf\":\"$e->egd_number\"}"; $out = "{\"id\":$id,\"name\":\"$e->last_name\",\"firstname\":\"$e->first_name\",\"rating\":$e->rating,\"rank\":$rank,\"country\":\"$e->country\",\"club\":\"$e->club\",\"final\":false,\"egf\":\"$e->egd_number\"}";
if ($i + 1 < $count) { if ($i + 1 < $count) {
$out .= ","; $out .= ",";
} }
fwrite($output, $out); fwrite($output, $out);
} }
fwrite($output,'],"games":[[]]}'); fwrite($output, '],"games":[[]]}');