本文整理汇总了PHP中HTML_Table::setHeaderContents方法的典型用法代码示例。如果您正苦于以下问题:PHP HTML_Table::setHeaderContents方法的具体用法?PHP HTML_Table::setHeaderContents怎么用?PHP HTML_Table::setHeaderContents使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HTML_Table
的用法示例。
在下文中一共展示了HTML_Table::setHeaderContents方法的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: imprimirCabecera
/**
* Imprime la cabecera de la tabla.
*/
private function imprimirCabecera()
{
$this->tabla->setHeaderContents(0, 0, 'Área');
$this->tabla->setHeaderContents(0, 1, 'Horas asignadas');
$this->tabla->setHeaderContents(0, 2, 'Horas asignadas actualmente');
$this->tabla->setHeaderContents(0, 3, 'Acción');
$this->tabla->setRowAttributes(0, $this->clase, false);
}
示例4: 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());
}
示例5: 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>';
}
示例6: convert_array_to_html
/**
* @param array $data
* @param array $params
*
* @return string
*/
public static function convert_array_to_html($data, $params = array())
{
$headers = $data[0];
unset($data[0]);
$header_attributes = isset($params['header_attributes']) ? $params['header_attributes'] : array();
$table = new HTML_Table(array('class' => 'data_table', 'repeat_header' => '1'));
$row = 0;
$column = 0;
foreach ($headers as $header) {
$table->setHeaderContents($row, $column, $header);
$attributes = array();
if (isset($header_attributes) && isset($header_attributes[$column])) {
$attributes = $header_attributes[$column];
}
if (!empty($attributes)) {
$table->updateCellAttributes($row, $column, $attributes);
}
$column++;
}
$row++;
foreach ($data as &$printable_data_row) {
$column = 0;
foreach ($printable_data_row as &$printable_data_cell) {
$table->setCellContents($row, $column, $printable_data_cell);
//$table->updateCellAttributes($row, $column, $atributes);
$column++;
}
$table->updateRowAttributes($row, $row % 2 ? 'class="row_even"' : 'class="row_odd"', true);
$row++;
}
$table_tp_html = $table->toHtml();
return $table_tp_html;
}
示例7: 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();
}
示例8: header
break;
case 'delete':
if (isset($_GET['user_id'])) {
$legal->deleteUserAgreement($_GET['user_id'], $courseId, $sessionId);
header('Location: '.$url);
exit;
}
break;
}
$order = " ORDER BY firstname, lastname";
$userList = $legal->getUserAgreementList($courseId, $sessionId, $order);
$table = new HTML_Table(array('class' => 'data_table'));
$table->setHeaderContents(0, 0, get_lang('User'));
$table->setHeaderContents(0, 1, $legal->get_lang('WebAgreement'));
$table->setHeaderContents(0, 2, $legal->get_lang('MailAgreement'));
$table->setHeaderContents(0, 3, $legal->get_lang('Actions'));
$row = 1;
$pluginPath = api_get_path(WEB_PLUGIN_PATH).'courselegal/';
if (!empty($userList)) {
foreach ($userList as $user) {
$userName = api_get_person_name($user['firstname'], $user['lastname']);
$webDate = !empty($user['web_agreement_date']) ? api_get_local_time($user['web_agreement_date']) : '-';
$mailDate = !empty($user['mail_agreement_date']) ? api_get_local_time($user['mail_agreement_date']) : '-';
$url = $pluginPath.'user_list.php?action=resend&user_id='.$user['user_id'].'&'.api_get_cidreq();
$link = Display::url(
Display::return_icon('inbox.png', $legal->get_lang('ReSendMailAgreementLink')),
示例9: export_pdf_flatview
/**
* @param FlatViewTable $flatviewtable
* @param Category $cat
* @param $users
* @param $alleval
* @param $alllinks
* @param array $params
* @param null $mainCourseCategory
*/
public static function export_pdf_flatview($flatviewtable, $cat, $users, $alleval, $alllinks, $params = array(), $mainCourseCategory = null)
{
// Getting data
$printable_data = self::get_printable_data($cat[0], $users, $alleval, $alllinks, $params, $mainCourseCategory);
// HTML report creation first
$course_code = trim($cat[0]->get_course_code());
$displayscore = ScoreDisplay::instance();
$customdisplays = $displayscore->get_custom_score_display_settings();
$total = array();
if (is_array($customdisplays) && count($customdisplays)) {
foreach ($customdisplays as $custom) {
$total[$custom['display']] = 0;
}
$user_results = $flatviewtable->datagen->get_data_to_graph2(false);
foreach ($user_results as $user_result) {
$total[$user_result[count($user_result) - 1][1]]++;
}
}
$parent_id = $cat[0]->get_parent_id();
if (isset($cat[0]) && isset($parent_id)) {
if ($parent_id == 0) {
$grade_model_id = $cat[0]->get_grade_model_id();
} else {
$parent_cat = Category::load($parent_id);
$grade_model_id = $parent_cat[0]->get_grade_model_id();
}
}
$use_grade_model = true;
if (empty($grade_model_id) || $grade_model_id == -1) {
$use_grade_model = false;
}
if ($use_grade_model) {
if ($parent_id == 0) {
$title = api_strtoupper(get_lang('Average')) . '<br />' . get_lang('Detailed');
} else {
$title = api_strtoupper(get_lang('Average')) . '<br />' . $cat[0]->get_description() . ' - (' . $cat[0]->get_name() . ')';
}
} else {
if ($parent_id == 0) {
$title = api_strtoupper(get_lang('Average')) . '<br />' . get_lang('Detailed');
} else {
$title = api_strtoupper(get_lang('Average'));
}
}
$columns = count($printable_data[0]);
$has_data = is_array($printable_data[1]) && count($printable_data[1]) > 0;
$table = new HTML_Table(array('class' => 'data_table'));
$row = 0;
$column = 0;
$table->setHeaderContents($row, $column, get_lang('NumberAbbreviation'));
$column++;
foreach ($printable_data[0] as $printable_data_cell) {
if (!is_array($printable_data_cell)) {
$printable_data_cell = strip_tags($printable_data_cell);
}
$table->setHeaderContents($row, $column, $printable_data_cell);
$column++;
}
$row++;
if ($has_data) {
$counter = 1;
foreach ($printable_data[1] as &$printable_data_row) {
$column = 0;
$table->setCellContents($row, $column, $counter);
$table->updateCellAttributes($row, $column, 'align="center"');
$column++;
$counter++;
foreach ($printable_data_row as $key => &$printable_data_cell) {
$attributes = array();
$attributes['align'] = 'center';
$attributes['style'] = null;
if ($key === 'name') {
$attributes['align'] = 'left';
}
if ($key === 'total') {
$attributes['style'] = 'font-weight:bold';
}
$table->setCellContents($row, $column, $printable_data_cell);
$table->updateCellAttributes($row, $column, $attributes);
$column++;
}
$table->updateRowAttributes($row, $row % 2 ? 'class="row_even"' : 'class="row_odd"', true);
$row++;
}
} else {
$column = 0;
$table->setCellContents($row, $column, get_lang('NoResults'));
$table->updateCellAttributes($row, $column, 'colspan="' . $columns . '" align="center" class="row_odd"');
}
$pdfParams = array('filename' => get_lang('FlatView') . '_' . api_get_utc_datetime(), 'pdf_title' => $title, 'course_code' => $course_code, 'add_signatures' => true);
$page_format = $params['orientation'] == 'landscape' ? 'A4-L' : 'A4';
//.........这里部分代码省略.........
示例10: array
api_not_allowed(true);
}
}
$interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH) . 'work/work.php?' . api_get_cidreq(), 'name' => get_lang('StudentPublications'));
$interbreadcrumb[] = array('url' => '#', 'name' => $userInfo['complete_name']);
Display::display_header(null);
echo '<div class="actions">';
echo '<a href="' . api_get_path(WEB_CODE_PATH) . 'work/work.php?' . api_get_cidreq() . '&origin=' . $origin . '&gradebook=' . $gradebook . '">' . Display::return_icon('back.png', get_lang('BackToWorksList'), '', ICON_SIZE_MEDIUM) . '</a>';
echo '</div>';
$workPerUser = getWorkPerUser($studentId);
$table = new HTML_Table(array('class' => 'data_table'));
$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++;
示例11: build_html
function build_html(&$html, &$chartData, $query, $sql_key, $result, $report, $title, $description, $parms, $format = '', $timestamp)
{
//Create EXCEL output object
$file_name = "{$report}" . "_" . $timestamp . ".csv";
if (file_exists("/tmp/{$file_name}")) {
$csv = fopen("/tmp/{$file_name}", "a") or die("ERROR: Could not open file...");
} else {
$csv = fopen("/tmp/{$file_name}", "w") or die("ERROR: Could not open file...");
}
fwrite($csv, "{$title}\n");
fwrite($csv, "{$report}\n");
fwrite($csv, "{$description}\n");
fwrite($csv, "\n");
fwrite($csv, "Parameters Passed:\n");
foreach ($parms as $key => $value) {
fwrite($csv, "{$key},{$value}\n");
}
fwrite($csv, "\n");
$column_format = array();
//$attrs = array('width' => '600', 'border' => '1', 'class' => 'report');
$attrs = array('border' => '1', 'class' => 'report');
$table = new \HTML_Table($attrs);
$table->setAutoGrow(true);
$hrAttrs = array('bgcolor' => 'silver', 'align' => 'center');
$table->setRowAttributes(0, $hrAttrs, true);
$hrAttrs = array('align' => 'right');
foreach ($format as $key => $value) {
if ("{$key}" == "name") {
$column_format[strtolower($value)] = $format['format'];
break;
} else {
foreach ($value as $key2 => $value2) {
$column_format[strtolower($value2)] = $value['format'];
break;
}
}
}
$record = 0;
$chartData = "function drawChart() {\n var data = google.visualization.arrayToDataTable([\n";
while ($row = $result->fetch_assoc()) {
if ($record > 0) {
$col = 0;
$table->setCellContents($record + 1, $col, $record + 1);
$table->setRowAttributes($record + 1, $hrAttrs, true);
$chartData .= ",\n";
foreach ($row as $key => $value) {
$col++;
if (isset($column_format[strtolower($key)])) {
$fmt_value = format_column($value, $column_format[strtolower($key)]);
$table->setCellContents($record + 1, $col, $fmt_value);
// If we have a format, check its type
if (in_array($column_format[strtolower($key)], array('string', 'date'))) {
if ($col == 1) {
$chartData .= "['" . $value . "'";
} else {
$chartData .= ",'" . $value . "'";
}
} else {
if ($col == 1) {
$chartData .= "[" . $value;
} else {
$chartData .= "," . $value;
}
}
} else {
// If not format, we assume its a number
$table->setCellContents($record + 1, $col, $value);
if ($col == 1) {
$chartData .= $value;
} else {
$chartData .= "," . $value;
}
}
//CSV
if ($col == 1) {
fwrite($csv, "{$value}");
} else {
fwrite($csv, ",{$value}");
}
//Chart
}
fwrite($csv, "\n");
$chartData .= "]";
} else {
if ($record == 0) {
$col = 0;
$table->setHeaderContents(0, $col, '#');
foreach ($row as $key => $value) {
$col++;
$table->setHeaderContents($record, $col, ucfirst($key));
if ($col == 1) {
fwrite($csv, "{$key}");
$chartData .= "['" . ucfirst($key) . "'";
} else {
fwrite($csv, ",{$key}");
$chartData .= ",'" . ucfirst($key) . "'";
}
}
fwrite($csv, "\n");
$chartData .= "],\n";
//.........这里部分代码省略.........
示例12: 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>';
}
示例13: 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;
}
示例14: foreach
$displayscore = ScoreDisplay::instance();
foreach ($data_array as $data) {
$newarray[] = array_slice($data, 1);
}
$userinfo = api_get_user_info($my_user_id);
$html .= get_lang('Results') . ' : ' . api_get_person_name($userinfo['firstname'], $userinfo['lastname']) . ' (' . api_convert_and_format_date(null, DATE_FORMAT_SHORT) . ' ' . api_convert_and_format_date(null, TIME_NO_SEC_FORMAT) . ')';
if ($displayscore->is_custom()) {
$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);
示例15: mysqli
<?php
// Include the HTML_Table package
require_once "HTML/Table.php";
// Connect to the MySQL database
$mysqli = new mysqli("localhost", "websiteuser", "secret", "corporate");
// Create an array of table attributes
$attributes = array('border' => '1');
// Create the table object
$table = new HTML_Table($attributes);
// Set the headers
$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);