本文整理汇总了PHP中Config::dbSurvey方法的典型用法代码示例。如果您正苦于以下问题:PHP Config::dbSurvey方法的具体用法?PHP Config::dbSurvey怎么用?PHP Config::dbSurvey使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Config
的用法示例。
在下文中一共展示了Config::dbSurvey方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: generate
function generate($seid, $nestingcounter = 1)
{
$_SESSION['PARAMETER_RETRIEVAL'] = PARAMETER_SURVEY_RETRIEVAL;
global $db;
set_time_limit(0);
ini_set('memory_limit', '128M');
$this->seid = $seid;
$q = "select * from " . Config::dbSurvey() . "_routing where suid=" . $this->suid . " and seid=" . $this->seid . " order by rgid asc";
if ($rules = $db->selectQuery($q)) {
if ($db->getNumberOfRows($rules) > 0) {
/* set uscic-paperversion-nesting counter */
$this->nesting = $nestingcounter;
while ($row = $db->getRow($rules)) {
//echo $row["rule"] . "<br/>";
$this->instructions[$row["rgid"]] = new RoutingInstruction($row["suid"], $row["seid"], $row["rgid"], $row["rule"]);
}
//echo'yytyyy';
/* process rules */
for ($this->cnt = 1; $this->cnt <= sizeof($this->instructions); $this->cnt++) {
if (isset($this->instructions[$this->cnt])) {
//echo $this->instructions[$this->cnt]->getRule() . "<br/>";
$this->addRule($rootnode, $this->instructions[$this->cnt]);
}
}
}
}
$_SESSION['PARAMETER_RETRIEVAL'] = PARAMETER_ADMIN_RETRIEVAL;
}
示例2: checkAccess
function checkAccess()
{
global $db, $survey;
switch ($survey->getAccessType()) {
case LOGIN_ANONYMOUS:
return true;
break;
case LOGIN_DIRECT:
return true;
break;
case LOGIN_LOGINCODE:
$logincode = loadvarSurvey('primkey');
$result = $db->selectQuery('select count(*), primkey from ' . Config::dbSurvey() . '_respondents where aes_decrypt(logincode, \'' . Config::loginCodeKey() . '\') = \'' . prepareDatabaseString($logincode) . '\'');
//echo 'select count(*), primkey from ' . Config::dbSurvey() . '_respondents where aes_decrypt(logincode, "' . Config::loginCodeKey() . '") = "' . prepareDatabaseString($logincode) . '"';
$row = $db->getRow($result);
if ($row[0] == 1) {
$_SESSION['PRIMKEY'] = $row['primkey'];
return true;
} else {
$logactions = new LogActions();
$logactions->addAction('', '', "loginwrong", USCIC_SURVEY);
}
break;
}
return false;
}
示例3: checkProxyCode
function checkProxyCode($startcode, $permissioncode)
{
global $db;
$query = 'select count(*) as cnt from ' . Config::dbSurvey() . '_proxypermission where startcode=\'' . prepareDatabaseString($startcode) . '\' and permissioncode = \'' . prepareDatabaseString($permissioncode) . '\'';
//echo '<br/><br/><br/>' . $query;
$result = $db->selectQuery($query);
$row = $db->getRow($result);
return $row['cnt'] > 0;
}
示例4: Psu
function Psu($rowOrPuid)
{
global $db;
if (is_array($rowOrPuid)) {
$this->psu = $rowOrPuid;
} else {
$query = 'select * from ' . Config::dbSurvey() . '_psus where puid = ' . prepareDatabaseString($rowOrPuid);
$result = $db->selectQuery($query);
$this->psu = $db->getRow($result);
}
}
示例5: getPsusByCodeAsArray
function getPsusByCodeAsArray()
{
//used in assign new sample to map between code and index
global $db;
$psus = array();
$result = $db->selectQuery('select * from ' . Config::dbSurvey() . '_psus');
while ($row = $db->getRow($result)) {
$psus[$row['code']] = $row['puid'];
}
return $psus;
}
示例6: GPS
function GPS($village, $dwellingid)
{
global $db;
$query = 'select *,';
$query .= 'aes_decrypt(latitude, "' . Config::smsPersonalInfoKey() . '") as latitude, ';
$query .= 'aes_decrypt(longitude, "' . Config::smsPersonalInfoKey() . '") as longitude ';
$query .= ' from ' . Config::dbSurvey() . '_gps where dwellingid = "' . prepareDatabaseString($dwellingid) . '" and code = "' . prepareDatabaseString($village) . '"';
//echo '<br/><br/><br/>' . $query;
$result = $db->selectQuery($query);
$this->gps = $db->getRow($result);
}
示例7: Version
function Version($rowOrVnid = "")
{
if (is_array($rowOrVnid)) {
$this->version = $rowOrVnid;
} else {
if ($rowOrVnid != "") {
global $db;
$result = $db->selectQuery('select * from ' . Config::dbSurvey() . '_versions where suid=' . prepareDatabaseString(getSurvey()) . ' and vnid = ' . prepareDatabaseString($rowOrVnid));
$this->version = $db->getRow($result);
}
}
}
示例8: addRemark
function addRemark($primkey, $remark, $urid)
{
global $db;
$query = 'replace into ' . Config::dbSurvey() . '_remarks (primkey, remark, urid, ts) values (\'' . prepareDatabaseString($primkey) . '\', aes_encrypt(\'' . prepareDatabaseString($remark) . '\',\'' . Config::smsRemarkKey() . '\'), ' . $urid . ', \'' . date('Y-m-d H:i:s') . '\')';
// echo '<br/><br/><br/>' . $query;
$db->executeQuery($query);
if (isset($this->remarksArray[$primkey])) {
unset($this->remarksArray[primkey]);
//remove from array so getremarks re-reads it.
}
return $query;
}
示例9: getEntry
function getEntry($trid)
{
global $db;
$query = "select * from " . Config::dbSurvey() . "_tracks where trid=" . prepareDatabaseString($trid);
$res = $db->selectQuery($query);
$arr = array();
if ($res) {
if ($db->getNumberOfRows($res) > 0) {
$arr = $db->getRow($res);
}
}
return $arr;
}
示例10: dbType
{
return dbConfig::dbServer();
}
static function dbType()
{
return dbConfig::dbType();
}
static function dbSurveyData()
{
if (isset($_SESSION[SURVEY_EXECUTION_MODE])) {
switch ($_SESSION[SURVEY_EXECUTION_MODE]) {
case SURVEY_EXECUTION_MODE_NORMAL:
return Config::dbSurvey();
case SURVEY_EXECUTION_MODE_TEST:
return Config::dbSurvey() . "_test";
示例11: getUsers
function getUsers()
{
global $db;
if (isset($this->userArray[$_SESSION['URID']])) {
$users = $this->userArray[$_SESSION['URID']];
} else {
$users = array();
$result = $db->selectQuery('SELECT ' . $this->getSelectQuery() . ' FROM ' . Config::dbSurvey() . '_users');
while ($row = $db->getRow($result)) {
$users[] = new User($row);
}
$this->userArray[$_SESSION['URID']] = $users;
}
return $users;
}
示例12: DataExport
function DataExport($suid)
{
global $db, $survey;
$this->db = $db;
$this->suid = $suid;
$this->survey = new Survey($this->suid);
$survey = $this->survey;
$this->variabledescriptives = array();
$this->setProperty(DATA_OUTPUT_MAINTABLE, Config::dbSurvey());
$this->setProperty(DATA_OUTPUT_MAINDATATABLE, Config::dbSurveyData());
/* set file names */
$this->setProperty(DATA_OUTPUT_FILENAME, $this->getProperty(DATA_OUTPUT_MAINTABLE));
/* set defaults */
$this->setProperty(DATA_OUTPUT_FILETYPE, FILETYPE_STATA);
$this->setProperty(DATA_OUTPUT_SURVEY, "");
$this->setProperty(DATA_OUTPUT_MODES, "");
$this->setProperty(DATA_OUTPUT_LANGUAGES, "");
$this->setProperty(DATA_OUTPUT_VERSIONS, "");
$this->setProperty(DATA_OUTPUT_PRIMARY_KEY_IN_DATA, PRIMARYKEY_YES);
$this->setProperty(DATA_OUTPUT_HIDDEN, DATA_NOTHIDDEN);
$this->setProperty(DATA_OUTPUT_CLEAN, DATA_DIRTY);
$this->setProperty(DATA_OUTPUT_INCLUDE_VALUE_LABEL_NUMBERS, VALUELABELNUMBERS_YES);
$this->setProperty(DATA_OUTPUT_FIELDNAME_CASE, FIELDNAME_LOWERCASE);
$this->setProperty(DATA_OUTPUT_INCLUDE_VALUE_LABELS, VALUELABEL_YES);
$this->setProperty(DATA_OUTPUT_VARIABLES_WITHOUT_DATA, VARIABLES_WITHOUT_DATA_YES);
$this->setProperty(DATA_OUTPUT_VALUELABEL_PREFIX, $this->getProperty(DATA_OUTPUT_MAINTABLE) . "_vl");
$this->setProperty(DATA_OUTPUT_VALUELABEL_WIDTH, VALUELABEL_WIDTH_FULL);
$this->setProperty(DATA_OUTPUT_ENCODING, "UTF-8");
$this->setProperty(DATA_OUTPUT_COMPLETED, INTERVIEW_NOTCOMPLETED);
$this->setProperty(DATA_OUTPUT_MARK_EMPTY, MARKEMPTY_IN_VARIABLE);
$this->setProperty(DATA_OUTPUT_KEEP_ONLY, DATA_KEEP_NO);
$this->setProperty(DATA_OUTPUT_CLEAN, DATA_CLEAN);
$this->setProperty(DATA_OUTPUT_TYPEDATA, DATA_REAL);
$this->setProperty(DATA_OUTPUT_VARLIST, "");
$this->setProperty(DATA_OUTPUT_TYPE, DATA_OUTPUT_TYPE_DATA_TABLE);
$this->setProperty(DATA_OUTPUT_PRIMARY_KEY_ENCRYPTION, "");
$this->setProperty(DATA_OUTPUT_FROM, "");
$this->setProperty(DATA_OUTPUT_TO, "");
$this->minprimkeylength = Config::getMinimumPrimaryKeyLength();
$this->maxprimkeylength = Config::getMaximumPrimaryKeyLength();
}
示例13: getBarcode
function getBarcode()
{
$barcode = $this->lab['barcode_dec'];
if ($barcode != '') {
return $this->lab['barcode_dec'];
} else {
//lookup barcode!!! in haalsi_data -> stored at BS021
global $survey, $db;
$query = 'select *, aes_decrypt(answer, "' . $survey->getDataEncryptionKey() . '") as answer from ' . Config::dbSurvey() . '_data where primkey = "' . prepareDatabaseString($this->getPrimkey()) . '" and variablename="bs021"';
$result = $db->selectQuery($query);
// print_r($result);
if ($result != null && $db->getNumberOfRows($result) > 0) {
$row = $db->getRow($result);
$barcode = $row['answer'];
$this->lab['barcode_dec'] = $barcode;
$this->saveChanges();
return $barcode;
} else {
//no barcode....
//echo "no code";
return '';
}
}
}
示例14: save
function save()
{
global $db;
if (!isset($this->variabledescriptive['vsid'])) {
$query = "select max(vsid) as max from " . Config::dbSurvey() . "_variables";
$r = $db->selectQuery($query);
$row = $db->getRow($r);
$vsid = $row["max"] + 1;
$this->setObjectName($vsid);
$this->setVsid($vsid);
/* set position */
$query = "select max(position) as max from " . Config::dbSurvey() . "_variables where suid=" . $this->getSuid() . " and seid=" . $this->getSeid();
$r = $db->selectQuery($query);
$row = $db->getRow($r);
$pos = $row["max"] + 1;
$this->setPosition($pos);
}
$query = "replace into " . Config::dbSurvey() . "_variables (suid, vsid, seid, variablename, position, tyd) values(";
$query .= prepareDatabaseString($this->getSuid()) . ",";
$query .= prepareDatabaseString($this->getVsid()) . ",";
$query .= prepareDatabaseString($this->getSeid()) . ",";
$query .= "'" . prepareDatabaseString($this->getName()) . "',";
$order = $this->getPosition();
if ($order == "") {
$order = 1;
}
$query .= prepareDatabaseString($order) . ",";
$tyd = $this->getTyd();
if ($tyd == "") {
$tyd = -1;
}
$query .= prepareDatabaseString($tyd) . "";
$query .= ")";
$db->executeQuery($query);
/* save settings */
$settings = $this->getSettingsArray();
foreach ($settings as $key => $setting) {
$setting->setObject($this->getVsid());
$setting->setSuid($this->getSuid());
$setting->save();
}
}
示例15: getRespondentsByUrid
function getRespondentsByUrid($urid)
{
global $db;
$respondents = array();
$query = 'select primkey from ' . Config::dbSurvey() . '_lab where urid = \'' . prepareDatabaseString($urid) . '\'';
$result = $db->selectQuery($query);
while ($row = $db->getRow($result)) {
$respondents[] = new Respondent($row['primkey']);
}
return $respondents;
}