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


PHP Question::find_by_id方法代码示例

本文整理汇总了PHP中Question::find_by_id方法的典型用法代码示例。如果您正苦于以下问题:PHP Question::find_by_id方法的具体用法?PHP Question::find_by_id怎么用?PHP Question::find_by_id使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Question的用法示例。


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

示例1: disable_survey

function disable_survey($id)
{
    $question = Question::find_by_id($id);
    $question->is_enabled = 'false';
    $question->update();
    echo "Survey disabled successfully...";
}
开发者ID:aarsee,项目名称:Drexel-Project,代码行数:7,代码来源:edit-survey-ajax.php

示例2: array

<?php

require_once "initialize.php";
$ja = array("id" => "nothing", "runda" => "nothing", "kategoria" => "nothing", "tresc" => "nothing", "odp_a" => "nothing", "odp_b" => "nothing", "odp_c" => "nothing", "odp_d" => "nothing", "poprawna" => "nothing", "link" => "nothing");
if (isset($_POST['id'])) {
    $question = Question::find_by_id($_POST['id']);
    $arr = array();
    foreach ($question as $key => $value) {
        $arr[] = $value;
    }
    $ja["id"] = $arr[0];
    $ja["runda"] = $arr[4];
    $ja["kategoria"] = $arr[5];
    $ja["tresc"] = $arr[6];
    $ja["odp_a"] = $arr[7];
    $ja["odp_b"] = $arr[8];
    $ja["odp_c"] = $arr[9];
    $ja["odp_d"] = $arr[10];
    $ja["poprawna"] = $arr[11];
    $ja["link"] = $arr[12];
}
// return the value to jQuery via ajax to confirm if the login was succesful
echo json_encode($ja);
开发者ID:qmmr,项目名称:wszechwiedzacy,代码行数:23,代码来源:get_question.php

示例3: envapi_get_html_for_reg_user

$user = User::find_by_id($_SESSION['user_id']);
?>

<?php 
$path = 'assets/images/profile_pic/' . $user->profile_pic;
echo envapi_get_html_for_reg_user('176644-3EaSQ9JhWGaxqDH2EJ91XS3smNIPajiD', $user->first_name, $user->last_name, $path, false, "HI");
?>

<?php 
//Count the no. of unread messages...
$count = User::count_unread_messages($_SESSION['user_id']);
?>

<?php 
if (isset($_GET['id'])) {
    $question = Question::find_by_id($_GET['id']);
    if ($question == '') {
        redirect_to('extra-404');
    }
}
?>

<?php 
if (isset($_POST['submit_option'])) {
    $survey_data_obj = new SurveyData();
    $survey_data_obj->respondent_id = $_SESSION['user_id'];
    $survey_data_obj->question_id = $_GET['id'];
    $survey_data_obj->option_id = $_POST['user_response'];
    $survey_data_obj->create();
}
?>
开发者ID:aarsee,项目名称:Drexel-Project,代码行数:31,代码来源:respond-survey.php


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