<?php
require '../config/db.php';

$table = 'development_employee_attendance';

$pdo->prepare("
INSERT INTO $table (employee_id,att_date,status)
VALUES (?,?, 'Leave')
")->execute([
    $_POST['emp'],
    $_POST['date']
]);

$pdo->prepare("
UPDATE development_employee_leave_requests
SET status='HRApproved'
WHERE id=?
")->execute([$_POST['id']]);

header("Location: development_leave_approvals.php");
