本文整理汇总了PHP中HTML_Table类的典型用法代码示例。如果您正苦于以下问题:PHP HTML_Table类的具体用法?PHP HTML_Table怎么用?PHP HTML_Table使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了HTML_Table类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: 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();
}
开发者ID:jloguercio,项目名称:chamilo-lms,代码行数:32,代码来源:upload_exercise.php
示例2: __construct
public function __construct()
{
parent::__construct('aicml_staff');
if ($this->loginError) {
return;
}
echo '<h1>AICML Staff</h1>';
$table = new HTML_Table(array('class' => 'stats'));
$table->addRow(array('Name', 'Start', 'End', 'Num Pubs', 'Pub Ids'));
$table->setRowType(0, 'th');
//pdDb::debugOn();
$staff_list = pdAicmlStaffList::create($this->db);
foreach ($staff_list as $staff_id => $author_id) {
$staff = pdAicmlStaff::newFromDb($this->db, $staff_id, pdAicmlStaff::DB_LOAD_PUBS_MIN);
$author = pdAuthor::newFromDb($this->db, $author_id, pdAuthor::DB_LOAD_MIN);
//debugVar('staff', array($staff, $author));
$pub_links = array();
if (isset($staff->pub_ids)) {
foreach ($staff->pub_ids as $pub_id) {
$pub_links[] = '<a href="../view_publication.php?pub_id=' . $pub_id . '">' . $pub_id . '</a>';
}
}
$table->addRow(array($author->name, $staff->start_date, $staff->end_date, count($staff->pub_ids), implode(', ', $pub_links)), array('class' => 'stats_odd'));
}
echo $table->toHtml();
}
开发者ID:papersdb,项目名称:papersdb,代码行数:26,代码来源:aicml_staff.php
示例3: 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>';
}
开发者ID:jorgeeliecerballesteros,项目名称:controldeacceso,代码行数:33,代码来源:CuerpoLogin.php
示例4: pubByYears
private function pubByYears()
{
$pub_years = pdPubList::create($this->db, array('year_list' => true));
if (empty($pub_years) || count($pub_years) == 0) {
return;
}
$table = new HTML_Table(array('class' => 'nomargins', 'width' => '60%'));
$text = '';
foreach (array_values($pub_years) as $item) {
$text .= '<a href="list_publication.php?year=' . $item['year'] . '">' . $item['year'] . '</a> ';
}
$table->addRow(array($text));
echo '<h2>Publications by Year:</h2>', $table->toHtml();
}
开发者ID:papersdb,项目名称:papersdb,代码行数:14,代码来源:index.php
示例5: __construct
public function __construct()
{
parent::__construct('auth_success', 'Authorization Success', 'Admin/auth_success.php');
if ($this->loginError) {
return;
}
echo "<h2>Authorization Successful</h2>" . "\n<p>The following users have been granted access.</p>";
$table = new HTML_Table(array('class' => 'stats'));
$table->addRow(array('Access Level', 'Login', 'Name', 'Conf. Email'));
$table->setRowType(0, 'th');
foreach ($_SESSION['auth_success'] as $auth) {
$table->addRow(array(AccessLevel::getAccessLevelStr($auth['user']->access_level), $auth['user']->login, $auth['user']->name, $auth['email']), array('class' => 'stats_odd'));
}
echo $table->toHtml();
}
开发者ID:papersdb,项目名称:papersdb,代码行数:15,代码来源:auth_success.php
示例6: 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>';
}
开发者ID:jloguercio,项目名称:chamilo-lms,代码行数:48,代码来源:diagnoser.lib.php
示例7: __construct
public function __construct()
{
parent::__construct('auth_error', 'Authorization Error', 'Admin/auth_error.php');
if ($this->loginError) {
return;
}
echo "<h2>Invalid Access Level</h2>" . "\n<p>The following users have incorrect access level.</p>";
$table = new HTML_Table(array('class' => 'stats'));
$table->addRow(array('Access Level', 'Login', 'Name'));
$table->setRowType(0, 'th');
foreach ($_SESSION['auth_errors'] as $auth_err) {
$table->addRow(array(AccessLevel::getAccessLevelStr($auth_err['access']), $auth_err['user']->login, $auth_err['user']->name), array('class' => 'stats_odd'));
}
echo $table->toHtml();
echo '<p><a href="authorize_new_users.php">Authorize new users</a></p>';
}
开发者ID:papersdb,项目名称:papersdb,代码行数:16,代码来源:auth_error.php
示例8: __construct
public function __construct()
{
parent::__construct('all_categories');
if ($this->loginError) {
return;
}
$cat_list = pdCatList::create($this->db);
echo '<h1>Publication Categories</h1>';
foreach (array_keys($cat_list) as $cat_id) {
unset($fields);
unset($cells);
$category = new pdCategory();
$result = $category->dbLoad($this->db, $cat_id);
assert('$result');
$table = new HTML_Table(array('class' => 'publist'));
$table->setAutoGrow(true);
$cells[] = '<b>' . $category->category . '</b><br/>';
if (count($category->info) > 0) {
foreach ($category->info as $info_id => $name) {
$fields[] = $name;
}
$cells[] = 'Fields: ' . implode(', ', $fields);
} else {
$cells[] = '';
}
if ($this->access_level > 0) {
$cells[] = $this->getCategoryIcons($category);
}
$table->addRow($cells);
$table->updateColAttributes(0, array('class' => 'category'), NULL);
$table->updateColAttributes(2, array('class' => 'icons'), NULL);
echo $table->toHtml();
unset($table);
}
}
开发者ID:papersdb,项目名称:papersdb,代码行数:35,代码来源:list_categories.php
示例9: __construct
public function __construct()
{
parent::__construct('all_authors');
if ($this->loginError) {
return;
}
$this->loadHttpVars(true, false);
if (!isset($this->tab)) {
$this->tab = 'A';
} else {
$tab = strtoupper($this->tab);
if (strlen($tab) != 1 || ord($tab) < ord('A') || ord($tab) > ord('Z')) {
$this->pageError = true;
return;
}
}
$auth_list = pdAuthorList::create($this->db, null, $this->tab);
echo $this->alphaSelMenu($this->tab, get_class($this) . '.php');
echo "<h2>Authors</h2>";
if (empty($auth_list) || count($auth_list) == 0) {
echo 'No authors with last name starting with ', $this->tab, '<br/>';
return;
}
foreach ($auth_list as $author_id => $name) {
$author = new pdAuthor();
$author->dbLoad($this->db, $author_id, pdAuthor::DB_LOAD_BASIC | pdAuthor::DB_LOAD_PUBS_MIN);
$name = '<span class="emph"><a href="view_author.php?author_id=' . $author_id . '">' . $name . '</a> ';
$icons = $this->getAuthorIcons($author) . '</span>';
$info = array();
if ($author->title != '') {
$info[] = '<span class="small">' . $author->title . '</span>';
}
if ($author->organization != '') {
$info[] = '<span class="small">' . $author->organization . '</span>';
}
$info[] .= '<a href="list_publication.php?author_id=' . $author_id . '&menu=0"><span class="small" style="color:#000;font-weight:normal;">' . 'Publication entries in database: ' . $author->totalPublications . '</span>';
$table = new HTML_Table(array('class' => 'publist'));
$table->addRow(array($name . '<br/>' . implode('<br/>', $info), $icons));
$table->updateColAttributes(1, array('class' => 'icons'), NULL);
echo $table->toHtml();
unset($table);
}
}
开发者ID:papersdb,项目名称:papersdb,代码行数:43,代码来源:list_author.php
示例10: __construct
public function __construct()
{
parent::__construct('delete_author', 'Delete Author', 'Admin/delete_author.php');
if ($this->loginError) {
return;
}
$this->loadHttpVars();
if (!isset($this->author_id) || !is_numeric($this->author_id)) {
$this->pageError = true;
return;
}
$author = new pdAuthor();
$result = $author->dbLoad($this->db, $this->author_id);
if (!$result) {
$this->pageError = true;
return;
}
$pub_list = pdPubList::create($this->db, array('author_id' => $this->author_id));
if (isset($pub_list) && count($pub_list) > 0) {
echo 'Cannot delete Author <b>', $author->name, '</b>.<p/>', 'The author has the following publications in the database:', displayPubList($this->db, $pub_list, true, -1, null, null, '../');
return;
}
$form =& $this->confirmForm('deleter');
$form->addElement('hidden', 'author_id', $this->author_id);
if ($form->validate()) {
$values = $form->exportValues();
// This is where the actual deletion happens.
$name = $author->name;
$author->dbDelete($this->db);
echo 'You have successfully removed the following author from the database:', '<p/><b>', $name, '</b>';
} else {
if (!isset($this->author_id) || !is_numeric($this->author_id)) {
$this->pageError = true;
return;
}
$renderer = new HTML_QuickForm_Renderer_QuickHtml();
$form->accept($renderer);
$table = new HTML_Table(array('width' => '100%', 'border' => '0', 'cellpadding' => '6', 'cellspacing' => '0'));
$table->addRow(array('Name:', $author->name));
if (isset($author->title) && trim($author->title != '')) {
$table->addRow(array('Title:', $author->title));
}
$table->addRow(array('Email:', $author->email));
$table->addRow(array('Organization:', $author->organization));
$cell = '';
if (isset($author->webpage) && trim($author->webpage != '')) {
$cell = '<a href="' . $author->webpage . '">' . $author->webpage . '</a>';
} else {
$cell = "none";
}
$table->addRow(array('Web page:', $cell));
$table->updateColAttributes(0, array('class' => 'emph', 'width' => '25%'));
echo '<h3>Delete Author</h3><p/>Delete the following author?';
$this->form =& $form;
$this->renderer =& $renderer;
$this->table =& $table;
}
}
开发者ID:papersdb,项目名称:papersdb,代码行数:58,代码来源:delete_author.php
示例11: viewList
/**
* View list
*
* @author John.meng
* @since version - Dec 23, 2005
* @param datatype paramname description
* @return datatype description
*/
function viewList()
{
global $__Lang__, $UrlParameter, $FlushPHPObj, $table, $page_data, $all_data, $links, $form, $smarty;
include_once PEAR_DIR . 'HTML/QuickForm.php';
include_once PEAR_DIR . "HTML/Table.php";
require_once PEAR_DIR . 'Pager/Pager.php';
$form = new HTML_QuickForm('viewList');
$renderer =& $form->defaultRenderer();
$renderer->setFormTemplate("\n<form{attributes}>\n<table border=\"0\" width=\"99%\" cellpadding=\"0\" cellspacing=\"0\" align=\"center\">\n{content}\n</table>\n</form>");
$tableAttrs = array("class" => "grid_table");
$table = new HTML_Table($tableAttrs);
$table->setAutoGrow(true);
// $table->setAutoFill("n/a");
$hrAttrs = array("class" => "grid_table_head");
$table->setRowAttributes(0, $hrAttrs, true);
$params = array('itemData' => $all_data, 'perPage' => 10, 'delta' => 3, 'append' => true, 'separator' => ' . ', 'clearIfVoid' => false, 'urlVar' => 'entrant', 'useSessions' => true, 'closeSession' => true, 'mode' => 'Jumping', 'prevImg' => $__Lang__['langPaginationPrev'], 'nextImg' => $__Lang__['langPaginationNext']);
$pager =& Pager::factory($params);
$page_data = $pager->getPageData();
$links = $pager->getLinks();
$selectBox = $pager->getPerPageSelectBox();
}
开发者ID:BackupTheBerlios,项目名称:flushcms,代码行数:29,代码来源:UI.class.php
示例12: __construct
public function __construct()
{
parent::__construct('bibtex', null, false);
if ($this->loginError) {
return;
}
$this->loadHttpVars();
if (!isset($this->pub_ids)) {
$this->pageError = true;
return;
}
$pubs = explode(',', $this->pub_ids);
if (!is_array($pubs) || count($pubs) == 0) {
$this->pageError = true;
return;
}
$pub_list = pdPubList::create($this->db, array('pub_ids' => $pubs));
if (!is_array($pub_list) || count($pub_list) == 0) {
$this->pageError = true;
return;
}
$table = new HTML_Table(array('width' => '100%', 'border' => '0', 'cellpadding' => '0', 'cellspacing' => '0'));
$table->setAutoGrow(true);
$pub_count = 0;
foreach ($pub_list as $pub) {
$pub_count++;
$result = $pub->dbLoad($this->db, $pub->pub_id);
if ($result === false) {
$this->pageError = true;
return;
}
$table->addRow(array('<pre>' . $pub->getBibtex() . '</pre>'));
}
// now assign table attributes including highlighting for even and odd
// rows
for ($i = 0; $i < $table->getRowCount(); $i++) {
if ($i & 1) {
$table->updateRowAttributes($i, array('class' => 'even'), true);
} else {
$table->updateRowAttributes($i, array('class' => 'odd'), true);
}
}
$table->updateColAttributes(0, array('class' => 'publist'), true);
echo $table->toHtml();
}
开发者ID:papersdb,项目名称:papersdb,代码行数:45,代码来源:bibtex.php
示例13: HTML_Table
<?php
$tbl = new HTML_Table('', 'table table-striped table-bordered');
$tbl->addRow();
$tbl->addCell('FY ID', '', 'header');
$tbl->addCell('FY Description', '', 'header');
$tbl->addCell('Start Date', '', 'header');
$tbl->addCell('End Date', '', 'header');
$tbl->addCell('Status', '', 'header');
$tbl->addCell('Actions', '', 'header');
?>
<?php
$sql = 'SELECT * FROM ' . DB_PREFIX . $_SESSION['co_prefix'] . 'fiscal_years ORDER by fiscal_year_start_date';
$get_fy = DB::query($sql);
foreach ($get_fy as $fy) {
$tbl->addRow();
$tbl->addCell($fy['fiscal_year_id']);
$tbl->addCell($fy['fiscal_year_desc']);
$tbl->addCell(getDateTime($fy['fiscal_year_start_date'], "dLong"));
$tbl->addCell(getDateTime($fy['fiscal_year_end_date'], "dLong"));
$tbl->addCell($fy['fy_status']);
$tbl->addCell("<a class='pull btn btn-danger btn-xs' href ='" . $_SERVER['PHP_SELF'] . "?route=modules/gl/setup/financial_periods/edit_fiscal_year&fisca_year_id=" . $fy['fiscal_year_id'] . "'>Edit Fiscal Year <span class='glyphicon glyphicon-edit'></span></a>\n\t\t\t ");
}
?>
<!-- Content Header (Page header) -->
<section class="content-header">
<h1>
Fiscal Years
<small>Defined Fiscal Years for Company Accounts.</small>
</h1>
开发者ID:rylsteel,项目名称:phpledger,代码行数:31,代码来源:list_fiscal_years.php
示例14: listCategories
/**
* @param string $categorySource
*
* @return string
*/
function listCategories($categorySource)
{
$categorySource = isset($categorySource) ? $categorySource : null;
$categories = self::getCategories($categorySource);
if (count($categories) > 0) {
$table = new HTML_Table(array('class' => 'data_table'));
$column = 0;
$row = 0;
$headers = array(get_lang('Category'), get_lang('CategoriesNumber'), get_lang('Courses'), get_lang('Actions'));
foreach ($headers as $header) {
$table->setHeaderContents($row, $column, $header);
$column++;
}
$row++;
$mainUrl = api_get_path(WEB_CODE_PATH) . 'admin/course_category.php?category=' . $categorySource;
$editIcon = Display::return_icon('edit.png', get_lang('EditNode'), null, ICON_SIZE_SMALL);
$deleteIcon = Display::return_icon('delete.png', get_lang('DeleteNode'), null, ICON_SIZE_SMALL);
$moveIcon = Display::return_icon('up.png', get_lang('UpInSameLevel'), null, ICON_SIZE_SMALL);
foreach ($categories as $category) {
$editUrl = $mainUrl . '&id=' . $category['code'] . '&action=edit';
$moveUrl = $mainUrl . '&id=' . $category['code'] . '&action=moveUp&tree_pos=' . $category['tree_pos'];
$deleteUrl = $mainUrl . '&id=' . $category['code'] . '&action=delete';
$actions = Display::url($editIcon, $editUrl) . Display::url($moveIcon, $moveUrl) . Display::url($deleteIcon, $deleteUrl);
$url = api_get_path(WEB_CODE_PATH) . 'admin/course_category.php?category=' . $category['code'];
$title = Display::url(Display::return_icon('folder_document.gif', get_lang('OpenNode'), null, ICON_SIZE_SMALL) . ' ' . $category['name'], $url);
$content = array($title, $category['children_count'], $category['nbr_courses'], $actions);
$column = 0;
foreach ($content as $value) {
$table->setCellContents($row, $column, $value);
$column++;
}
$row++;
}
return $table->toHtml();
} else {
return Display::return_message(get_lang("NoCategories"), 'warning');
}
}
开发者ID:omaoibrahim,项目名称:chamilo-lms,代码行数:43,代码来源:course_category.lib.php
示例15: foreach
<?php
$sql = 'SELECT * FROM ' . DB_PREFIX . $_SESSION['co_prefix'] . 'journal_vouchers WHERE voucher_status="draft" ORDER by voucher_id DESC';
$draft_jvs = DB::query($sql);
foreach ($draft_jvs as $draft_jv) {
$tbl_draft->addRow();
$tbl_draft->addCell($draft_jv['voucher_id']);
$tbl_draft->addCell(getDateTime($draft_jv['voucher_date'], "dShort"));
$tbl_draft->addCell($draft_jv['voucher_ref_no']);
$tbl_draft->addCell($draft_jv['voucher description']);
$tbl_draft->addCell($draft_jv['debits_total']);
$tbl_draft->addCell($draft_jv['credits_total']);
$tbl_draft->addCell("More info here like created on, last modify etc");
$tbl_draft->addCell("<a class='pull btn btn-primary btn-xs' href ='" . SITE_ROOT . "?route=modules/gl/transactions/journal_vouchers/add_journal_voucher_detail&voucher_id=" . $draft_jv['voucher_id'] . "'>Edit <span class='glyphicon glyphicon-edit'></span></a> <a class='pull btn btn-danger btn-xs' href ='#'>Delete <span class='glyphicon glyphicon-trash'></span></a>");
}
//Journal Vouchers Pending Approvel
$tbl_pending = new HTML_Table('', 'table table-striped table-bordered');
$tbl_pending->addRow();
$tbl_pending->addCell('Voucher ID', '', 'header');
$tbl_pending->addCell('Ref #', '', 'header');
$tbl_pending->addCell('Voucher Description', '', 'header');
$tbl_pending->addCell('Total Amount', '', 'header');
$tbl_pending->addCell('Voucher Approved By', '', 'header');
$tbl_pending->addCell('Voucher Status', '', 'header');
$tbl_pending->addCell('Actions', '', 'header');
?>
<?php
$sql = 'SELECT * FROM ' . DB_PREFIX . $_SESSION['co_prefix'] . 'journal_vouchers WHERE voucher_status = "pending" ORDER by voucher_id DESC';
$pending_jvs = DB::query($sql);
foreach ($pending_jvs as $pending_jv) {
$tbl_pending->addRow();
开发者ID:rylsteel,项目名称:phpledger,代码行数:31,代码来源:view_journal_vouchers.php
示例16: 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;
}
开发者ID:omaoibrahim,项目名称:chamilo-lms,代码行数:49,代码来源:TestCategory.php
示例17: exportAttendanceLogin
/**
* @param string $startDate in UTC time
* @param string $endDate in UTC time
*
* @return string
*/
public function exportAttendanceLogin($startDate, $endDate)
{
$data = $this->getAttendanceLogin($startDate, $endDate);
if (!$data) {
return null;
}
$users = $data['users'];
$results = $data['results'];
$table = new HTML_Table(array('class' => 'data_table'));
$table->setHeaderContents(0, 0, get_lang('User'));
$table->setHeaderContents(0, 1, get_lang('Date'));
$row = 1;
foreach ($users as $user) {
$table->setCellContents($row, 0, $user['lastname'] . ' ' . $user['firstname'] . ' (' . $user['username'] . ')');
$row++;
}
$table->setColAttributes(0, array('style' => 'width:28%'));
$row = 1;
foreach ($users as $user) {
if (isset($results[$user['user_id']]) && !empty($results[$user['user_id']])) {
$dates = implode(', ', array_keys($results[$user['user_id']]));
$table->setCellContents($row, 1, $dates);
}
$row++;
}
//$tableToString = null;
//$sessionInfo = api_get_session_info(api_get_session_id());
//if (!empty($sessionInfo)) {
/*$tableToString .= '<strong>'.get_lang('PeriodToDisplay').'</strong>: '.
sprintf(get_lang('FromDateXToDateY'), $startDate, $endDate);*/
//}
$tableToString = $table->toHtml();
$params = array('filename' => get_lang('Attendance') . '_' . api_get_utc_datetime(), 'pdf_title' => get_lang('Attendance'), 'course_code' => api_get_course_id(), 'show_real_course_teachers' => true);
$pdf = new PDF('A4', null, $params);
$pdf->html_to_pdf_with_template($tableToString);
}
开发者ID:daffef,项目名称:chamilo-lms,代码行数:42,代码来源:attendance.lib.php
示例18: 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>';
}
开发者ID:jorgeeliecerballesteros,项目名称:controldeacceso,代码行数:65,代码来源:ContenidoUsuario.php
示例19: array
$csvContent = array();
$table = new HTML_Table(array('class' => 'data_table'));
$table->setHeaderContents(0, 0, get_lang('Information'));
$csvContent[] = get_lang('Information');
$data = array(get_lang('Name') => $user['complete_name'], get_lang('Email') => $user['email'], get_lang('Phone') => $user['phone'], get_lang('OfficialCode') => $user['official_code'], get_lang('Online') => $user['user_is_online'] ? Display::return_icon('online.png') : Display::return_icon('offline.png'), get_lang('Status') => $user['status'] == 1 ? get_lang('Teacher') : get_lang('Student'), null => sprintf(get_lang('CreatedByXYOnZ'), 'user_information.php?user_id=' . $creatorId, $creatorInfo['username'], api_get_utc_datetime($registrationDate)));
$row = 1;
foreach ($data as $label => $item) {
if (!empty($label)) {
$label = $label . ': ';
}
$table->setCellContents($row, 0, $label . $item);
$csvContent[] = array($label, strip_tags($item));
$row++;
}
$userInformation = $table->toHtml();
$table = new HTML_Table(array('class' => 'data_table'));
$table->setHeaderContents(0, 0, get_lang('Tracking'));
$csvContent[] = get_lang('Tracking');
$data = array(get_lang('FirstLogin') => Tracking::get_first_connection_date($user['user_id']), get_lang('LatestLogin') => Tracking::get_last_connection_date($user['user_id'], true));
$row = 1;
foreach ($data as $label => $item) {
if (!empty($label)) {
$label = $label . ': ';
}
$table->setCellContents($row, 0, $label . $item);
$csvContent[] = array($label, strip_tags($item));
$row++;
}
$trackingInformation = $table->toHtml();
$tbl_session_course = Database::get_main_table(TABLE_MAIN_SESSION_COURSE);
$tbl_session_course_user = Database::get_main_table(TABLE_MAIN_SESSION_COURSE_USER);
开发者ID:KRCM13,项目名称:chamilo-lms,代码行数:31,代码来源:user_information.php
示例20: pubSelect
public function pubSelect($viewCat = null)
{
assert('is_object($this->db)');
echo $this->pubSelMenu($viewCat), '<br/>';
$text = '';
switch ($viewCat) {
case "year":
$pub_years = pdPubList::create($this->db, array('year_list' => true));
echo '<h2>Publications by Year:</h2>';
if (count($pub_years) > 0) {
$table = new HTML_Table(array('class' => 'nomargins', 'width' => '100%'));
$table->addRow(array('Year', 'Num. Publications'), array('class' => 'emph'));
foreach (array_values($pub_years) as $item) {
$cells = array();
$cells[] = '<a href="list_publication.php?year=' . $item['year'] . '">' . $item['year'] . '</a>';
$cells[] = $item['count'];
$table->addRow($cells);
}
echo $table->toHtml();
} else {
echo 'No publication entries.';
}
break;
case 'author':
echo '<h2>Publications by Author:</h2>';
$al = pdAuthorList::create($this->db);
for ($c = 65; $c <= 90; ++$c) {
|
请发表评论