Skip to content

Commit 907aba0

Browse files
committed
Created edit country view
1 parent f87ace3 commit 907aba0

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

app/views/countries/edit.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<h1>Edit Country:</h1>
2+
3+
<form method="POST" action="./applyChanges" style="display: flex; flex-direction: column; align-items: center">
4+
<input type="hidden" name="id" value="<?php echo $data["country"]["id"] ?>" />
5+
<input type="text" name="name" value="<?php echo $data["country"]["name"] ?>" />
6+
<input type="text" name="capitalCity" value="<?php echo $data["country"]["capitalCity"] ?>" />
7+
<select name="continent">
8+
<?php
9+
foreach($data["continents"] as $continent) {
10+
$selected = $data["country"]["continent"] == $continent ? " selected" : '';
11+
12+
echo "<option value='$continent'$selected>$continent</option>";
13+
}
14+
?>
15+
</select>
16+
<input type="number" min="0" max="4294967295" name="population" value="<?php echo $data["country"]["population"] ?>" />
17+
18+
<input type="submit" value="Submit" />
19+
</form>

0 commit comments

Comments
 (0)