File size: 4,029 Bytes
6f32ae8
b0a0ed0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6f32ae8
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
@model LibraryManagement.Shared.Models.UserUpdateRequest
@{
    ViewData["Title"] = "Edit Member";
}

<div class="mb-8">
    <a asp-action="Index" class="inline-flex items-center text-sm font-medium text-slate-500 hover:text-slate-900 mb-6 group">
        <svg class="w-4 h-4 mr-2 transition-transform group-hover:-translate-x-1" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10 19l-7-7m0 0l7-7m-7 7h18"></path></svg>
        Back to Directory
    </a>

    <div class="max-w-3xl mx-auto">
        <div class="mb-8">
            <h1 class="text-3xl font-bold tracking-tight text-slate-900">Edit Member</h1>
            <p class="mt-2 text-slate-500">Update member's profile details.</p>
        </div>

        <div class="card p-6 sm:p-8">
            <form asp-action="Edit" method="post" class="space-y-6">
                <!-- Validation Summary -->
                <div asp-validation-summary="ModelOnly" class="text-sm text-red-600 bg-red-50 p-3 rounded-md"></div>

                <div class="grid grid-cols-1 gap-6 sm:grid-cols-2">
                    <!-- FullName -->
                    <div class="sm:col-span-2">
                        <label asp-for="FullName" class="block text-sm font-medium text-slate-700">Full Name <span class="text-rose-500">*</span></label>
                        <div class="mt-1">
                            <input asp-for="FullName" class="block w-full rounded-md border-slate-300 shadow-sm focus:border-slate-900 focus:ring-slate-900 sm:text-sm px-3 py-2 border bg-white" required />
                            <span asp-validation-for="FullName" class="mt-1 text-xs text-rose-500"></span>
                        </div>
                    </div>

                    <!-- Phone Number -->
                    <div>
                        <label asp-for="PhoneNumber" class="block text-sm font-medium text-slate-700">Phone Number</label>
                        <div class="mt-1">
                            <input asp-for="PhoneNumber" class="block w-full rounded-md border-slate-300 shadow-sm focus:border-slate-900 focus:ring-slate-900 sm:text-sm px-3 py-2 border bg-white" />
                            <span asp-validation-for="PhoneNumber" class="mt-1 text-xs text-rose-500"></span>
                        </div>
                    </div>

                    <!-- Student ID -->
                    <div>
                        <label asp-for="StudentId" class="block text-sm font-medium text-slate-700">Student ID</label>
                        <div class="mt-1">
                            <input asp-for="StudentId" class="block w-full rounded-md border-slate-300 shadow-sm focus:border-slate-900 focus:ring-slate-900 sm:text-sm px-3 py-2 border bg-white" />
                            <span asp-validation-for="StudentId" class="mt-1 text-xs text-rose-500"></span>
                        </div>
                    </div>

                    <!-- Address -->
                    <div class="sm:col-span-2">
                        <label asp-for="Address" class="block text-sm font-medium text-slate-700">Address</label>
                        <div class="mt-1">
                            <textarea asp-for="Address" rows="3" class="block w-full rounded-md border-slate-300 shadow-sm focus:border-slate-900 focus:ring-slate-900 sm:text-sm px-3 py-2 border bg-white"></textarea>
                            <span asp-validation-for="Address" class="mt-1 text-xs text-rose-500"></span>
                        </div>
                    </div>
                </div>

                <div class="pt-5 border-t border-slate-100 flex justify-end gap-3">
                    <a asp-action="Index" class="btn-secondary">Cancel</a>
                    <button type="submit" class="btn-primary">Save Changes</button>
                </div>
            </form>
        </div>
    </div>
</div>

@section Scripts {
    @{await Html.RenderPartialAsync("_ValidationScriptsPartial");}
}