source: db_tsh/Views/Home/Index.cshtml

main
Last change on this file was 705d6f5, checked in by ardit <ardit@…>, 2 days ago

Commiting all files of project - 20250224

  • Property mode set to 100644
File size: 10.1 KB
Line 
1@model IEnumerable<db_tsh.Models.Policy>
2<!DOCTYPE html>
3<html>
4<head>
5
6 @{
7 ViewData["Title"] = "Home Page";
8 }
9 <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
10
11 <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
12 <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
13 <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
14 @*pop up*@
15 <script src="https://cdn.jsdelivr.net/npm/sweetalert2@11.1.4/dist/sweetalert2.all.min.js"></script>
16 <link href="https://cdn.jsdelivr.net/npm/sweetalert2@11.1.4/dist/sweetalert2.min.css" rel="stylesheet" />
17</head>
18<body>
19 <h1>Welcome to Our Insurance Menu</h1>
20
21 <style>
22 .h3 {
23 /*font: 20px;*/
24 color: red;
25 }
26
27 #parent {
28 width: 100%;
29 height: 90px;
30 white-space: nowrap;
31 overflow-x: auto;
32 }
33
34 .child {
35 display: inline-block;
36 width: 50%;
37 height: 50%;
38 }
39
40 h1 {
41 text-align: center;
42 }
43
44 .navbar {
45 background-color: aqua;
46 color: white;
47 font-family: Arial, sans-serif;
48 }
49
50 .navbar-brand {
51 color: white;
52 font-weight: bold;
53 margin-right: 30px;
54 }
55
56 .nav-link {
57 color: white;
58 margin-right: 15px;
59 }
60
61 .nav-link:hover {
62 color: #f8f8f8;
63 text-decoration: none;
64 }
65
66 .navbar-toggler {
67 border: none;
68 background-color: transparent;
69 color: white;
70 }
71
72 .navbar-toggler-icon {
73 background-color: white;
74 }
75
76 .navcontainer {
77 display: flex;
78 align-items: center;
79 }
80
81 img {
82 margin-right: 10px;
83 }
84
85 .popup {
86 display: none;
87 position: fixed;
88 top: 50%;
89 left: 50%;
90 transform: translate(-50%, -50%);
91 padding: 15px;
92 background-color: #f1f1f1;
93 color: #333;
94 border-radius: 5px;
95 box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
96 }
97
98 .popup-message {
99 font-size: 16px;
100 }
101
102 /* Add this style in your CSS file or <style> tag */
103 .confirmation-popup {
104 display: none;
105 position: fixed;
106 top: 50%;
107 left: 50%;
108 transform: translate(-50%, -50%);
109 padding: 20px;
110 background-color: #fff;
111 border: 1px solid #ccc;
112 box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
113 }
114
115 .confirmation-popup h3 {
116 margin-top: 0;
117 }
118
119 .confirmation-popup button {
120 margin-right: 10px;
121 }
122
123 .custom-btn {
124 width: 250px; /* Adjust the width as needed */
125 }
126 </style>
127
128
129 <header>
130 <!-- Bootstrap CSS link (CDN) -->
131 <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
132 </header>
133
134
135
136 <div class="container mt-4">
137 <div class="row">
138 <div class="col-md-6">
139 <div class="row mb-3">
140 <div class="col">
141 <button class="btn btn-outline-secondary btn-lg custom-btn" onclick="location.href='@Url.Action("Auto", "Home")'">Buy Auto Policy</button>
142 </div>
143 </div>
144 <div class="row">
145 <div class="col">
146 <button class="btn btn-outline-secondary btn-lg custom-btn" onclick="location.href='@Url.Action("Travel", "Home")'">Buy Travel Health Policy</button>
147 </div>
148 </div>
149 <br />
150 <div class="row">
151 <div class="col">
152 <button class="btn btn-outline-secondary btn-lg custom-btn" onclick="location.href='@Url.Action("Property", "Home")'">Property Policy</button>
153 </div>
154 </div>
155 <br />
156 @if (ViewBag.isadmin != null)
157 {
158 <div class="row">
159 <div class="col">
160 <button class="btn btn-outline-secondary btn-lg custom-btn" onclick="location.href='@Url.Action("Package", "Home")'">Generate Package</button>
161 </div>
162 </div>
163 <br />
164 <div class="row">
165 <div class="col">
166 <button class="btn btn-outline-secondary btn-lg custom-btn" onclick="location.href='@Url.Action("Covers", "Home")'">Generate Covers</button>
167 </div>
168 </div>
169 }
170 </div>
171 </div>
172 </div>
173 <br />
174 <br />
175
176
177
178 <script src="https://cdn.jsdelivr.net/npm/sweetalert2@11.0.18/dist/sweetalert2.min.js"></script>
179
180
181 <div class="table-responsive table-container">
182 <table class="table table-striped table-hover">
183 <thead class="thead-dark">
184 <tr>
185 <th>
186 P_id
187 </th>
188 <th>
189 PolicyType
190 </th>
191 <th>
192 CustomerName
193 </th>
194 <th>
195 Sdate
196 </th>
197 <th>
198 Edate
199 </th>
200 <th>
201 PackageTitle
202 </th>
203 <th>
204 PackageTotal
205 </th>
206 </tr>
207 </thead>
208 <tbody>
209 @if (Model != null)
210 {
211 @foreach (var item in Model)
212 {
213 <tr>
214 <td> @Html.DisplayFor(modelItem => item.P_id) </td>
215 <td> @Html.DisplayFor(modelItem => item.PolicyType) </td>
216 <td> @Html.DisplayFor(modelItem => item.CustomerName) </td>
217 <td> @Html.DisplayFor(modelItem => item.Sdate) </td>
218 <td> @Html.DisplayFor(modelItem => item.Edate) </td>
219 <td> @Html.DisplayFor(modelItem => item.PackageTitle) </td>
220 <td> @Html.DisplayFor(modelItem => item.PackageTotal) </td>
221 </tr>
222 }
223 }
224 else
225 {
226 <tr>
227 <td colspan="8"> @ViewBag.Error </td>
228 </tr>
229 }
230 </tbody>
231 </table>
232
233
234
235
236 @if (ViewBag.TotalPages > 1)
237 {
238 <div class="pagination-container">
239 <nav>
240 <ul class="pagination">
241
242 @if (ViewBag.CurrentPage > 1)
243 {
244 <li class="page-item">
245 <a class="page-link" href="@Url.Action("Index", new { page = ViewBag.CurrentPage - 1 })" aria-label="Previous">
246 <span aria-hidden="true">&laquo;</span>
247 <span class="sr-only">Previous</span>
248 </a>
249 </li>
250 }
251
252 @if (ViewBag.CurrentPage > 3)
253 {
254 <li class="page-item">
255 <a class="page-link" href="@Url.Action("Index", new { page = 1 })">1</a>
256 </li>
257 <li class="page-item disabled">
258 <span class="page-link">...</span>
259 </li>
260 }
261
262 @for (int i = ViewBag.CurrentPage - 2; i <= ViewBag.CurrentPage + 2; i++)
263 {
264 if (i > 0 && i <= ViewBag.TotalPages)
265 {
266 if (i == ViewBag.CurrentPage)
267 {
268 <li class="page-item active">
269 <span class="page-link">@i<span class="sr-only">(current)</span></span>
270 </li>
271 }
272 else
273 {
274 <li class="page-item">
275 <a class="page-link" href="@Url.Action("Index", new { page = i })">@i</a>
276 </li>
277 }
278 }
279 }
280
281 @if (ViewBag.CurrentPage < ViewBag.TotalPages - 2)
282 {
283 <li class="page-item disabled">
284 <span class="page-link">...</span>
285 </li>
286 <li class="page-item">
287 <a class="page-link" href="@Url.Action("Index", new { page = ViewBag.TotalPages })">@ViewBag.TotalPages</a>
288 </li>
289 }
290
291 @if (ViewBag.CurrentPage < ViewBag.TotalPages)
292 {
293 <li class="page-item">
294 <a class="page-link" href="@Url.Action("Index", new { page = ViewBag.CurrentPage + 1 })" aria-label="Next">
295 <span aria-hidden="true">&raquo;</span>
296 <span class="sr-only">Next</span>
297 </a>
298 </li>
299 }
300
301 </ul>
302 </nav>
303 </div>
304 }
305 </div>
306</body>
307</html>
Note: See TracBrowser for help on using the repository browser.