package com.example.kasirapp

import android.content.Intent
import android.os.Bundle
import android.widget.Button
import android.widget.Toast
import androidx.appcompat.app.AppCompatActivity

class AdminDashboardActivity : AppCompatActivity() {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_admin_dashboard)

        val btnManageMenu = findViewById<Button>(R.id.btnManageMenu)
        val btnSalesReport = findViewById<Button>(R.id.btnSalesReport)
        val btnSalesTraffic = findViewById<Button>(R.id.btnSalesTraffic)
        val btnPaymentManagement = findViewById<Button>(R.id.btnPaymentManagement)
        val btnLogoutAdmin = findViewById<Button>(R.id.btnLogoutAdmin)

        btnManageMenu.setOnClickListener {
            val intent = Intent(this, ManageMenuActivity::class.java)
            startActivity(intent)
        }

        btnSalesReport.setOnClickListener {
            val intent = Intent(this, SalesReportActivity::class.java)
            startActivity(intent)
        }

        btnSalesTraffic.setOnClickListener {
            val intent = Intent(this, SalesTrafficActivity::class.java)
            startActivity(intent)
        }

        btnPaymentManagement.setOnClickListener {
            val intent = Intent(this, PaymentManagementActivity::class.java)
            startActivity(intent)
        }

        btnLogoutAdmin.setOnClickListener {
            val intent = Intent(this, LoginActivity::class.java)
            intent.flags = Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TASK
            startActivity(intent)
            finish()
        }
    }
}