Отображаю номер столбца при скачивании Excel файла

This commit is contained in:
2021-10-06 16:31:01 +06:00
parent 5ebcf5041d
commit 830e89fbfc
5 changed files with 73 additions and 65 deletions

View File

@ -1171,6 +1171,7 @@
fwrite($fh, ' <caption><b>'.findNode($currNode,'objects-list')->getAttribute("d").'</b></caption>'."\n");
fwrite($fh, ' <thead>'."\n");
fwrite($fh, ' <tr>');
fwrite($fh, '<td bgcolor="#d1d1d1">№</td>');
$nextnode=findNode($currNode,'objects-list')->firstChild;
$col=0;
while ($nextnode)
@ -1182,9 +1183,11 @@
fwrite($fh, ' </tr>'."\n");
fwrite($fh, ' </thead>'."\n");
fwrite($fh, ' <tbody>'."\n");
$pos=0;
while ($row = $res->fetch(PDO::FETCH_ASSOC))
{
fwrite($fh, ' <tr>');
fwrite($fh, '<td>'.(++$pos).'</td>');
$nextnode=findNode($currNode,'objects-list')->firstChild;
while ($nextnode)
{ if ($nextnode->nodeName=='column')