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


PHP Participant::load_with_participant_id方法代码示例

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


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

示例1: date

     include "../include/dbconnopen.php";
     $link_id_sqlsafe = mysqli_real_escape_string($cnnEnlace, $_POST['link_id']);
     $drop_from_program = "UPDATE Participants_Programs SET Date_Dropped='" . date('Y-m-d') . "' WHERE Participant_Program_ID='" . $link_id_sqlsafe . "'";
     echo $drop_from_program;
     mysqli_query($cnnEnlace, $drop_from_program);
     include "../include/dbconnclose.php";
 } else {
     include "../include/dbconnopen.php";
     $participant_sqlsafe = mysqli_real_escape_string($cnnEnlace, $_POST['participant']);
     $program_id_sqlsafe = mysqli_real_escape_string($cnnEnlace, $_POST['program_id']);
     $add_person_to_program = "INSERT INTO Participants_Programs (Participant_ID, Program_ID) VALUES ('{$participant_sqlsafe}', '{$program_id_sqlsafe}')";
     mysqli_query($cnnEnlace, $add_person_to_program);
     include "../include/dbconnclose.php";
     // Construct a participant object
     $participant = new Participant();
     $participant->load_with_participant_id($participant_sqlsafe);
     // Find the participants surveys are impact surveys from the last 6 months.
     $assessments = $participant->find_previous_surveys(6, Assessment::IMPACT_TYPE);
     print_r($assessments);
     if ($assessments) {
         // A survey exists, we should now duplicate the newest (first in array)
         $assessment = $assessments[0];
         // Removing the primary key will cause Assessment to create a new one on Assessment->save()
         $assessment->assessment_id = null;
         // Change the type and session
         $assessment->pre_post = Assessment::INTAKE_TYPE;
         $assessment->session_id = $program_id_sqlsafe;
         // Save this back to the database
         $assessment->save();
     }
 }
开发者ID:CompanyOnTheWorld,项目名称:lisc-ttm,代码行数:31,代码来源:join_program.php

示例2: Participant

$id_sqlsafe = mysqli_real_escape_string($cnnEnlace, $_GET['assessment']);
$person_sqlsafe = mysqli_real_escape_string($cnnEnlace, $_GET['person']);
/* if the assessment is not new, then Get['assessment'] exists, and this query returns the entered responses. */
$get_assessment_info = "SELECT * FROM Assessments \r\n                        LEFT JOIN Participants_Caring_Adults ON Caring_Id=Caring_Adults_ID\r\n                        LEFT JOIN Participants_Future_Expectations ON Future_Id=Future_Expectations_ID\r\n                        LEFT JOIN Participants_Interpersonal_Violence ON Violence_Id=Interpersonal_Violence_ID\r\n                        LEFT JOIN Programs ON Participants_Future_Expectations.Program=Programs.Program_ID\r\n                        WHERE Assessment_ID='" . $id_sqlsafe . "'";
$get_assessment = mysqli_query($cnnEnlace, $get_assessment_info);
$assessment_info = mysqli_fetch_array($get_assessment);
$caring_id = $assessment_info['Caring_ID'];
$baseline_id = $assessment_info['Baseline_ID'];
$future_id = $assessment_info['Future_ID'];
$violence_id = $assessment_info['Violence_ID'];
$person = new Participant();
$person->load_with_participant_id($assessment_info[1]);
/* if it IS a new assessment, then we get the person from the get[person]: */
if (!isset($_GET['assessment'])) {
    $person = new Participant();
    $person->load_with_participant_id($person_sqlsafe);
}
/* create a dropdown of the programs/sessions that the person is involved in. */
$get_programs = "SELECT * FROM Participants_Programs\r\n            INNER JOIN Session_Names ON Participants_Programs.Program_ID=Session_Names.Session_ID \r\n            INNER JOIN Programs ON Session_Names.Program_ID=Programs.Program_ID\r\n            WHERE Participants_Programs.Participant_ID='" . $person->participant_id . "'";
$programs = mysqli_query($cnnEnlace, $get_programs);
?>
<h4>Program Impact Survey - <?php 
echo $person->first_name . " " . $person->last_name;
?>
</h4>

<div style="text-align:center;"><span class="helptext">Program: </span>
    <select id="program">
        <option value="">-------</option>
        <?php 
