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


PHP table::set_column方法代码示例

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


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

示例1: bbDrawTable

function bbDrawTable($limit = false, $where = false, $title = false)
{
    //only show add new on main page
    $options = !$limit ? false : array('#bottom' => getString('add_new'));
    $t = new table('bb_topics', drawHeader($options, $title));
    $t->set_column('topic', 'l', getString('topic'));
    $t->set_column('starter', 'l', getString('starter'), 120);
    $t->set_column('replies', 'c', getString('replies'), 30);
    $t->set_column('last_post', 'r', getString('last_post'), 100);
    $result = bbGetTopics($where, $limit);
    foreach ($result as &$r) {
        array_argument($r, 'thread');
        if ($r['is_admin']) {
            array_argument($r, 'admin');
        }
        $r['link'] = 'topic.php?id=' . $r['id'];
        if (empty($r['topic'])) {
            $r['topic'] = '<i>no topic entered</i>';
        }
        $r['topic'] = draw_link($r['link'], $r['topic']);
        $r['starter'] = $r['firstname'] . ' ' . $r['lastname'];
        $r['last_post'] = format_date($r['last_post']);
    }
    return $t->draw($result, getString('topics_empty'));
}
开发者ID:Rhenan,项目名称:intranet-1,代码行数:25,代码来源:include.php

示例2: drawTop

<?php

include "include.php";
if (url_action('delete')) {
    db_delete('bb_topics_types');
    url_drop('action,id');
}
echo drawTop();
$t = new table('bb_topics_types', drawHeader($page['is_admin'] ? array('category_edit.php' => getString('category_new')) : false));
$t->set_column('category', 'l', getString('category'));
$t->set_column('topics', 'r', getString('topics'));
if ($page['is_admin']) {
    $t->set_column('delete', 'd', '&nbsp;');
}
$result = db_table('SELECT 
		y.id, 
		y.title' . langExt() . ' category, 
		(SELECT COUNT(*) FROM bb_topics t WHERE t.type_id = y.id AND t.is_active = 1) topics 
	FROM bb_topics_types y 
	WHERE y.is_active = 1
	ORDER BY y.title');
foreach ($result as &$r) {
    $r['category'] = draw_link('category.php?id=' . $r['id'], $r['category']);
    if ($page['is_admin']) {
        $r['delete'] = draw_img('/images/icons/delete.png', url_query_add(array('action' => 'delete', 'id' => $r['id']), false));
    }
}
echo $t->draw($result, 'No categories added yet');
echo drawBottom();
开发者ID:Rhenan,项目名称:intranet-1,代码行数:29,代码来源:categories.php

示例3: drawBottom

    $f->set_field(array('name' => 'content', 'label' => getString('file'), 'type' => 'file', 'additional' => getString('upload_max') . file_get_max()));
    $f->set_field(array('name' => 'categories', 'label' => getString('categories'), 'type' => 'checkboxes', 'options_table' => 'dl_categories', 'option_title' => 'title', 'linking_table' => 'dl_docs_to_categories', 'object_id' => 'doc_id', 'option_id' => 'category_id'));
    echo $f->draw();
} else {
    $result = db_table('SELECT 
					d.id, 
					d.title, 
					' . db_updated('d') . ', 
					d.extension,
					c.title "group"
			FROM dl_docs d
			JOIN dl_docs_to_categories d2c ON d.id = d2c.doc_id
			JOIN dl_categories c ON d2c.category_id = c.id
			ORDER BY c.precedence, d.title;');
    $links = $page['is_admin'] ? array(url_query_add(array('doc_id' => 'new'), false) => getString('add_new')) : false;
    $t = new table('dl_docs', drawHeader($links));
    $t->set_column('icon', 'd', '&nbsp;');
    $t->set_column('title', 'l', getString('title'));
    $t->set_column('updated', 'r', getString('updated'));
    foreach ($result as &$r) {
        $link = 'info.php?id=' . $r['id'];
        $r['icon'] = file_icon($r['extension'], $link);
        $r['title'] = draw_link($link, $r['title']);
        if (getOption('languages')) {
            $r['title'] .= ' (' . $r['language'] . ')';
        }
        $r['updated'] = format_date($r['updated']);
    }
    echo $t->draw($result, getString('documents_empty'));
}
echo drawBottom();
开发者ID:Rhenan,项目名称:intranet-1,代码行数:31,代码来源:index.php

示例4: drawBottom

			<?php 
        }
        ?>
		</td>
	</tr>
	<?php 
    }
    ?>
	
