Skip to content

Commit

Permalink
Solution conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
Chuck-D-Norris committed Dec 3, 2024
1 parent e8b039c commit 723b94f
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 22 deletions.
4 changes: 2 additions & 2 deletions src/app/Views/Admin/Contract/Create.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div class="mb-4 flex justify-end">
<a href="/contracts"
<a href="/contracts/"

Check warning on line 2 in src/app/Views/Admin/Contract/Create.php

View check run for this annotation

Codecov / codecov/patch

src/app/Views/Admin/Contract/Create.php#L2

Added line #L2 was not covered by tests
class="bg-blue-500 hover:bg-blue-600 text-white font-medium py-2 px-4 rounded-lg shadow focus:outline-none focus:ring focus:ring-green-500 flex items-center space-x-2">
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 19l-7-7 7-7"></path>
Expand All @@ -13,7 +13,7 @@ class="bg-blue-500 hover:bg-blue-600 text-white font-medium py-2 px-4 rounded-lg
<div id="errorMessages" class="bg-red-100 border border-red-400 text-red-700 px-4 py-3 rounded relative mb-6 hidden"></div>

Check warning on line 14 in src/app/Views/Admin/Contract/Create.php

View check run for this annotation

Codecov / codecov/patch

src/app/Views/Admin/Contract/Create.php#L14

Added line #L14 was not covered by tests
<form id="contractForm" action="/contracts/store" method="POST" class="space-y-6">
<form id="contractForm" action="/admin/contract/store" method="POST" class="space-y-6">

Check warning on line 16 in src/app/Views/Admin/Contract/Create.php

View check run for this annotation

Codecov / codecov/patch

src/app/Views/Admin/Contract/Create.php#L16

Added line #L16 was not covered by tests
<div>
<label for="name" class="block text-sm font-medium text-gray-700 mb-1">Name</label>
<input type="text" id="name" name="name"
Expand Down
37 changes: 20 additions & 17 deletions src/app/Views/Admin/Contract/Edit.php
Original file line number Diff line number Diff line change
@@ -1,31 +1,32 @@
<div class="mb-4 flex justify-end">
<a href="/contracts/"

Check warning on line 2 in src/app/Views/Admin/Contract/Edit.php

View check run for this annotation

Codecov / codecov/patch

src/app/Views/Admin/Contract/Edit.php#L2

Added line #L2 was not covered by tests
class="bg-blue-500 hover:bg-blue-600 text-white font-medium py-2 px-4 rounded-lg shadow focus:outline-none focus:ring focus:ring-green-500 flex items-center space-x-2">
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 19l-7-7 7-7"></path>
</svg>
<span>Return to Contracts</span>
</a>
</div>

Check warning on line 9 in src/app/Views/Admin/Contract/Edit.php

View check run for this annotation

Codecov / codecov/patch

src/app/Views/Admin/Contract/Edit.php#L9

Added line #L9 was not covered by tests

<div class="bg-white p-8 border border-gray-300 rounded-lg shadow-md">
<h2 class="text-2xl font-semibold text-gray-800 mb-6">Edit Contract</h2>


<div id="errorMessages"
class="bg-red-100 border border-red-400 text-red-700 px-4 py-3 rounded relative mb-6 hidden"></div>

<form id="contractForm" action="/contracts/<?php echo htmlspecialchars($contract->getId()); ?>/update" method="POST"
class="space-y-6">

<form action="/admin/contract/<?php echo htmlspecialchars($contract->getId()); ?>/update" method="POST" class="space-y-6">

Check warning on line 13 in src/app/Views/Admin/Contract/Edit.php

View check run for this annotation

Codecov / codecov/patch

src/app/Views/Admin/Contract/Edit.php#L13

Added line #L13 was not covered by tests
<div>
<label for="name" class="block text-sm font-medium text-gray-700 mb-1">Name</label>
<input type="text" id="name" name="name" value="<?php echo htmlspecialchars($contract->name); ?>"
class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring focus:ring-blue-500 focus:border-blue-500">
</div>


