+Функция postJsonData
This commit is contained in:
@ -534,7 +534,11 @@
|
||||
try
|
||||
{ $res = $stmt->execute();
|
||||
} catch (Exception $e)
|
||||
{ sendError(1,$e->getMessage()."\n".$sql_query);
|
||||
{
|
||||
if(str_contains($e->getMessage(), ']]')) //If already sending short error text.
|
||||
sendError(1, $e->getMessage());
|
||||
else
|
||||
sendError(1, '[['.trt("SQL_query_error").']]'.$e->getMessage()."\n".$sql_query);
|
||||
}
|
||||
$result = $stmt->fetch(PDO::FETCH_NUM); //$obj_id
|
||||
if($result[0]==''){ $result[0]=$obj_id; }
|
||||
@ -569,7 +573,11 @@
|
||||
try
|
||||
{ $res = $db->query($sql_query);
|
||||
}catch (Exception $e)
|
||||
{ sendError(1,$e->getMessage());
|
||||
{
|
||||
if(str_contains($e->getMessage(), ']]')) //If already sending short error text.
|
||||
sendError(1, $e->getMessage());
|
||||
else
|
||||
sendError(1, '[['.trt("SQL_query_error").']]'.$e->getMessage()."\n".$sql_query);
|
||||
}
|
||||
//записываем id удалённой записи для удаления без перезагрузки страницы через javascript
|
||||
$xmlstring="";
|
||||
@ -1290,9 +1298,7 @@ if ($code!=$_POST['code']) return new AuthError('invalid code');
|
||||
$file='file_'.$num.'.xls';
|
||||
$myFile = $dir.$file;
|
||||
|
||||
$fh = fopen($myFile, 'w');
|
||||
if($fh)
|
||||
{
|
||||
if(($fh = @fopen($myFile, 'w')) !== FALSE){
|
||||
fwrite($fh, '<html>'."\n");
|
||||
fwrite($fh, ' <head>'."\n");
|
||||
fwrite($fh, ' <title>'.$currNode->getAttribute("d").'</title>'."\n");
|
||||
@ -1345,7 +1351,9 @@ if ($code!=$_POST['code']) return new AuthError('invalid code');
|
||||
fwrite($fh, '</html>'."\n");
|
||||
|
||||
fclose($fh);
|
||||
}
|
||||
}else{
|
||||
sendError(1,trt('Failed_to_generate_report'));
|
||||
}
|
||||
|
||||
/*if($ext=="pdf")
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user