<?php
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
    $plateform = $_POST['plateform'];
    $url = $_POST['url'];
    $name = $_POST['name'];
    $pass = $_POST['pass'];
    $type = $_POST['type'];

    $id = $_POST['id']; 
    // Here, you should perform the database update based on the values received
    // Connect to your database (replace with your database details)
    include('connection.php');

    // Assuming you have a table named "hr_accounts" in your database
    // Update the data (replace with the actual SQL query)
    $updateQuery = "UPDATE hr_accounts SET plateform='$plateform', url='$url', name='$name', pass='$pass', type='$type' WHERE id=$id";

    if ($conn->query($updateQuery) === TRUE) {

        // echo "Record updated successfully";
        header("Location:hr_accounts.php");

    } else {
        echo "Error updating record: " . $conn->error;
    }

    // Close the database connection
    $conn->close();
}
?>
