0, 'error' => 'Kein Server ausgewählt' ] ) ); } if ( empty( $idLong ) ){ die( json_encode( [ 'status' => 0, 'error' => 'Keine Identität ausgewählt' ] ) ); } if ( empty( $_REQUEST['eventId'] ) ){ die( json_encode( [ 'status' => 0, 'error' => 'Daten unvollständig' ] ) ); } $msg = new ParTCP_Outgoing_Message( $serverLong, $idLong, 'event-details-request' ); $msg->set( 'Event-Id', $_REQUEST['eventId'] ); $response = pas_check_response( $msg->send() ); if ( is_string( $response ) ){ die( json_encode( [ 'status' => 0, 'error' => $response ] ) ); } $votings = $response->get('Votings'); if ( empty( $votings ) ){ die( json_encode( [ 'status' => 0, 'error' => 'In der Veranstaltung sind keine Abstimmungen definiert' ] ) ); } foreach ( $votings as $voting ){ if ( ! empty( $_REQUEST['votings'] ) && ! in_array( $voting['id'], $_REQUEST['votings'] ) ){ continue; } unset( $voting['id'], $voting['event_id'], $voting['status'], $voting['created_on'], $voting['created_by'], $voting['modified_on'], $voting['modified_by'] ); $result[] = $voting; } echo json_encode( [ 'status' => 1, 'file_name' => basename( $_REQUEST['eventId'] ) . '-votings.yaml', 'file_data' => yaml_emit( $result ) ] ); // end of file ajax/export_votings.php