本文整理汇总了PHP中HTML_Table::updateColAttributes方法的典型用法代码示例。如果您正苦于以下问题:PHP HTML_Table::updateColAttributes方法的具体用法?PHP HTML_Table::updateColAttributes怎么用?PHP HTML_Table::updateColAttributes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HTML_Table
的用法示例。
在下文中一共展示了HTML_Table::updateColAttributes方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __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);
}
}
示例2: __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;
}
}
示例3: __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();
}
示例4: __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);
}
}
示例5: die
if ($_GET['sortby'] == "date") {
$sql = "SELECT `flmevent_date`,`flmevent_user`,MAX(`flmevent_feature`),count(*) FROM `flexlm_events` WHERE `flmevent_type`='OUT' GROUP BY `flmevent_date`,`flmevent_user` ORDER BY `flmevent_date`,`flmevent_user`,`flmevent_feature` DESC;";
} else {
if ($_GET['sortby'] == "user") {
$sql = "SELECT `flmevent_date`,`flmevent_user`,MAX(`flmevent_feature`),count(*) FROM `flexlm_events` WHERE `flmevent_type`='OUT' GROUP BY `flmevent_user`,`flmevent_date` ORDER BY `flmevent_user`,`flmevent_date`,`flmevent_feature` DESC;";
} else {
$sql = "SELECT `flmevent_date`,MAX(flmevent_user),`flmevent_feature`,count(*) FROM `flexlm_events` WHERE `flmevent_type`='OUT' GROUP BY `flmevent_feature`,`flmevent_date` ORDER BY `flmevent_feature`,`flmevent_date`,`flmevent_user` DESC;";
}
}
if (isset($debug) && $debug == 1) {
print_sql($sql);
}
$recordset = $db->query($sql);
if (DB::isError($recordset)) {
die($recordset->getMessage());
}
while ($row = $recordset->fetchRow()) {
$table->AddRow($row, "style=\"background: " . $features_color[$row[2]] . ";\"");
}
$table->updateColAttributes(3, "align=\"center\"");
$recordset->free();
$db->disconnect();
################################################################
# Right align the 3 column
################################################################
$table->updateColAttributes(2, "align=\"right\"");
$table->display();
include './version.php';
?>
</body></html>
示例6: 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();
}
示例7: showSearchParams
public function showSearchParams()
{
$sp =& $_SESSION['search_params'];
$table = new HTML_Table(array('class' => 'nomargins', 'width' => '90%'));
if ($sp->search != '') {
$table->addRow(array($sp->search));
} else {
// check each field of the search parameter except the dates and
// authors
foreach (array_diff(array_keys(get_class_vars(get_class($sp))), array('startdate', 'enddate', 'author_myself', 'authors', 'paper_rank', 'paper_rank_other', 'paper_col')) as $param) {
if ($sp->{$param} != '') {
$name = '';
if ($param == 'cat_id') {
$cl = pdCatList::create($this->db);
$name = 'Category';
$value =& $cl[$sp->cat_id];
} else {
$name = preg_replace('/_/', ' ', ucwords($param));
$value = $sp->{$param};
}
if ($param == 'show_internal_info' && $sp->{$param} == 'no') {
continue;
}
if ($name != '') {
$table->addRow(array($name . ':', $value));
}
}
}
$al = null;
$values = array();
if (!empty($_SESSION['user']) && $sp->author_myself != '' && $_SESSION['user']->author_id != '') {
$authors = pdAuthorList::create($this->db, null, null, true);
$values[] = $authors[$_SESSION['user']->author_id];
}
if (!empty($sp->authors)) {
$values[] = $sp->authors;
}
if (count($values) > 0) {
$table->addRow(array('<b>Author(s)</b>:', implode(' AND ', $values)));
}
if (isset($_SESSION['user']) && $_SESSION['user']->showInternalInfo()) {
if (!empty($sp->paper_rank)) {
// ranking
$label = 'Ranking:';
$rankings = pdPublication::rankingsGlobalGet($this->db);
foreach ($sp->paper_rank as $rank_id => $value) {
if ($value != 'yes') {
continue;
}
$table->addRow(array($label, $rankings[$rank_id]));
$label = '';
}
if ($sp->paper_rank_other != '') {
$table->addRow(array($label, $sp->paper_rank_other));
}
}
if (!empty($sp->paper_col)) {
// collaboration
$label = 'Collaboration:';
$collaborations = pdPublication::collaborationsGet($this->db);
foreach ($sp->paper_col as $col_id => $value) {
if ($value != 'yes') {
continue;
}
$table->addRow(array($label, $collaborations[$col_id]));
$label = '';
}
}
}
if ($sp->startdate != '' && $sp->enddate != '') {
$stime = strtotime(implode('-', $sp->startdate) . '-1');
$etime = strtotime(implode('-', $sp->enddate) . '-1');
// now check the dates
if ($etime > $stime) {
$table->addRow(array('<b>Start date</b>:', $sp->startdate['Y'] . '-' . sprintf("%02d", $sp->startdate['M'])));
$table->addRow(array('<b>End date</b>:', $sp->enddate['Y'] . '-' . sprintf("%02d", $sp->enddate['M'])));
}
}
}
$table->updateColAttributes(0, array('class' => 'emph'), true);
echo '<h3>SEARCH RESULTS FOR</h3>';
echo $table->toHtml();
}
示例8: showUser
public function showUser()
{
$user =& $_SESSION['user'];
$user->collaboratorsDbLoad($this->db);
echo '<h2>Login Information <a href="edit_user.php?status=edit">', '<img src="../images/pencil.gif" title="edit" ', 'alt="edit" height="16" width="16" border="0" ', 'align="top" /></a></h2>';
$table = new HTML_Table(array('width' => '100%', 'border' => '0', 'cellpadding' => '6', 'cellspacing' => '0'));
$table->setAutoGrow(true);
$table->addRow(array('Login:', $user->login));
$table->addRow(array('Name:', $user->name));
$table->addRow(array('E-mail:', $user->email));
$option_value = $user->showInternalInfo() ? 'Yes' : 'No';
$table->addRow(array('Show Internal Info:', $option_value));
$option_value = $user->showUserInfo() ? 'Yes' : 'No';
$table->addRow(array('Show User Info:', $option_value));
if (is_array($user->collaborators) && count($user->collaborators) > 0) {
$rowcount = 0;
foreach ($user->collaborators as $collaborator) {
if ($rowcount == 0) {
$cell1 = 'Favorite Collaborators:';
} else {
$cell1 = '';
}
$table->addRow(array($cell1, $collaborator));
$rowcount++;
}
} else {
$table->addRow(array('Favorite Collaborators:', 'None assigned'));
}
$table->updateColAttributes(0, array('class' => 'emph', 'width' => '30%'));
$this->table =& $table;
}
示例9: elseif
#######################################################################
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'])) {
$cactiurl = $cactiurl . $host['cacti'];
$cactigraph = $cactigraph . $host['cacti'];
printf("<div align=\"center\"><a href=\"%s\" border=0><img src=\"%s\"></a></div>\n", $cactiurl, $cactigraph);
}
$master_array = getDetails($host);
$users = $master_array['users'];
示例10: array
$data[0][] = 'i am';
$data[0][] = 'i think';
$data[0][] = 'therefore';
$data[0][] = 'therefore';
$data[1][] = 'i think';
$data[1][] = 'i am';
$data[1][] = 'therefore';
$data[1][] = 'therefore';
$data[2][] = 'i am';
$data[2][] = 'therefore';
$data[2][] = 'i think';
$data[2][] = 'i think';
foreach ($data as $key => $value) {
$table->addRow($data[$key], array(array('bgcolor' => 'blue', 'align' => 'center'), array('bgcolor' => 'green'), array('bgcolor' => 'red')));
}
foreach ($data as $key => $value) {
$table->addRow($data[$key], array('bgcolor=blue', 'bgcolor=green', 'bgcolor=red'));
}
foreach ($data as $key => $value) {
$table->addRow($data[$key], 'bgcolor=yellow align=right', 'TD', true);
}
foreach ($data as $key => $value) {
$table->addRow($data[$key], array('bgcolor' => 'pink', 'align' => 'center'));
}
$table->setColAttributes(1, 'bgcolor=purple');
$table->updateColAttributes(2, array('bgcolor=blue', 'bgcolor=green', 'bgcolor=red'));
echo '<pre>';
var_dump($table->getCellAttributes(2, 2));
var_dump($table->getRowAttributes(8));
echo '</pre>';
echo $table->toHTML();
示例11: 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'];
//.........这里部分代码省略.........
示例12: __construct
//.........这里部分代码省略.........
} else {
if (strlen($this->tab) != 1 || ord($this->tab) < ord('A') || ord($this->tab) > ord('Z')) {
$this->pageError = true;
return;
}
}
$venue_list = pdVenueList::create($this->db, array('starting_with' => $this->tab, 'cat_id' => $this->cat_id));
$this->category = new pdCategory();
$this->category->dbLoad($this->db, $this->cat_id);
$form = new HTML_QuickForm('cat_selection', 'get', 'list_venues.php');
$form->addElement('hidden', 'tab', $this->tab);
$form->addElement('select', 'cat_id', 'Category:', array('' => '-- All Categories --') + pdCatList::create($this->db), array('onchange' => 'update();'));
$renderer =& $form->defaultRenderer();
$form->accept($renderer);
$form->setDefaults(array('cat_id' => ''));
$alpha_menu = $this->alphaSelMenu($this->tab, get_class($this) . '.php');
// put category id in the alpha menu
if (!empty($this->cat_id)) {
$alpha_menu = preg_replace('/tab=(\\w)/', "tab=\\1&cat_id={$this->cat_id}", $alpha_menu);
}
$this->javascript();
echo $alpha_menu;
echo '<h2>Publication Venues</h2>';
echo $renderer->toHtml();
if (empty($venue_list) || count($venue_list) == 0) {
echo 'No venues with name starting with ', $this->tab, '<br/>';
return;
}
foreach ($venue_list as $venue) {
// only show global venues
if ($venue->v_usage == 'single') {
continue;
}
$venue->dbLoad($this->db, $venue->venue_id);
$table = new HTML_Table(array('class' => 'publist'));
$cells = array();
$text = '';
if ($venue->title != '') {
$text .= '<b>' . $venue->title . '</b><br/>';
}
$v_cat = $venue->categoryGet();
if (!empty($v_cat)) {
$text .= '<b>' . ucfirst($v_cat) . '</b>: ';
}
$url = $venue->urlGet();
if ($url != null) {
$text .= '<a href="' . $url . '" target="_blank">';
}
$text .= $venue->nameGet();
if ($url != null) {
$text .= '</a>';
}
if (!empty($venue->options)) {
$vopt_names = $venue->voptsGet();
foreach ($venue->options as $vopt_id => $value) {
if (!empty($value)) {
$text .= '<br/><b>' . $vopt_names[$vopt_id] . '</b>: ' . $value;
}
}
}
if ($venue->editor != '') {
$text .= "<br/><b>Editor: </b>" . $venue->editor;
}
if (isset($venue->ranking)) {
$text .= '<br/><b>Ranking</b>: ' . $venue->ranking;
}
// display occurrences
if (count($venue->occurrences) > 0) {
foreach ($venue->occurrences as $occ) {
$text .= '<br/>';
$date = explode('-', $occ->date);
if ($occ->url != '') {
$text .= '<a href="' . $occ->url . '" target="_blank">';
}
$text .= $date[0];
if ($occ->url != '') {
$text .= '</a>';
}
if ($occ->location != '') {
$text .= ', ' . $occ->location;
}
}
} else {
if ($venue->date != '' && $venue->date != '0000-00-00') {
$date = explode('-', $venue->date);
$text .= "<br/><b>Date: </b>" . $date[0] . '-' . $date[1];
}
}
$pub_count = pdPubList::create($this->db, array('venue_id_count' => $venue->venue_id));
$text .= '<a href="list_publication.php?venue_id=' . $venue->venue_id . '&menu=0"><span class="small" style="color:#000;font-weight:normal;">' . '<br/>Publication entries: ' . $pub_count . '</span></a>';
$cells[] = $text;
if ($this->access_level > 0) {
$cells[] = $this->getVenueIcons($venue);
}
$table->addRow($cells);
$table->updateColAttributes(1, array('class' => 'icons'), NULL);
echo $table->toHtml();
unset($table);
}
}
示例13: showPublication
private function showPublication(&$pub)
{
$content = "<h2>" . $pub->title;
if ($this->access_level > 0) {
$content .= getPubIcons($this->db, $pub, 0xc);
}
$content .= "</h2>\n" . $pub->authorsToHtml();
if (isset($pub->paper) && strtolower($pub->paper) != 'no paper' && basename($pub->paper) != 'paper_') {
if ($pub->paperExists()) {
$content .= 'Full Text: <a href="' . $pub->paperAttGetUrl() . '">';
$name = split('paper_', $pub->paper);
if ($name[1] != '') {
$content .= $name[1];
}
$content .= '</a> ';
$content .= getPubIcons($this->db, $pub, 0x1) . "<br/>\n";
}
}
// Show Additional Materials
$att_types = pdAttachmentTypesList::create($this->db);
if (count($pub->additional_info) > 0) {
$table = new HTML_Table(array('width' => '350', 'border' => '0', 'cellpadding' => '6', 'cellspacing' => '0'));
$heading = 'Other Attachments:';
$add_count = 1;
foreach ($pub->additional_info as $att) {
$cell = '';
if ($pub->attExists($att)) {
$name = split('additional_', $att->location);
$cell .= '<a href="' . $pub->attachmentGetUrl($add_count - 1) . '">';
if ($name[1] != '') {
$cell .= $name[1];
}
$cell .= '</a>';
if (in_array($att->type, $att_types)) {
$cell .= ' [' . $att->type . ']';
}
$cell .= ' <a href="' . $pub->attachmentGetUrl($add_count - 1) . '">' . $this->getPubAddAttIcons($att) . '</a>';
$add_count++;
}
$table->addRow(array($heading, $cell));
$heading = '';
}
$content .= $table->toHtml();
}
$content .= '<p/>' . stripslashes($pub->abstract) . '<p/>' . '<h3>Citation</h3>' . $pub->getCitationHtml() . '<p/>';
$table = new HTML_Table(array('width' => '600', 'border' => '0', 'cellpadding' => '6', 'cellspacing' => '0'));
$category = '';
if (isset($pub->category) && isset($pub->category->category)) {
$category = $pub->category->category;
}
$table->addRow(array('Keywords:', $pub->keywordsGet()));
$table->addRow(array('Category:', $category));
if (isset($_SESSION['user']) && $_SESSION['user']->showInternalInfo()) {
$table->addRow(array('Ranking:', $pub->ranking));
if (is_array($pub->collaborations) && count($pub->collaborations) > 0) {
$col_desciptions = $pub->collaborationsGet($this->db);
foreach ($pub->collaborations as $col_id) {
$values[] = $col_desciptions[$col_id];
}
$table->addRow(array('Collaboration:', implode(', ', $values)));
}
$table->addRow(array('Extra Info:', $pub->extraInfoGet()));
}
if (isset($_SESSION['user']) && $_SESSION['user']->showUserInfo()) {
$table->addRow(array('User Info:', $pub->user));
}
$web_links = $pub->getWebLinks();
if (count($web_links) > 0) {
$c = 0;
foreach ($web_links as $name => $url) {
if ($c == 0) {
$label = 'Web Links:';
} else {
$label = '';
}
$table->addRow(array($label, '<a href="' . $url . '" ' . 'target="_blank">' . $name . '</a>'));
$c++;
}
}
if (count($pub->relatedPubsGet()) > 0) {
$c = 0;
foreach ($pub->relatedPubsGet() as $related_pub_id) {
if ($c == 0) {
$label = 'Related Publication(s):';
} else {
$label = '';
}
$rel_pub = new pdPublication();
$rel_pub->dbLoad($this->db, $related_pub_id);
$table->addRow(array($label, '<a href="view_publication.php?' . 'pub_id=' . $rel_pub->pub_id . '" ' . ' target="_blank">' . $rel_pub->title . '</a>'));
$c++;
}
}
$table->updateColAttributes(0, array('class' => 'emph', 'width' => '25%'));
$content .= $table->toHtml();
$bibtex = $pub->getBibtex();
if ($bibtex !== false) {
$content .= '<h3>BibTeX</h3><pre class="bibtex">' . $bibtex . '</pre><p/>';
}
$updateStr = $this->lastUpdateGet($pub);
//.........这里部分代码省略.........
示例14: foreach
foreach ($expiration_array as $key => $myarray) {
for ($j = 0; $j < sizeof($myarray); $j++) {
if (strcmp($myarray[$j]["days_to_expiration"], "permanent") != 0 && $myarray[$j]["days_to_expiration"] <= $lead_time) {
if ($myarray[$j]["days_to_expiration"] < 0) {
$myarray[$j]["days_to_expiration"] = "<b>Already expired</b>";
}
$table->addRow(array($host["hostname"], $host["desc"], $key, $myarray[$j]["version"], $myarray[$j]["expiration_date"], $myarray[$j]["days_to_expiration"], $myarray[$j]["num_licenses"]), "bgcolor='" . $color[$i] . "'");
}
}
}
//}
}
########################################################
# 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) {
示例15: authorShow
public function authorShow($auth)
{
$result = '';
$table = new HTML_Table(array('width' => '600', 'border' => '0', 'cellpadding' => '6', 'cellspacing' => '0'));
$table->setAutoGrow(true);
$table->addRow(array('Name:', $auth->name));
if (isset($auth->title) && trim($auth->title) != "") {
$table->addRow(array('Title:', $auth->title));
}
$table->addRow(array('Email:', "<a href='mailto:" . $auth->email . "'>" . $auth->email . "</a>"));
$table->addRow(array('Organization:', $auth->organization));
$webpage = str_replace('http://', '', $auth->webpage);
if (isset($auth->webpage) && !empty($webpage)) {
$webpage = "<a href=\"" . $auth->webpage . "\" target=\"_blank\">" . $auth->webpage . "</a>";
} else {
$webpage = "none";
}
$table->addRow(array('Webpage:', $webpage));
$interestsStr = '';
if (isset($auth->interests) && is_array($auth->interests)) {
$interestsStr = implode('; ', array_values($auth->interests));
}
$table->addRow(array('Interest(s):', $interestsStr));
if ($auth->totalPublications == 0) {
$table->addRow(array('No publications by this author'), array('colspan' => 2));
} else {
if ($auth->totalPublications <= 6) {
assert('is_array($auth->pub_list)');
$headingCell = 'Publications:';
$table->addRow(array($headingCell));
} else {
$table->addRow(array('Publications:', '<a id="start" href="#">Show Publications by this author</a>'));
}
}
$table->updateColAttributes(0, array('class' => 'emph', 'width' => '25%'));
$result .= $table->toHtml();
if ($auth->totalPublications > 0 && $auth->totalPublications <= 6) {
$result .= displayPubList($this->db, $auth->pub_list);
} else {
$result .= "<div id=\"publist\"> </div>";
}
$this->css();
$this->javascript();
return $result;
}