• 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!

TOPIC: PDF Plugin - pre-processing php script

PDF Plugin - pre-processing php script 8 years 10 months ago #35355

  • mail_alv
  • mail_alv's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 2
I am trying to use the following PDF plugin pre-processing script:
// Get database connector
$db = JFactory::getDbo();
 
// Prepare query to get all fields
$query = $db->getQuery(true)
  ->select($db->qn('p.PropertyValue'))
  ->from($db->qn('#__rsform_properties', 'p'))
  ->leftJoin($db->qn('#__rsform_components', 'c').' ON ('.$db->qn('c.ComponentId').' = '.$db->qn('p.ComponentId').')')
  ->where($db->qn('c.FormId').'='.$db->q($args['form']->FormId))
  ->where($db->qn('p.PropertyName').'='.$db->q('NAME'))
  ->where($db->qn('c.Published').'='.$db->q(1))
  ->order($db->qn('c.Order'));
 
// Get all fields
$fields = $db->setQuery($query)->loadColumn();
foreach ($fields as $field) {
  // Find the :value placeholder and grab its value
  $position   = array_search('{'.$field.':value}', $args['placeholders']);
  $value    = $position !== false ? $args['values'][$position] : null;
 
  // Find the :caption placeholder and grab its value
  $position   = array_search('{'.$field.':caption}', $args['placeholders']);
  $caption  = $position !== false ? $args['values'][$position] : null;
 
  // If we have a value, append it
  if ($value && $caption) {
    $info->{$type.'email_layout'} .= '<p><strong>'.$caption.'</strong>: '.$value.'</p>';
  }
}

This code shows how to get all the captions and their values.

But I have to collect just the values of fields in individual variables like $name (name from db).

Something like $name=$result->Name;

Can you help me?
The administrator has disabled public write access.
  • 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!