当前位置: 首页>>代码示例>>PHP>>正文


PHP HTML_Table::toHTML方法代码示例

本文整理汇总了PHP中HTML_Table::toHTML方法的典型用法代码示例。如果您正苦于以下问题:PHP HTML_Table::toHTML方法的具体用法?PHP HTML_Table::toHTML怎么用?PHP HTML_Table::toHTML使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在HTML_Table的用法示例。


在下文中一共展示了HTML_Table::toHTML方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: row

            }
        }
    }
    //}
}
########################################################
# Center columns 2,4,5and 6. Columns start with 0 index
########################################################
$table->updateColAttributes(1, "align=center");
$table->updateColAttributes(4, "align=center");
$table->updateColAttributes(5, "align=center");
$table->updateColAttributes(3, "align=center");
########################################################
# Dump the table HTML into a variable
########################################################
$table_html = $table->toHTML();
#echo($table_html);
$message = "<HTML>\n<BODY>\nThese licenses will expire within " . $lead_time . " days. Licenses \nwill expire at 23:59 on the day of expiration.<p>";
$message .= $table_html;
########################################################################
# If the table has more than one row (header row will be one) there
# are expiring licenses
########################################################################(
if ($table->getRowCount() > 1) {
    if ($notify_to && !isset($_GET['nomail'])) {
        $message .= "<p>URL: <a href=\"" . $URL . "\">" . $URL . "</a></p>";
        $message .= "</HTML>";
        echo "Emailing to {$notify_to}<p>\n";
        mail($notify_to, "ALERT: License expiration within " . $lead_time . " days", $message, "From: License Robot <" . $notify_from . ">\nContent-Type: text/html\nMime-Version: 1.0");
    }
}
开发者ID:tseel,项目名称:phplicensewatcher,代码行数:31,代码来源:license_alert.php

示例2: 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();
?>

开发者ID:alannet,项目名称:example,代码行数:29,代码来源:listing35-2.php

示例3: getDetails

 function getDetails($id, $tplname = 'details.tpl.html')
 {
     $this->tpl = new HTML_Template_IT($basedir);
     $this->tpl->loadTemplateFile($this->basedir . $tplname);
     $query = "select * from " . $this->cfg['table']['compound'] . " where id = {$id}";
     $row = $this->db_con->getRow($query);
     $this->tpl->setVariable("HEADING", $row->{"name_" . LC_LANG});
     $this->tpl->setVariable('LC_SPECIFICATIONS', $this->lang->translate('specifications'));
     $query = "select *,comp.id as mixid, comp.name_de as mischname_de,comp.name_en as mischname_en,cat_comp.name_de as mischkatname_de,cat_comp.name_en as mischkatname_en\n            from " . $this->cfg['table']['cat_compound'] . ' as cat_comp, ' . $this->cfg['table']['compound'] . " as comp\n            where comp.id_mischungkat=cat_comp.id AND comp.id={$id}";
     $row = $this->db_con->getRow($query);
     include_once 'HTML/Table.php';
     $tbl = new HTML_Table('class="overview"');
     $tbl->addRow(array($this->lang->translate('name'), $row->{"mischname_" . LC_LANG}));
     $tbl->addRow(array($this->lang->translate('category'), $row->{"mischkatname_" . LC_LANG}));
     $tbl->addRow(array('M100', $row->m100));
     $tbl->addRow(array('M300', $row->m300));
     $tbl->addRow(array('TS', $row->ts));
     $tbl->addRow(array('EAB', $row->eab));
     $tbl->addRow(array('Rebound', $row->rebound));
     $tbl->addRow(array('Shore A', $row->shore_a));
     $tbl->addRow(array('SG', $row->sg));
     $tbl->setColAttributes(0, 'width="100"');
     $tbl->setColAttributes(1, 'width="300"');
     $row1Style = array('class' => 'overview');
     $row2Style = array('class' => 'overviewalternate');
     $tbl->altRowAttributes(0, $row1Style, $row2Style);
     $this->tpl->setVariable("COMPOUND_DATA", $tbl->toHTML());
     $tbl = new HTML_Table('class="overview"');
     $tbl->addRow(array('Name', 'phr'), 'class="overview"', 'TH');
     $query = "select *  from " . $this->cfg['table']['details_compound'] . " where id_mischung={$id}";
     $this->db_res = $this->db_con->Query($query);
     while ($row = $this->db_res->fetchrow(DB_FETCHMODE_OBJECT)) {
         if ($row->id_produkt) {
             $_url = '<a class="maroon" href="' . url(array('module' => 'product', 'action' => 'details', 'id' => $row->id_produkt)) . '">' . $row->name . '</a>';
         } else {
             $_url = $row->name;
         }
         $tbl->addRow(array($_url, $row->phr));
     }
     $query = "select sum(phr) as phrsum from " . $this->cfg['table']['details_compound'] . " where id_mischung={$id}";
     $row = $this->db_con->getRow($query);
     $tbl->addRow(array('', $row->phrsum));
     $tbl->updateColAttributes(1, 'align="right" "bgcolor=#eeeeee"');
     $tbl->updateRowAttributes($tbl->getrowCount() - 1, "bgcolor=#CCCCCC");
     $this->tpl->setVariable('TBL_DETAILS', $tbl->toHTML());
     $this->tpl->setVariable("CATEGORY_COLOR", $this->color);
     return $this->tpl->get();
 }
