@page "/main_page/kullaniciler"

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="css/AdminUsersPage.css">
    <title>Document</title>
</head>

<body>
    <div id="colums_name">
        <div style="margin-left: -90%; position: absolute;">ID</div>
        <div style="margin-left: -65%; position: absolute;">İsim </div>
        <div style="margin-left: -45%; position: absolute;">Soyisim</div>
        <div style="margin-left: -23%; position: absolute;">Takım ID</div>
        <div style="margin-left: -1%; position: absolute;">Email</div>
        <div style="margin-left: 20%; position: absolute;">Şifre</div>
        <div style="margin-left: 43%; position: absolute;">Kayıt Tarihi</div>
        <div style="margin-left: 65.5%; position: absolute;">Hesap Aktifliği</div>
        <div style="margin-left: 87%; position: absolute;">Kullanıcı Rol</div>


    </div>
    <div id="main_page_kullaniciler_users">
        @{
            string style_value = "";
            foreach (var item in user_info_list)
            {
                switch (item.User_rol)
                {
                    case 1:
                        style_value = "background-color:green;color:azure";
                        break;
                    case 2:
                    
                        if (item.User_Account_Confirmation_Status == false)
                        {
                            style_value = "background-color:dodgerblue;color:red";
                        }else
                        style_value = "background-color:dodgerblue;color:azure";
                        break;
                    case 3:
                        if (item.User_Account_Confirmation_Status == false)
                        {
                            style_value = "background-color:gold;color:red";
                        }else
                        style_value = "background-color:gold;color:black";
                        break;
                }
                <div  style="@style_value">
                    <p>@item.ID</p>
                </div>
                <div style="@style_value">
                    <p>@item.name </p>
                </div>
                <div style="@style_value">
                    <p> @item.surname</p>
                </div>
                <div style="@style_value">
                    <input @bind-style="input_style" @bind-style:event="oninput" value="@item.user_team_id"
                    @onchange="(e)=>takim_guncelle(item.ID,e)">
                </div>
                <div style="@style_value">
                    <p>@item.email</p>
                </div>
                <div style="@style_value">
                    <p>@item.password</p>
                </div>
                <div style="@style_value">
                    <p>@item.Registration_Date</p>
                </div>
                <div style="@style_value">
                    @switch (@item.User_Account_Confirmation_Status)
                    {
                        case true:
                            <select id="@item.ID" @onchange="(e)=>aktiflik_degistir(item.ID,e,item.User_rol)">
                                <option selected value="true">True</option>
                                <option value="false">false</option>
                            </select>
                            break;
                        case false:
                            <select  id="@item.ID" @onchange="(e)=>aktiflik_degistir(item.ID,e,item.User_rol)">
                                <option value="true">True</option>
                                <option selected value="false">false</option>
                            </select>
                            break;
                    }
                </div>
                <div style="@style_value">
                    @switch (@item.User_rol)
                    {
                        case 1:
                            <select>
                                <option selected disabled value="1">1</option>
                            </select>
                            break;
                        case 2:
                            <select @onchange="(e)=>secim_rol(item.ID,e)">
                                <option selected value="2">2</option>
                                <option value="3">3</option>
                            </select>
                            break;
                        case 3:
                            <select @onchange="(e)=>secim_rol(item.ID,e)">
                                <option value="2">2</option>
                                <option selected value="3">3</option>
                            </select>
                            break;
                    }
                </div>
            }

        }
    </div>
</body>

</html>