while ($program = mysqli_fetch_array($programs)) {
开发者ID:CompanyOnTheWorld,项目名称:lisc-ttm,代码行数:31,代码来源:all_impact.php

示例3: VALUES

     $child_sqlsafe = mysqli_real_escape_string($cnnEnlace, $_POST['child']);
     $add_relative = "INSERT INTO Child_Parent (Parent_ID, Child_ID)\r\n                VALUES ('" . $id . "', '" . $child_sqlsafe . "')";
     include "../include/dbconnopen.php";
     mysqli_query($cnnEnlace, $add_relative);
     include "../include/dbconnclose.php";
 }
 /* add a participant to the people in a program */
 if ($_POST['action'] == 'add_program') {
     include "../include/dbconnopen.php";
     $program_id_sqlsafe = mysqli_real_escape_string($cnnEnlace, $_POST['program_id']);
     $add_person_to_program = "INSERT INTO Participants_Programs (Participant_ID, Program_ID) VALUES ('{$id}', '{$program_id_sqlsafe}')";
     mysqli_query($cnnEnlace, $add_person_to_program);
     include "../include/dbconnclose.php";
     // Construct a participant object
     $participant = new Participant();
     $participant->load_with_participant_id($id);
     // Find the participants surveys are impact surveys from the last 6 months.
     $assessments = $participant->find_previous_surveys(6, Assessment::IMPACT_TYPE);
     if ($assessments) {
         // A survey exists, we should now duplicate the newest (first in array)
         $assessment = $assessments[0];
         // Removing the primary key will cause Assessment to create a new one on Assessment->save()
         $assessment->assessment_id = null;
         // Change the type and session
         $assessment->pre_post = Assessment::INTAKE_TYPE;
         $assessment->session_id = $program_id_sqlsafe;
         // Save this back to the database
         $assessment->save();
     }
 }
 ?>
开发者ID:CompanyOnTheWorld,项目名称:lisc-ttm,代码行数:31,代码来源:add_participant.php

示例4: Participant

    $responses = mysqli_query($cnnLSNA, $get_responses);
    $response = mysqli_fetch_array($responses);
}
?>
<h4><?php 
/*if this is a new survey, get[survey] will not be set, and "new" will appear: */
if (!isset($_GET['survey'])) {
    ?>
New <?php 
}
?>
 Survey<?php 
if (isset($_COOKIE['participant'])) {
    include "../classes/participants.php";
    $parti = new Participant();
    $parti->load_with_participant_id($_COOKIE['participant']);
    echo " - " . $parti->full_name;
}
?>
</h4>
<table class="pm_survey">
    <tr><td class="pm_survey question" width="65%">1. School Name</td>
        <td class="pm_survey response"><select id="new_school">
                <option value="">----------</option>
                <?php 
$get_schools = "SELECT * FROM Institutions WHERE Institution_Type='1'";
include "../include/dbconnopen.php";
$schools = mysqli_query($cnnLSNA, $get_schools);
while ($school = mysqli_fetch_array($schools)) {
    ?>
                        <option value="<?php 
开发者ID:CompanyOnTheWorld,项目名称:lisc-ttm,代码行数:31,代码来源:new_pm_teacher_survey.php

示例5: array

$id_sqlsafe = mysqli_real_escape_string($cnnEnlace, $_GET['id']);
$participant_program_list = "SELECT Session_Names.*, Name FROM Session_Names INNER JOIN Participants_Programs ON Session_Names.Session_ID = Participants_Programs.Program_ID INNER JOIN Programs ON Session_Names.Program_ID = Programs.Program_ID WHERE Participant_Id = " . $id_sqlsafe . " ORDER BY Name;";
$access_to_participant = mysqli_query($cnnEnlace, $participant_program_list);
$program_array = array();
while ($program = mysqli_fetch_array($access_to_participant)) {
    $program_array[] = $program['Program_ID'];
}
$USER->enforce_access_program_array($Enlace_id, $program_array);
/* This page shows all the information about a person in one place.
 * The participant id comes in through a Get.
 */
include "../include/datepicker_wtw.php";
//get participant info
include "../classes/participant.php";
$person = new Participant();
$person->load_with_participant_id($_GET['id']);
/* Get role here.  The role determines what elements show on the page.s */
$get_role = "SELECT Role FROM Roles WHERE Role_ID = {$person->role}";
include "../include/dbconnopen.php";
if ($this_role = mysqli_query($cnnEnlace, $get_role)) {
    $role = mysqli_fetch_array($this_role);
}
include "../include/dbconnclose.php";
?>

<script type="text/javascript">
    $(document).ready(function() {
        $('#participants_selector').addClass('selected');
        $('#ajax_loader').hide();
        $('#add_date').hide();
        $('#add_referral').hide();
开发者ID:CompanyOnTheWorld,项目名称:lisc-ttm,代码行数:31,代码来源:participant_profile.php


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