开发者ID:BackupTheBerlios,项目名称:molecms,代码行数:48,代码来源:mod_compound.php

示例4: die

<?php

// no direct access
defined('PARENT_FILE') or die('Restricted access');
if (is_readable($this->file . "/action/" . $this->registry->action . ".php") == false || $this->registry->action == "index") {
    $this->registry->Error('404 Page NOT Found', $this->registry->path);
} else {
    $title = ucwords(str_replace("_", " ", $this->registry->action));
    $this->registry->page_title = $title;
    $this->setTitle($title . ' | ' . $this->get('config.server.site_name'));
    $table_attrs = array('class' => 'contentpaneopen');
    $rowAttrs = array('class' => 'contentheading', 'width' => '100%');
    $table = new HTML_Table($table_attrs);
    $table->setCellContents(0, 0, $this->registry->page_title);
    $table->setColAttributes(0, $rowAttrs);
    $this->addContent($table->toHTML());
    require_once 'action/' . $this->registry->action . '.php';
}
开发者ID:Rem122,项目名称:Uthando-CMS,代码行数:18,代码来源:index.php

示例5: array

$tbl->addRow(array($lang->translate('website'), $row->product_url));
$tbl->setColAttributes(0, 'width="100"');
$tbl->setColAttributes(1, 'width="300"');
$row1Style = array('class' => 'overview');
$row2Style = array('class' => 'overviewalternate');
$tbl->altRowAttributes(0, $row1Style, $row2Style);
$tpl->setVariable("UEBERSCHRIFT", $row->product_name);
$tpl->SetVariable("TABELLE_UEBERSCHRIFT", $row->product_name . " (" . $link_back . ")");
/** BEGIN Vertrieb **/
$query = "select *,t_reseller.name as reseller\n        from {$table['product']},{$table['company']} as t_reseller, {$table['reseller']}\n        where {$table['product']}.id={$id}\n        AND {$table['product']}.id={$table['reseller']}.id_produkt\n        AND {$table['reseller']}.id_firma=t_reseller.id";
require_once 'mms_tablepager.php';
$tabpage = new PageTable($cfg['database']['dsn'], "overview");
$tabpage->fields = array('name', 'land');
$tabpage->make_url = false;
$tabpage->add_extra = false;
$tabpage->col_view = 'name';
$tabpage->url_view = url(array('module' => 'company', 'action' => 'details'));
$res_vertrieb = '<h2>' . $lang->translate('reseller') . '</h2>' . $tabpage->get($query, $from, 'overview') . '<br>';
/** END Vertrieb **/
/** BEGIN Beispielmischungen **/
$query = "select *,{$table['compound']}.id as mixid, {$table['compound']}.name_" . LC_LANG . " as mischname from {$table['product']},{$table['compound_details']},{$table['compound']} where {$table['compound_details']}.id_produkt={$table['product']}.id AND {$table['compound']}.id = {$table['compound_details']}.id_mischung AND {$table['product']}.id={$id}";
$tabpage = new PageTable($cfg['database']['dsn'], "overview");
$tabpage->fields = array('mischname');
$tabpage->map_cols = array('mischname' => $lang->translate('compound'));
$tabpage->url_view = url(array('module' => 'compound', 'action' => 'details'));
$tabpage->setEmptyString($lang->translate('no compounds available for this product'));
$res_compound = '<h2>' . $lang->translate('compound') . '</h2>' . $tabpage->get($query, $from, 'overview');
/** END Beispielmischungen  **/
$tpl->setCurrentBlock("TABELLEBLOCK");
$tpl->setVariable("TABELLE", $tbl->toHTML() . $res_vertrieb . $res_compound);
$tpl->parseCurrentBlock();
开发者ID:BackupTheBerlios,项目名称:molecms,代码行数:31,代码来源:details.php

