当前位置: 首页>>代码示例>>PHP>>正文


PHP orsee_query函数代码示例

本文整理汇总了PHP中orsee_query函数的典型用法代码示例。如果您正苦于以下问题:PHP orsee_query函数的具体用法?PHP orsee_query怎么用?PHP orsee_query使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了orsee_query函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: faq__load_answer

function faq__load_answer($faq_id = "")
{
    $pars = array(':faq_id' => $faq_id);
    $query = "SELECT * from " . table('lang') . "\n            WHERE content_type='faq_answer'\n            AND content_name= :faq_id";
    $line = orsee_query($query, $pars);
    return $line;
}
开发者ID:danorama,项目名称:orsee,代码行数:7,代码来源:faqs.php

示例2: content__get_content

function content__get_content($content_name)
{
    global $lang;
    $this_lang = lang('lang');
    $pars = array(':content_name' => $content_name);
    $query = "SELECT * FROM " . table('lang') . "\n              WHERE content_type='public_content'\n              AND content_name=:content_name";
    $line = orsee_query($query, $pars);
    return $line[$this_lang];
}
开发者ID:danorama,项目名称:orsee,代码行数:9,代码来源:public_content.php

示例3: admin__check_login

function admin__check_login($username, $password)
{
    global $lang;
    $pars = array(':adminname' => $username);
    $query = "SELECT * FROM " . table('admin') . " \n            WHERE adminname= :adminname";
    $admin = orsee_query($query, $pars);
    $continue = true;
    $not_allowed = false;
    $locked = false;
    if ($continue) {
        if (!isset($admin['admin_id'])) {
            $continue = false;
            log__admin('login_admin_wrong_username', 'used_username:' . $username);
            //message('id');
        }
    }
    if ($continue) {
        $admin = admin__check_has_lockout($admin);
        if ($admin['locked']) {
            $continue = false;
            log__admin('login_admin_locked_out', 'username:' . $username);
            $locked = admin__track_unsuccessful_login($admin);
            //message('locked');
        }
    }
    if ($continue) {
        $check_pw = crypt_verify($password, $admin['password_crypt']);
        if (!$check_pw) {
            $continue = false;
            log__admin('login_admin_wrong_password', 'username:' . $username);
            $locked = admin__track_unsuccessful_login($admin);
            //message('wrong_pw');
        }
    }
    if ($continue) {
        $expadmindata = $admin;
        // load admin rights
        $expadmindata['rights'] = admin__load_admin_rights($expadmindata['admin_type']);
        if (!$expadmindata['rights']['login'] || $expadmindata['disabled'] == 'y') {
            $continue = false;
            $not_allowed = true;
            //message('not_allowed');
        }
    }
    if ($continue) {
        $_SESSION['expadmindata'] = $expadmindata;
        $done = admin__track_successful_login($admin);
        return true;
    } else {
        //if ($locked) message(lang('error_locked_out'));
        if ($not_allowed) {
            message(lang('error_not_allowed_to_login'));
        }
        return false;
    }
}
开发者ID:kfarr2,项目名称:psu-orsee,代码行数:56,代码来源:expadmin.php

示例4: laboratories__get_laboratory_text

function laboratories__get_laboratory_text($laboratory_id, $tlang = "")
{
    if (!$tlang) {
        global $lang;
        $tlang = lang('lang');
    }
    $pars = array(':laboratory_id' => $laboratory_id);
    $query = "SELECT * FROM " . table('lang') . " WHERE content_type='laboratory' AND content_name=:laboratory_id";
    $lab = orsee_query($query, $pars);
    return stripslashes($lab[$tlang]);
}
开发者ID:danorama,项目名称:orsee,代码行数:11,代码来源:laboratories.php

