<?php
	require_once 'dbconfig.php';

if(isset($_POST['selectedIds'])) {
    $selectedIds = $_POST['selectedIds'];
 
        foreach($selectedIds as $id) {
            // Delete from mobileorders table
            $stmt_delete_mobileorders = $DB_con->prepare('DELETE FROM tbl_quotations_items WHERE quotations_id = :quotations_id');
            $stmt_delete_mobileorders->bindParam(':quotations_id', $id);
            $stmt_delete_mobileorders->execute();
            
            // // Delete from mobiletemporarycart table
            $stmt_delete_mobiletemporarycart = $DB_con->prepare('DELETE FROM tbl_quotations WHERE quotations_id = :quotations_id');
            $stmt_delete_mobiletemporarycart->bindParam(':quotations_id', $id);
            $stmt_delete_mobiletemporarycart->execute();
            
           
        }

    echo 'Rows deleted successfully';
} else {
    echo 'Error: No rows selected for deletion';
}
?>

