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


PHP HTML_Table::setRowType方法代码示例

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


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

示例1: __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

示例2: __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

示例3: __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

示例4: staffPublicationsTable

 private function staffPublicationsTable()
 {
     $table = new HTML_Table(array('class' => 'stats'));
     $table->addRow(array('Fiscal Year Start', 'T1', 'Author(s)', 'Num Pubs', 'Pub Ids'));
     $table->setRowType(0, 'th');
     $this->statsToHtmlTable($table, 'staff');
     return '<h3>Staff Machine Learning Papers</h3>' . $table->toHtml();
 }
开发者ID:papersdb,项目名称:papersdb,代码行数:8,代码来源:aicml_stats.php

示例5: 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


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