本文整理汇总了PHP中HTML_Table::setCellContents方法的典型用法代码示例。如果您正苦于以下问题:PHP HTML_Table::setCellContents方法的具体用法?PHP HTML_Table::setCellContents怎么用?PHP HTML_Table::setCellContents使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HTML_Table
的用法示例。
在下文中一共展示了HTML_Table::setCellContents方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: imprimirFormularioLogin
/**
* Muestra el formulario para iniciar sesión.
*/
private function imprimirFormularioLogin()
{
imprimirTabulados(5);
echo '<div class="tablaTituloBotones">';
imprimirTabulados(6);
echo '<h2>Iniciar sesión</h2>';
imprimirTabulados(6);
echo '<form action="index.php" method="post">';
imprimirTabulados(6);
echo '<fieldset class="login">';
imprimirTabulados(6);
$clase = array('class' => 'tablaCarga');
$tabla = new HTML_Table($clase);
$tabla->setAutoGrow(true);
$tabla->setHeaderContents(0, 0, 'Usuario');
$tabla->setCellContents(0, 1, '<input class="campoTexto campoTextoAlineado" type="text" name="username" value="" />');
$tabla->setHeaderContents(1, 0, 'Contraseña');
$tabla->setCellContents(1, 1, '<input class="campoTexto campoTextoAlineado" type="password" name="password" value="" />');
$tabla->setColAttributes(0, $clase);
$tabla->setColAttributes(1, $clase);
echo $tabla->toHtml();
imprimirTabulados(6);
echo '<br /><input type="submit" name="botonIniciarSesion" value="Iniciar sesión" >';
imprimirTabulados(6);
echo '</fieldset>';
imprimirTabulados(6);
echo '</form>';
imprimirTabulados(5);
echo '</div>';
}
示例2: lp_upload_quiz_main
function lp_upload_quiz_main()
{
// variable initialisation
$lp_id = isset($_GET['lp_id']) ? intval($_GET['lp_id']) : null;
$form = new FormValidator('upload', 'POST', api_get_self() . '?' . api_get_cidreq() . '&lp_id=' . $lp_id, '', array('enctype' => 'multipart/form-data'));
$form->addElement('header', get_lang('ImportExcelQuiz'));
$form->addElement('file', 'user_upload_quiz', get_lang('FileUpload'));
$link = '<a href="../exercice/quiz_template.xls">' . Display::return_icon('export_excel.png', get_lang('DownloadExcelTemplate')) . get_lang('DownloadExcelTemplate') . '</a>';
$form->addElement('label', '', $link);
$table = new HTML_Table(array('class' => 'table'));
$tableList = array(UNIQUE_ANSWER => get_lang('UniqueSelect'), MULTIPLE_ANSWER => get_lang('MultipleSelect'), FILL_IN_BLANKS => get_lang('FillBlanks'), MATCHING => get_lang('Matching'), FREE_ANSWER => get_lang('FreeAnswer'), GLOBAL_MULTIPLE_ANSWER => get_lang('GlobalMultipleAnswer'));
$table->setHeaderContents(0, 0, get_lang('QuestionType'));
$table->setHeaderContents(0, 1, '#');
$row = 1;
foreach ($tableList as $key => $label) {
$table->setCellContents($row, 0, $label);
$table->setCellContents($row, 1, $key);
$row++;
}
$table = $table->toHtml();
$form->addElement('label', get_lang('QuestionType'), $table);
$form->addElement('checkbox', 'user_custom_score', null, get_lang('UseCustomScoreForAllQuestions'), array('id' => 'user_custom_score'));
$form->addElement('html', '<div id="options" style="display:none">');
$form->addElement('text', 'correct_score', get_lang('CorrectScore'));
$form->addElement('text', 'incorrect_score', get_lang('IncorrectScore'));
$form->addElement('html', '</div>');
$form->addRule('user_upload_quiz', get_lang('ThisFieldIsRequired'), 'required');
$form->add_progress_bar();
$form->addButtonUpload(get_lang('Upload'), 'submit_upload_quiz');
// Display the upload field
$form->display();
}
示例3: show_html
public function show_html()
{
$sections = array('chamilo', 'php', 'database', 'webserver', 'paths');
$currentSection = isset($_GET['section']) ? $_GET['section'] : 'chamilo';
if (!in_array(trim($currentSection), $sections)) {
$currentSection = 'chamilo';
}
$html = '<div class="tabbable"><ul class="nav nav-tabs">';
foreach ($sections as $section) {
if ($currentSection === $section) {
$html .= '<li class="active">';
} else {
$html .= '<li>';
}
$params['section'] = $section;
$html .= '<a href="system_status.php?section=' . $section . '">' . get_lang($section) . '</a></li>';
}
$html .= '</ul><div class="tab-pane">';
$data = call_user_func(array($this, 'get_' . $currentSection . '_data'));
echo $html;
if ($currentSection != 'paths') {
$table = new SortableTableFromArray($data, 1, 100);
$table->set_header(0, '', false);
$table->set_header(1, get_lang('Section'), false);
$table->set_header(2, get_lang('Setting'), false);
$table->set_header(3, get_lang('Current'), false);
$table->set_header(4, get_lang('Expected'), false);
$table->set_header(5, get_lang('Comment'), false);
$table->display();
} else {
$headers = $data['headers'];
$results = $data['data'];
$table = new HTML_Table(array('class' => 'data_table'));
$column = 0;
foreach ($headers as $header) {
$table->setHeaderContents(0, $column, $header);
$column++;
}
$row = 1;
foreach ($results as $index => $rowData) {
$table->setCellContents($row, 0, $rowData);
$table->setCellContents($row, 1, $index);
$row++;
}
echo $table->display();
}
echo '</div></div>';
}
示例4: filaTablaHorasAsignadasEditar
private function filaTablaHorasAsignadasEditar($horario, $fila)
{
// Debe sumarse uno a la fila porque la fila 0 es la cabecera
$this->tabla->setCellContents($fila + 1, 0, $this->formulario . $horario->getArea()->getNombreArea());
$this->tabla->setCellContents($fila + 1, 1, '<input class="campoTexto campoTextoChico" type="text" name="cantidadHoras" size="4" value="' . $horario->getHorasAsignadas() . '" />');
$this->tabla->setCellContents($fila + 1, 2, $horario->getHorasActualmenteAsignadas());
$this->tabla->setCellContents($fila + 1, 3, $this->accionesFilaTablaHorasAsignadasEditar($horario->getArea()->getIdArea()));
$this->tabla->setRowAttributes($fila + 1, $this->clase, false);
}
示例5: viewList
/**
* View list
*
* @author John.meng
* @since version1.0 - Dec 12, 2005
*/
function viewList()
{
global $__Lang__, $FlushPHPObj, $smarty;
include_once PEAR_DIR . "HTML/Table.php";
include_once PEAR_DIR . "HTML/QuickForm.php";
include_once APP_DIR . "UI.class.php";
$form =& new HTML_QuickForm();
$FilesDirsObj = $FlushPHPObj->loadUtility("FilesDirs");
$FilesDirsObj->FilesDirs(MODULE_DIR, 1, "CVS,General");
$Module_arr = $FilesDirsObj->listDirs();
asort($Module_arr);
reset($Module_arr);
$data = array();
$installImageObj = new UIImage(THEMES_DIR . "images/install.gif");
$unInstallImageObj = new UIImage(THEMES_DIR . "images/uninstall.gif");
if (sizeof($Module_arr)) {
foreach ($Module_arr as $key => $value) {
$temp_Module_arr = $FlushPHPObj->getModuleInfo($value);
if (file_exists(MODULE_DIR . "/" . $temp_Module_arr['name'] . "/" . $temp_Module_arr['logo']) && $temp_Module_arr['logo']) {
$ModuleImageLogo = new UIImage(MODULE_DIR . "/" . $temp_Module_arr['name'] . "/" . $temp_Module_arr['logo']);
$Module_logo = $ModuleImageLogo->toHTML() . "<br/>";
}
$data[$key] = array($Module_logo . $temp_Module_arr['name'] . " <b> " . $temp_Module_arr['version'] . " <b/> ", $temp_Module_arr['description'], $temp_Module_arr['author'], $unInstallImageObj->toHTML() . "<br/>" . $__Lang__['langGeneralUnInstall'], $installImageObj->toHTML() . "<br/>" . $__Lang__['langGeneralInstall']);
}
}
$tableAttrs = array("class" => "grid_table");
$table = new HTML_Table($tableAttrs);
$table->setAutoGrow(true);
$table->setAutoFill("n/a");
for ($nr = 0; $nr < count($data); $nr++) {
$table->setHeaderContents($nr + 1, 0, (string) $nr);
for ($i = 0; $i < 5; $i++) {
if ("" != $data[$nr][$i]) {
$table->setCellContents($nr + 1, $i + 1, $data[$nr][$i]);
}
}
}
$table->setColAttributes(3, array(" align" => "center"));
$table->setColAttributes(4, array(" align" => "center"));
$table->setColAttributes(5, array(" align" => "center"));
$altRow = array("class" => "grid_table_tr_alternate");
$table->altRowAttributes(1, null, $altRow);
$table->setHeaderContents(0, 0, "");
$table->setHeaderContents(0, 1, $__Lang__['langMenuModule']);
$table->setHeaderContents(0, 2, $__Lang__['langGeneralSummary']);
$table->setHeaderContents(0, 3, $__Lang__['langGeneralAuthor']);
$table->setHeaderContents(0, 4, $__Lang__['langGeneralStatus']);
$table->setHeaderContents(0, 5, $__Lang__['langGeneralOperation']);
$hrAttrs = array("class" => "grid_table_head");
$table->setRowAttributes(0, $hrAttrs, true);
$table->setColAttributes(0, $hrAttrs);
$smarty->assign("Main", $table->toHtml());
}
示例6: get_table
/**
* Get HTML table (as string that can be echoed)
*
* @param array $row_data (to appear in rows of table)
* @param array $column_headers (to appear in head of table
* @return string
*
* @access private
*/
private function get_table($row_data, $column_headers, $delete = false, $deleteColumn = -999, $deleteField = 'dummy-field-name')
{
// see http://pear.php.net/manual/en/package.html.html-table.intro.php
$table = new HTML_Table();
$table->setAutoGrow(true);
$table->setAutoFill('n/a');
for ($nr = 0, $maxr = count($row_data); $nr < $maxr; $nr++) {
for ($i = 0, $ii = count($column_headers); $i < $ii; $i++) {
if (isset($row_data[$nr][$i])) {
if ('' != $row_data[$nr][$i]) {
if ($deleteColumn == $i) {
if ($delete) {
$table->setCellContents($nr + 1, $i, $this->getDeleteButton($row_data[$nr][$i], $deleteField));
}
} else {
$table->setCellContents($nr + 1, $i, $row_data[$nr][$i]);
}
}
} else {
$table->setCellContents($nr + 1, $i, $this->fillerForEmptyCell);
}
}
}
for ($i = 0, $ii = count($column_headers); $i < $ii; $i++) {
$table->setHeaderContents(0, $i, $column_headers[$i]);
}
$header_attribute = array('class' => 'header');
$table->setRowAttributes(0, $header_attribute, true);
$table->setColAttributes(0, $header_attribute);
$altRow = array('class' => 'alt_row');
$table->altRowAttributes(1, null, $altRow);
return $table->toHtml();
}
示例7: array
$column = 0;
$row = 0;
$headers = array(get_lang('Title'), get_lang('HandedOutDate'), get_lang('HandOutDateLimit'), get_lang('Score'), get_lang('Actions'));
foreach ($headers as $header) {
$table->setHeaderContents($row, $column, $header);
$column++;
}
$row++;
$column = 0;
foreach ($workPerUser as $work) {
$work = $work['work'];
$scoreWeight = intval($work->qualification) == 0 ? null : $work->qualification;
$workId = $work->id;
$workExtraData = get_work_assignment_by_id($workId);
foreach ($work->user_results as $userResult) {
$table->setCellContents($row, $column, $work->title . ' [' . strip_tags($userResult['title']) . ']');
$table->setCellAttributes($row, $column, array('width' => '300px'));
$column++;
$table->setCellContents($row, $column, $userResult['sent_date']);
$column++;
$dateQualification = !empty($workExtraData['expires_on']) && $workExtraData['expires_on'] != '0000-00-00 00:00:00' ? api_get_local_time($workExtraData['expires_on']) : '-';
$table->setCellContents($row, $column, $dateQualification);
$column++;
$score = '-';
if (!empty($scoreWeight)) {
$score = strip_tags($userResult['qualification']) . "/" . $scoreWeight;
}
$table->setCellContents($row, $column, $score);
$column++;
// Actions
$links = null;
示例8: get_stats_table_by_attempt
/**
* Returns a category summary report
* @params int exercise id
* @params array pre filled array with the category_id, score, and weight
* example: array(1 => array('score' => '10', 'total' => 20));
*/
public static function get_stats_table_by_attempt($exercise_id, $category_list = array())
{
if (empty($category_list)) {
return null;
}
$category_name_list = TestCategory::getListOfCategoriesNameForTest($exercise_id);
$table = new HTML_Table(array('class' => 'data_table'));
$table->setHeaderContents(0, 0, get_lang('Categories'));
$table->setHeaderContents(0, 1, get_lang('AbsoluteScore'));
$table->setHeaderContents(0, 2, get_lang('RelativeScore'));
$row = 1;
$none_category = array();
if (isset($category_list['none'])) {
$none_category = $category_list['none'];
unset($category_list['none']);
}
$total = array();
if (isset($category_list['total'])) {
$total = $category_list['total'];
unset($category_list['total']);
}
if (count($category_list) > 1) {
foreach ($category_list as $category_id => $category_item) {
$table->setCellContents($row, 0, $category_name_list[$category_id]);
$table->setCellContents($row, 1, ExerciseLib::show_score($category_item['score'], $category_item['total'], false));
$table->setCellContents($row, 2, ExerciseLib::show_score($category_item['score'], $category_item['total'], true, false, true));
$row++;
}
if (!empty($none_category)) {
$table->setCellContents($row, 0, get_lang('None'));
$table->setCellContents($row, 1, ExerciseLib::show_score($none_category['score'], $none_category['total'], false));
$table->setCellContents($row, 2, ExerciseLib::show_score($none_category['score'], $none_category['total'], true, false, true));
$row++;
}
if (!empty($total)) {
$table->setCellContents($row, 0, get_lang('Total'));
$table->setCellContents($row, 1, ExerciseLib::show_score($total['score'], $total['total'], false));
$table->setCellContents($row, 2, ExerciseLib::show_score($total['score'], $total['total'], true, false, true));
}
return $table->toHtml();
}
return null;
}
示例9: imprimirFormularioNuevoUsuario
/**
* Muestra el formulario para dar de alta un nuevo usuario.
*/
private function imprimirFormularioNuevoUsuario()
{
imprimirTabulados(5);
echo '<div class="tablaTituloBotones">';
imprimirTabulados(6);
echo '<h1>Nuevo usuario</h1>';
imprimirTabulados(6);
echo '<form action="usuario.php" method="post">';
imprimirTabulados(6);
echo '<fieldset>';
imprimirTabulados(6);
$clase = array('class' => 'tablaCarga');
$tabla = new HTML_Table($clase);
$tabla->setAutoGrow(true);
$tabla->setHeaderContents(0, 0, 'Tipo de documento');
$tabla->setCellContents(0, 1, '<select class="cuadroSeleccion cuadroSeleccionAlineado" name="tipoDocumento"><option>DNI</option><option>LE</option><option>LC</option></select>');
$tabla->setHeaderContents(1, 0, 'Número de documento *');
$tabla->setCellContents(1, 1, '<input class="campoTexto campoTextoAlineado" type="text" name="numeroDocumentoNuevo" value="" />');
$tabla->setHeaderContents(2, 0, 'Nombre *');
$tabla->setCellContents(2, 1, '<input class="campoTexto campoTextoAlineado" type="text" name="nombre" value="" />');
$tabla->setHeaderContents(3, 0, 'Segundo nombre');
$tabla->setCellContents(3, 1, '<input class="campoTexto campoTextoAlineado" type="text" name="segundoNombre" value="" />');
$tabla->setHeaderContents(4, 0, 'Apellido *');
$tabla->setCellContents(4, 1, '<input class="campoTexto campoTextoAlineado" type="text" name="apellido" value="" />');
$tabla->setHeaderContents(5, 0, 'Fecha de nacimiento *');
$tabla->setCellContents(5, 1, '<input class="campoTexto campoTextoAlineado" type="text" name="fechaNacimiento" value="DD-MM-AAAA" />');
$tabla->setHeaderContents(6, 0, 'Dirección *');
$tabla->setCellContents(6, 1, '<input class="campoTexto campoTextoAlineado" type="text" name="direccion" value="" />');
$tabla->setHeaderContents(7, 0, 'Teléfono fijo');
$tabla->setCellContents(7, 1, '<input class="campoTexto campoTextoAlineado" type="text" name="telefonoFijo" value="" />');
$tabla->setHeaderContents(8, 0, 'Teléfono celular');
$tabla->setCellContents(8, 1, '<input class="campoTexto campoTextoAlineado" type="text" name="telefonoCelular" value="" />');
$tabla->setHeaderContents(9, 0, 'E-mail *');
$tabla->setCellContents(9, 1, '<input class="campoTexto campoTextoAlineado" type="text" name="email" value="" />');
$tabla->setHeaderContents(10, 0, 'Legajo *');
$tabla->setCellContents(10, 1, '<input class="campoTexto campoTextoAlineado" type="text" name="legajo" value="" />');
$tabla->setHeaderContents(11, 0, 'Área *');
$tabla->setCellContents(11, 1, $this->mostrarAreasMultipleSeleccion());
$tabla->setHeaderContents(12, 0, 'Tipo de usuario');
$tabla->setCellContents(12, 1, $this->mostrarNiveles());
$tabla->setHeaderContents(13, 0, 'Activo');
$tabla->setCellContents(13, 1, '<select class="cuadroSeleccionAlineado" name="activo"><option value="1">Si</option><option value="0">No</option></select>');
$tabla->setHeaderContents(14, 0, 'Notas');
$tabla->setCellContents(14, 1, '<textarea class="areaTexto" name="notas" rows="4" cols="20"></textarea>');
$tabla->setColAttributes(0, $clase);
$tabla->setColAttributes(1, $clase);
echo $tabla->toHtml();
imprimirTabulados(6);
echo '<br /><input type="submit" name="enviarNuevoUsuario" value="Enviar" >';
imprimirTabulados(6);
echo '</fieldset>';
imprimirTabulados(6);
echo '</form>';
imprimirTabulados(6);
echo '<div class="notas">';
imprimirTabulados(7);
echo '<p>(*) Campos obligatorios</p>';
imprimirTabulados(6);
echo '</div>';
imprimirTabulados(5);
echo '</div>';
}
示例10: CONCAT
$table->setHeaderContents(0, 0, "Order ID");
$table->setHeaderContents(0, 1, "Client ID");
$table->setHeaderContents(0, 2, "Order Time");
$table->setHeaderContents(0, 3, "Sub Total");
$table->setHeaderContents(0, 4, "Shipping Cost");
$table->setHeaderContents(0, 5, "Total Cost");
// Cycle through the array to produce the table data
// Create and execute the query
$query = "SELECT id AS `Order ID`, client_id AS `Client ID`,\n order_time AS `Order Time`,\n CONCAT('\$', sub_total) AS `Sub Total`,\n CONCAT('\$', shipping_cost) AS `Shipping Cost`,\n CONCAT('\$', total_cost) AS `Total Cost`\n FROM sales ORDER BY id";
$stmt = $mysqli->prepare($query);
$stmt->execute();
$stmt->bind_result($orderID, $clientID, $time, $subtotal, $shipping, $total);
// Begin at row 1 so don't overwrite the header
$rownum = 1;
// Format each row
while ($stmt->fetch()) {
$table->setCellContents($rownum, 0, $orderID);
$table->setCellContents($rownum, 1, $clientID);
$table->setCellContents($rownum, 2, $time);
$table->setCellContents($rownum, 3, $subtotal);
$table->setCellContents($rownum, 4, $shipping);
$table->setCellContents($rownum, 5, $total);
$rownum++;
}
// Output the data
echo $table->toHTML();
// Close the MySQL connection
$mysqli->close();
?>
示例11: array
$header_names = array(get_lang('Evaluation'), get_lang('Course'), get_lang('Category'), get_lang('EvaluationAverage'), get_lang('Result'), get_lang('Display'));
} else {
$header_names = array(get_lang('Evaluation'), get_lang('Course'), get_lang('Category'), get_lang('EvaluationAverage'), get_lang('Result'));
}
$table = new HTML_Table(array('class' => 'data_table'));
$row = 0;
$column = 0;
foreach ($header_names as $item) {
$table->setHeaderContents($row, $column, $item);
$column++;
}
$row = 1;
if (!empty($newarray)) {
foreach ($newarray as $data) {
$column = 0;
$table->setCellContents($row, $column, $data);
$table->updateCellAttributes($row, $column, 'align="center"');
$column++;
$row++;
}
}
$html .= $table->toHtml();
$pdf = new PDF();
$pdf->content_to_pdf($html);
exit;
}
$actions = '<div class="actions">';
if (isset($_GET['selectcat'])) {
$interbreadcrumb[] = array('url' => 'gradebook_flatview.php?selectcat=' . Security::remove_XSS($_GET['selectcat']), 'name' => get_lang('FlatView'));
$actions .= '<a href=gradebook_flatview.php?selectcat=' . Security::remove_XSS($_GET['selectcat']) . '>' . Display::return_icon('back.png', get_lang('BackTo') . ' ' . get_lang('FlatView'), '', ICON_SIZE_MEDIUM) . '</a>';
}
示例12: get_table
/**
* Get HTML table (as string that can be echoed)
*
* @param array $row_data (to appear in rows of table)
* @param array $column_headers (to appear in head of table
* @return string
*
* @access public
*/
public function get_table($row_data, $column_headers)
{
// see http://pear.php.net/manual/en/package.html.html-table.intro.php
$table = new HTML_Table();
$table->setAutoGrow(true);
$table->setAutoFill('n/a');
for ($nr = 0, $maxr = count($row_data); $nr < $maxr; $nr++) {
for ($i = 0, $ii = count($column_headers); $i < $ii; $i++) {
if ('' != $row_data[$nr][$i]) {
$table->setCellContents($nr + 1, $i, $row_data[$nr][$i]);
}
}
}
for ($i = 0, $ii = count($column_headers); $i < $ii; $i++) {
$table->setHeaderContents(0, $i, $column_headers[$i]);
}
$header_attribute = array('class' => 'header');
$table->setRowAttributes(0, $header_attribute, true);
$table->setColAttributes(0, $header_attribute);
$altRow = array('class' => 'alt_row');
$table->altRowAttributes(1, null, $altRow);
return $table->toHtml();
}
示例13: exportAllStudentWorkFromPublication
//.........这里部分代码省略.........
);
}
}
$header .= '<br />'.get_lang('Teachers').': '.$teachers.'<br />';
$header .= '<br />'.get_lang('Date').': '.api_get_local_time().'<br />';
$header .= '<br />'.get_lang('StudentPublication').': '.$workData['title'].'<br />';
$content = null;
$expiresOn = null;
if (!empty($assignment) && isset($assignment['expires_on'])) {
$content .= '<br /><strong>' . get_lang('ExpiryDate') . '</strong>: ' . api_get_local_time($assignment['expires_on']);
$expiresOn = api_get_local_time($assignment['expires_on']);
}
if (!empty($workData['description'])) {
$content .= '<br /><strong>' . get_lang('Description') . '</strong>: ' . $workData['description'];
}
$workList = get_work_user_list(null, null, null, null, $workId);
switch ($format) {
case 'pdf':
if (!empty($workList)) {
require_once api_get_path(LIBRARY_PATH).'pdf.lib.php';
$table = new HTML_Table(array('class' => 'data_table'));
$headers = array(
get_lang('Name'),
get_lang('User'),
get_lang('HandOutDateLimit'),
get_lang('SentDate'),
get_lang('Filename'),
get_lang('Score'),
get_lang('Feedback')
);
$column = 0;
foreach($headers as $header) {
$table->setHeaderContents(0, $column, $header);
$column++;
}
$row = 1;
//$pdf->set_custom_header($header);
foreach ($workList as $work) {
$content .= '<hr />';
// getWorkComments need c_id
$work['c_id'] = $courseInfo['real_id'];
//$content .= get_lang('Date').': '.api_get_local_time($work['sent_date_from_db']).'<br />';
$score = null;
if (!empty($work['qualification_only'])) {
$score = $work['qualification_only'];
}
//$content .= get_lang('Description').': '.$work['description'].'<br />';
$comments = getWorkComments($work);
$feedback = null;
if (!empty($comments)) {
$content .= '<h4>'.get_lang('Feedback').': </h4>';
foreach ($comments as $comment) {
$feedback .= get_lang('User').': '.api_get_person_name(
$comment['firstname'],
$comment['lastname']
).'<br />';
$feedback .= $comment['comment'].'<br />';
}
}
$table->setCellContents($row, 0, strip_tags($workData['title']));
$table->setCellContents($row, 1, api_get_person_name(strip_tags($work['firstname']), strip_tags($work['lastname'])));
$table->setCellContents($row, 2, $expiresOn);
$table->setCellContents($row, 3, api_get_local_time($work['sent_date_from_db']));
$table->setCellContents($row, 4, strip_tags($work['title']));
$table->setCellContents($row, 5, $score);
$table->setCellContents($row, 6, $feedback);
$row++;
}
$content = $table->toHtml();
if (!empty($content)) {
$params = array(
'filename' => $workData['title'] . '_' . api_get_local_time(),
'pdf_title' => replace_dangerous_char($workData['title']),
'course_code' => $courseInfo['code'],
'add_signatures' => false
);
$pdf = new PDF('A4', null, $params);
$pdf->html_to_pdf_with_template($content);
}
exit;
}
break;
}
}
示例14: array
$table->setHeaderContents(0, 7, "手机");
$table->setHeaderContents(0, 8, "固话");
$table->setHeaderContents(0, 9, "Email");
$table->setHeaderContents(0, 10, "婚否");
$table->setHeaderContents(0, 11, "籍贯");
$table->setHeaderContents(0, 12, "现居住地");
$table->setHeaderContents(0, 13, "特长");
$table->setHeaderContents(0, 14, "备注");
$query = "select id,number,name,sex,birthday,format((timestampdiff(day,birthday,now())/365),2),idno,cell,tel,email,marriage,hometown,livesite,feature,memo FROM yuangong ORDER BY id DESC";
$stmt = $mysqli->prepare($query);
$stmt->execute();
$stmt->bind_result($id, $number, $name, $sex, $birthday, $age, $idno, $cell, $tel, $email, $marriage, $hometown, $livesite, $feature, $memo);
$rownum = 1;
//不是从第0行,而是从第1行开始,所以不会覆盖表头
while ($stmt->fetch()) {
$table->setCellContents($rownum, 0, $id);
$table->setCellContents($rownum, 1, $number);
$table->setCellContents($rownum, 2, $name);
$table->setCellContents($rownum, 3, $sex);
$table->setCellContents($rownum, 4, $birthday);
$table->setCellContents($rownum, 5, $age);
$table->setCellContents($rownum, 6, $idno);
$table->setCellContents($rownum, 7, $cell);
$table->setCellContents($rownum, 8, $tel);
$table->setCellContents($rownum, 9, $email);
$table->setCellContents($rownum, 10, $marriage);
$table->setCellContents($rownum, 11, $hometown);
$table->setCellContents($rownum, 12, $livesite);
$table->setCellContents($rownum, 13, $feature);
$table->setCellContents($rownum, 14, $memo);
$table->altRowAttributes(1, null, array("class" => "alt"));
示例15: showAutoreplyHelp
//.........这里部分代码省略.........
echo UNKNOWN;
?>
special keyword again, but this time <em>within</em> the LOTR keyword:
</p>
<p align='center'>
<?php
$rowIdx = $table->addRow($lotrUnknown, $rowAttribs);
?>
<?php
echo $table->toHtml();
?>
</p>
<p>
Now if someone texts "LOTR FRODO" the system will reply with "Sorry we haven't entered that character...".
</p>
<p>
<b>Using Variables</b>
</p>
<p>
But wouldn't it be nice if we could use the character's name <em>in</em> the error message?
We can do that with the <?php
echo SUBKEYWORDS;
?>
variable.
Just put it into the reply and it will be replaced with all the keywords after the first one.
</p>
<p align='center'>
<?php
$table->setCellContents($rowIdx, 2, $lotrUnknownUpdate);
?>
<?php
echo $table->toHtml();
?>
</p>
<p>
Now "LOTR FRODO" will get a reply of "Sorry we haven't entered FRODO yet...".
</p>
<p>
<b>Using Rematching</b>
</p>
<p>
Some users of the system may text "LOTR STRIDER", which is another name for Aragorn. Currently, this will get
a reply of "Sorry we haven't entered STRIDER yet...". We could of course make a separate entry for Strider,
perhaps even copying and pasting the reply for Aragorn into it. However, this would get to be very hard to
maintain for large numbers of characters, especially if you wanted to correct any typos or add new info.
(Aragorn has <em>lots</em> of names, by the way.)
</p>
<p>
What we need is some way to have one autoreply <em>point</em> to another autoreply. This is done with the
special variable <?php
echo REMATCH;
?>
. It tells PlaySms to use the autoreply <em>as if</em> it were
an incoming text, rematching it all over again. With <?php
echo REMATCH;
?>
we can add a STRIDER entry