-
Mikhael Artur Darmakesuma authored601ebb7d
edit-prefered-locations.php 1.87 KiB
<html>
<head>
<title>Projekers - Edit Prefered Location</title>
<link rel = "stylesheet" href = "../css/edit-prefered-location.css">
<link rel = "stylesheet" href = "../css/primary.css">
<script src = "../js/edit-prefered-location.js"></script>
</head>
<body>
<div class = "container">
<h1>EDIT PREFERED LOCATIONS</h1>
<?php
include "../model/user.php";
$user = new User;
$user_id = 1;
$result = $user->getPreferredLocation($user_id);
if ($result->num_rows > 0) {
echo '
<table class="tab">
<tr>
<th class="tabno">No</td>
<th class="tabloc">Location</td>
<th class="tabact">Actions</td>
</tr>
';
$i=1;
while($row = $result->fetch_assoc()) {
echo '
<tr>
<td class="tabno">'.$i.'</td>
<td class="tabloc">
<div id="locationtext'.$i.'">'.$row["location"].'</div>
<input class="locationinput" id="locationinput'.$i.'" type="text">
</td>
<td class="tabact">
<div class="addset" align="center">
<div class="editsavebox">
<button onClick=hideMe('.$i.') class="editsave">
<img src="../img/pencil.png" class="editsavebutton" id="imageeditsave'.$i.'">
</button>
</div>
<div>
<button onClick=f() class="delete">
<img src="../img/delete.png" class="deletebutton" id="imagedelete'.$i.'">
</button>
</div>
</div>
</td>
</tr>';
$i++;
}
echo '
</table>
';
} else {
echo "No prefered location, add one using the box below.";
}
?>
<br>
<br>
<h2>ADD NEW LOCATION:</h2>
<div class="addset">
<div class="field"><input type="text"></div>
<div class="submitbutton">
<input type="Submit" value="ADD" class="submit">
</div>
</div>
</div>
</body>
</html>