function addAction($primkey, $urid, $page, $systemtype = USCIC_SMS, $actiontype = 1) { global $db; $query = 'INSERT INTO ' . Config::dbSurveyData() . '_actions (primkey, sessionid, urid, suid, ipaddress, systemtype, action, actiontype, params, language, mode, version) VALUES ('; if ($primkey != '') { $query .= '\'' . prepareDatabaseString($primkey) . '\', '; } else { $query .= 'NULL, '; } $query .= '\'' . session_id() . '\', '; if ($urid != '') { $query .= '\'' . $urid . '\', '; } else { $query .= 'NULL, '; } if ($systemtype == USCIC_SURVEY) { $query .= getSurvey() . ', '; } else { $query .= 'NULL, '; } $query .= '\'' . prepareDatabaseString(getClientIp()) . '\', '; $query .= $systemtype . ', '; $query .= '\'' . prepareDatabaseString($page) . '\', '; $query .= $actiontype . ', '; if (Config::logParams()) { //log post vars? $query .= ' AES_ENCRYPT(\'' . prepareDatabaseString(serialize($_POST)) . '\', \'' . Config::logActionParamsKey() . '\'), '; } else { $query .= ' NULL, '; } if ($systemtype == USCIC_SURVEY) { $query .= getSurveyLanguage() . ', '; $query .= getSurveyMode() . ', '; $query .= getSurveyVersion(); } else { $query .= 'NULL, NULL, NULL'; } $query .= ")"; $db->executeQuery($query); if (isset($this->LogActions[$primkey])) { //unset so it is read in again.. unset($this->LogActions[$primkey]); } }