</table>
<?php 
} else {
    //main table
    $result = db_table('SELECT 
		e.id, e.title' . langExt() . ' title, t.title' . langExt() . ' "group", e2t.type_id
		FROM external_orgs e
		JOIN external_orgs_to_types e2t ON e.id = e2t.org_id
		JOIN external_orgs_types t ON e2t.type_id = t.id
		WHERE e.is_active = 1 ORDER BY t.title, e.title
		');
    $t = new table('external_orgs_types', drawHeader(array('#bottom' => getString('add_new'))));
    $t->set_column('title', 'l', getString('title'));
    foreach ($result as &$r) {
        $r['group'] = draw_link('./type.php?id=' . $r['type_id'], $r['group']);
        $r['title'] = draw_link('./?id=' . $r['id'], $r['title']);
    }
    echo $t->draw($result, 'There are no external orgs added yet.');
    //add new
    include 'edit.php';
}
echo drawBottom();
开发者ID:Rhenan,项目名称:intranet-1,代码行数:31,代码来源:index.php

示例5: drawTop

<?php

include "../../include.php";
echo drawTop();
$t = new table('emails', drawHeader());
$t->set_column('address', 'l', 'Email Address');
$t->set_column('created_date', 'r', 'Sent');
$emails = db_table('SELECT address, subject "group", created_date FROM emails ORDER BY created_date DESC', 100);
foreach ($emails as &$e) {
    $e['created_date'] = format_date_time($e['created_date']);
}
echo $t->draw($emails);
echo drawBottom();
开发者ID:Rhenan,项目名称:intranet-1,代码行数:13,代码来源:emails.php

示例6: drawTop

<?php

include "../../include.php";
echo drawTop();
$blurbs = db_table("SELECT \n\t\tr.id,\n\t\tr.title,\n\t\tt.icon,\n\t\tISNULL(r.updated_date, r.created_date) updated\n\t\tFROM employer_strategy_resources r\n\t\tJOIN docs_types t ON r.type_id = t.id\n\t\tWHERE r.is_active = 1\n\t\tORDER BY updated DESC", 20);
$t = new table("web_news_blurbs");
$t->set_column("icon");
$t->set_column("title");
$t->set_column("updated", "r");
$t->set_title(drawHeader(array("add new" => "edit/")));
foreach ($blurbs as &$b) {
    $b["icon"] = draw_img($b["icon"]);
    $b["title"] = draw_link("edit/?id=" . $b["id"], $b["title"]);
    $b["updated"] = format_date($b["updated"]);
}
echo $t->draw($blurbs);
echo drawBottom();
开发者ID:Rhenan,项目名称:intranet-1,代码行数:17,代码来源:index.php

示例7: drawTop

<?php

include "../../include.php";
if (url_id('module_id')) {
    $result = db_table('SELECT p.id, p.title, p.url, p.is_hidden FROM pages p WHERE module_id = ' . $_GET['module_id'] . ' ORDER BY p.precedence');
} elseif (url_id('modulette_id')) {
    $result = db_table('SELECT p.id, p.title, p.url, p.is_hidden FROM pages p WHERE modulette_id = ' . $_GET['modulette_id'] . ' ORDER BY p.precedence');
} else {
    url_change('./');
}
echo drawTop();
//pages list
$t = new table('pages', drawHeader());
$t->set_column('is_hidden', 'd', '&nbsp;');
$t->set_column('draggy', 'd', '&nbsp;');
$t->set_column('title', 'l', getString('title'));
$t->set_column('url');
$t->set_draggable('draggy');
foreach ($result as &$r) {
    $r['is_hidden'] = draw_form_checkbox('foo', !$r['is_hidden'], false, 'ajax_set(\'pages\', \'is_hidden\', ' . $r['id'] . ', ' . abs($r['is_hidden'] - 1) . ');');
    $r['draggy'] = draw_img('/images/icons/move.png');
    $r['title'] = draw_link('page.php?id=' . $r['id'], $r['title']);
    if (empty($r['url'])) {
        $r['url'] = 'index.php';
    }
}
echo $t->draw($result, 'No pages');
echo drawBottom();
开发者ID:Rhenan,项目名称:intranet-1,代码行数:28,代码来源:pages.php

示例8: drawTop

<?php

include '../../include.php';
if ($posting) {
    langTranslatePost('title');
    $id = db_save('modulettes');
    url_drop('id');
}
echo drawTop();
if (url_id()) {
    //form
    $f = new form('modulettes', @$_GET['id']);
    langUnsetFields($f, 'title');
    langTranslateCheckbox($f);
    echo $f->draw();
} else {
    //modulettes list
    $t = new table('modulettes', drawHeader());
    $t->set_column('is_active', 'd', '&nbsp;');
    $t->set_column('title', 'l', getString('title'));
    $t->set_column('pages', 'r');
    $result = db_table('SELECT m.id, m.title' . langExt() . ' title, m.is_active, (SELECT COUNT(*) FROM pages p WHERE p.modulette_id = m.id) pages FROM modulettes m ORDER BY m.title' . langExt());
    foreach ($result as &$r) {
        $r['is_active'] = draw_form_checkbox('is_active', $r['is_active'], false, 'ajax_set(\'modulettes\', \'is_active\', ' . $r['id'] . ', ' . abs($r['is_active'] - 1) . ');');
        $r['title'] = draw_link('modulettes.php?id=' . $r['id'], $r['title']);
        $r['pages'] = draw_link('pages.php?modulette_id=' . $r['id'], format_quantitize($r['pages'], 'page'));
    }
    echo $t->draw($result, 'No modulettes');
}
echo drawBottom();
开发者ID:Rhenan,项目名称:intranet-1,代码行数:30,代码来源:modulettes.php

示例9: drawtop

<?php

include '../../include.php';
echo drawtop();
$t = new table('ldcodes', drawHeader(false, 'Long Distance Codes'));
$t->set_column('code', 'c', 'Code');
$t->set_column('user', 'l', 'User');
$result = db_table('SELECT l.code, (SELECT CONCAT_WS(",", u.lastname, u.firstname, u.id) FROM users u WHERE u.longDistanceCode = l.code AND u.is_active = 1) user FROM ldcodes l ORDER BY user');
foreach ($result as &$r) {
    if ($r['user']) {
        $r['group'] = 'Assigned';
        list($lastname, $firstname, $id) = explode(',', $r['user']);
        $r['user'] = draw_link('/staff/view.php?id=' . $id, $lastname . ', ' . $firstname);
    } else {
        $r['group'] = 'Unassigned Codes';
    }
}
echo $t->draw($result, 'There are no long distance codes');
echo drawBottom();
开发者ID:Rhenan,项目名称:intranet-1,代码行数:19,代码来源:index.php

示例10: drawTop

<?php

include "../include.php";
echo drawTop();
$result = db_table('SELECT 
		d.id,
		d.title' . langExt() . ' title,
		(SELECT COUNT(*) FROM docs_views v WHERE v.documentID = d.id) downloads,
		i.extension,
		i.description alt
	FROM docs d
	JOIN docs_types i ON d.type_id = i.id
	' . getChannelsWhere('docs', 'd', 'doc_id') . '
	ORDER BY downloads DESC', 20);
$t = new table('docs', drawHeader());
$t->set_column('icon', 'd', '&nbsp;');
$t->set_column('title', 'l', getString('title'));
$t->set_column('downloads', 'r', getString('downloads'));
foreach ($result as &$r) {
    $link = 'info.php?id=' . $r['id'];
    $r['icon'] = file_icon($r['extension'], $link);
    $r['title'] = draw_link($link, $r['title']);
}
echo $t->draw($result, getString('documents_empty'));
echo drawBottom();
开发者ID:Rhenan,项目名称:intranet-1,代码行数:25,代码来源:most_popular.php

示例11: drawBottom

            ?>
'><?php 
        } else {
            ?>
<b><?php 
        }
        echo format_string($o['title'], 26);
        ?>
</b></a></td>
		<?php 
    }
    ?>
	</tr>