示例6: array

$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"));
    //隔行变色
    $rownum++;
}
$tb = $table->toHTML();
$mysqli->close();
?>


开发者ID:simple8888,项目名称:rm,代码行数:28,代码来源:renliziyuan1.php

示例7: fiches_a_valider

/** fiches_a_valider () - Renvoie les annonces restant a valider par un administrateur
*
* @return   string  HTML
*/
function fiches_a_valider()
{
    // Pour les administrateurs d'une rubrique, on affiche les fiches a valider de cette rubrique
    // On effectue une requete sur le bazar pour voir les fiches a administrer
    $GLOBALS['_BAZAR_']['url']->addQueryString(BAZ_VARIABLE_VOIR, BAZ_VOIR_ADMIN);
    $res = '<h2>' . BAZ_ANNONCES_A_ADMINISTRER . '</h2><br />' . "\n";
    $requete = 'SELECT * FROM ' . BAZ_PREFIXE . 'fiche, ' . BAZ_PREFIXE . 'nature WHERE bf_statut_fiche=0 AND ' . 'bn_id_nature=bf_ce_nature AND bn_ce_id_menu IN (' . $GLOBALS['_BAZAR_']['categorie_nature'] . ') ';
    if (isset($GLOBALS['_BAZAR_']['langue'])) {
        $requete .= ' and bn_ce_i18n like "' . $GLOBALS['_BAZAR_']['langue'] . '%" ';
    }
    $requete .= 'ORDER BY bf_date_maj_fiche DESC';
    $resultat = $GLOBALS['_BAZAR_']['db']->query($requete);
    if (DB::isError($resultat)) {
        echo 'Echec de la requete<br />' . $resultat->getMessage() . '<br />' . $resultat->getDebugInfo();
    }
    if ($resultat->numRows() != 0) {
        $tableAttr = array('id' => 'table_bazar');
        $table = new HTML_Table($tableAttr);
        $entete = array(BAZ_TITREANNONCE, BAZ_ANNONCEUR, BAZ_TYPE_FICHE, BAZ_PUBLIER, BAZ_SUPPRIMER);
        $table->addRow($entete);
        $table->setRowType(0, 'th');
        // On affiche une ligne par proposition
        while ($ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) {
            //Requete pour trouver le nom et prenom de l'annonceur
            $requetenomprenom = 'SELECT ' . BAZ_CHAMPS_PRENOM . ', ' . BAZ_CHAMPS_NOM . ' FROM ' . BAZ_ANNUAIRE . ' WHERE ' . BAZ_CHAMPS_ID . '=' . $ligne['bf_ce_utilisateur'];
            $resultatnomprenom = $GLOBALS['_BAZAR_']['db']->query($requetenomprenom);
            if (DB::isError($resultatnomprenom)) {
                echo "Echec de la requete<br />" . $resultatnomprenom->getMessage() . "<br />" . $resultatnomprenom->getDebugInfo();
            }
            while ($lignenomprenom = $resultatnomprenom->fetchRow(DB_FETCHMODE_ASSOC)) {
                $annonceur = $lignenomprenom[BAZ_CHAMPS_PRENOM] . " " . $lignenomprenom[BAZ_CHAMPS_NOM];
            }
            $lien_voir = $GLOBALS['_BAZAR_']['url'];
            $lien_voir->addQueryString(BAZ_VARIABLE_ACTION, BAZ_VOIR_FICHE);
            $lien_voir->addQueryString('id_fiche', $ligne['bf_id_fiche']);
            //$lien_voir->addQueryString('typeannonce', $ligne['bn_id_nature']);
            // Nettoyage de l'url
            // NOTE (jpm - 23 mai 2007): pour �tre compatible avec PHP5 il faut utiliser tjrs $GLOBALS['_BAZAR_']['url'] car en php4 on
            // copie bien une variable mais pas en php5, cela reste une r�f�rence...
            $GLOBALS['_BAZAR_']['url']->removeQueryString(BAZ_VARIABLE_ACTION);
            $GLOBALS['_BAZAR_']['url']->removeQueryString('id_fiche');
            //$GLOBALS['_BAZAR_']['url']->removeQueryString('typeannonce');
            $GLOBALS['_BAZAR_']['url']->addQueryString('id_fiche', $ligne['bf_id_fiche']);
            $GLOBALS['_BAZAR_']['url']->addQueryString('typeannonce', $ligne['bn_id_nature']);
            $GLOBALS['_BAZAR_']['url']->addQueryString(BAZ_VARIABLE_ACTION, BAZ_VOIR_FICHE);
            $lien_voir = $GLOBALS['_BAZAR_']['url']->getURL();
            $GLOBALS['_BAZAR_']['url']->removeQueryString(BAZ_VARIABLE_ACTION);
            $GLOBALS['_BAZAR_']['url']->addQueryString(BAZ_VARIABLE_ACTION, BAZ_ACTION_PUBLIER);
            $lien_publie_oui = $GLOBALS['_BAZAR_']['url']->getURL();
            $GLOBALS['_BAZAR_']['url']->removeQueryString(BAZ_VARIABLE_ACTION);
            $GLOBALS['_BAZAR_']['url']->addQueryString(BAZ_VARIABLE_ACTION, BAZ_ACTION_PAS_PUBLIER);
            $lien_publie_non = $GLOBALS['_BAZAR_']['url']->getURL();
            $GLOBALS['_BAZAR_']['url']->removeQueryString(BAZ_VARIABLE_ACTION);
            $GLOBALS['_BAZAR_']['url']->addQueryString(BAZ_VARIABLE_ACTION, BAZ_ACTION_SUPPRESSION);
            $lien_supprimer = $GLOBALS['_BAZAR_']['url']->getURL();
            $GLOBALS['_BAZAR_']['url']->removeQueryString(BAZ_VARIABLE_ACTION);
            $GLOBALS['_BAZAR_']['url']->removeQueryString('id_fiche');
            $GLOBALS['_BAZAR_']['url']->removeQueryString('typeannonce');
            $table->addRow(array('<a href="' . $lien_voir . '">' . $ligne['bf_titre'] . '</a>' . "\n", $annonceur . "\n", $ligne['bn_label_nature'] . "\n", "<a href=\"" . $lien_publie_oui . "\">" . BAZ_OUI . "</a> / \n" . "<a href=\"" . $lien_publie_non . "\">" . BAZ_NON . "</a>", "<a href=\"" . $lien_supprimer . "\"" . " onclick=\"javascript:return confirm('" . BAZ_CONFIRMATION_SUPPRESSION . "');\">" . BAZ_SUPPRIMER . "</a>\n"));
            // col 5 : supprimer
        }
        $table->altRowAttributes(1, array("class" => "ligne_impaire"), array("class" => "ligne_paire"));
        $table->updateColAttributes(1, array("align" => "center"));
        $table->updateColAttributes(2, array("align" => "center"));
        $table->updateColAttributes(3, array("align" => "center"));
        $table->updateColAttributes(4, array("align" => "center"));
        $res .= $table->toHTML();
    } else {
        $res .= '<p class="zone_info">' . BAZ_PAS_DE_FICHE_A_VALIDER . '</p>' . "\n";
    }
    $GLOBALS['_BAZAR_']['url']->addQueryString(BAZ_VARIABLE_ACTION, BAZ_VOIR_TOUTES_ANNONCES);
    // Nettoyage de l'url
    $GLOBALS['_BAZAR_']['url']->removeQueryString(BAZ_VARIABLE_ACTION);
    $GLOBALS['_BAZAR_']['url']->removeQueryString('id_fiche');
    $GLOBALS['_BAZAR_']['url']->removeQueryString('typeannonce');
    // Les autres fiches, deja validees
    $res .= '<h2>' . BAZ_TOUTES_LES_FICHES . '</h2>' . "\n";
    $requete = 'SELECT * FROM ' . BAZ_PREFIXE . 'fiche, ' . BAZ_PREFIXE . 'nature WHERE bf_statut_fiche=1 AND ' . 'bn_id_nature=bf_ce_nature AND bn_ce_id_menu IN (' . $GLOBALS['_BAZAR_']['categorie_nature'] . ') ';
    if (isset($GLOBALS['_BAZAR_']['langue'])) {
        $requete .= ' and bn_ce_i18n like "' . $GLOBALS['_BAZAR_']['langue'] . '%" ';
    }
    $requete .= 'ORDER BY bf_date_maj_fiche DESC';
    $resultat = $GLOBALS['_BAZAR_']['db']->query($requete);
    if (DB::isError($resultat)) {
        echo 'Echec de la requete<br />' . $resultat->getMessage() . '<br />' . $resultat->getDebugInfo();
    }
    if ($resultat->numRows() != 0) {
        $tableAttr = array('class' => 'table_bazar');
        $table = new HTML_Table($tableAttr);
        $entete = array(BAZ_TITREANNONCE, BAZ_ANNONCEUR, BAZ_TYPE_FICHE, BAZ_PUBLIER, BAZ_SUPPRIMER);
        $table->addRow($entete);
        $table->setRowType(0, 'th');
        // On affiche une ligne par proposition
        while ($ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) {
            //Requete pour trouver le nom et prenom de l'annonceur
            $requetenomprenom = 'SELECT ' . BAZ_CHAMPS_PRENOM . ', ' . BAZ_CHAMPS_NOM . ' FROM ' . BAZ_ANNUAIRE . ' WHERE ' . BAZ_CHAMPS_ID . '=' . $ligne['bf_ce_utilisateur'];
//.........这里部分代码省略.........
开发者ID:BackupTheBerlios,项目名称:wikiplug,代码行数:101,代码来源:bazar.fonct.php

示例8: drawCell

 /**
  * Draw the cell for the day $days
  *
  * @param days Date_Calc's 'days' value
  * @param week week number of this cell in the calendar
  * @param col column number of this cell in the calendar
  *
  * @access public
  * @return string of the rendered HTML
  */
 function drawCell($days, $week, $col)
 {
     $type = $this->getType($days);
     $a = array_merge($this->_attributes['day'], $this->_attributes['day_' . $type]);
     $t = new HTML_Table($a);
     $t->addRow(array($this->drawCellLabel($days, $week, $col)));
     $t->setRowAttributes(0, $this->_attributes['label']);
     $t->updateRowAttributes(0, $this->_attributes['label_' . $type]);
     if ($this->_size & HTML_CALENDAR_FULL) {
         $type = $this->getType($days);
         if (!$this->_otherMonths && $type == 'other_month') {
             $cell_text = '&nbsp;';
         } else {
             $cell_text = $this->drawCellText($days, $week, $col);
         }
         $t->addRow(array($cell_text));
         $t->setRowAttributes(1, $this->_attributes['text']);
         $t->updateRowAttributes(1, $this->_attributes['text_' . $type]);
     }
     return $t->toHTML();
 }
开发者ID:Artea,项目名称:freebeer,代码行数:31,代码来源:Calendar.php

示例9: setData


//.........这里部分代码省略.........
                     $row_format_value = strtolower($value);
                 }
                 if ($col > 1 && $row_format == TRUE) {
                     // Valid ROW format
                     $table->setCellContents($record + 1, $col, $this->formatValue($this->formats[$row_format_column]->rows[$row_format_value], $value));
                 } else {
                     if (isset($this->formats[strtolower($key)])) {
                         // Valid format
                         if ($this->formats[strtolower($key)]->class == 'column') {
                             // Valid column format
                             $table->setCellContents($record + 1, $col, $this->formatValue($this->formats[strtolower($key)]->type, $value));
                         } else {
                             // Row format, but invalid value
                             $table->setCellContents($record + 1, $col, $value);
                         }
                     } else {
                         // If not format, we assume its a number
                         $table->setCellContents($record + 1, $col, $value);
                     }
                 }
                 //CSV
                 if ($col == 1) {
                     fwrite($fh, '"' . $value . '"');
                 } else {
                     fwrite($fh, ',"' . $value . '"');
                 }
             }
             fwrite($fh, "\n");
         } else {
             if ($record == 0) {
                 $col = 0;
                 $table->setHeaderContents(0, $col, '#');
                 //$yui_column='columns: [';
                 foreach ($row as $key => $value) {
                     $col++;
                     $table->setHeaderContents($record, $col, ucfirst($key));
                     if ($col > 1) {
                         //$yui_column.=$yui_column.",\"$col\"";
                     } else {
                         //$yui_column.=$yui_column."\"$col\"";
                     }
                     //CSV
                     if ($col == 1) {
                         fwrite($fh, "{$key}");
                     } else {
                         fwrite($fh, ",{$key}");
                     }
                 }
                 //$yui_column.=$yui_column."]";
                 fwrite($fh, "\n");
                 $col = 0;
                 $table->setCellContents($record + 1, $col, $record + 1);
                 $table->setRowAttributes($record + 1, $rAttrs, true);
                 foreach ($row as $key => $value) {
                     $col++;
                     // This checks if we have a valid ROW format based on col 1 value
                     if ($col == 1 && isset($this->formats[strtolower($key)]) && $this->formats[strtolower($key)]->class == 'row' && isset($this->formats[strtolower($key)]->rows[strtolower($value)])) {
                         $row_format = TRUE;
                         $row_format_column = strtolower($key);
                         $row_format_value = strtolower($value);
                     }
                     if ($col > 1 && $row_format == TRUE) {
                         // Valid ROW format
                         $table->setCellContents($record + 1, $col, $this->formatValue($this->formats[$row_format_column]->rows[$row_format_value], $value));
                     } else {
                         if (isset($this->formats[strtolower($key)])) {
                             // Valid Format
                             if ($this->formats[strtolower($key)]->class == 'column') {
                                 // Valid Column Format
                                 $table->setCellContents($record + 1, $col, $this->formatValue($this->formats[strtolower($key)]->type, $value));
                             } else {
                                 // Invalid Row Format
                                 $table->setCellContents($record + 1, $col, $value);
                             }
                         } else {
                             // No format
                             $table->setCellContents($record + 1, $col, $value);
                         }
                     }
                     // CSV
                     if ($col == 1) {
                         fwrite($fh, '"' . $value . '"');
                     } else {
                         fwrite($fh, ',"' . $value . '"');
                     }
                 }
                 fwrite($fh, "\n");
             }
         }
         $record++;
     }
     fwrite($fh, "\n");
     fclose($fh);
     // Get the HTML for the table
     if ($this->isHidden == FALSE) {
         $this->HTML = $table->toHTML();
     } else {
         $this->HTML = '';
     }
 }
