mcmahon WIP
This commit is contained in:
2215
go-form-plugin/export/mcmahon-help.php
Normal file
2215
go-form-plugin/export/mcmahon-help.php
Normal file
File diff suppressed because it is too large
Load Diff
@@ -11,26 +11,39 @@ $form = go_form_get_form_by_id($form_id);
|
|||||||
$form_name = $form ? $form->name : 'Unknown Form';
|
$form_name = $form ? $form->name : 'Unknown Form';
|
||||||
$entries = go_form_get_entries($form_id);
|
$entries = go_form_get_entries($form_id);
|
||||||
|
|
||||||
header('Content-Type: text/csv; charset=utf-8');
|
header('Content-Type: text/xml; charset=utf-8');
|
||||||
header('Content-Disposition: attachment; filename="go-form-' . sanitize_title($form_name) . '-export.csv"');
|
header('Content-Disposition: attachment; filename="go-form-' . sanitize_title($form_name) . '-export-macmahon.xml"');
|
||||||
|
|
||||||
$output = fopen('php://output', 'w');
|
$output = fopen('php://output', 'w');
|
||||||
fputcsv($output, ['ID', 'First Name', 'Last Name', 'Country', 'Club', 'Rank', 'Email', 'EGD Number', 'Comment', 'Date Added']);
|
include_once 'mcmahon-help.php';
|
||||||
|
|
||||||
foreach ($entries as $e) {
|
fwrite($output, $mcmahonfirst);
|
||||||
global $ranks;
|
|
||||||
fputcsv($output, [
|
foreach ($entries as $i => $e) {
|
||||||
$e->id,
|
$rank = $ranks[$e->rank];
|
||||||
$e->first_name,
|
$id = $e->i + 1;
|
||||||
$e->last_name,
|
$egd = $e->egd_number ? $e->egd_number : '0';
|
||||||
$e->country,
|
$out = " <IndividualParticipant typeversion=\"1\">
|
||||||
$e->club,
|
<Id>$id</Id>
|
||||||
$ranks[$e->rank] ?? '',
|
<Joker>false</Joker>
|
||||||
$e->email,
|
<PreliminaryRegistration>false</PreliminaryRegistration>
|
||||||
$e->egd_number,
|
<ScoreAdjustment>false</ScoreAdjustment>
|
||||||
$e->comment,
|
<ScoreAdjustmentValue>0</ScoreAdjustmentValue>
|
||||||
$e->created_at
|
<SuperBarMember>false</SuperBarMember>
|
||||||
]);
|
<GoPlayer typeversion=\"1\">
|
||||||
|
<AsianName>false</AsianName>
|
||||||
|
<FirstName><![CDATA[$e->first_name]]></FirstName>
|
||||||
|
<Surname><![CDATA[$e->last_name]]></Surname>
|
||||||
|
<GoLevel>$rank</GoLevel>
|
||||||
|
<Rating>$e->rating</Rating>
|
||||||
|
<EgdPin>$e->egd_number</EgdPin>
|
||||||
|
<Country>$e->country</Country>
|
||||||
|
<Club>$e->club</Club>
|
||||||
|
</GoPlayer>
|
||||||
|
</IndividualParticipant>";
|
||||||
|
fwrite($output, $out);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fwrite($output, $mcmahonlast);
|
||||||
|
|
||||||
fclose($output);
|
fclose($output);
|
||||||
@@ -18,7 +18,6 @@ $output = fopen('php://output', 'w');
|
|||||||
|
|
||||||
fwrite($output, '<?xml version="1.0" encoding="UTF-8" standalone="no"?><Tournament fullVersionNumber="3.52.03" runningMode="SAL" saveDT="20260506230816" dataVersion="201"><Players>');
|
fwrite($output, '<?xml version="1.0" encoding="UTF-8" standalone="no"?><Tournament fullVersionNumber="3.52.03" runningMode="SAL" saveDT="20260506230816" dataVersion="201"><Players>');
|
||||||
|
|
||||||
$count = count($entries);
|
|
||||||
foreach ($entries as $i => $e) {
|
foreach ($entries as $i => $e) {
|
||||||
$rank = $ranks[$e->rank];
|
$rank = $ranks[$e->rank];
|
||||||
$out = "<Player agaExpirationDate=\"\" agaId=\"\" club=\"$e->club\" country=\"$e->country\" egfPin=\"$e->egd_number\" ffgLicence=\"\" ffgLicenceStatus=\"\" firstName=\"$e->first_name\" grade=\"$rank\" name=\"$e->last_name\" participating=\"11111111111111111111\" rank=\"$rank\" rating=\"$e->rating\" ratingOrigin=\"\" registeringStatus=\"PRE\" smmsCorrection=\"0\"/>";
|
$out = "<Player agaExpirationDate=\"\" agaId=\"\" club=\"$e->club\" country=\"$e->country\" egfPin=\"$e->egd_number\" ffgLicence=\"\" ffgLicenceStatus=\"\" firstName=\"$e->first_name\" grade=\"$rank\" name=\"$e->last_name\" participating=\"11111111111111111111\" rank=\"$rank\" rating=\"$e->rating\" ratingOrigin=\"\" registeringStatus=\"PRE\" smmsCorrection=\"0\"/>";
|
||||||
|
|||||||
Reference in New Issue
Block a user