Skip to content

Commit

Permalink
import price from csv and remove comments
Browse files Browse the repository at this point in the history
  • Loading branch information
krzysiek581234 committed May 21, 2024
1 parent 4b5c13a commit 1590b09
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 95 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,28 +12,28 @@
<tr>
<td scope="row">Presenting author <br> (for Paper, Poster, or Journal-first Paper)</td>
<td>June 30</td>
<td>EUR 500</td>
<td>EUR 400</td>
<td>EUR {{tickets[0].Fullprice}}</td>
<td>EUR {{tickets[0].DiscountedPrice}}</td>
</tr>
<tr>
<td scope="row">Discounted fee for additional paper <br> (Paper, Poster, or Journal-first Paper)</td>
<td colspan="3">EUR 300</td>
<td colspan="3">EUR {{tickets[1].Fullprice}}</td>
</tr>
<tr>
<td scope="row">Extra page <br> (only one permitted per paper)</td>
<td colspan="3">EUR 50</td>
<td colspan="3">EUR {{tickets[2].Fullprice}}</td>
</tr>
<tr>
<td scope="row">Non-presenting participant - early bird registration<br> (including non-presenting authors) </td>
<td>July 21</td>
<td>EUR 300</td>
<td>EUR 200</td>
<td>EUR {{tickets[4].Fullprice}}</td>
<td>EUR {{tickets[4].DiscountedPrice}}</td>
</tr>
<tr>
<td scope="row">Non-presenting participant - late registration <br> (including non-presenting authors) </td>
<td>August 11</td>
<td>EUR 400</td>
<td>EUR 300</td>
<td>EUR {{tickets[3].Fullprice}}</td>
<td>EUR {{tickets[3].Fullprice}}</td>
</tr>
</tbody>
</table>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
import { Component, OnInit } from '@angular/core';

import { Ticket } from 'src/app/interfaces/Ticket';
import { CsvDataService } from 'src/app/services/csv-data/csv-data.service';
@Component({
selector: 'isd-table',
templateUrl: './table.component.html',
styleUrls: ['./table.component.scss']
})
export class TableComponent implements OnInit {

constructor() { }
tickets!: Ticket[];
constructor(private csvDataService: CsvDataService) { }

ngOnInit(): void {
this.csvDataService.getTicketsData().subscribe(tickets => {
this.tickets = tickets;
})
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -2,47 +2,9 @@
<div class="container">
<div class="side-bar-organizer">Please read the fee structure and registration details carefully before proceeding to registration. Double-check that your e-mail is correct. The bank <b> account number</b> to which the fee is to be paid shall be <b>included</b> in the confirmation of registration.</div>
<div class="checkout mt-2">


<!-- <div class="number-of-tickets" *ngIf="ticketValues.size > 0">
<br>
<span *ngFor="let ticket of ticketValues.entries()" class="ticket-type">
{{ ticket[1].value }}x {{ ticket[1].name }}:
<strong class="price">{{ calculatePrice(ticket[1]) | currency:'EUR':true:'1.2-2' }}</strong>
</span>
<hr class="separator">
<span class="total-price">
Total:
<strong class="total">{{ calculateTotalPrice() | currency:'EUR':true:'1.2-2' }}</strong>
</span>
<br>
<isd-addbutton></isd-addbutton>
</div> -->
<isd-form></isd-form>


<isd-form></isd-form>
</div>
<div class="top">
<isd-accordion></isd-accordion>



<!-- <div class="header"><p>About the organizors</p></div> -->
<!-- <div class="ticket-grid"> -->
<!-- <isd-ticket (ticketSelected)="TicketSelected($event)" *ngFor="let ticket of tickets" [ticket]="ticket"></isd-ticket> -->
<!-- </div> -->


<!-- <div class="ad">
<div class="side_bar_about">
<isd-about-the-tickets></isd-about-the-tickets>
</div>
<div class="side-bar-organizer">
<isd-side-bar-organizer></isd-side-bar-organizer>
</div>
</div> -->
</div>

</div>
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
import { Component, OnInit } from '@angular/core';
import { Ticket } from 'src/app/interfaces/Ticket';
// import { MOCK_TRACKS } from 'src/app/mock_data/tickets_data';
import { CsvDataService } from 'src/app/services/csv-data/csv-data.service';
import { ChangeDetectorRef } from '@angular/core';

// declare var $: any;

@Component({
selector: 'isd-register-page',
templateUrl: './register-page.component.html',
Expand All @@ -20,9 +17,7 @@ export class RegisterPageComponent implements OnInit {
{
this.csvDataService.getTicketsData().subscribe(tickets => {
this.tickets = tickets;
// console.log("Tickets:", this.tickets);
})
// $('#collapseExample').collapse();
}
ticketValues: Map<number, { id: number, value: number, name: string }> = new Map();

Expand All @@ -34,44 +29,4 @@ export class RegisterPageComponent implements OnInit {
this.cdr.detectChanges();
}

// calculatePrice(ticket: { id: number, value: number, name: string }): number {
// console.log("Ticket:", ticket.name);
// if (ticket.name === 'Presenting author') {
// return ticket.value * 400;
// } else if (ticket.name === 'Normal ticket') {
// return ticket.value * 200;
// } else if (ticket.name === 'Discounted fee for additional paper') {
// return ticket.value * 300;
// } else if (ticket.name === 'Extra page') {
// return ticket.value * 50; // Cena za stronę
// } else if (ticket.name === 'Discouted ticked') {
// return ticket.value * 200; // Cena za przeceniony bilet
// }
// // Jeśli nazwa biletu nie pasuje do żadnej z powyższych, zwróć 0
// return 0;
// }
// calculateTotalPrice(): number {
// let totalPrice = 0;
// for (const ticket of this.ticketValues.values()) {
// totalPrice += this.calculatePrice(ticket);
// }
// return totalPrice;
// }

// inicjalizujHarmonijkę() {
// const tytuly = document.querySelectorAll('.tytul');

// tytuly.forEach(function(tytul) {
// tytul.addEventListener('click', function(this: HTMLElement) {
// const zawartosc = this.nextElementSibling as HTMLElement;
// if (zawartosc.style.display === 'none') {
// zawartosc.style.display = 'block';
// } else {
// zawartosc.style.display = 'none';
// }
// });
// });
// }


}

0 comments on commit 1590b09

Please sign in to comment.