开发者ID:rjevansatari,项目名称:Analytics,代码行数:101,代码来源:Report_Class.php

示例10: listTableDbVars

 function listTableDbVars($withForm = 1, $doNl2Br = 1, $listAction = "")
 {
     //Ajouter les identifiants ajoutés precédemment au liens HREF de la table
     //Cf MODIF_FP.pl
     require_once 'HTML/Table.php';
     $table = new HTML_Table("class=\"localList\"");
     $header = $this->fetchHeader();
     $content = $this->fetchListe();
     $id_name = $this->getIdName();
     foreach ($header as $value) {
         if ($value->visible) {
             $tab_row[0][] = $value->content;
         }
     }
     $fkeys = $this->getFKeysString();
     $cpt_row = 1;
     while ($a_row = fetchRowAssocDb($content)) {
         foreach ($header as $key => $value) {
             if ($value->visible && $key != "ATAB_CHKSELECT_" && $key != "ATAB_SELECT_") {
                 if ($doNl2Br == 1) {
                     $tab_row[$cpt_row][] = nl2br(htmlentities($a_row[$key], ENT_QUOTES, $this->encoding));
                 } else {
                     $tab_row[$cpt_row][] = htmlentities($a_row[$key], ENT_QUOTES, $this->encoding);
                 }
             }
         }
         // Afficher ou non la colonne des checkbox de selection
         if ($header['ATAB_CHKSELECT_']->visible) {
             $tab_row[$cpt_row][] = "<p align=\"center\"><input type=\"checkbox\" name=\"SEL_" . $id_name . "_" . $a_row[$id_name] . "\" value=\"ON\" " . ($this->vars["SEL_" . $id_name . "_" . $a_row[$id_name]] == "ON" ? "CHECKED" : "") . "><input type=\"hidden\" name=\"WAS_" . $id_name . "_" . $a_row[$id_name] . "\" value = \"" . $this->vars["SEL_" . $id_name . "_" . $a_row[$id_name]] . "\" size=\"6\"></p>";
         }
         // Afficher ou non la colonne des liens de selection
         if ($header['ATAB_SELECT_']->visible) {
             $tab_row[$cpt_row][] = "<A HREF=\"" . $_SERVER['PHP_SELF'] . "?" . $id_name . "=" . $a_row[$id_name] . "&" . $fkeys . "\">[{$cpt_row}]</A>";
         }
         $cpt_row++;
     }
     foreach ($tab_row as $key => $value) {
         $table->addRow($tab_row[$key], $key == 0 ? "class=\"firstLine\"" : "");
     }
     //formulaire ayant action sur le tableau
     $str_form = "<div align=\"center\">\n";
     if ($withForm == 1) {
         $str_form .= "<form method=\"post\" name=\"{$this->name}_TBL\" action=\"" . $_SERVER['PHP_SELF'] . "?" . $GLOBALS['QUERY_STRING'] . "\">\n";
     }
     $str_form .= $table->toHTML();
     if ($withForm == 1) {
         $str_form .= "<input type=\"submit\" value=\"S&eacute;lectionner\" name=\"SELECTIONNER_{$this->name}\">\n";
         $str_form .= "<input type=\"submit\" value=\"Supprimer\" name=\"SUPPRIMER_{$this->name}\">\n";
         $str_form .= "</form></div>\n";
     }
     $str_form .= "\n";
     return $str_form;
 }
