function uc_csv_report_grid in Ubercart CSV 7.2
Same name and namespace in other branches
- 6.2 uc_csv.module \uc_csv_report_grid()
Present a list of exported reports
Allows for viewing and downloading of exported reports
1 string reference to 'uc_csv_report_grid'
- uc_csv_menu in ./
uc_csv.module - Implements hook_menu
File
- ./
uc_csv.module, line 178
Code
function uc_csv_report_grid() {
$i = 0;
$rows = array();
$header = array(
array(
'data' => t('Export Name'),
),
array(
'data' => t('Last Exported'),
'style' => 'text-align: center;',
),
array(
'data' => t('Last Order ID'),
'style' => 'text-align: center;',
),
array(
'data' => t('Actions'),
'style' => 'text-align: center;',
),
);
$result = db_query('SELECT * FROM {uc_csv_reports} ORDER BY report_name ASC');
while ($data = $result
->fetchObject()) {
/* if this is an untrackable report, then it is not necessary for list the last exported */
/* number since it will always be zero */
if ($data->track < 1) {
$data->last_order_id = 'N/A';
}
$row = array();
$row[] = $data->report_name;
$row[] = array(
'data' => $data->last_exported,
'style' => 'text-align: center;',
);
$row[] = array(
'data' => $data->last_order_id,
'style' => 'text-align: center;',
);
$row[] = array(
'data' => l(t('Edit'), 'admin/store/export/reports/update/' . $data->rid) . ' | ' . l(t('Delete'), 'admin/store/export/reports/delete/' . $data->rid),
'style' => 'text-align: center;',
);
$rows[] = $row;
}
if (count($rows) == 0) {
$rows = array(
array(
'data' => array(
array(
'align' => 'center',
'colspan' => 4,
'data' => t('THERE ARE CURRENTLY NO CONFIGURED EXPORT REPORTS'),
),
),
),
);
}
$output = theme('table', array(
'header' => $header,
'rows' => $rows,
));
return $output;
}