<?php
 if ($R['deleteIdReport']) { $OK=1; if (!is_numeric($R['deleteIdReport']) or $R['deleteIdReport']<=0) { $showMessage['warning']=$_LANG['reports']['mng']['reportsList']['deleteReportWrongId']; } if ($OK) { $deleteReportSQL="UPDATE `$DBTReports` SET deleted='1' WHERE id='".$R['deleteIdReport']."'"; $deleteReportEx=$db->Execute($deleteReportSQL); if (!$deleteReportEx) { $showMessage['error']=$_LANG['reports']['mng']['reportsList']['deleteReportNotOk']; writeLog("Could not delete report. SQL: ".$deleteReportSQL, 'events', 10); } else { $deleteAccessSQL="DELETE FROM `$DBTReportsAccess` WHERE idReport='".$R['deleteIdReport']."'"; $deleteAccessEx=$db->Execute($deleteAccessSQL); if (!$deleteAccessEx) writeLog("Could not delete report accesses.", 'events', 10); $showMessage['success']=$_LANG['reports']['mng']['reportsList']['deleteReportOk']; $userTrailItem->updateActionOld('reportDeleteOk'); $userTrailItem->updateEntityOld('report', $R['deleteIdReport']); } } } ?>