Advertisement
chrishajer

pull entries from one form

Jun 11th, 2013
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. // function to pull entries from one form
  3. if(is_array($inquiries)){
  4.    
  5.     // show # of inquiries?
  6.     if($atts['showcount']){
  7.         $count = count($inquiries);
  8.         if(!count)$count='0';
  9.         $html = '<h4 class="inquiries_count" style="clear:both;"># of Inquiries: '.count($inquiries).'</h4>';
  10.     }
  11.    
  12.     // show full details?
  13.     if($atts['hidelist'])
  14.         return $html;
  15.    
  16.    
  17.     $html .= "<ul class='inquiries_list'>\n";
  18.     // loop through all the returned results
  19.     foreach ($inquiries as $inquiry) {
  20.  
  21.         $html .= "\t<li class='inquiries_row'>\n";
  22.         $html .= $inquiry['date_created'].' - ';
  23.         $html .= $inquiry[7].' - '; //name
  24.         $html .= $inquiry[9].'<br />'; //name
  25.         $field_8_long = RGFormsModel::get_field_value_long($inquiry['id'], $inquiry[8], $form_id, true);
  26.         $html .= '<blockquote>'.$field_8_long.'</blockquote>'; //name
  27.         $html .= "</li>\n";
  28.  
  29.     }
  30. }
  31. $html .= '</ul>';
  32.  
  33. // return the html output from the shortcode
  34. return $html;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement