require('fpdf/fpdf.php');
include "config/db.php";

$order_id = $_GET['order_id'];
$order = mysqli_fetch_assoc(
  mysqli_query($conn,"SELECT * FROM orders WHERE id='$order_id'")
);

$pdf = new FPDF();
$pdf->AddPage();
$pdf->SetFont('Arial','B',14);

$pdf->Cell(0,10,'ShopNest Invoice',0,1,'C');
$pdf->Ln(5);

$pdf->Cell(0,10,'Order ID: '.$order_id,0,1);
$pdf->Cell(0,10,'Amount: ₹'.$order['total_price'],0,1);
$pdf->Cell(0,10,'Status: '.$order['status'],0,1);

$pdf->Output();
