Beispiel #1
0
         echo 'You missed report ids !';
     }
     break;
     //////// SET ISSUE FOR REPORTS
 //////// SET ISSUE FOR REPORTS
 case 'setReportsIssue':
     $reportIds = @$_POST['reportIds'];
     $currentIssueId = @$_POST['currentIssueId'];
     $newIssueId = @$_POST['newIssueId'];
     if (!empty($reportIds) && !empty($currentIssueId) && !empty($newIssueId)) {
         // update reports
         DbHelper::exec('UPDATE ' . TBL_REPORTS . ' SET ' . REPORT_ISSUE . '=' . $newIssueId . ' WHERE ' . REPORT_ID . ' IN (' . $reportIds . ')');
         // delete issue if no more reports attached
         $count = DbHelper::countRows(TBL_REPORTS, REPORT_ISSUE . '=' . $currentIssueId);
         if ($count == 0) {
             DbHelper::deleteIssues($currentIssueId);
         }
     } else {
         $error = "Invalid parameters !";
     }
     if ($error == null) {
         Helper::pushAlert(ALERT_SUCCESS, 'Reports switched with success !');
     } else {
         Helper::pushAlert(ALERT_ERROR, $error);
     }
     header('Location:index.php?p=' . PAGE_ID_ISSUES);
     break;
     //////// GET ISSUES TABLE
 //////// GET ISSUES TABLE
 case 'getIssuesTbl':
     // get reports preferences