function amr_display_a_page($linessaved, $icols, $cols, $ahtm) { $html = ''; foreach ($linessaved as $il => $line) { /// have index at this point $id = $line['ID']; /* always have the id - may not always print it */ $user = amr_get_userdata($id); $html .= amr_display_a_line($line, $icols, $cols, $user, $ahtm); } return $html; }
function amr_display_a_page($linessaved, $icols, $cols, $ahtm) { $html = ''; foreach ($linessaved as $il => $line) { /// have index at this point $id = $line['ID']; /* always have the id - may not always print it */ $user = amr_get_userdata($id); $user = amr_add_data_in_line_to_user_object($line, $user); // in case we wnt to use it // need this data for links, etc // hmmm not sure about this, what if want other values in line? // how to accomodate both line data and maybe other user data ? $html .= amr_display_a_line($line, $icols, $cols, $user, $ahtm); } return $html; }
function alist_one_widget($type = 'user', $i = 1, $do_headings = false, $do_csv = false, $max = 10) { /* a widget version of alist one*/ /* Get the fields to use for the chosen list type */ global $aopt; global $amain; $c = new adb_cache(); $rptid = $c->reportid($i, $type); $line = $c->get_cache_report_lines($rptid, '0', '2'); /* get the internal heading names for internal plugin use only */ /* get the user defined heading names */ if (!defined('str_getcsv')) { $icols = amr_str_getcsv($line[0]['csvcontent'], ',', '"', '\\'); } else { $icols = str_getcsv($line[0]['csvcontent'], ',', '"', '\\'); } // if (!defined('str_getcsv')) $cols = amr_str_getcsv( $line[1]['csvcontent'], '","','"','\\'); // else $cols = str_getcsv( $line[1]['csvcontent'], ',','"','\\'); foreach ($icols as $ic => $cv) { /* use the icols as our controlling array, so that we have the internal field names */ $v = $cols[$ic]; $html .= '<th>' . $v . '</th>'; } $hhtml = '<thead><tr>' . $html . '</tr></thead>'; /* setup the html for the table headings */ $fhtml = '<tfoot><tr>' . $html . '</tr>' . '</tfoot>'; /* setup the html for the table headings */ $html = ''; $totalitems = $c->get_cache_totallines($rptid); $lines = $c->get_cache_report_lines($rptid, $start + 1, $max); if (!($lines > 0)) { amr_flag_error($c->get_error('numoflists')); return false; } foreach ($lines as $il => $l) { $id = $lineitems[0]; /* *** pop the first one - this should always be the id */ $user = amr_get_userdata($id); unset($linehtml); foreach ($icols as $ic => $c) { /* use the icols as our controlling array, so that we have the internal field names */ $v = $lineitems[$ic]; $linehtml .= '<td>' . amr_format_user_cell($c, $v, $user) . '</td>'; } $html .= PHP_EOL . '<tr>' . $linehtml . '</tr>'; } $html = '<table>' . $hhtml . $fhtml . '<tbody>' . $html . '</tbody></table>'; return $html; }