I am using DOMpdf to create pdf files. To print the following table I have to get it as a variable and then send it to my controller. just like $value = "Some value(in this place I want the following table) "; But here in this case I am not sure how get this entire table inside a variable when you have some PHP script to populate data.
Please help.
<?php if(count($records) > 0) { ?>
<h1> Batch Name: <?php echo "$batchname";?> </h1>
<table id="table1" class="gtable sortable">
<thead>
<tr>
<th>S.N</th>
<th>Student ID</th>
<th>Exam Date</th>
<th>Exam Type</th>
<th>Subject</th>
<th>Total Mark</th>
<th>Highest Mark</th>
<th>Obtained Mark</th>
<th>GPA</th>
<th>Grade</th>
<th>Status</th>
</tr>
</thead>
<tbody>
<?php $i = $this->uri->segment(3) + 0; foreach ($records as $row){ $i++; ?>
<tr>
<td><?php echo $i; ?>.</td>
<td><a href="<?php echo base_url(); ?>viewbatch/get/<?php echo $row['studentid']; ?>"><?php echo $row['studentid'];?></a></td>
<td><?php echo $row['examdate'];?></td>
<td><?php echo $row['examtype'];?></td>
<td><?php echo $row['subject'];?></td>
<td><?php echo $row['totalmark'];?></td>
<td><?php echo $row['highestmark'];?></td>
<td><?php echo $row['obtainedmark'];?></td>
<td><?php echo $row['gradepoint'];?></td>
<td><?php echo $row['grade'];?></td>
<td><?php echo $row['status'];?></td>
</tr>
<?php } ?>
</tbody>
</table>