示例5: table

         $selfdesc[$language] = '';
     }
 }
 if ($continue) {
     if (!$subpool_id) {
         $new = true;
         $query = "SELECT subpool_id+1 as new_sub FROM " . table('subpools') . "\n              \t\t\tORDER BY subpool_id DESC LIMIT 1";
         $line = orsee_query($query);
         $subpool_id = $line['new_sub'];
         $lsub['content_type'] = "subjectpool";
         $lsub['content_name'] = $subpool_id;
     } else {
         $new = false;
         $pars = array(':subpool_id' => $subpool_id);
         $query = "SELECT * from " . table('lang') . " \n\t\t\t\t\t\tWHERE content_type='subjectpool' \n\t\t\t\t\t\tAND content_name= :subpool_id";
         $lsub = orsee_query($query, $pars);
     }
     $subpool = $_REQUEST;
     $subpool['experiment_types'] = id_array_to_db_string($exptype_ids);
     foreach ($languages as $language) {
         $lsub[$language] = $selfdesc[$language];
     }
     $done = orsee_db_save_array($subpool, "subpools", $subpool_id, "subpool_id");
     if ($new) {
         $lsub['lang_id'] = lang__insert_to_lang($lsub);
     } else {
         $done = orsee_db_save_array($lsub, "lang", $lsub['lang_id'], "lang_id");
     }
     message(lang('changes_saved'));
     log__admin("subjectpool_edit", "subjectpool:" . $subpool['subpool_name'] . "\nsubpool_id:" . $subpool['subpool_id']);
     redirect("admin/subpool_edit.php?subpool_id=" . $subpool_id);
开发者ID:kfarr2,项目名称:psu-orsee,代码行数:31,代码来源:subpool_edit.php

示例6: experiment__count_participate_at

function experiment__count_participate_at($experiment_id, $session_id = "", $condition = "", $cond_pars = array())
{
    $query = "";
    $pars = array();
    $query = "SELECT COUNT(*) as regcount FROM " . table('participate_at') . " WHERE ";
    if ($session_id) {
        $query .= "session_id= :tsession_id";
        $pars[':tsession_id'] = $session_id;
    } else {
        $query .= "experiment_id= :texperiment_id";
        $pars[':texperiment_id'] = $experiment_id;
    }
    if ($condition) {
        $query .= " AND (" . $condition . ")";
        foreach ($cond_pars as $p => $v) {
            $pars[$p] = $v;
        }
    }
    $line = orsee_query($query, $pars);
    return $line['regcount'];
}
开发者ID:kfarr2,项目名称:psu-orsee,代码行数:21,代码来源:experiments.php

示例7: orsee_db_load_array

    // load subject pool
    $subpool = orsee_db_load_array("subpools", $subpool_id, "subpool_id");
    if (!isset($subpool['subpool_id'])) {
        redirect("admin/subpool_main.php");
    }
}
if ($proceed) {
    $exptype_ids = db_string_to_id_array($subpool['experiment_types']);
    $subpool['exptypes'] = array();
    foreach ($exptype_ids as $exptype_id) {
        $subpool['exptypes'][] = $exptypes[$exptype_id][lang('lang')];
    }
    unset($subpool['experiment_types']);
    $pars = array(':subpool_id' => $subpool_id);
    $query = "SELECT * from " . table('lang') . " WHERE content_type='subjectpool' AND content_name= :subpool_id";
    $selfdesc = orsee_query($query, $pars);
    foreach ($languages as $language) {
        $subpool['selfdesc_' . $language] = $selfdesc[$language];
    }
    echo '<center>';
    if ($reallydelete) {
        if (isset($_REQUEST['merge_with']) && $_REQUEST['merge_with']) {
            $merge_with = $_REQUEST['merge_with'];
        } else {
            $merge_with = 1;
        }
        $subpools = subpools__get_subpools();
        if (!isset($subpools[$merge_with])) {
            redirect("admin/subpool_main.php");
        } else {
            // transaction?
开发者ID:kfarr2,项目名称:psu-orsee,代码行数:31,代码来源:subpool_delete.php

示例8: implode

            $pubs_string = implode(",", $pubs);
            $parts_string = implode(",", $parts);
            $query = "SELECT * FROM " . table('options') . "\n\t\t\t\t\tWHERE option_type='general' AND option_name='language_enabled_public'";
            $result = orsee_query($query);
            $now = time();
            if (isset($result['option_id'])) {
                $pars = array(':pubs_string' => $pubs_string);
                $query = "UPDATE " . table('options') . " SET option_value= :pubs_string  \n\t\t\t\t\t\tWHERE option_type='general' AND option_name='language_enabled_public'";
                $done = or_query($query, $pars);
            } else {
                $pars = array(':pubs_string' => $pubs_string, ':option_id' => $now + 1);
                $query = "INSERT INTO " . table('options') . " \n\t\t\t\t\t\tSET option_id=:option_id,\n\t\t\t\t\t\toption_type='general',\n\t\t\t\t\t\toption_name='language_enabled_public',\n\t\t\t\t\t\toption_value= :pubs_string";
                $done = or_query($query, $pars);
            }
            $query = "SELECT * FROM " . table('options') . "\n\t\t\t\t\tWHERE option_type='general' AND option_name='language_enabled_participants'";
            $result2 = orsee_query($query);
            if (isset($result2['option_id'])) {
                $pars = array(':parts_string' => $parts_string);
                $query = "UPDATE " . table('options') . " SET option_value= :parts_string \n\t\t\t\t\t\tWHERE option_type='general' AND option_name='language_enabled_participants'";
                $done = or_query($query, $pars);
            } else {
                $pars = array(':parts_string' => $parts_string, ':option_id' => $now + 2);
                $query = "INSERT INTO " . table('options') . " \n\t\t\t\t\t\tSET option_id=:option_id,\n\t\t\t\t\t\toption_type='general',\n\t\t\t\t\t\toption_name='language_enabled_participants',\n\t\t\t\t\t\toption_value= :parts_string";
                $done = or_query($query, $pars);
            }
            log__admin("language_availability_edit");
            message(lang('changes_saved'));
            redirect("admin/lang_main.php");
        }
    }
}
开发者ID:kfarr2,项目名称:psu-orsee,代码行数:31,代码来源:lang_main.php

