本文整理汇总了PHP中yes_no函数的典型用法代码示例。如果您正苦于以下问题:PHP yes_no函数的具体用法?PHP yes_no怎么用?PHP yes_no使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了yes_no函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: plugin_list
function plugin_list($message = '')
{
pagetop(gTxt('edit_plugins'), $message);
echo n . n . startTable('edit') . tr(tda(plugin_form(), ' colspan="8" style="height: 30px; border: none;"')) . endTable();
extract(gpsa(array('sort', 'dir')));
$dir = $dir == 'desc' ? 'desc' : 'asc';
if (!in_array($sort, array('name', 'status', 'author', 'version', 'modified', 'load_order'))) {
$sort = 'name';
}
$sort_sql = $sort . ' ' . $dir;
$switch_dir = $dir == 'desc' ? 'asc' : 'desc';
$rs = safe_rows_start('name, status, author, author_uri, version, description, length(help) as help, abs(strcmp(md5(code),code_md5)) as modified, load_order, flags', 'txp_plugin', '1 order by ' . $sort_sql);
if ($rs and numRows($rs) > 0) {
echo '<form action="index.php" method="post" name="longform" onsubmit="return verify(\'' . gTxt('are_you_sure') . '\')">' . startTable('list') . tr(column_head('plugin', 'name', 'plugin', true, $switch_dir, '', '', 'name' == $sort ? $dir : '') . column_head('author', 'author', 'plugin', true, $switch_dir, '', '', 'author' == $sort ? $dir : '') . column_head('version', 'version', 'plugin', true, $switch_dir, '', '', 'version' == $sort ? $dir : '') . column_head('plugin_modified', 'modified', 'plugin', true, $switch_dir, '', '', 'modified' == $sort ? $dir : '') . hCell(gTxt('description')) . column_head('active', 'status', 'plugin', true, $switch_dir, '', '', 'status' == $sort ? $dir : '') . column_head('order', 'load_order', 'plugin', true, $switch_dir, '', '', 'load_order' == $sort ? $dir : '') . hCell(gTxt('manage'), '', ' class="manage"') . hCell());
while ($a = nextRow($rs)) {
foreach ($a as $key => $value) {
${$key} = htmlspecialchars($value);
}
// Fix up the description for clean cases
$description = preg_replace(array('#<br />#', '#<(/?(a|b|i|em|strong))>#', '#<a href="(https?|\\.|\\/|ftp)([A-Za-z0-9:/?.=_]+?)">#'), array('<br />', '<$1>', '<a href="$1$2">'), $description);
$help = !empty($help) ? n . t . '<li><a href="?event=plugin' . a . 'step=plugin_help' . a . 'name=' . urlencode($name) . '">' . gTxt('help') . '</a></li>' : '';
$plugin_prefs = $flags & PLUGIN_HAS_PREFS && $status ? n . t . '<li><a href="?event=plugin_prefs.' . urlencode($name) . '">' . gTxt('plugin_prefs') . '</a></li>' : '';
echo tr(n . td($name) . td(href($author, $author_uri)) . td($version, 10) . td($modified ? gTxt('yes') : '') . td($description, 260) . td(status_link($status, $name, yes_no($status)), 30) . td($load_order) . td(n . '<ul class="plugin_manage">' . $help . n . t . '<li>' . eLink('plugin', 'plugin_edit', 'name', $name, gTxt('edit')) . '</li>' . $plugin_prefs . n . '</ul>') . td(fInput('checkbox', 'selected[]', $name), 30));
unset($name, $page, $deletelink);
}
echo tr(tda(select_buttons() . plugin_multiedit_form('', $sort, $dir, '', ''), ' colspan="10" style="text-align: right; border: none;"')) . n . endTable() . n . '</form>';
}
}
示例2: plugin_list
function plugin_list($message = '')
{
global $event;
pagetop(gTxt('tab_plugins'), $message);
echo '<h1 class="txp-heading">' . gTxt('tab_plugins') . '</h1>';
echo '<div id="' . $event . '_control" class="txp-control-panel">';
echo n . plugin_form() . n . '</div>';
extract(gpsa(array('sort', 'dir')));
if ($sort === '') {
$sort = get_pref('plugin_sort_column', 'name');
}
if ($dir === '') {
$dir = get_pref('plugin_sort_dir', 'asc');
}
$dir = $dir == 'desc' ? 'desc' : 'asc';
if (!in_array($sort, array('name', 'status', 'author', 'version', 'modified', 'load_order'))) {
$sort = 'name';
}
$sort_sql = $sort . ' ' . $dir;
set_pref('plugin_sort_column', $sort, 'plugin', 2, '', 0, PREF_PRIVATE);
set_pref('plugin_sort_dir', $dir, 'plugin', 2, '', 0, PREF_PRIVATE);
$switch_dir = $dir == 'desc' ? 'asc' : 'desc';
$rs = safe_rows_start('name, status, author, author_uri, version, description, length(help) as help, abs(strcmp(md5(code),code_md5)) as modified, load_order, flags', 'txp_plugin', '1 order by ' . $sort_sql);
if ($rs and numRows($rs) > 0) {
echo n . '<div id="' . $event . '_container" class="txp-container">';
echo '<form action="index.php" id="plugin_form" class="multi_edit_form" method="post" name="longform">' . n . '<div class="txp-listtables">' . n . startTable('', '', 'txp-list') . n . '<thead>' . tr(n . hCell(fInput('checkbox', 'select_all', 0, '', '', '', '', '', 'select_all'), '', ' title="' . gTxt('toggle_all_selected') . '" class="multi-edit"') . n . column_head('plugin', 'name', 'plugin', true, $switch_dir, '', '', ('name' == $sort ? "{$dir} " : '') . 'name') . n . column_head('author', 'author', 'plugin', true, $switch_dir, '', '', ('author' == $sort ? "{$dir} " : '') . 'author') . n . column_head('version', 'version', 'plugin', true, $switch_dir, '', '', ('version' == $sort ? "{$dir} " : '') . 'version') . n . column_head('plugin_modified', 'modified', 'plugin', true, $switch_dir, '', '', ('modified' == $sort ? "{$dir} " : '') . 'modified') . n . hCell(gTxt('description'), '', ' class="description"') . n . column_head('active', 'status', 'plugin', true, $switch_dir, '', '', ('status' == $sort ? "{$dir} " : '') . 'status') . n . column_head('order', 'load_order', 'plugin', true, $switch_dir, '', '', ('load_order' == $sort ? "{$dir} " : '') . 'load-order') . n . hCell(gTxt('manage'), '', ' class="manage actions"')) . n . '</thead>';
echo '<tbody>';
while ($a = nextRow($rs)) {
foreach ($a as $key => $value) {
${$key} = txpspecialchars($value);
}
// Fix up the description for clean cases
$description = preg_replace(array('#<br />#', '#<(/?(a|b|i|em|strong))>#', '#<a href="(https?|\\.|\\/|ftp)([A-Za-z0-9:/?.=_]+?)">#'), array('<br />', '<$1>', '<a href="$1$2">'), $description);
$help = !empty($help) ? '<a class="plugin-help" href="?event=plugin' . a . 'step=plugin_help' . a . 'name=' . urlencode($name) . '">' . gTxt('help') . '</a>' : '';
$plugin_prefs = $flags & PLUGIN_HAS_PREFS ? '<a class="plugin-prefs" href="?event=plugin_prefs.' . urlencode($name) . '">' . gTxt('plugin_prefs') . '</a>' : '';
$manage = array();
if ($help) {
$manage[] = $help;
}
if ($plugin_prefs) {
$manage[] = $plugin_prefs;
}
$manage_items = $manage ? join(tag(sp . '|' . sp, 'span'), $manage) : '-';
$edit_url = eLink('plugin', 'plugin_edit', 'name', $name, $name);
echo tr(n . td(fInput('checkbox', 'selected[]', $name), '', 'multi-edit') . td($edit_url, '', 'name') . td(href($author, $author_uri, ' rel="external"'), '', 'author') . td($version, '', 'version') . td($modified ? '<span class="warning">' . gTxt('yes') . '</span>' : '', '', 'modified') . td($description, '', 'description') . td(status_link($status, $name, yes_no($status)), '', 'status') . td($load_order, '', 'load-order') . td($manage_items, '', 'manage'), $status ? ' class="active"' : '');
unset($name, $page, $deletelink);
}
echo '</tbody>', n, endTable(), n, '</div>', n, plugin_multiedit_form('', $sort, $dir, '', ''), n, tInput(), n, '</form>', n, '</div>';
// Show/hide "Options" link by setting the appropriate class on the plugins TR
echo script_js(<<<EOS
textpattern.Relay.register('txpAsyncHref.success', function(event, data) {
\t\$(data['this']).closest('tr').toggleClass('active');
});
EOS
);
}
}
示例3: list_plugins
function list_plugins($message = '')
{
pagetop(gTxt('edit_plugins'), $message);
echo startTable('list') . tr(tda(plugin_form() . plugin_form_old(), ' colspan="5" style="border:0;height:50px"')) . assHead('plugin', 'author', 'version', 'description', 'active', '');
$rs = safe_rows("*", "txp_plugin", "1 order by name");
foreach ($rs as $a) {
extract($a);
// nice to have eval() do a syntax check on the plugin here
echo tr(td(eLink('plugin', 'edit', 'name', $name, $name), 150) . td('<a href="' . $author_uri . '">' . $author . '</a>', 100) . td($version, 10) . td($description, 260) . td(status_link($status, $name, yes_no($status)), 30) . td(dLink('plugin', 'delete', 'name', $name), 30));
unset($name, $page, $deletelink);
}
echo endTable();
}
示例4: plugin_list
function plugin_list($message = '')
{
pagetop(gTxt('edit_plugins'), $message);
echo startTable('list') . tr(tda(plugin_form() . plugin_form_old(), ' colspan="8" style="border:0;height:50px"')) . assHead('plugin', 'author', 'version', 'description', 'active', '', '', '');
$rs = safe_rows_start("*", "txp_plugin", "1 order by name");
while ($a = nextRow($rs)) {
extract($a);
$elink = eLink('plugin', 'plugin_edit', 'name', $name, gTxt('edit'));
$hlink = '<a href="?event=plugin&step=plugin_help&name=' . $name . '">' . gTxt('help') . '</a>';
echo tr(td($name) . td('<a href="' . $author_uri . '">' . $author . '</a>') . td($version, 10) . td($description, 260) . td(status_link($status, $name, yes_no($status)), 30) . td($elink) . td($hlink) . td(dLink('plugin', 'plugin_delete', 'name', $name), 30));
unset($name, $page, $deletelink);
}
echo endTable();
}
示例5: plugin_list
function plugin_list($message = '')
{
pagetop(gTxt('edit_plugins'), $message);
echo n . n . startTable('list') . tr(tda(plugin_form(), ' colspan="8" style="height: 30px; border: none;"'));
$rs = safe_rows_start('name, status, author, author_uri, version, description, code_md5, length(help) as help, md5(code) as md5', 'txp_plugin', '1 order by name');
if ($rs and numRows($rs) > 0) {
echo assHead('plugin', 'author', 'version', 'plugin_modified', 'description', 'active', 'help', '', '');
while ($a = nextRow($rs)) {
foreach ($a as $key => $value) {
${$key} = htmlspecialchars($value);
}
// Fix up the description for clean cases
$description = preg_replace(array('#<br />#', '#<(/?(a|b|i|em|strong))>#', '#<a href="(https?|\\.|\\/|ftp)([A-Za-z0-9:/?.=_]+?)">#'), array('<br />', '<$1>', '<a href="$1$2">'), $description);
$help = !empty($help) ? '<a href="?event=plugin' . a . 'step=plugin_help' . a . 'name=' . $name . '">' . gTxt('view') . '</a>' : gTxt('none');
// modified?
$modified = strtolower($md5) != strtolower($code_md5);
echo tr(n . td($name) . td(href($author, $author_uri)) . td($version, 10) . td($modified ? gTxt('yes') : '') . td($description, 260) . td(status_link($status, $name, yes_no($status)), 30) . td($help) . td(eLink('plugin', 'plugin_edit', 'name', $name, gTxt('edit'))) . td(dLink('plugin', 'plugin_delete', 'name', $name), 30));
unset($name, $page, $deletelink);
}
}
echo endTable();
}
示例6: section_toggle_option
/**
* Toggles section yes/no parameters.
*
* This function requires three HTTP POST parameters: 'column', 'value' and
* 'name'. The 'value' is the new value, localised 'Yes' or 'No',
* 'name' is the section and the 'column' is the altered setting,
* either 'on_frontpage', 'in_rss' or 'searchable'.
*
* Outputs a text/plain response comprising the new displayable
* value for the toggled parameter.
*/
function section_toggle_option()
{
extract(psa(array('property', 'value', 'thing')));
$value = (int) ($value === gTxt('no'));
if (in_array($property, array('on_frontpage', 'in_rss', 'searchable'))) {
if (safe_update('txp_section', $property . ' = ' . $value, "name = '" . doSlash($thing) . "'")) {
echo yes_no($value);
return;
}
}
trigger_error(gTxt('section_save_failed'), E_USER_ERROR);
}
示例7: use_helper
<?php
// auto-generated by sfPropelCrud
// date: 2008/04/03 03:08:20
use_helper('Object', 'Global', 'Project');
?>
<h1>Due Diligence</h1>
<div class="blue-content">
Will the project generate any profit? <strong><?php
echo yes_no($project->getProfit());
?>
</strong><br />
<?php
echo $project->getProfitDetails();
?>
<br />
Are there any liability concerns for this project? <strong><?php
echo yes_no($project->getLiability());
?>
</strong><br />
<?php
echo $project->getLiabilityDetails();
?>
</div>
示例8: yes_no
if ($action != "print") {
$entry_output .= yes_no($row_log['brewConfirmed'], $base_url);
} else {
$entry_output .= "Yes";
}
}
$entry_output .= "</td>";
if ($action == "print") {
$entry_output .= "<td class='dataList bdr1B'>";
} else {
$entry_output .= "<td class='dataList'>";
}
if ($action != "print") {
$entry_output .= yes_no($row_log['brewPaid'], $base_url);
} else {
$entry_output .= yes_no($row_log['brewPaid'], $base_url, 3);
}
$entry_output .= "</td>";
if ($action == "print") {
$entry_output .= "<td class='dataList bdr1B'>";
} else {
$entry_output .= "<td class='dataList'>";
}
if ($row_log['brewUpdated'] != "") {
$entry_output .= getTimeZoneDateTime($_SESSION['prefsTimeZone'], strtotime($row_log['brewUpdated']), $_SESSION['prefsDateFormat'], $_SESSION['prefsTimeFormat'], "short", "date-time-no-gmt");
} else {
$entry_output .= " ";
}
$entry_output .= "</td>";
// Display if Closed, Judging Dates have passed, winner display is enabled, and the winner display delay time period has passed
if ($show_scores) {
示例9: unset
$msg .= " Error: " . $importer->getFault() . "<br />";
} else {
$msg .= "Mail redirect " . $entry['id'] . " (" . $entry['mail_name'] . "@" . $parent_domain['name'] . " to " . $redir['address'] . ") inserted/updated.<br />";
}
}
unset($mail_redir);
}
unset($mail_addresses);
$mail_aliases = $exdb->queryAllRecords("SELECT a.id, a.mn_id, a.alias, m.dom_id, m.mail_name FROM mail_aliases as a INNER JOIN mail as m ON (m.id = a.mn_id)");
foreach ($mail_aliases as $entry) {
$parent_domain = $exdb->queryOneRecord("SELECT d.id, d.cl_id, d.name FROM domains as d WHERE d.id = '" . $entry['dom_id'] . "'");
if (!$parent_domain) {
$msg .= "Could not insert/update mail alias " . $entry['alias'] . " as domain is missing.<br />";
continue;
}
$params = array('server_id' => $server_id, 'source' => $entry['alias'] . "@" . $parent_domain['name'], 'destination' => $entry['mail_name'] . "@" . $parent_domain['name'], 'type' => 'alias', 'active' => yes_no(1));
$client_id = $plesk_ispc_ids[$domain_owners[$entry['dom_id']]];
$old_mail = $app->db->queryOneRecord("SELECT forwarding_id FROM mail_forwarding WHERE source = '" . $entry['alias'] . "@" . $parent_domain['name'] . "' AND destination = '" . $entry['mail_name'] . "@" . $parent_domain['name'] . "'");
if ($old_mail) {
$new_id = $old_mail['forwarding_id'];
$ok = $importer->mail_alias_update($session_id, $client_id, $new_id, array_merge($old_mail, $params));
if ($ok === false) {
$msg .= " Error: " . $importer->getFault() . "<br />";
}
} else {
$new_id = $importer->mail_alias_add($session_id, $client_id, $params);
}
if ($new_id === false) {
//something went wrong here...
$msg .= "Mail alias " . $entry['id'] . " (" . $entry['alias'] . "@" . $parent_domain['name'] . ") could not be inserted/updated.<br />";
$msg .= " Error: " . $importer->getFault() . "<br />";
示例10: yes_no
$table_body1 .= $table_assign_judge;
$table_body1 .= "</tbody>";
$table_body1 .= "</table>";
$table_body1 .= "</div>";
$table_body1 .= "</div>";
}
// end if ((!$judge_available_not_assigned) && (!empty($table_assign_judge)))
}
// end if (!empty($judge_info))
}
// end if ($_SESSION['brewerJudge'] == "Y")
$table_body1 .= "<div class=\"row bcoem-account-info\">";
$table_body1 .= "<div class=\"col-lg-3 col-md-3 col-sm-4 col-xs-4\"><strong>Steward?</strong></div>";
$table_body1 .= "<div class=\"col-lg-9 col-md-9 col-sm-8 col-xs-8\">";
if (!empty($_SESSION['brewerSteward']) && $action != "print") {
$table_body1 .= yes_no($_SESSION['brewerSteward'], $base_url);
} else {
$table_body1 .= "None entered";
}
$table_body1 .= "</div>";
$table_body1 .= "</div>";
if ($_SESSION['brewerSteward'] == "Y") {
if (!empty($steward_info)) {
$table_body1 .= "<div class=\"row bcoem-account-info\">";
$table_body1 .= "<div class=\"col-lg-3 col-md-3 col-sm-4 col-xs-4\"><strong>Availability</strong></div>";
$table_body1 .= "<div class=\"col-lg-9 col-md-9 col-sm-8 col-xs-8\">";
if ($assignment == "steward" || empty($assignment)) {
if (empty($table_assign_steward)) {
$table_body1 .= "<table id=\"sortable_steward\" class=\"table table-condensed table-striped table-bordered table-responsive\">";
$table_body1 .= "<thead>";
$table_body1 .= "<tr>";
示例11: display
function display()
{
$ss = new Sugar_Smarty();
$db = DBManagerFactory::getInstance();
// ONLY LOAD A RECORD IF A RECORD ID IS GIVEN;
// A RECORD ID IS NOT GIVEN WHEN VIEWING IN LAYOUT EDITOR
$record = isset($_GET["record"]) ? htmlspecialchars($_GET["record"]) : '';
$template = file_get_contents('modules/Passports/tpls/export.tpl');
$sql = " SELECT * FROM passports WHERE id = '" . $record . "' AND deleted = 0";
$result = $db->query($sql);
$row = $db->fetchByAssoc($result);
$template = str_replace("{ID}", $row['id'], $template);
function yes_no($ques)
{
if ($ques == 'co') {
return 'Có';
} else {
return 'Không';
}
}
function TinhTrangHonNhan($tinhtranghonnhan)
{
if ($tinhtranghonnhan == 'docthan') {
return 'Độc thân';
} else {
if ($tinhtranghonnhan == 'cogiadinh') {
return 'Có gia đình';
} else {
return 'Ly thân';
}
}
}
if (!empty($row['NAME'])) {
$template = str_replace("{NAME}", $row['NAME'], $template);
} else {
$template = str_replace("{NAME}", '', $template);
}
$template = str_replace("{HOVATEN}", $row['hovaten'], $template);
$gioitinh = 'Nam';
if ($row['gioitinh'] == 'nu') {
$gioitinh = 'Nữ';
}
$template = str_replace("{GIOITINH}", $gioitinh, $template);
$template = str_replace("{TENKHAC}", $row['tenkhac'], $template);
$template = str_replace("{NGAYSINH}", $row['ngaysinh'], $template);
$template = str_replace("{TINHTRANGHONNHAN}", TinhTrangHonNhan($row['tinhtranghonnhan']), $template);
$template = str_replace("{NOISINH}", $row['noisinh'], $template);
$template = str_replace("{QUOCGIA}", $row['quocgia'], $template);
$template = str_replace("{QUOCTICH}", $row['quoctich'], $template);
$template = str_replace("{QUOCTICHKHAC}", $row['quoctichkhac'], $template);
$template = str_replace("{CMND}", $row['socmnd'], $template);
$template = str_replace("{HOKHAUTHUONGTRU}", html_entity_decode(nl2br($row['hokhauthuongtru'])), $template);
$template = str_replace("{DIACHINHANVISA}", html_entity_decode(nl2br($row['diachinhanvisa'])), $template);
$template = str_replace("{SODIENTHOAINHA}", $row['sodienthoainha'], $template);
$template = str_replace("{SODIENTHOAIDIDONG}", $row['sodienthoaididong'], $template);
$template = str_replace("{EMAIL}", $row['email'], $template);
$template = str_replace("{SOHOCHIEU}", $row['sohochieu'], $template);
$template = str_replace("{NGAYCAP}", $row['ngaycap'], $template);
$template = str_replace("{NGAYHETHAN}", $row['ngayhethan'], $template);
$template = str_replace("{QUOCGIACAP}", $row['quocgiacap'], $template);
$template = str_replace("{THANHPHOCAP}", $row['thanhphocap'], $template);
$template = str_replace("{BIDANHCAPHOCHIEU}", yes_no($row['tungbimathochieu']), $template);
$template = str_replace("{TENCONGTY}", $row['tencongty'], $template);
$template = str_replace("{DIACHICONGTY}", $row['diachicongty'], $template);
$template = str_replace("{DIENTHOAICONGTY}", $row['dienthoaicongty'], $template);
$template = str_replace("{SOFAX}", $row['sofax'], $template);
$template = str_replace("{CHUCVU}", $row['chucvu'], $template);
$template = str_replace("{MUCLUONG}", $row['mucluonghangthang'], $template);
$template = str_replace("{MOTACONGVIEC}", html_entity_decode(nl2br($row['motacongviec'])), $template);
$template = str_replace("{TENCONGTYCU}", html_entity_decode(nl2br($row['congtycu'])), $template);
$template = str_replace("{DIACHICONGTYCU}", html_entity_decode(nl2br($row['diachicongtycu'])), $template);
$template = str_replace("{CHUCVUCONGTYCU}", $row['chucvucongtycu'], $template);
$template = str_replace("{DIENTHOAICONGTYCU}", $row['dienthoaicongtycu'], $template);
$template = str_replace("{TENCAPTREN}", $row['captren'], $template);
$template = str_replace("{NGAYVAOLAMCONGTYCU}", $row['ngayvaolam'], $template);
$template = str_replace("{NGAYKETTHUCCONGTYCU}", $row['ngayketthuc'], $template);
$template = str_replace("{MOTACONGVIECCONGTYCU}", $row['motacongvieccu'], $template);
$template = str_replace("{TRUONGTUNGHOC}", html_entity_decode(nl2br($row['truongdahoc'])), $template);
$template = str_replace("{DIACHITRUONG}", html_entity_decode(nl2br($row['diachitruong'])), $template);
$template = str_replace("{NGANHHOC}", $row['nganhhoc'], $template);
$template = str_replace("{NGAYVAOHOC}", $row['ngaynhaphoc'], $template);
$template = str_replace("{NGAYKETTHUCKHOAHOC}", $row['ngayketthuchoc'], $template);
$template = str_replace("{HOTENCHA}", $row['hotencha'], $template);
$template = str_replace("{NGAYSINHCHA}", $row['ngaysinhcha'], $template);
$template = str_replace("{HOTENME}", $row['hotenme'], $template);
$template = str_replace("{NGAYSINHME}", $row['ngaysinhme'], $template);
$template = str_replace("{PHAIKHONG}", yes_no($row['chamedangonoiden']), $template);
$template = str_replace("{HOTENVOCHONG}", $row['hotenvochong'], $template);
$template = str_replace("{NGAYSINHVOCHONG}", $row['ngaysinhvochong'], $template);
$template = str_replace("{QUOCTICHVOCHONG}", $row['quoctichvochong'], $template);
$template = str_replace("{DIACHIVOCHONG}", $row['diachivochong'], $template);
$template = str_replace("{NGAYDUTINHDI}", $row['ngaydiden'], $template);
$template = str_replace("{TENNGUOICUNGDI}", $row['nguoicungdi'], $template);
$template = str_replace("{QUOCGIATUNGDI}", html_entity_decode(nl2br($row['quocgiatungden'])), $template);
$template = str_replace("{MUCDICHDIDEN}", $row['mucdichchuyendi'], $template);
$template = str_replace("{NGUOICHITRACHUYENDI}", $row['nguoichitra'], $template);
$template = str_replace("{THOIGIANO}", $row['thoigiano'], $template);
$template = str_replace("{TUNGDUOCCAPTHITHUC}", yes_no($row['tungduoccapthithuc']), $template);
$template = str_replace("{NGAYDUOCCAPVISA}", $row['ngaycapvisa'], $template);
$template = str_replace("{SOVISADUOCCAP}", $row['sovisa'], $template);
//.........这里部分代码省略.........
示例12: foreach
</h1>
<?php
if (count($expensetypes)) {
?>
<table cellpadding="2" cellspacing="0" width="100%">
<tr><th width="2"> </th><th width="12"> </th><th width="12"> </th><th>Name</th><th>Taxable</th><th class="monetary">Income</th><th align="right">Uses</th><th>Content</th></tr>
<?php
$i = 0;
foreach ($expensetypes as $expensetype) {
$tr = $i++ % 2 ? 'even' : 'odd';
echo "<tr class='{$tr}'>";
echo "<td> </td>";
echo "<td><a onClick=\"nw('detailPanel', 'expensetype/edit/{$expensetype['id']}')\" title='Edit Expense Type'><img src='images/icons/edit_small.png' /></a></td>";
echo "<td><a onClick=\"nw('detailPanel', 'expensetype/delete/{$expensetype['id']}')\" title='Delete Expense Type'><img src='images/icons/delete_small.png' /></a></td>";
echo "<td>{$expensetype['name']}</td>";
echo "<td>" . yes_no($expensetype['taxable']) . "</td>";
echo "<td class='monetary'>\$ " . number_format($expensetype['amount_sum'], 2) . "</td>";
echo "<td align='right'>{$expensetype['expense_count']}</td>";
echo "<td>{$expensetype['content']}</td>";
echo "</tr>\n";
}
?>
</table>
<?php
if ($total > $per_page) {
echo "<div class='pagify'>Page";
$total_pages = ceil($total / $per_page);
for ($i = 0; $i < $total_pages; $i++) {
$j = $i * $per_page;
$p = $i + 1;
echo sort_expense_page($j, $page, $project_id, $p);
示例13: plugin_list
/**
* The main panel listing all installed plugins.
*
* @param string|array $message The activity message
*/
function plugin_list($message = '')
{
global $event;
pagetop(gTxt('tab_plugins'), $message);
echo hed(gTxt('tab_plugins'), 1, array('class' => 'txp-heading'));
echo n . '<div id="' . $event . '_control" class="txp-control-panel">' . plugin_form() . n . '</div>';
extract(gpsa(array('sort', 'dir')));
if ($sort === '') {
$sort = get_pref('plugin_sort_column', 'name');
}
if ($dir === '') {
$dir = get_pref('plugin_sort_dir', 'asc');
}
$dir = $dir == 'desc' ? 'desc' : 'asc';
if (!in_array($sort, array('name', 'status', 'author', 'version', 'modified', 'load_order'))) {
$sort = 'name';
}
$sort_sql = $sort . ' ' . $dir;
set_pref('plugin_sort_column', $sort, 'plugin', 2, '', 0, PREF_PRIVATE);
set_pref('plugin_sort_dir', $dir, 'plugin', 2, '', 0, PREF_PRIVATE);
$switch_dir = $dir == 'desc' ? 'asc' : 'desc';
$rs = safe_rows_start('name, status, author, author_uri, version, description, length(help) as help, abs(strcmp(md5(code),code_md5)) as modified, load_order, flags', 'txp_plugin', '1 order by ' . $sort_sql);
if ($rs and numRows($rs) > 0) {
echo n . tag_start('div', array('id' => $event . '_container', 'class' => 'txp-container')) . n . tag_start('form', array('action' => 'index.php', 'id' => 'plugin_form', 'class' => 'multi_edit_form', 'method' => 'post', 'name' => 'longform')) . n . tag_start('div', array('class' => 'txp-listtables')) . n . tag_start('table', array('class' => 'txp-list')) . n . tag_start('thead') . tr(hCell(fInput('checkbox', 'select_all', 0, '', '', '', '', '', 'select_all'), '', ' scope="col" title="' . gTxt('toggle_all_selected') . '" class="txp-list-col-multi-edit"') . column_head('plugin', 'name', 'plugin', true, $switch_dir, '', '', ('name' == $sort ? "{$dir} " : '') . 'txp-list-col-name') . column_head('author', 'author', 'plugin', true, $switch_dir, '', '', ('author' == $sort ? "{$dir} " : '') . 'txp-list-col-author') . column_head('version', 'version', 'plugin', true, $switch_dir, '', '', ('version' == $sort ? "{$dir} " : '') . 'txp-list-col-version') . column_head('plugin_modified', 'modified', 'plugin', true, $switch_dir, '', '', ('modified' == $sort ? "{$dir} " : '') . 'txp-list-col-modified') . hCell(gTxt('description'), '', ' scope="col" class="txp-list-col-description"') . column_head('active', 'status', 'plugin', true, $switch_dir, '', '', ('status' == $sort ? "{$dir} " : '') . 'txp-list-col-status') . column_head('order', 'load_order', 'plugin', true, $switch_dir, '', '', ('load_order' == $sort ? "{$dir} " : '') . 'txp-list-col-load-order') . hCell(gTxt('manage'), '', ' scope="col" class="txp-list-col-manage"')) . n . tag_end('thead') . n . tag_start('tbody');
while ($a = nextRow($rs)) {
foreach ($a as $key => $value) {
${$key} = txpspecialchars($value);
}
// Fix up the description for clean cases.
$description = preg_replace(array('#<br />#', '#<(/?(a|b|i|em|strong))>#', '#<a href="(https?|\\.|\\/|ftp)([A-Za-z0-9:/?.=_]+?)">#'), array('<br />', '<$1>', '<a href="$1$2">'), $description);
if (!empty($help)) {
$help = href(gTxt('help'), array('event' => 'plugin', 'step' => 'plugin_help', 'name' => $name), array('class' => 'plugin-help'));
}
if ($flags & PLUGIN_HAS_PREFS) {
$plugin_prefs = href(gTxt('plugin_prefs'), array('event' => 'plugin_prefs.' . $name), array('class' => 'plugin-prefs'));
} else {
$plugin_prefs = '';
}
$manage = array();
if ($help) {
$manage[] = $help;
}
if ($plugin_prefs) {
$manage[] = $plugin_prefs;
}
$manage_items = $manage ? join(tag(sp . '|' . sp, 'span'), $manage) : '-';
$edit_url = eLink('plugin', 'plugin_edit', 'name', $name, $name);
echo tr(td(fInput('checkbox', 'selected[]', $name), '', 'txp-list-col-multi-edit') . hCell($edit_url, '', ' scope="row" class="txp-list-col-name"') . td(href($author, $a['author_uri'], array('rel' => 'external')), '', 'txp-list-col-author') . td($version, '', 'txp-list-col-version') . td($modified ? span(gTxt('yes'), array('class' => 'warning')) : '', '', 'txp-list-col-modified') . td($description, '', 'txp-list-col-description') . td(status_link($status, $name, yes_no($status)), '', 'txp-list-col-status') . td($load_order, '', 'txp-list-col-load-order') . td($manage_items, '', 'txp-list-col-manage'), $status ? ' class="active"' : '');
unset($name, $page, $deletelink);
}
echo n . tag_end('tbody') . n . tag_end('table') . n . tag_end('div') . plugin_multiedit_form('', $sort, $dir, '', '') . tInput() . n . tag_end('form') . n . tag_end('div');
}
}
示例14: show_maint
function show_maint($pmPrefs)
{
$txt = "\n\t<fieldset id='plugin-pm-maint'>\n\t<legend>" . ADLAN_PM_62 . "</legend>\n\t<form method='post' action='" . e_SELF . "?maint'>\n\t<table class='table adminform'>\n\t<colgroup>\n\t\t<col class='col-label' />\n\t\t<col class='col-control' />\n\t</colgroup>\n\t<tbody>\n\t<tr>\n\t\t<td>" . ADLAN_PM_63 . "</td>\n\t\t<td>" . yes_no('pm_maint_sent', '0') . "</td>\n\t</tr>\n\t<tr>\n\t\t<td>" . ADLAN_PM_64 . "</td>\n\t\t<td>" . yes_no('pm_maint_rec', '0') . "</td>\n\t</tr>\n\t<tr>\n\t\t<td>" . ADLAN_PM_65 . "</td>\n\t\t<td>" . yes_no('pm_maint_blocked', '0') . "</td>\n\t</tr>\n\t";
if ($pmPrefs['read_timeout'] || $pmPrefs['unread_timeout']) {
$txt .= "\n\t\t<tr>\n\t\t\t<td>" . ADLAN_PM_71 . "</td>\n\t\t\t<td>" . yes_no('pm_maint_expired', '0') . "</td>\n\t\t</tr>";
}
$txt .= "\n\t<tr>\n\t\t<td>" . ADLAN_PM_78 . "</td>\n\t\t<td>" . yes_no('pm_maint_attach', '0') . "</td>\n\t</tr>\n\t</tbody>\n\t</table>\n\t<div class='buttons-bar center'>\n\t" . e107::getForm()->admin_button('pm_maint_execute', 'no-value', 'delete', ADLAN_PM_61) . "\n\t</div>\n\t</form>\n\t</fieldset>\n\t";
return $txt;
}
示例15: yes_no
echo "<td>{$segment['project_name']}</td>";
echo "<td>{$segment['worktype_name']}</td>";
echo "<td>{$segment['duration']}</td>";
echo "<td>{$segment['user_name']}</td>";
echo "<td align='center'>" . yes_no($segment['billable']) . "</td>";
echo "</tr>\n";
}
echo "</table>\n";
?>
<h4>Invoice Expenses</h4>
<?php
if ($expenses) {
echo "<table width='100%'>\n";
echo "<tr><th width='16'> </th><th width='130'>Date</th><th>Project</th><th>Expense Type</th><th width='60' class='monetary' style='padding-right: 8px;'>Amount</th><th align='center'>Bill</th></tr>\n";
foreach ($expenses as $expense) {
echo "<tr id='expense-row-{$expense['id']}'><td><a onClick=\"unassignExpense('{$expense['id']}');\" title='Unassign Expense from Invoice'><img src='images/icons/unassign_small.png' alt='unassign' /></a></td><td><acronym title='" . htmlentities($expense['content']) . "'>" . date($this->lang->line('date_format_short'), strtotime($expense['date'])) . "</acronym></td><td>{$expense['project_name']}</td><td>{$expense['expensetype_name']}</td><td class='monetary' style='padding-right: 8px;'>\${$expense['amount']}</td><td align='center'>" . yes_no($expense['billable']) . "</td></tr>\n";
}
echo "</table>\n";
} else {
echo "<div class='notice'>There are no recorded expenses for this invoice.</div>\n";
}
?>
<h4>Invoice Payments</h4>
<?php
if ($payments) {
echo "<table width='100%'>\n";
echo "<tr><th width='16'> </th><th width='130'>Date</th><th width='60' class='monetary' style='padding-right: 8px;'>Amount</th><th>Notes</th></tr>\n";
foreach ($payments as $payment) {
echo "<tr id='payment-row-{$payment['id']}'>";
echo "<td><a onClick=\"deletePayment('{$payment['id']}');\" title='Delete Payment'><img src='images/icons/delete_small.png' alt='delete' /></a></td>";
echo "<td>" . date($this->lang->line('date_format_short'), strtotime($segment['date'])) . "</td>";