in codeigniter 3 view page i use following ajax to fetch some data from phpmyadmin which consisted of some html data:
$(document).ready(function() {
$('#fetchDataButton').click(function() {
var activeProfileId = '<?php echo $AKTIF_PROFIL->id; ?>';
$.ajax({
url: '{{$user_base_url}}/profil/get_report_content',
type: 'GET',
data: { activeProfileId: activeProfileId }, // Pass the active profile ID as data
dataType: 'json',
success: function(response) {
var reportContent_kullanici_profilleri_Full = response.kullanici_profilleri;
var reportContent_kullanici_profilleri = reportContent_kullanici_profilleri_Full.find(function(item) {
return item.id == activeProfileId;
});
console.log('Data received:', reportContent_kullanici_profilleri);
},
error: function(xhr, status, error) {
console.error('Error fetching data:', error);
}
});
});
});
i want to print this fetched data as pdf by dompdf.
how should i code for that?
could anyone provide required controller /ajax for that purpose?
thanks in advance.