本文整理汇总了PHP中Vote::getValue方法的典型用法代码示例。如果您正苦于以下问题:PHP Vote::getValue方法的具体用法?PHP Vote::getValue怎么用?PHP Vote::getValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Vote
的用法示例。
在下文中一共展示了Vote::getValue方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: elseif
<?php
if ($answer->getType() == "radio") {
print 'name="formSurvey' . $question->getId() . 'Answer" ';
} else {
print 'name="formSurvey' . $question->getId() . 'Answer' . $answer->getId() . 'Type' . $answer->getType() . '" ';
}
?>
type="<?php
print $answer->getType();
?>
"
value="<?php
if ($answer->getType() == "radio" || $answer->getType() == "checkbox") {
print_r($answer_id);
} elseif ($answer->getType() == "text" && $has_answered == TRUE) {
print_r($vote->getValue());
}
?>
"
<?php
if ($has_answered == TRUE) {
if (($answer->getType() == "radio" || $answer->getType() == "checkbox") && !empty($user_vote_by_answer)) {
?>
checked="checked"
<?php
}
?>
disabled="disabled"
<?php
}
?>
示例2: foreach
$objPHPExcel->setActiveSheetIndex($sheetId)->setCellValue($cell, $cell_value);
// list votes by user
$columnId = 2;
foreach ($question_answers as $question_answer_id) {
$vote = new Vote();
$vote_id_array = $vote->get_by_user_and_answer($voted_user_id, $question_answer_id);
$cell_value = "";
$answer = new Answer();
$answer->get_from_db($question_answer_id);
if (!empty($vote_id_array)) {
$vote_id = $vote_id_array[0];
$vote->get_from_db($vote_id);
if ($answer->getType() == "radio" || $answer->getType() == "checkbox") {
$cell_value = 1;
} elseif ($answer->getType() == "text") {
$cell_value = $vote->getValue();
}
}
// fill in cell
$cell = divideBy26($columnId) . $row_id;
// Add some data
$objPHPExcel->setActiveSheetIndex($sheetId)->setCellValue($cell, $cell_value);
$objPHPExcel->getActiveSheet()->getStyle($cell)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
// increase column number
$columnId++;
}
// increase row number
$row_id++;
}
// create new sheet
$objPHPExcel->createSheet(NULL, $sheetId);