示例9: orsee_db_load_array

function orsee_db_load_array($table, $key, $keyname)
{
    $query = "SELECT * FROM " . table($table) . " where " . $keyname . "=:key";
    $pars = array(':key' => $key);
    $line = orsee_query($query, $pars);
    return $line;
}
开发者ID:kfarr2,项目名称:psu-orsee,代码行数:7,代码来源:orsee_mysql.php

示例10: table

             $continue = false;
         }
     }
 }
 if ($continue) {
     if (!$exptype_id) {
         $new_entry = true;
         $query = "SELECT exptype_id+1 as new_sub FROM " . table('experiment_types') . "\n                        ORDER BY exptype_id DESC LIMIT 1";
         $line = orsee_query($query);
         $exptype_id = $line['new_sub'];
         $lsub['content_type'] = "experiment_type";
         $lsub['content_name'] = $exptype_id;
     } else {
         $new_entry = false;
         $query = "SELECT * from " . table('lang') . "\n                        WHERE content_type='experiment_type'\n                        AND content_name='" . $exptype_id . "'";
         $lsub = orsee_query($query);
     }
     $exptype = $_REQUEST;
     $exptype['exptype_mapping'] = implode(",", $map);
     foreach ($languages as $language) {
         $lsub[$language] = $selfdesc[$language];
     }
     $done = orsee_db_save_array($exptype, "experiment_types", $exptype_id, "exptype_id");
     if ($new_entry) {
         $done = lang__insert_to_lang($lsub);
     } else {
         $done = orsee_db_save_array($lsub, "lang", $lsub['lang_id'], "lang_id");
     }
     log__admin("experimenttype_edit", $exptype['exptype_name']);
     message(lang('changes_saved'));
     redirect("admin/experiment_type_edit.php?exptype_id=" . $exptype_id);
开发者ID:danorama,项目名称:orsee,代码行数:31,代码来源:experiment_type_edit.php

示例11: participant__get_participant_status

function participant__get_participant_status($participant_id)
{
    //status_type can be access_to_profile, eligible_for_experiments, is_default_active or is_default_inactive
    $statuses = participant_status__get_statuses();
    $pars = array(':participant_id' => $participant_id);
    $query = "SELECT status_id\n            FROM " . table('participants') . "\n            WHERE participant_id= :participant_id";
    $line = orsee_query($query, $pars);
    return $statuses[$line['status_id']];
}
开发者ID:danorama,项目名称:orsee,代码行数:9,代码来源:participant.php

示例12: array

         $status_id = $line['new_status_id'];
     } else {
         $status_id = 1;
     }
     $status_name_lang['content_type'] = "participant_status_name";
     $status_name_lang['content_name'] = $status_id;
     $status_error_lang['content_type'] = "participant_status_error";
     $status_error_lang['content_name'] = $status_id;
 } else {
     $new = false;
     $pars = array(':status_id' => $status_id);
     $query = "SELECT * from " . table('lang') . " WHERE content_type='participant_status_name' AND content_name= :status_id";
     $status_name_lang = orsee_query($query, $pars);
     if ($not_unconfirmed) {
         $query = "SELECT * from " . table('lang') . " WHERE content_type='participant_status_error' AND content_name= :status_id";
         $status_error_lang = orsee_query($query, $pars);
     }
 }
 foreach ($languages as $language) {
     $status_name_lang[$language] = $status_name[$language];
     if ($not_unconfirmed) {
         $status_error_lang[$language] = $status_error[$language];
     }
 }
 if ($new) {
     $status_name['lang_id'] = lang__insert_to_lang($status_name_lang);
     $status_error['lang_id'] = lang__insert_to_lang($status_error_lang);
 } else {
     $done = orsee_db_save_array($status_name_lang, "lang", $status_name_lang['lang_id'], "lang_id");
     if ($not_unconfirmed) {
         $done = orsee_db_save_array($status_error_lang, "lang", $status_error_lang['lang_id'], "lang_id");
开发者ID:kfarr2,项目名称:psu-orsee,代码行数:31,代码来源:participant_status_edit.php

示例13: check_clearpixel

function check_clearpixel()
{
    $return = false;
    $query = "SELECT * from " . table('objects') . "\n            WHERE item_type='clearpixel' AND item_name='clearpixel'";
    $cp = orsee_query($query);
    if (!isset($cp['item_details'])) {
        $query = "INSERT IGNORE INTO " . table('objects') . "\n                SET item_type='clearpixel', item_name='clearpixel', item_details='" . time() . "'";
        $done = or_query($query);
        $return = true;
    } else {
        if (time() - $cp['item_details'] > 24 * 60 * 60) {
            $query = "UPDATE " . table('objects') . "\n                    SET item_details='" . time() . "'\n                    WHERE item_type='clearpixel' AND item_name='clearpixel'";
            $done = or_query($query);
            $return = true;
        } else {
            $return = false;
        }
    }
    return $return;
}
开发者ID:danorama,项目名称:orsee,代码行数:20,代码来源:site.php

示例14: message

     $_REQUEST['password'] = "";
     $_REQUEST['password2'] = "";
 }
 if ($_REQUEST['password'] && !$_REQUEST['password'] == $_REQUEST['password2']) {
     message(lang('you_have_to_give_a_password'));
     $continue = false;
     $_REQUEST['password'] = "";
     $_REQUEST['password2'] = "";
 }
 if ($continue) {
     foreach (array('fname', 'lname', 'adminname') as $k) {
         $_REQUEST[$k] = trim($_REQUEST[$k]);
     }
     $pars = array(':adminname' => $_REQUEST['adminname']);
     $query = "SELECT admin_id FROM " . table('admin') . " \n\t\t\t\t\tWHERE adminname = :adminname";
     $existing_admin = orsee_query($query, $pars);
     if (isset($existing_admin['admin_id']) && $existing_admin['admin_id'] != $admin_id) {
         $continue = false;
         message(lang('error_username_exists'));
     }
 }
 if ($continue) {
     if ($_REQUEST['password']) {
         // no password strength checks when account created by super-admin?
         $_REQUEST['password_crypt'] = unix_crypt($_REQUEST['password']);
         message(lang('password_changed'));
     } else {
         unset($_REQUEST['password']);
     }
     if (!$admin_id) {
         $admin_id = time();
开发者ID:kfarr2,项目名称:psu-orsee,代码行数:31,代码来源:admin_edit.php

示例15: query__save_query

function query__save_query($json_query, $type, $experiment_id = 0, $properties = array(), $permanent = false)
{
    // type can be participants_search_active, participants_search_all, assign, deassign
    global $expadmin;
    $now = time();
    if ($experiment_id && $permanent) {
        // if this query is supposed to be permanent, then reset current permanent query if any
        $done = query__reset_permanent($experiment_id);
        // for new query
        $properties['is_permanent'] = 1;
        $properties['permanent_start_time'] = time();
        $properties['assigned_count'] = 0;
        $addquery = ", permanent=1";
        $addmessage = lang('activated_as_permanent_query');
    } else {
        $addquery = ", permanent=0";
    }
    $properties_string = property_array_to_db_string($properties);
    $continue = true;
    if ($experiment_id == 0) {
        // check if we already know this query, and if so, just update the record
        $pars = array(':json_query' => $json_query);
        $query = "SELECT * FROM " . table('queries') . "\n                WHERE json_query= :json_query LIMIT 1";
        $line = orsee_query($query, $pars);
        if (isset($line['query_id'])) {
            $pars = array(':query_time' => $now, ':query_id' => $line['query_id']);
            $query = "UPDATE " . table('queries') . "\n                    SET query_time= :query_time\n                    WHERE query_id= :query_id";
            $done = or_query($query, $pars);
            message(lang('query_existed_now_updated'));
            $continue = false;
        }
    }
    // otherwise, save the query
    if ($continue) {
        if (isset($expadmindata['admin_id'])) {
            $admin_id = $expadmindata['admin_id'];
        } else {
            $admin_id = '';
        }
        $pars = array(':query_time' => $now, ':json_query' => $json_query, ':query_type' => $type, ':experiment_id' => $experiment_id, ':properties' => $properties_string, ':admin_id' => $admin_id);
        $query = "INSERT INTO " . table('queries') . "\n                SET query_time=:query_time,\n                json_query=:json_query,\n                query_type=:query_type,\n                experiment_id=:experiment_id,\n                admin_id=:admin_id,\n                properties=:properties " . $addquery;
        $done = or_query($query, $pars);
        message(lang('query_saved'));
        if (isset($addmessage)) {
            message($addmessage);
        }
    }
    return $done;
}
开发者ID:danorama,项目名称:orsee,代码行数:49,代码来源:query.php


注:本文中的orsee_query函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。