开发者ID:BackupTheBerlios,项目名称:phpaie,代码行数:53,代码来源:classes.php

示例11: toHtml

 /**
  * Returns Html for the group
  * 
  * @access      public
  * @return      string
  */
 function toHtml()
 {
     include_once 'HTML/Table.php';
     $tripleLinkTable = new HTML_Table();
     $tripleLinkTable->setAutoGrow(true);
     $tripleLinkTable->setAutoFill('');
     $tripleLinkTable->updateAttributes($this->getAttributes());
     $row = 0;
     $col = 0;
     if ($this->_columnNames) {
         foreach ($this->_columnNames as $key => $value) {
             ++$col;
             $tripleLinkTable->setCellContents($row, $col, $value);
             $tripleLinkTable->setCellAttributes($row, $col, array('style' => 'text-align: center'));
         }
         ++$row;
     }
     foreach (array_keys($this->_rows) as $key) {
         $col = 0;
         $tripleLinkTable->setCellContents($row, $col, $this->_rowNames[$key]);
         foreach (array_keys($this->_rows[$key]) as $key2) {
             ++$col;
             $tripleLinkTable->setCellContents($row, $col, $this->_rows[$key][$key2]->toHTML());
             $tripleLinkTable->setCellAttributes($row, $col, array('style' => 'text-align: center'));
         }
         ++$row;
     }
     if ($this->_columnNames) {
         $tripleLinkTable->setRowAttributes(0, array('class' => 'elementTableColumnLabel'), true);
     }
     $tripleLinkTable->setColAttributes(0, array('class' => 'elementTableRowLabel'));
     return $tripleLinkTable->toHTML();
     /*include_once('HTML/QuickForm/Renderer/Default.php');
       $renderer =& new HTML_QuickForm_Renderer_Default();
       $renderer->setElementTemplate('{element}');
       $this->accept($renderer);
       return $renderer->toHtml();*/
 }
