/ Published in: PHP
                    
                                        Found This Code to make a stats page view for a client. Make Sure your header input format is PHP.
                
                            
                                Expand |
                                Embed | Plain Text
                            
                        
                        Copy this code and paste it in your HTML
 <?php // load view object (has no results yet) $view = views_get_current_view(); // execute view query $view->execute(); $total =0; foreach ( $view->result as $k=> $v ) { $total += $v->node_data_field_paymen_total_value; } // results are now stored as an array in $view->result print "Total Number of Payments : <b>$count</b><br />"; Print "Total Payments :$<b>$total</b> "; ?>
URL: http://www.impossible.co.in/blog/admin/drupal-views-get-total-rows-and-field-values-header
Comments
                    Subscribe to comments
                
                