|
6 | 6 | <!DOCTYPE html>
|
7 | 7 | <html>
|
8 | 8 | <head>
|
| 9 | + <meta charset="UTF-8"/> |
9 | 10 | <title>Clients</title>
|
10 | 11 | <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">
|
11 | 12 | <link href="https://cdn.datatables.net/1.11.3/css/dataTables.bootstrap4.min.css" rel="stylesheet">
|
|
102 | 103 | <th>Pays</th>
|
103 | 104 | <th>Solde</th>
|
104 | 105 | <th>Mail</th>
|
105 |
| - <th>Actions</th> |
| 106 | + <th style="width: 200px;">Actions</th> |
106 | 107 | </tr>
|
107 | 108 | </thead>
|
108 | 109 | <tbody>
|
|
112 | 113 | <td><c:out value="${client.nom()}"/></td>
|
113 | 114 | <td><c:out value="${client.sexe()}"/></td>
|
114 | 115 | <td><c:out value="${client.pays()}"/></td>
|
115 |
| - <td><fmt:formatNumber value="${client.solde()}" type="number" maxFractionDigits="2" minFractionDigits="2" groupingUsed="true"/></td> |
116 |
| - <td><c:out value="${client.mail()}"/></td> |
| 116 | + <td> |
| 117 | + <fmt:formatNumber value="${client.solde()}" type="number" maxFractionDigits="2" minFractionDigits="2" groupingUsed="true"/> |
| 118 | + <c:choose> |
| 119 | + <c:when test="${client.pays().toLowerCase() == 'france'}">€</c:when> |
| 120 | + <c:when test="${client.pays().toLowerCase() == 'usa'}">$</c:when> |
| 121 | + <c:when test="${client.pays().toLowerCase() == 'madagascar'}">Ar</c:when> |
| 122 | + <c:otherwise>Other Currency</c:otherwise> |
| 123 | + </c:choose> |
| 124 | + </td> |
| 125 | + <td><c:out value="${client.mail()}"/> </td> |
117 | 126 | <td class="pl-4">
|
118 | 127 | <button class="btn btn-warning btn-sm edit-btn rounded-circle"
|
119 | 128 | data-numtel="<c:out value='${client.numtel()}'/>"
|
|
156 | 165 |
|
157 | 166 | <!-- Modal Header -->
|
158 | 167 | <div class="modal-header">
|
159 |
| - <h4 class="modal-title">Client Form</h4> |
| 168 | + <h4 class="modal-title">Client</h4> |
160 | 169 | <button type="button" class="close" data-dismiss="modal">×</button>
|
161 | 170 | </div>
|
162 | 171 |
|
|
370 | 379 | let table = $('#clientsTable').DataTable();
|
371 | 380 | let found = false;
|
372 | 381 | let numtel = $('#numtel').val();
|
| 382 | + let action = $('#formAction').val(); |
373 | 383 | table.rows().every(function () {
|
374 | 384 | // Get the data for the first column of this row
|
375 | 385 | let cellData = this.data()[0];
|
|
381 | 391 | // You can add more actions here if a match is found
|
382 | 392 | }
|
383 | 393 | });
|
384 |
| - if (found) { |
| 394 | + if (found && action === "insert") { |
385 | 395 | $('#numtelExistsModal').modal('show');
|
386 | 396 | } else {
|
387 | 397 | $('#clientForm').submit();
|
|
0 commit comments