</table>
<?php 
} else {
    echo drawPanel(draw_form_select('foo', $orgs, url_id(), false, false, 'location.href=\'' . $request['path'] . '?id=\' + this.value'));
}
if (url_id()) {
    $where = $_GET['id'] == 0 ? ' IS NULL ' : ' = ' . $_GET['id'];
    $links = $page['is_admin'] ? array('add_edit.php' => getString('add_new')) : false;
    echo drawStaffList('u.is_active = 1 AND u.organization_id ' . $where, 'This organization has no staff associated with it.', $links, draw_link($request['path_query'], $page['title']) . ' &gt; ' . db_grab('SELECT title FROM organizations WHERE id = ' . $_GET['id']));
} else {
    $t = new table('foo', drawHeader());
    $t->set_column('title', false, getString('title'));
    foreach ($orgs as &$o) {
        $o['title'] = draw_link('organizations.php?id=' . $o['id'], $o['title']);
    }
    echo $t->draw($orgs);
}
echo drawBottom();
开发者ID:Rhenan,项目名称:intranet-1,代码行数:31,代码来源:organizations.php

示例12: drawTop

<?php

include '../include.php';
echo drawTop();
$t = new table('staff', drawHeader());
$t->set_column('picture', 'l', '&nbsp;', '50');
$t->set_column('name');
$t->set_column('organization');
$t->set_column('last_login', 'r');
$result = db_table('SELECT u.id, u.firstname, u.lastname, u.title, o.title organization, u.organization_id, u.lastLogin last_login FROM users u LEFT JOIN organizations o ON u.organization_id = o.id JOIN users_to_modules u2m ON u.id = u2m.user_id WHERE u.is_active = 1 AND u2m.module_id = ' . $page['module_id'] . ' ORDER BY u.lastname, u.firstname');
foreach ($result as &$r) {
    $link = '/staff/view.php?id=' . $r['id'];
    $r['picture'] = draw_img(file_dynamic('users', 'image_small', $r['id'], 'jpg'), $link);
    $r['name'] = draw_link($link, $r['firstname'] . ' ' . $r['lastname']);
    if ($r['organization']) {
        $r['organization'] = draw_link('/staff/organizations.php?id=' . $r['organization_id'], $r['organization']) . '<br>';
    }
    $r['organization'] .= $r['title'];
    $r['last_login'] = format_date($r['last_login']);
}
echo $t->draw($result, 'No administrators for this module yet!');
echo drawBottom();
开发者ID:Rhenan,项目名称:intranet-1,代码行数:22,代码来源:admins.php

