<!DOCTYPE html>
<html lang="th">
<head>

  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">

  <link rel="apple-touch-icon" sizes="76x76" href="https://www.cdn.niendsitekungz.com/finance/assets/img/apple-icon.png">

  <link rel="icon" type="image/png" href="https://www.cdn.niendsitekungz.com/finance/assets/img/favicon556.png">

  <title>Edit Task | NiendsiteKunGz</title>

  <link href="https://fonts.googleapis.com/css?family=Open+Sans:300,400,600,700" rel="stylesheet">

  <link href='https://fonts.googleapis.com/css?family=Kanit' rel='stylesheet'>

  

  <link href="https://www.cdn.niendsitekungz.com/finance/assets/css/nucleo-icons.css" rel="stylesheet">

  <link href="https://www.cdn.niendsitekungz.com/finance/assets/css/nucleo-svg.css" rel="stylesheet">

  <link href="https://www.cdn.niendsitekungz.com/finance/assets/css/nucleo-svg.css" rel="stylesheet">

  

  <link id="pagestyle" href="https://www.cdn.niendsitekungz.com/finance/assets/css/ui.css?v=1.0.6" rel="stylesheet">

  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/sweetalert/1.1.3/sweetalert.min.css">

  <link rel="stylesheet" href="https://cdn.niendsitekungz.com/fontawesome/css/all.css">

  <link rel="stylesheet" href="https://cdn.niendsitekungz.com/fontawesome/css/all.min.css">

  

  <script src="https://kit.fontawesome.com/42d5adcbca.js" crossorigin="anonymous"></script>

  <script src="https://code.jquery.com/jquery-3.6.1.min.js"></script>

  <script src="https://cdnjs.cloudflare.com/ajax/libs/sweetalert/1.1.3/sweetalert-dev.min.js"></script>

  <script src="https://cdn.niendsitekungz.com/fontawesome/js/all.js"></script>

  <script src="https://cdn.niendsitekungz.com/fontawesome/js/all.min.js"></script>

  

<style>



body {

    font-family: 'Kanit';font-size: 22px;

}



li {

   font-family: 'Kanit';font-size: 22px;

}



div {

    font-family: 'Kanit';font-size: 15px;

}



html {

   font-family: 'Kanit';font-size: 17px;

}

h5 {

   font-family: 'Kanit';font-size: 15px;

}

p {

   font-family: 'Kanit';font-size: 15px;

}

small {

   font-family: 'Kanit';font-size: 12px;

}

</style>
</head>
<body>
    <div class="container mt-5">
        <h1 class="text-center mb-4">Edit Task</h1>

        <div class="card">
            <div class="card-body">
                <form method="post" action="/tasks/update/<?= $task['id'] ?>">
                    <div class="mb-3">
                        <label for="description" class="form-label">Task Description</label>
                        <input type="text" id="description" name="description" class="form-control"
                               value="<?= $task['description'] ?>" required>
                    </div>
                    <div class="mb-3">
                        <label for="employee" class="form-label">Assign to Employee</label>
                        <select id="employee" name="employee_id" class="form-select" required>
                            <?php foreach ($employees as $employee): ?>
                                <option value="<?= $employee['id'] ?>" <?= $employee['id'] == $task['employee_id'] ? 'selected' : '' ?>>
                                    <?= $employee['name'] ?>
                                </option>
                            <?php endforeach; ?>
                        </select>
                    </div>
                    <button type="submit" class="btn btn-primary">Update Task</button>
                    <a href="/tasks" class="btn btn-secondary">Cancel</a>
                </form>
            </div>
        </div>
    </div>

    <!-- Bootstrap JS -->
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html>
