Jump to content

require help with php and table combo.


spoolup

Recommended Posts

Hi everyone, 

i recently purchased the jbjobs component for joomla and have been modifying the views to suit my needs.

i've reached a dead end though. i have a php bit that needs to be combined with a table, but i have not managed to make it work. 

can someone please lend a hand?

thanks 

<?php
   $db=JFactory::getDBO();
   $q = "select * from #__jbjobs_employer where user_id=".$job->employer_id;
   $db->setQuery($q);
   $employer_record = $db->loadObject();                                   
            '<table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr>
               <td>';echo ($employer_record->show_addr == 'y')? "".$employer_record->street_addr : JText::_('JBJOBS_NOT_DISPLAYED').'</tr>
              <tr>
                <td>';
   echo ($employer_record->show_location == 'y')? "".$employer_record->city.', '.$employer_record->state : JText::_('JBJOBS_NOT_DISPLAYED').'</td>
               </tr>
              <tr>
                <td>';
   echo ($employer_record->show_phone == 'y')? "".$employer_record->primary_phone : JText::_('JBJOBS_NOT_DISPLAYED').'</td>
               </tr>
              <tr>
                <td>';  
   echo ($employer_record->show_fax == 'y')? "".$employer_record->fax_number : JText::_('JBJOBS_NOT_DISPLAYED').'</td>
               </tr>
              <tr>
                <td>';  
   $u = JFactory::getUser($job->employer_id);
   echo ($employer_record->show_email == 'y')? "".$u->email : JText::_('JBJOBS_NOT_DISPLAYED');'</td>
           </td>
               </tr>
           </table>'
?>
Link to comment
https://forums.phpfreaks.com/topic/286402-require-help-with-php-and-table-combo/
Share on other sites

Change your code to

$db=JFactory::getDBO();
$q = "select * from #__jbjobs_employer where user_id=".$job->employer_id;
$db->setQuery($q);
$employer_record = $db->loadObject();  

$u = JFactory::getUser($job->employer_id);
echo '<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td>'.($employer_record->show_addr == 'y') ? $employer_record->street_addr : JText::_('JBJOBS_NOT_DISPLAYED')).'</tr>
  <tr>
    <td>'.(($employer_record->show_location == 'y')? $employer_record->city.', '.$employer_record->state : JText::_('JBJOBS_NOT_DISPLAYED')).'</td>
  </tr>
  <tr>
    <td>'.(($employer_record->show_phone == 'y')? $employer_record->primary_phone : JText::_('JBJOBS_NOT_DISPLAYED')).'</td>
  </tr>
  <tr>
    <td>'.(($employer_record->show_fax == 'y')? $employer_record->fax_number : JText::_('JBJOBS_NOT_DISPLAYED')).'</td>
  </tr>
  <tr>
    <td>'.(($employer_record->show_email == 'y')? $u->email : JText::_('JBJOBS_NOT_DISPLAYED')).'</td>
   </tr>
</table>';

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.