ontarget
Active Member
Hi I have a fabrik list with a custom pdf template which echoes all the row data.
/components/com_fabrik/views/list/tmpl/listpdf/default.php
I am trying to grab the value of one element (The course title) {aed_reg_list2___course_title_raw} and echo it as a heading for the pdf. I don't need to repeat it in the table rows as shown in the attachment
Here is the pdf output so far see attachment. using the following code
I have another custom details pdf which works very well with the following code to output elements
but the same code doesnt work in the list template (default.php) file
Can anyone help point me in the right direction!!
/components/com_fabrik/views/list/tmpl/listpdf/default.php
I am trying to grab the value of one element (The course title) {aed_reg_list2___course_title_raw} and echo it as a heading for the pdf. I don't need to repeat it in the table rows as shown in the attachment
Here is the pdf output so far see attachment. using the following code
PHP:
<?php if ($this->params->get('show-title', 1)) {?>
<?php echo "<img style='width:50%;' src='/images/assets/logo.png' />";?>
<h1>
<?php //echo $this->table->label;?>
Attendance Roll - Blackrock Education Centre
</h1>
<hr />
<p>Tutor Name:</p>
<?php }?>
<?php //echo $this->table->intro;?>
<form class="fabrikForm" action="<?php echo $this->table->action;?>" method="post" id="<?php echo $this->formid;?>" name="fabrikList">
<div class="fabrikDataContainer">
<?php foreach ($this->pluginBeforeList as $c) {
echo $c;
}?>
<div class="boxflex">
<div class="fabrikList" id="list_<?php echo $this->table->renderid;?>" >
<?php
$gCounter = 0;
foreach ($this->rows as $groupedby => $group) {
if ($this->isGrouped) {
?>
<div class="fabrik_groupheading">
<a href="#" class="toggle">
<?php echo FabrikHelperHTML::image('orderasc.png', 'list', $this->tmpl, JText::_('COM_FABRIK_TOGGLE'));?>
<?php echo $this->grouptemplates[$groupedby]; ?> ( <?php echo count($group)?> )
</a>
</div>
<?php }?>
<div class="fabrik_groupdata">
<div class="groupdataMsg">
<div class="emptyDataMessage" style="<?php echo $this->emptyStyle?>">
<?php echo $this->emptyDataMessage; ?>
</div>
</div>
</div>
<?php
//User Details
echo "<table style='width:100%;' border='1'>";
echo "<thead style='background:#ccc; padding:10px;'>";
echo "<tr>";
echo "<th>Course</th>";
echo "<th>Date</th>";
echo "<th>Name</th>";
echo "<th>Teaching Council Num</th>";
echo "<th>School Roll </th>";
echo "<th>School Name </th>";
echo "<th>Signature</th>";
echo "</tr>";
echo "</thead>";
foreach ($group as $this->_row) {
//echo $this->loadTemplate('row');
echo "<tr>";
echo "<td>".$this->_row->data->aed_reg_list2___course_title_raw. "</td>";
echo "<td>".$this->_row->data->aed_reg_list2___course_date. "</td>";
echo "<td>".$this->_row->data->aed_reg_list2___first_name_raw .$this->_row->data->aed_reg_list2___last_name_raw . "</td>";
echo "<td>". $this->_row->data->aed_reg_list2___school_tn_raw . "</td>";
echo "<td>". $this->_row->data->aed_reg_list2___school_roll_raw . "</td>";
echo "<td>". $this->_row->data->aed_reg_list2___school_name_raw . "</td>";
echo "<td width='20%'>"."</td>";
echo "</tr>";
}
echo "</table>";
?>
<?php if ($this->hasCalculations) { ?>
<ul class="fabrik_calculations">
<?php
foreach ($this->calculations as $cal) {
echo "<li class=\"fabrik_row___".$el."\">";
echo array_key_exists($groupedby, $cal->grouped ) ? $cal->grouped[$groupedby] : $cal->calc;
echo "</li>";
}
?>
</ul>
<?php }
$gCounter++;
}?>
</div>
<?php
echo $this->nav;
print_r($this->hiddenFields);
?>
</div>
</div>
</form>
PHP:
<?php
$group_name = $this->groups['ED Reg List 2'];
$elements = $group_name->elements;
$coursename = $elements ['aed_reg_list2___course_title_raw']->element;
echo "<h3 style='margin-left:0; margin-top:36%;'> ". $coursename . "</h3>";
?>
Can anyone help point me in the right direction!!