Поправил функцию getColN(name) для поиска данных по названию колонки.

This commit is contained in:
Igor I
2024-01-25 17:00:47 +06:00
parent 7797b141bf
commit eca2e4f45f
3 changed files with 10 additions and 9 deletions

View File

@ -1101,7 +1101,7 @@
}else }else
if ($fn==8)//Получить отчёт как Excel.xls файл (почти тоже самое что и функция 4) if ($fn==8)//Получить отчёт как Excel.xls файл (почти тоже самое что и функция 4)
{ {
$dir='./temp/'; $dir='./temp/'; //$tmpfname = tempnam($dir, "");
// отправка файла в отдельном файле download.php для совместимости с java версией // отправка файла в отдельном файле download.php для совместимости с java версией
session_write_close(); //Разблокируем сессионный файл так как запросы могут быть достаточно долгими session_write_close(); //Разблокируем сессионный файл так как запросы могут быть достаточно долгими
@ -1307,7 +1307,6 @@
header('Content-type: text/xml'); header('Content-type: text/xml');
echo '<?xml version="1.0" encoding="utf-8"?><metadata fn="8"><file><![CDATA['.$num.']]></file></metadata>'; echo '<?xml version="1.0" encoding="utf-8"?><metadata fn="8"><file><![CDATA['.$num.']]></file></metadata>';
//deleteTempFiles($dir);
}else }else
{ {
sendError(1,trt('Not found the requested node:').' "'.$typename.'"!'); sendError(1,trt('Not found the requested node:').' "'.$typename.'"!');

View File

@ -1462,10 +1462,11 @@ class SRec
} }
} }
//Get column number by name //Get column number by name, if result=-1 then not find else find
getColN(name){ getColN(name){
let i=-1; let result=-1;
//determine the sequence number of the column //determine the sequence number of the column
let pos=0;
let node=findNodeOnPath(this.nodeMetadata,"type/objects-list"); let node=findNodeOnPath(this.nodeMetadata,"type/objects-list");
let nodeCol = node.firstChild; let nodeCol = node.firstChild;
while (nodeCol != null) while (nodeCol != null)
@ -1473,13 +1474,14 @@ class SRec
if(nodeCol.nodeName=="column") if(nodeCol.nodeName=="column")
{ {
if(nodeCol.getAttribute("n")==name){ if(nodeCol.getAttribute("n")==name){
result=pos;
break; break;
} }
i++; pos++;
} }
nodeCol = nodeCol.nextSibling; nodeCol = nodeCol.nextSibling;
} }
return i; return result;
} }
//find the value in the result set by the id of the record and the name of the column //find the value in the result set by the id of the record and the name of the column

View File

@ -622,7 +622,7 @@ function getCookie(c_name)
//expires - Сколько дней хранить куки //expires - Сколько дней хранить куки
//path - Путь куда разрешено пересылать куки (по умолчанию текущий) //path - Путь куда разрешено пересылать куки (по умолчанию текущий)
function setCookie (name, value, expires, path, domain, secure) function setCookie(name, value, expires, path, domain, secure)
{ {
let exDate=new Date(); let exDate=new Date();
exDate.setDate(exDate.getDate() + expires); exDate.setDate(exDate.getDate() + expires);
@ -632,8 +632,8 @@ function setCookie (name, value, expires, path, domain, secure)
((expires) ? "; expires=" + expires : "") + ((expires) ? "; expires=" + expires : "") +
((path) ? "; path=" + path : "") + ((path) ? "; path=" + path : "") +
((domain) ? "; domain=" + domain : "") + ((domain) ? "; domain=" + domain : "") +
((secure) ? "; secure" : ""); ((secure) ? "; secure" : "") +
"; SameSite=Strict";
document.cookie = str; document.cookie = str;
} }