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

$table = 'design_employee_attendance';

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

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

header("Location: design_leave_approvals.php");