示例13: drawTop

<?php

include "../include.php";
echo drawTop();
$t = new table('bb_topics', drawHeader());
$t->set_column('contact', 'l', 'Contact Record');
$t->set_column('action');
//$t->set_column('contact', 'l', 'Done By');
$t->set_column('when', 'r');
$result = db_table('SELECT
			c.id,
			c.firstname,
			c.lastname,
			c.updated_date,
			' . db_updated('c') . '
		FROM contacts c
		ORDER BY updated DESC', 40);
foreach ($result as &$r) {
    $r['contact'] = draw_link('contact.php?id=' . $r['id'], $r['lastname'] . ', ' . $r['firstname']);
    $r['action'] = $r['updated_date'] ? 'Update' : 'New Contact';
    $r['when'] = format_date($r['updated']);
}
echo $t->draw($result);
echo drawBottom();
开发者ID:Rhenan,项目名称:intranet-1,代码行数:24,代码来源:activity.php

示例14: drawStaffList

function drawStaffList($where, $errmsg = false, $options = false, $listtitle = false, $searchterms = false)
{
    global $page, $_josh;
    if (!$errmsg) {
        $errmsg = getString('results_empty');
    }
    //only show delete for admins on pages that aren't the chagnes page
    $showDelete = $page['is_admin'] && $page['id'] != 35;
    $t = new table('staff', drawHeader($options, $listtitle));
    $t->set_column('pic', 'c', '&nbsp;', 50);
    $t->set_column('name', 'l', getString('name') . (getOption('staff_showoffice') ? ' / ' . getString('location') : ''));
    $t->set_column('title', 'l', getString('staff_title') . ' / ' . (getOption('staff_showdept') ? getString('department') : getString('organization')), 222);
    $t->set_column('phone', 'l', getString('telephone'));
    if ($showDelete) {
        $t->set_column('del', 'c', '&nbsp;', 16);
    }
    $result = db_table('SELECT DISTINCT
							u.id, 
							u.lastname,
							ISNULL(u.nickname, u.firstname) firstname, 
							u.bio, 
							u.phone,
							c.title' . langExt() . ' organization,
							u.organization_id,
							o.name office, 
							o.isMain,
							u.title, 
							d.departmentName department
						FROM users u
						LEFT JOIN users_to_channels u2c ON u.id = u2c.user_id
						LEFT JOIN departments d	ON d.departmentID = u.departmentID 
						LEFT JOIN organizations c ON u.organization_id = c.id
						LEFT JOIN offices o ON o.id = u.officeID
						' . getChannelsWhere('users', 'u', 'user_id') . ' AND ' . $where . '
						ORDER BY u.lastname, ISNULL(u.nickname, u.firstname)');
    foreach ($result as &$r) {
        $link = '/staff/view.php?id=' . $r['id'];
        $r['pic'] = draw_img(file_dynamic('users', 'image_small', $r['id'], 'jpg'), $link);
        $r['name'] = draw_link($link, $r['lastname'] . ', ' . $r['firstname']);
        if (getOption('staff_showoffice')) {
            $r['name'] .= '<br/>' . $r['office'];
        }
        if (getOption('staff_showdept')) {
            $r['title'] .= '<br/>' . $r['department'];
        } else {
            $r['title'] .= '<br/>' . draw_link('organizations.php?id=' . $r['organization_id'], format_string($r['organization']));
        }
        if ($showDelete) {
            $r['del'] = drawColumnDelete($r['id']);
        }
    }
    return $t->draw($result, $errmsg);
}
开发者ID:Rhenan,项目名称:intranet-1,代码行数:53,代码来源:include.php

示例15: drawBottom

		c.address_2,
		RIGHT("00000" + RTRIM(c.zip), 5) zip,
		c.phone,
		c.fax,
		c.mobile_phone,
		c.email,
		z.city,
		z.state,
		c.notes
	FROM contacts c
	LEFT JOIN zip_codes z ON c.zip = z.zip
	WHERE c.id = ' . $_GET['id']);
$d = new display();
$d->row('Name', $r['salutation'] . ' ' . $r['firstname'] . ' ' . $r['lastname'] . ($r['suffix'] ? ', ' . $r['suffix'] : ''));
$d->row('Company', $r['organization']);
$d->row('Job Title', $r['title']);
$d->row('Address', $r['address_1'] . ($r['address_2'] ? BR . $r['address_2'] : false) . BR . $r['city'] . ', ' . $r['state'] . ' ' . $r['zip']);
$d->row('Phone', $r['phone']);
$d->row('Fax', $r['fax']);
$d->row('Mobile', $r['mobile_phone']);
$d->row('Email', draw_link('mailto:' . $r['email']));
$d->row('Notes', nl2br($r['notes']));
echo $d->draw();
$result = db_table('SELECT t.id, t.tag, y.title "group" FROM contacts_to_tags c2t JOIN contacts_tags t ON c2t.tag_id = t.id JOIN contacts_tags_types y ON t.type_id = y.id WHERE c2t.contact_id = ' . $_GET['id']);
$t = new table('contacts_tags');
$t->set_column('tag');
foreach ($result as &$r) {
    $r['tag'] = draw_link('value.php?id=' . $r['id'], $r['tag']);
}
echo $t->draw($result);
echo drawBottom();
开发者ID:Rhenan,项目名称:intranet-1,代码行数:31,代码来源:contact.php


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