本文整理匯總了PHP中DBGet函數的典型用法代碼示例。如果您正苦於以下問題:PHP DBGet函數的具體用法?PHP DBGet怎麽用?PHP DBGet使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了DBGet函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: MailingLabel
function MailingLabel($address_id)
{
global $THIS_RET, $_openSIS;
$student_id = $THIS_RET['STUDENT_ID'];
if ($address_id && !$_openSIS['MailingLabel'][$address_id][$student_id]) {
$p_sql = 'SELECT sa.ID AS ADDRESS_ID,p.STAFF_ID AS PERSON_ID,
coalesce((SELECT STREET_ADDRESS_1 FROM student_address WHERE STUDENT_ID=sa.STUDENT_ID AND TYPE =\'MAIL\'),sa.STREET_ADDRESS_1) AS ADDRESS,
coalesce((SELECT CITY FROM student_address WHERE STUDENT_ID=sa.STUDENT_ID AND TYPE =\'MAIL\'),sa.CITY) AS CITY,
coalesce((SELECT STATE FROM student_address WHERE STUDENT_ID=sa.STUDENT_ID AND TYPE =\'MAIL\'),sa.STATE) AS STATE,
coalesce((SELECT ZIPCODE FROM student_address WHERE STUDENT_ID=sa.STUDENT_ID AND TYPE =\'MAIL\'),sa.ZIPCODE) AS ZIPCODE,
s.PHONE,p.LAST_NAME,p.FIRST_NAME,p.MIDDLE_NAME
FROM student_address sa,people p,students s
WHERE p.STAFF_ID=sa.PEOPLE_ID AND s.STUDENT_ID=sa.STUDENT_ID AND sa.STUDENT_ID=\'' . $student_id . '\' AND p.CUSTODY=\'Y\'';
$people_RET = DBGet(DBQuery($p_sql), array(), array('LAST_NAME'));
if (count($people_RET)) {
foreach ($people_RET as $last_name => $people) {
for ($i = 1; $i < count($people); $i++) {
$return .= $people[$i]['FIRST_NAME'] . ' & ';
}
$return .= $people[$i]['FIRST_NAME'] . ' ' . $people[$i]['LAST_NAME'] . '<BR>';
}
// mab - this is a bit of a kludge but insert an html comment so people and address can be split later
$return .= '<!-- -->' . $people[$i]['ADDRESS'] . '<BR>' . $people[$i]['CITY'] . ', ' . $people[$i]['STATE'] . ' ' . $people[$i]['ZIPCODE'];
}
$_openSIS['MailingLabel'][$address_id][$student_id] = $return;
}
return $_openSIS['MailingLabel'][$address_id][$student_id];
}
示例2: GetCurrentMP
function GetCurrentMP($mp, $date, $error = true)
{
global $_openSIS;
switch ($mp) {
case 'FY':
$table = 'school_years';
break;
case 'SEM':
$table = 'school_semesters';
break;
case 'QTR':
$table = 'school_quarters';
break;
case 'PRO':
$table = 'school_progress_periods';
break;
}
if (!$_openSIS['GetCurrentMP'][$date][$mp]) {
$_openSIS['GetCurrentMP'][$date][$mp] = DBGet(DBQuery('SELECT MARKING_PERIOD_ID FROM ' . $table . ' WHERE \'' . $date . '\' BETWEEN START_DATE AND END_DATE AND SYEAR=\'' . UserSyear() . '\' AND SCHOOL_ID=\'' . UserSchool() . '\''));
}
if ($_openSIS['GetCurrentMP'][$date][$mp][1]['MARKING_PERIOD_ID']) {
return $_openSIS['GetCurrentMP'][$date][$mp][1]['MARKING_PERIOD_ID'];
} elseif (strpos($_SERVER['PHP_SELF'], 'Side.php') === false && $error == true) {
ErrorMessage(array('' . _("You are not currently in a marking period") . ''));
}
//ShowErr("You are not currently in a marking period");
}
示例3: AllowUse
function AllowUse($modname = false)
{
global $_openSIS;
if (!$modname) {
$modname = $_REQUEST['modname'];
}
if ($modname == 'Students/Student.php' && $_REQUEST['category_id']) {
$modname = $modname . '&category_id=' . $_REQUEST['category_id'];
}
if (!$_openSIS['AllowUse']) {
if (User('PROFILE_ID') != '') {
$_openSIS['AllowUse'] = DBGet(DBQuery("SELECT MODNAME FROM PROFILE_EXCEPTIONS WHERE PROFILE_ID='" . User('PROFILE_ID') . "' AND CAN_USE='Y'"), array(), array('MODNAME'));
} else {
$_openSIS['AllowUse'] = DBGet(DBQuery("SELECT MODNAME FROM STAFF_EXCEPTIONS WHERE USER_ID='" . User('STAFF_ID') . "' AND CAN_USE='Y'"), array(), array('MODNAME'));
}
}
if (!$_openSIS['AllowUse']) {
$_openSIS['AllowUse'] = array(true);
}
if (count($_openSIS['AllowUse'][$modname])) {
return true;
} else {
return false;
}
}
示例4: GetCurrentMP
function GetCurrentMP($mp, $date, $error = true)
{
global $_openSIS;
switch ($mp) {
case 'FY':
$table = 'SCHOOL_YEARS';
break;
case 'SEM':
$table = 'SCHOOL_SEMESTERS';
break;
case 'QTR':
$table = 'SCHOOL_QUARTERS';
break;
case 'PRO':
$table = 'SCHOOL_PROGRESS_PERIODS';
break;
}
if (!$_openSIS['GetCurrentMP'][$date][$mp]) {
$_openSIS['GetCurrentMP'][$date][$mp] = DBGet(DBQuery("SELECT MARKING_PERIOD_ID FROM {$table} WHERE '{$date}' BETWEEN START_DATE AND END_DATE AND SYEAR='" . UserSyear() . "' AND SCHOOL_ID='" . UserSchool() . "'"));
}
if ($_openSIS['GetCurrentMP'][$date][$mp][1]['MARKING_PERIOD_ID']) {
return $_openSIS['GetCurrentMP'][$date][$mp][1]['MARKING_PERIOD_ID'];
} elseif (strpos($_SERVER['PHP_SELF'], 'Side.php') === false && $error == true) {
ErrorMessage(array("You are not currently in a marking period"));
}
//ShowErr("You are not currently in a marking period");
}
示例5: GetStaffList
function GetStaffList(&$extra)
{
global $profiles_RET;
$functions = array('PROFILE' => 'makeProfile');
switch (User('PROFILE')) {
case 'admin':
$profiles_RET = DBGet(DBQuery("SELECT * FROM USER_PROFILES"), array(), array('ID'));
$sql = "SELECT CONCAT(\n\t\t\t\t\tCOALESCE(s.LAST_NAME,' '),', ',COALESCE(s.FIRST_NAME,' '),' ',COALESCE(s.MIDDLE_NAME,' ')) AS FULL_NAME,\n\t\t\t\t\ts.PROFILE,s.PROFILE_ID,s.STAFF_ID,s.SCHOOLS " . $extra['SELECT'] . "\n\t\t\t\tFROM\n\t\t\t\t\tSTAFF s " . $extra['FROM'] . "\n\t\t\t\tWHERE\n\t\t\t\t\ts.SYEAR='" . UserSyear() . "'";
if ($_REQUEST['_search_all_schools'] != 'Y') {
$sql .= " AND (s.SCHOOLS LIKE '%," . UserSchool() . ",%' OR s.SCHOOLS IS NULL OR s.SCHOOLS='') ";
}
if ($_REQUEST['username']) {
$sql .= "AND UPPER(s.USERNAME) LIKE '" . strtoupper($_REQUEST['username']) . "%' ";
}
if ($_REQUEST['last']) {
$sql .= "AND UPPER(s.LAST_NAME) LIKE '" . strtoupper($_REQUEST['last']) . "%' ";
}
if ($_REQUEST['first']) {
$sql .= "AND UPPER(s.FIRST_NAME) LIKE '" . strtoupper($_REQUEST['first']) . "%' ";
}
if ($_REQUEST['profile']) {
$sql .= "AND s.PROFILE='" . $_REQUEST['profile'] . "' ";
}
$sql .= $extra['WHERE'] . ' ';
$sql .= "ORDER BY FULL_NAME";
if ($extra['functions']) {
$functions += $extra['functions'];
}
return DBGet(DBQuery($sql), $functions);
break;
}
}
示例6: AllowUse
function AllowUse($modname = false)
{
global $_openSIS;
if (!$modname) {
$modname = $_REQUEST['modname'];
}
if ($modname == 'Students/Student.php' && $_REQUEST['category_id']) {
$modname = $modname . '&category_id=' . $_REQUEST['category_id'];
}
if (!$_openSIS['AllowUse']) {
if (User('PROFILE_ID') != '') {
$_openSIS['AllowUse'] = DBGet(DBQuery('SELECT MODNAME FROM profile_exceptions WHERE PROFILE_ID=\'' . User('PROFILE_ID') . '\' AND CAN_USE=\'Y\''), array(), array('MODNAME'));
} else {
$_openSIS['AllowUse'] = DBGet(DBQuery('SELECT MODNAME FROM staff_exceptions WHERE USER_ID=\'' . User('STAFF_ID') . '\' AND CAN_USE=\'Y\''), array(), array('MODNAME'));
}
}
if (!$_openSIS['AllowUse']) {
$_openSIS['AllowUse'] = array(true);
}
if (count($_openSIS['AllowUse'][$modname])) {
return true;
} else {
return false;
}
}
示例7: UpdateAttendanceDaily
function UpdateAttendanceDaily($student_id, $date = '', $comment = false)
{
$daysWeek = _('SuMoTuWeThFrSa');
/// Days of the week
if (!$date) {
$date = DBDate();
}
$sql = "SELECT\n\t\t\t\tsum(sp.LENGTH) AS TOTAL\n\t\t\tFROM SCHEDULE s,COURSE_PERIODS cp,SCHOOL_PERIODS sp,ATTENDANCE_CALENDAR ac\n\t\t\tWHERE\n\t\t\t\ts.COURSE_PERIOD_ID = cp.COURSE_PERIOD_ID AND position(',0,' IN cp.DOES_ATTENDANCE)>0\n\t\t\t\tAND ac.SCHOOL_DATE='{$date}' AND (ac.BLOCK=sp.BLOCK OR sp.BLOCK IS NULL)\n\t\t\t\tAND ac.CALENDAR_ID=cp.CALENDAR_ID AND ac.SCHOOL_ID=s.SCHOOL_ID AND ac.SYEAR=s.SYEAR\n\t\t\t\tAND s.SYEAR = cp.SYEAR AND sp.PERIOD_ID = cp.PERIOD_ID\n\t\t\t\tAND position(substring('{$daysWeek}' FROM cast(extract(DOW FROM cast('{$date}' AS DATE)) AS INT)*2+1 FOR 2) IN cp.DAYS)>0\n\t\t\t\tAND s.STUDENT_ID='{$student_id}'\n\t\t\t\tAND s.SYEAR='" . UserSyear() . "'\n\t\t\t\tAND ('{$date}' BETWEEN s.START_DATE AND s.END_DATE OR (s.END_DATE IS NULL AND '{$date}'>=s.START_DATE))\n\t\t\t\tAND s.MARKING_PERIOD_ID IN (" . GetAllMP('QTR', GetCurrentMP('QTR', $date)) . ")\n\t\t\t";
$RET = DBGet(DBQuery($sql));
$total = $RET[1]['TOTAL'];
if ($total == 0) {
return;
}
$sql = "SELECT sum(sp.LENGTH) AS TOTAL\n\t\t\tFROM ATTENDANCE_PERIOD ap,SCHOOL_PERIODS sp,ATTENDANCE_CODES ac\n\t\t\tWHERE ap.STUDENT_ID='{$student_id}' AND ap.SCHOOL_DATE='{$date}' AND ap.PERIOD_ID=sp.PERIOD_ID AND ac.ID = ap.ATTENDANCE_CODE AND ac.STATE_CODE='A'\n\t\t\tAND sp.SYEAR='" . UserSyear() . "'";
$RET = DBGet(DBQuery($sql));
$total -= $RET[1]['TOTAL'];
$sql = "SELECT sum(sp.LENGTH) AS TOTAL\n\t\t\tFROM ATTENDANCE_PERIOD ap,SCHOOL_PERIODS sp,ATTENDANCE_CODES ac\n\t\t\tWHERE ap.STUDENT_ID='{$student_id}' AND ap.SCHOOL_DATE='{$date}' AND ap.PERIOD_ID=sp.PERIOD_ID AND ac.ID = ap.ATTENDANCE_CODE AND ac.STATE_CODE='H'\n\t\t\tAND sp.SYEAR='" . UserSyear() . "'";
$RET = DBGet(DBQuery($sql));
$total -= $RET[1]['TOTAL'] * 0.5;
if ($total >= 300) {
$length = '1.0';
} elseif ($total >= 150) {
$length = '.5';
} else {
$length = '0.0';
}
$current_RET = DBGet(DBQuery("SELECT MINUTES_PRESENT,STATE_VALUE,COMMENT FROM ATTENDANCE_DAY WHERE STUDENT_ID='{$student_id}' AND SCHOOL_DATE='{$date}'"));
if (count($current_RET) && $current_RET[1]['MINUTES_PRESENT'] != $total) {
DBQuery("UPDATE ATTENDANCE_DAY SET MINUTES_PRESENT='{$total}',STATE_VALUE='{$length}'" . ($comment !== false ? ",COMMENT='" . str_replace("\\'", "''", $comment) . "'" : '') . " WHERE STUDENT_ID='{$student_id}' AND SCHOOL_DATE='{$date}'");
} elseif (count($current_RET) && $comment !== false && $current_RET[1]['COMMENT'] != $comment) {
DBQuery("UPDATE ATTENDANCE_DAY SET COMMENT='" . str_replace("\\'", "''", $comment) . "' WHERE STUDENT_ID='{$student_id}' AND SCHOOL_DATE='{$date}'");
} elseif (count($current_RET) == 0) {
DBQuery("INSERT INTO ATTENDANCE_DAY (SYEAR,STUDENT_ID,SCHOOL_DATE,MINUTES_PRESENT,STATE_VALUE,MARKING_PERIOD_ID,COMMENT) values('" . UserSyear() . "','{$student_id}','{$date}','{$total}','{$length}','" . GetCurrentMP('QTR', $date) . "','" . str_replace("\\'", "''", $comment) . "')");
}
}
示例8: GetCpDet
function GetCpDet($cp_id, $key)
{
if ($key != '' && $cp_id != '') {
$get_det = DBGet(DBQuery('SELECT ' . strtoupper($key) . ' FROM course_periods WHERE COURSE_PERIOD_ID=' . $cp_id));
}
return $get_det[1][strtoupper($key)];
}
示例9: GetSyear
function GetSyear($date)
{
//$RET = DBGet(DBQuery("SELECT SYEAR FROM ATTENDANCE_CALENDAR WHERE SCHOOL_DATE = '$date' AND DEFAULT_CALENDAR='Y'"));
//$RET = DBGet(DBQuery("SELECT SYEAR FROM SCHOOL_MARKING_PERIODS WHERE MP='FY' AND '".$date."' BETWEEN START_DATE AND END_DATE"));
$RET = DBGet(DBQuery("SELECT max(SYEAR) AS SYEAR FROM SCHOOL_MARKING_PERIODS WHERE MP='FY' AND START_DATE<='" . $date . "'"));
return $RET[1]['SYEAR'];
}
示例10: enrol_manual_enrol_users_object
function enrol_manual_enrol_users_object()
{
//first, gather the necessary variables
global $student_id, $course_period;
//then, convert variables for the Moodle object:
/*
list of (
object {
roleid int //Role to assign to the user
userid int //The user that is going to be enrolled
courseid int //The course to enrol the user role in
timestart int Optionnel //Timestamp when the enrolment start
timeend int Optionnel //Timestamp when the enrolment end
suspend int Optionnel //set to 1 to suspend the enrolment
}
)*/
//student's roleid = student = 5
$roleid = 5;
//get the Moodle user ID
$userid = DBGet(DBQuery("SELECT moodle_id FROM moodlexrosario WHERE rosario_id='" . $student_id . "' AND \"column\"='student_id'"));
if (count($userid)) {
$userid = (int) $userid[1]['MOODLE_ID'];
} else {
return null;
}
//gather the Moodle course ID
$courseid = DBGet(DBQuery("SELECT moodle_id FROM moodlexrosario WHERE rosario_id='" . $course_period['COURSE_PERIOD_ID'] . "' AND \"column\"='course_period_id'"));
if (count($courseid)) {
$courseid = (int) $courseid[1]['MOODLE_ID'];
} else {
return null;
}
$enrolments = array(array('roleid' => $roleid, 'userid' => $userid, 'courseid' => $courseid));
return array($enrolments);
}
示例11: MailingLabel
function MailingLabel($address_id)
{
global $THIS_RET, $_openSIS;
$student_id = $THIS_RET['STUDENT_ID'];
if ($address_id && !$_openSIS['MailingLabel'][$address_id][$student_id]) {
$people_RET = DBGet(DBQuery('SELECT a.ADDRESS_ID,p.PERSON_ID,
coalesce(a.MAIL_ADDRESS,a.ADDRESS) AS ADDRESS,coalesce(a.MAIL_CITY,a.CITY) AS CITY,coalesce(a.MAIL_STATE,a.STATE) AS STATE,coalesce(a.MAIL_ZIPCODE,a.ZIPCODE) AS ZIPCODE,a.PHONE,
p.LAST_NAME,p.FIRST_NAME,p.MIDDLE_NAME
FROM address a,people p,students_join_people sjp
WHERE a.ADDRESS_ID=\'' . $address_id . '\' AND a.ADDRESS_ID=sjp.ADDRESS_ID AND p.PERSON_ID=sjp.PERSON_ID
AND sjp.CUSTODY=\'Y\' AND sjp.STUDENT_ID=\'' . $student_id . '\''), array(), array('LAST_NAME'));
if (count($people_RET)) {
foreach ($people_RET as $last_name => $people) {
for ($i = 1; $i < count($people); $i++) {
$return .= $people[$i]['FIRST_NAME'] . ' & ';
}
$return .= $people[$i]['FIRST_NAME'] . ' ' . $people[$i]['LAST_NAME'] . '<BR>';
}
// mab - this is a bit of a kludge but insert an html comment so people and address can be split later
$return .= '<!-- -->' . $people[$i]['ADDRESS'] . '<BR>' . $people[$i]['CITY'] . ', ' . $people[$i]['STATE'] . ' ' . $people[$i]['ZIPCODE'];
} else {
$address_ret = DBGet(DBQuery('SELECT coalesce(MAIL_ADDRESS,ADDRESS) as ADDRESS,coalesce(MAIL_CITY,CITY) AS CITY,coalesce(MAIL_STATE,STATE) AS STATE,coalesce(MAIL_ZIPCODE,ZIPCODE) AS ZIPCODE FROM address WHERE ADDRESS_ID=\'' . $address_id . '\''));
$return .= '<!-- -->' . $address_ret[1]['ADDRESS'] . '<BR>' . $address_ret[1]['CITY'] . ', ' . $address_ret[1]['STATE'] . ' ' . $address_ret[1]['ZIPCODE'];
}
$_openSIS['MailingLabel'][$address_id][$student_id] = $return;
}
return $_openSIS['MailingLabel'][$address_id][$student_id];
}
示例12: DeCodeds
function DeCodeds($value, $column)
{
global $_openSIS;
$field = substr($column, 7);
if (!$_openSIS['DeCodeds'][$field]) {
$select_options = DBGet(DBQuery('SELECT SELECT_OPTIONS FROM custom_fields WHERE ID=\'' . $field . '\''));
$select_options = str_replace("\n", "\r", str_replace("\r\n", "\r", $select_options[1]['SELECT_OPTIONS']));
$select_options = explode("\r", $select_options);
foreach ($select_options as $option) {
$option = explode('|', $option);
if ($option[0] != '' && $option[1] != '') {
$options[$option[0]] = $option[1];
}
}
if (count($options)) {
$_openSIS['DeCodeds'][$field] = $options;
} else {
$_openSIS['DeCodeds'][$field] = true;
}
}
if ($value != '') {
if ($_openSIS['DeCodeds'][$field][$value] != '') {
return $_openSIS['DeCodeds'][$field][$value];
} else {
return "<FONT color=red>{$value}</FONT>";
}
} else {
return '';
}
}
示例13: core_user_update_users_object
function core_user_update_users_object()
{
//first, gather the necessary variables
global $_REQUEST;
//gather the Moodle user ID
if (User('PROFILE') == 'student') {
$rosario_id = UserStudentID();
$moodle_id = DBGet(DBQuery("SELECT moodle_id FROM moodlexrosario WHERE rosario_id='" . $rosario_id . "' AND \"column\"='student_id'"));
} else {
$rosario_id = User('STAFF_ID');
$moodle_id = DBGet(DBQuery("SELECT moodle_id FROM moodlexrosario WHERE rosario_id='" . $rosario_id . "' AND \"column\"='staff_id'"));
}
if (count($moodle_id)) {
$moodle_id = (double) $moodle_id[1]['MOODLE_ID'];
} else {
return '';
}
//then, convert variables for the Moodle object:
/*
list of (
object {
id double //ID of the user
password string Optional //Plain text password consisting of any characters
//note Francois: the password must respect the Moodle policy: 8 chars min., 1 number, 1 min, 1 maj and 1 non-alphanum at least.
}
)
*/
$password = $_REQUEST['values']['new'];
$users = array(array('id' => $moodle_id, 'password' => $password));
return array($users);
}
示例14: PortalPollsDisplay
function PortalPollsDisplay($value, $name)
{
global $THIS_RET;
static $js_included = false;
$poll_id = $THIS_RET['ID'];
//get poll:
$poll_RET = DBGet(DBQuery("SELECT EXCLUDED_USERS, VOTES_NUMBER, DISPLAY_VOTES FROM PORTAL_POLLS WHERE ID='" . $poll_id . "'"));
$poll_questions_RET = DBGet(DBQuery("SELECT ID, QUESTION, OPTIONS, TYPE, VOTES FROM PORTAL_POLL_QUESTIONS WHERE PORTAL_POLL_ID='" . $poll_id . "' ORDER BY ID"));
if (!$poll_RET || !$poll_questions_RET) {
return ErrorMessage(array('Poll does not exist'));
}
//should never be displayed, so do not translate
//verify if user is in excluded users list (format = '|[profile_id]:[user_id]')
$profile_id = User('PROFILE_ID');
if ($profile_id != 0) {
//modif Francois: call right Student/Staff ID
$user_id = UserStaffID();
} else {
$user_id = UserStudentID();
}
$excluded_user = '|' . $profile_id . ':' . $user_id;
if (mb_strpos($poll_RET[1]['EXCLUDED_USERS'], $excluded_user) !== false) {
return PortalPollsVotesDisplay($poll_id, $poll_RET[1]['DISPLAY_VOTES'], $poll_questions_RET, $poll_RET[1]['VOTES_NUMBER']);
}
//user already voted, display votes
$PollForm = '';
if (!$js_included) {
$PollForm .= includeOnceJquery();
$PollForm .= '<script type="text/javascript" src="assets/js/jquery.form.js"></script>';
$PollForm .= '<script type="text/javascript">
$(document).ready(function() {
$(\'.formPortalPoll\').ajaxForm({ //send the votes in AJAX
success: function(data,status,xhr,form) {
$(form).parent().html(data);
}
});
});
</script>';
$js_included = true;
}
$PollForm .= '<div id="divPortalPoll' . $poll_id . '" style="max-height:350px; overflow-y:auto;"><form method="POST" class="formPortalPoll" action="ProgramFunctions/PortalPolls.fnc.php"><input type="hidden" name="profile_id" value="' . $profile_id . '" /><input type="hidden" name="user_id" value="' . $user_id . '" /><input type="hidden" name="total_votes_string" value="' . _('Total Participants') . '" /><input type="hidden" name="poll_completed_string" value="' . _('Poll completed') . '" /><TABLE class="width-100p cellspacing-0">';
foreach ($poll_questions_RET as $question) {
$PollForm .= '<TR><TD><b>' . $question['QUESTION'] . '</b></TD><TD><TABLE class="width-100p cellspacing-0">';
$options_array = explode('<br />', nl2br($question['OPTIONS']));
$checked = true;
foreach ($options_array as $option_nb => $option_label) {
if ($question['TYPE'] == 'multiple_radio') {
$PollForm .= '<TR><TD><label><input type="radio" name="votes[' . $poll_id . '][' . $question['ID'] . ']" value="' . $option_nb . '" ' . ($checked ? 'checked' : '') . ' /> ' . $option_label . '</label></TD></TR>' . "\n";
} else {
//multiple
$PollForm .= '<TR><TD><label><input type="checkbox" name="votes[' . $poll_id . '][' . $question['ID'] . '][]" value="' . $option_nb . '" /> ' . $option_label . '</label></TD></TR>' . "\n";
}
$checked = false;
}
$PollForm .= '</TABLE></TD></TR>';
}
$PollForm .= '</TD></TR></TABLE><P><input type="submit" value="' . _('Submit') . '" /></P></form></div>';
return $PollForm;
}
示例15: _makeCalendar
function _makeCalendar($value, $column)
{
global $THIS_RET, $_CENTRE, $calendars_RET;
if (!$calendars_RET) {
$calendars_RET = DBGet(DBQuery("SELECT CALENDAR_ID,DEFAULT_CALENDAR,TITLE FROM ATTENDANCE_CALENDARS WHERE SYEAR='" . UserSyear() . "'"), array(), array('CALENDAR_ID'));
}
return $calendars_RET[$value][1]['TITLE'];
}