setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); if($_SERVER['REQUEST_METHOD'] === 'POST'){ try{ $stmt3 = $db->prepare("INSERT INTO emi (customerId, invoiceId, adPaymentAmount, adPaymentDate, adPaymentSource, adPaymentTran, adPaymentRemarks, payStatus) VALUES (:customerId, :invoiceId, :adPaymentAmount, :adPaymentDate, :adPaymentSource, :adPaymentTran, :adPaymentRemarks, 1)"); $stmt3->bindParam(':customerId', $_GET['customerId']); $stmt3->bindParam(':invoiceId', $_GET['invoiceId']); $stmt3->bindParam(':adPaymentAmount', $_POST['adPaymentAmount']); $stmt3->bindParam(':adPaymentDate', $_POST['adPaymentDate']); $stmt3->bindParam(':adPaymentSource', $_POST['adPaymentSource']); $stmt3->bindParam(':adPaymentTran', $_POST['adPaymentTran']); $stmt3->bindParam(':adPaymentRemarks', $_POST['adPaymentRemarks']); if($stmt3->execute()){ echo '
Additional Payment ' . htmlspecialchars($_POST['adPaymentAmount']) . ' Paid Successfully.
'; }else{ echo '
Additional Payment ' . htmlspecialchars($_POST['adPaymentAmount']) . ' Payment Faild.
'; } } catch(PDOException $e){ echo '
Error: ' . $e->getMessage() . '
'; } } try { $stmt = $db->prepare("SELECT * FROM invoice WHERE customerId = :customerId"); $stmt->bindParam(':customerId', $_GET['customerId']); $stmt->execute(); $invoiceData = $stmt->fetch(PDO::FETCH_ASSOC); $stmt2 = $db->prepare("SELECT * FROM emi WHERE customerId = :customerId"); $stmt2->bindParam(':customerId', $_GET['customerId']); $stmt2->execute(); $emiData = $stmt2->fetch(PDO::FETCH_ASSOC); // var_dump($emiData); } catch (PDOException $e) { echo '
Error: ' . $e->getMessage() . '
'; } ?>

Additional Payment