function web_DSShow($login) { $login = vf($login); $days = ds_GetDays(); $result = '<table width="100%" class="sortable">'; $result .= ' <tr class="row1"> <td>' . __('Day') . '</td> <td>' . __('Downloaded') . '</td> <td>' . __('Uploaded') . '</td> <td>' . __('Cash') . '</td> </tr> '; if (!empty($days)) { foreach ($days as $io => $eachday) { $downsumm = ds_GetDownSumm($login, $eachday['day']); $upsumm = ds_GetUpSumm($login, $eachday['day']); $cashsumm = ds_GetCashSumm($login, $eachday['day']); if (!$downsumm) { $downsumm = 0; } if (!$upsumm) { $upsumm = 0; } $result .= ' <tr class="row3"> <td><a href="?module=pl_traffdetails&username='******'&day=' . $eachday['day'] . '">' . $eachday['day'] . '</a></td> <td sorttable_customkey="' . $downsumm . '">' . stg_convert_size($downsumm) . '</td> <td sorttable_customkey="' . $upsumm . '">' . stg_convert_size($upsumm) . '</td> <td>' . round($cashsumm, 2) . '</td> </tr> '; } } $result .= '</table>'; return $result; }
/** * Renders stats for some user * * @param string $login * @return string */ function web_DSShow($login) { $login = vf($login); $days = ds_GetDays(); $result = ''; $cells = wf_TableCell(__('Day')); $cells .= wf_TableCell(__('Downloaded')); $cells .= wf_TableCell(__('Uploaded')); $cells .= wf_TableCell(__('Cash')); $rows = wf_TableRow($cells, 'row1'); if (!empty($days)) { foreach ($days as $io => $eachday) { $downsumm = ds_GetDownSumm($login, $eachday['day']); $upsumm = ds_GetUpSumm($login, $eachday['day']); $cashsumm = ds_GetCashSumm($login, $eachday['day']); if (!$downsumm) { $downsumm = 0; } if (!$upsumm) { $upsumm = 0; } $dayLink = wf_Link('?module=pl_traffdetails&username='******'&day=' . $eachday['day'], $eachday['day']); $cells = wf_TableCell($dayLink); $cells .= wf_TableCell(stg_convert_size($downsumm), '', '', 'sorttable_customkey="' . $downsumm . '"'); $cells .= wf_TableCell(stg_convert_size($upsumm), '', '', 'sorttable_customkey="' . $upsumm . '"'); $cells .= wf_TableCell(round($cashsumm, 2)); $rows .= wf_TableRow($cells, 'row3'); } } $result .= wf_TableBody($rows, '100%', 0, 'sortable'); return $result; }