<div>
<label for="start_date" class="block text-sm font-medium text-gray-700 mb-1">Start Date</label>
<input type="datetime-local" id="start_date" name="start_date"
<input type="date" id="start_date" name="start_date"
value="<?php echo htmlspecialchars($contract->start_date); ?>"
class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring focus:ring-blue-500 focus:border-blue-500">
</div>


<div>
<label for="end_date" class="block text-sm font-medium text-gray-700 mb-1">End Date</label>
<input type="datetime-local" id="end_date" name="end_date"
<input type="date" id="end_date" name="end_date"
value="<?php echo htmlspecialchars($contract->end_date); ?>"
class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring focus:ring-blue-500 focus:border-blue-500">
</div>
Expand All @@ -51,16 +52,18 @@ class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none foc
class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring focus:ring-blue-500 focus:border-blue-500">
</div>

<button type="button" id="submitBtn"
class="bg-blue-500 hover:bg-blue-600 text-white font-medium py-2 px-4 rounded-lg focus:outline-none focus:ring focus:ring-blue-500">
Update Contract
</button>
<div class="flex items-center">
<button type="submit"
class="bg-blue-500 hover:bg-blue-600 text-white font-medium py-2 px-4 rounded-lg focus:outline-none focus:ring focus:ring-blue-500">
Update Contract
</button>
</div>
</form>
</div>

<script src="/assets/js/app.js"></script>
<script>
document.getElementById('submitBtn').addEventListener('click', function (event) {
document.getElementById('submitBtn').addEventListener('click', function(event) {
const errorMessagesDiv = document.getElementById('errorMessages');
validateForm(event);

Expand Down
6 changes: 3 additions & 3 deletions src/app/Views/Admin/Contracts.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<?php } ?>

<div class="mb-4 flex justify-end">
<a href="/contract/create"
<a href="/admin/contract/create"

Check warning on line 15 in src/app/Views/Admin/Contracts.php

View check run for this annotation

Codecov / codecov/patch

src/app/Views/Admin/Contracts.php#L15

Added line #L15 was not covered by tests
class="bg-blue-500 hover:bg-blue-600 text-white font-medium py-2 px-4 rounded-lg shadow focus:outline-none focus:ring focus:ring-green-500">
Create Contract
</a>
Expand Down Expand Up @@ -63,7 +63,7 @@ class="bg-blue-500 hover:bg-blue-600 text-white font-medium py-2 px-4 rounded-lg
</td>
<td class="px-4 py-3 border-b text-center flex justify-center space-x-4">
<!-- Edit Button (Pencil Icon) -->
<a href="/contract/<?php echo htmlspecialchars($contract->getId()); ?>/edit"
<a href="/admin/contract/<?php echo htmlspecialchars($contract->getId()); ?>/edit"

Check warning on line 66 in src/app/Views/Admin/Contracts.php

View check run for this annotation

Codecov / codecov/patch

src/app/Views/Admin/Contracts.php#L66

Added line #L66 was not covered by tests
class="text-blue-500 hover:text-blue-700" title="Edit">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5"
stroke="currentColor" class="w-5 h-5">
Expand All @@ -72,7 +72,7 @@ class="text-blue-500 hover:text-blue-700" title="Edit">
</svg>
</a>
<!-- Delete Button (Trash Icon) -->
<a href="/contract/<?php echo htmlspecialchars($contract->getId()); ?>/delete"
<a href="/admin/contract/<?php echo htmlspecialchars($contract->getId()); ?>/delete"

Check warning on line 75 in src/app/Views/Admin/Contracts.php

View check run for this annotation

Codecov / codecov/patch

src/app/Views/Admin/Contracts.php#L75

Added line #L75 was not covered by tests
onclick="return confirm('Are you sure you want to delete this contract?');"
class="text-red-500 hover:text-red-700" title="Delete">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5"
Expand Down

0 comments on commit 723b94f

Please sign in to comment.