开发者ID:bobah,项目名称:acbdb,代码行数:44,代码来源:ElementTable.php

示例12: contentpaneHeading

 private function contentpaneHeading($heading)
 {
     $table = new HTML_Table(array('class' => 'contentpaneopen'));
     $table->setCellContents(0, 0, stripslashes($heading));
     $table->setColAttributes(0, array('class' => 'contentheading'));
     return $table->toHTML();
 }
开发者ID:Rem122,项目名称:Uthando-CMS,代码行数:7,代码来源:Uthando.php

示例13: license

            # Keep track of total number of licenses for a particular feature
            # this is since you can have licenses with different expiration
            $total_licenses += $feature_array[$p]["num_licenses"];
            $feature_table->addRow(array($feature_array[$p]["num_licenses"] . " license(s) expire(s) in " . $feature_array[$p]["days_to_expiration"] . " day(s) Date of expiration: " . $feature_array[$p]["expiration_date"]), "colspan=\"3\"");
            #######################################################################
            # Check whether license is close to expiration date
            #######################################################################
            if ($feature_array[$p]["days_to_expiration"] <= $lead_time) {
                if ($feature_array[$p]["days_to_expiration"] >= 0) {
                    $feature_table->updateRowAttributes($feature_table->getRowCount() - 1, "class=\"expires_soon\"");
                } elseif ($feature_array[$p]["days_to_expiration"] < 0) {
                    $feature_table->updateRowAttributes($feature_table->getRowCount() - 1, "class=\"already_expired\"");
                }
            }
        }
        $table->addRow(array($key, $feature_array[0]["vendor_daemon"], $total_licenses, $feature_table->toHTML()));
        unset($feature_table);
    }
    ########################################################
    # Center columns 2. Columns start with 0 index
    ########################################################
    $table->updateColAttributes(1, "align=\"center\"");
    $table->display();
} else {
    ########################################################
    # Licenses currently being used
    ########################################################
    echo "<p>Following is the list of licenses currently being used. Licenses that are currently not in use are not shown.</p>\n";
    # stop the annoying errors in error_log saying undefined var
    # happens when no user lics been checked out
    if (isset($host['cacti'])) {
开发者ID:tseel,项目名称:phplicensewatcher,代码行数:31,代码来源:details.php


注:本文中的HTML_Table::toHTML方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。