class Guest: def __init__(self, name, room_number, check_in_date, check_out_date): self.name = name self.room_number = room_number self.check_in_date = check_in_date self.check_out_date = check_out_date class Reception: def __init__(self): self.guests = [] def check_in(self, name, room_number, check_in_date, check_out_date): new_guest = Guest(name, room_number, check_in_date, check_out_date) self.guests.append(new_guest) print(f"{name} başarıyla oda {room_number}'a giriş yaptı.") def check_out(self, name): for guest in self.guests: if guest.name == name: self.guests.remove(guest) print(f"{name} başarıyla çıkış yaptı.") return print(f"{name} otelde kayıtlı değil!") def list_guests(self): if not self.guests: print("Şu anda otelde kayıtlı misafir yok.") else: for guest in self.guests: print(f"Misafir: {guest.name}, Oda: {guest.room_number}, Giriş: {guest.check_in_date}, Çıkış: {guest.check_out_date}") # Kullanım örneği: otel_resepsiyon = Reception() otel_resepsiyon.check_in("Ahmet", 101, "2025-04-02", "2025-04-06") otel_resepsiyon.check_in("Ayşe", 102, "2025-04-02", "2025-04-05") otel_resepsiyon.list_guests() otel_resepsiyon.check_out("Ahmet") otel_resepsiyon.list_guests()
top of page

Page Title

<!DOCTYPE html>
<html>
<head>
    <title>Resepsiyon Uygulaması</title>
</head>
<body>
    <h1>Misafir Yönetimi</h1>

    <h2>Giriş Yap</h2>
    <form method="POST" action="/checkin">
        <label>İsim:</label>
        <input type="text" name="name" required>
        <label>Oda No:</label>
        <input type="number" name="room_number" required>
        <button type="submit">Giriş Yap</button>
    </form>

    <h2>Misafirler</h2>
    <ul>
        {% for guest in guests %}
            <li>
                İsim: {{ guest[1] }}, Oda: {{ guest[2]}, Giriş: {{ guest[3]}}, Çıkış: {{ guest[4] or 'Henüz çıkış yapılmadı.' }}
                <form method="POST" action="/checkout/{{ guest[0] }}">
                    <button type="submit">Çıkış Yap</button>
                </form>
            </li>
        {% endfor %}
    </ul>
</body>
</html>
 

Section Title

This is a Paragraph. Click on "Edit Text" or double click on the text box to start editing the content and make sure to add any relevant details or information that you want to share with your visitors.

List Title

This is a Paragraph. Click on "Edit Text" or double click on the text box to start editing the content and make sure to add any relevant details or information that you want to share with your visitors.

List Title

This is a Paragraph. Click on "Edit Text" or double click on the text box to start editing the content and make sure to add any relevant details or information that you want to share with your visitors.

List Title

This is a Paragraph. Click on "Edit Text" or double click on the text box to start editing the content and make sure to add any relevant details or information that you want to share with your visitors.

List Title

This is a Paragraph. Click on "Edit Text" or double click on the text box to start editing the content and make sure to add any relevant details or information that you want to share with your visitors.

bottom of page