private function sendReportEmail()
 {
     // send one mail with all errors to RT, clean db.
     $gk = new GeoKretyApi();
     if ($gk->mailToRT($this->toMail)) {
         $queryParamTmp = '';
         foreach ($this->toMail as $recordId) {
             $queryParamTmp .= $recordId['id'] . ',';
         }
         $queryParam = substr($queryParamTmp, 0, -1);
         GeoKretyApi::removeDbRows($queryParam);
         if ($this->debug) {
             print "wyslano maila, usunieto wpisy z bazy<br/>";
         }
     }
 }
Exemple #2
0
 }
 $log_date = date('Y-m-d H:i:s', mktime($log_date_hour, $log_date_min, 0, $log_date_month, $log_date_day, $log_date_year));
 $log_uuid = create_uuid();
 //add logentry to db
 if ($log_type < 0) {
     // nie wybrano typu logu
 } elseif (!($log_type == 3 && $log_text == "")) {
     if ($log_type == 1) {
         /* GeoKretyApi: call method logging selected Geokrets  (by Łza) */
         if ($debug) {
             dataBase::debugOC('#' . __LINE__ . ' ', $_POST);
         }
         $MaxNr = isset($_POST['MaxNr']) ? (int) $_POST['MaxNr'] : 0;
         if ($MaxNr > 0) {
             require_once 'GeoKretyAPI.php';
             $LogGeokrety = new GeoKretyApi($secid, $cache_waypt);
             $b = 1;
             for ($i = 1; $i < $MaxNr + 1; $i++) {
                 if ($_POST['GeoKretIDAction' . $i]['action'] > -1) {
                     $GeokretyLogArray = array('secid' => $secid, 'nr' => $_POST['GeoKretIDAction' . $i]['nr'], 'id' => $_POST['GeoKretIDAction' . $i]['id'], 'nm' => $_POST['GeoKretIDAction' . $i]['nm'], 'formname' => 'ruchy', 'logtype' => $_POST['GeoKretIDAction' . $i]['action'], 'data' => $log_date_year . '-' . $log_date_month . '-' . $log_date_day, 'godzina' => $log_date_hour, 'minuta' => $log_date_min, 'comment' => substr($_POST['GeoKretIDAction' . $i]['tx'], 0, 80) . ' (autom. log oc.' . substr($absolute_server_URI, -3, 2) . ')', 'wpt' => $cache_waypt, 'app' => 'Opencaching', 'app_ver' => 'PL');
                     if ($debug) {
                         dataBase::debugOC('#' . __LINE__ . ' ', $GeokretyLogArray);
                     }
                     $GeoKretyLogResult[$b] = $LogGeokrety->LogGeokrety($GeokretyLogArray);
                     $b++;
                 }
             }
             $_SESSION['GeoKretyApi'] = serialize($GeoKretyLogResult);
         }
         unset($b);
         if ($debug) {