本文整理匯總了PHP中print_select_from_sql函數的典型用法代碼示例。如果您正苦於以下問題:PHP print_select_from_sql函數的具體用法?PHP print_select_from_sql怎麽用?PHP print_select_from_sql使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了print_select_from_sql函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: array
$table->data = array();
$table->colspan[7][0] = 2;
/* First row */
$table->data[0][0] = print_input_text('name', $name, '', 20, 0, true, __('Name'));
if ($config['enteprise'] == 1) {
$table->data[0][1] = print_checkbox('forced_email', 1, $forced_email, true, __('Forced email'));
} else {
$table->data[0][1] = print_checkbox('enforce_soft_limit', 1, $enforce_soft_limit, true, __('Enforce soft limit'));
}
/* Banner preview image is a bit bigger */
$table->data[0][2] = '<span id="banner_preview">';
if ($id && $banner != '') {
$table->data[0][2] .= ' <img src="images/group_banners/' . $banner . '" />';
}
$table->data[0][2] .= '</span>';
$table->data[2][0] = print_select_from_sql('SELECT id_grupo, nombre FROM tgrupo ORDER BY nombre', 'parent', $parent, '', 'None', '', true, false, false, __('Parent'));
//$table->data[2][1] = combo_user_visible_for_me ($id_user_default, "id_user_default", 0, "IR", true, __('Default user'));
$params_creator['input_id'] = 'text-id_user';
$params_creator['input_name'] = 'id_user';
$params_creator['input_value'] = $id_user;
$params_creator['title'] = __('Default user');
$params_creator['return'] = true;
$params_creator['return_help'] = true;
$table->data[2][1] = user_print_autocomplete_input($params_creator);
/*$table->data[2][1] = print_input_text_extended ('id_user', $id_user, 'text-id_user', '', 15, 30, false, '',
array('style' => 'background: url(' . $src_code . ') no-repeat right;'), true, '', __('Default user'))
. print_help_tip (__("Type at least two characters to search"), true);*/
$icons = list_files('images/groups_small/', 'png', 0, true, '');
$table->data[3][0] = print_select($icons, 'icon', $icon, '', 'None', '', true, false, false, __('Icon'));
$table->data[3][0] .= ' <span id="icon_preview">';
if ($id && $icon != '') {
示例2: __
}
echo "<h3 class='suc'>" . __('Disabled bad addresses') . "</h3>";
$id = 0;
}
echo '<br>';
echo '<div id="loading" style="display:none; width: 90%; margin-left: 0;">';
echo print_image("images/wait.gif", true, array("border" => '0')) . '<br />';
echo '<strong>' . __('Please wait...') . '</strong>';
echo '</div>';
// General issue listing
echo "<h2>" . __('Newsletter queue management') . "</h2>";
if ($manager) {
echo '<form method="post" action="index.php?sec=customers&sec2=operation/newsletter/queue_manager&create=1">';
echo "<table width=90% class=databox>";
echo "<tr><td>";
echo print_select_from_sql('SELECT id, email_subject FROM tnewsletter_content ORDER BY email_subject', 'id_newsletter_content', 0, '', '', '', true, false, false, "");
echo "<td>";
print_submit_button(__('Create'), 'new_btn', false, 'class="sub next"');
echo "</tr></table>";
echo '</form>';
}
$sql = "SELECT * FROM tnewsletter_queue ORDER BY datetime DESC";
$queue = get_db_all_rows_sql($sql);
if ($queue !== false) {
$table->width = "90%";
$table->class = "listing";
$table->data = array();
$table->style = array();
$table->style[0] = 'font-weight: bold';
$table->style[2] = 'font-size: 9px';
$table->style[1] = 'font-size: 10px';
示例3: array
}
print_table ($table);
$table->data = array ();
echo '<a href="javascript:;" onclick="$(\'#advanced_div\').slideToggle (); return false">';
echo __('Advanced search >>');
echo '</a>';
echo '<div id="advanced_div" style="padding: 0px; margin: 0px; display: none;">';
$table->data[0][0] = print_select_from_sql ('SELECT id, name FROM two_category ORDER BY name',
'id_category', $id_category, '', __("Any"), 0, true, false, false,
__('Category'));
$table->data[0][1] = print_select_from_sql (get_projects_query($config['id_user']),
'id_project', $id_project, '', __("Any"), 0, true, false, false,
__('Project'));
$table->data[0][2] = print_checkbox ("need_validation", 1, $need_validation, true, __("Require validation"));
print_table ($table);
echo "</div>";
echo '</form>';
if ($owner == $config['id_user'] && $creator == "") {
$order_by = "ORDER BY created_by_user, priority, last_update DESC";
} elseif ($creator == $config['id_user'] && $owner == "") {
$order_by = "ORDER BY assigned_user, priority, last_update DESC";
} else {
$order_by = "ORDER BY priority, last_update DESC";
}
示例4: __
} else {
echo "<h3>" . __('Update existing KB item') . "</a></h3>";
echo "<form id='form-kb_item' enctype='multipart/form-data' name=prodman2 method='post' action='index.php?sec=kb&sec2=operation/kb/manage_data&update2'>";
echo "<input id='id_kb_item' type=hidden name=id value='{$id}'>";
}
echo '<table width="90%" class="databox">';
echo "<tr>";
echo "<td class=datos>";
echo __('Title');
echo "<td class=datos>";
echo "<input id='text-name' type=text size=60 name='title' value='{$title}'>";
echo "<tr>";
echo "<td>";
echo __('Language');
echo "<td>";
echo print_select_from_sql('SELECT id_language, name FROM tlanguage', 'id_language', $id_language, '', __("Any"), '', true, false, false, '');
echo "<tr>";
echo "<td class=datos2 valign=top>";
echo __('Data');
echo "<td class=datos2>";
print_textarea("data", 15, 40, $data, '', false, false);
echo "<tr>";
echo "<td class=datos2>";
echo __('Product');
echo "<td class=datos2>";
//combo_kb_products ($id_product);
combo_product_types($product, 0);
echo "<tr>";
echo "<td class=datos>";
echo __('Category');
echo "<td class=datos>";
示例5: StdClass
$id_sla_type = $sla["id_sla_type"];
}
$table = new StdClass();
$table->width = "100%";
$table->class = "search-table-button";
$table->data = array ();
$table->colspan = array ();
$table->align = array ();
$table->colspan[3][0] = 4;
$table->data[0][0] = print_input_text ("name", $name, "", 30, 100, true, __('SLA name'));
$table->data[0][1] = print_checkbox ('enforced', 1 ,$enforced, true, __('Enforced'));
$table->data[0][2] = print_select_from_sql ('SELECT id, name FROM tsla ORDER BY name',
'id_sla_base', $id_sla_base, '', __('None'), 0, true, false, false, __('SLA Base'));
$id_sla_type_arr[0] = __("Normal SLA");
$id_sla_type_arr[1] = __("Third party SLA");
$id_sla_type_arr[2] = __("Both");
$table->data[0][3] = print_select ($id_sla_type_arr, 'id_sla_type', $id_sla_type,'', '', '0', true, 0, false, __('SLA Type'));
$table->data[1][0] = print_label(__('Max. response time (in hours)'), '', 'text', true);
$table->data[1][0] .= "<input type='text' name='min_response' id='text-min_response' value='$min_response' size='5' maxlenght='100' onChange='hours_to_dms(\"min\")'>";
$min_response_time = incidents_hours_to_dayminseg ($min_response);
$table->data[1][0] .= print_input_text ('min_response_time', $min_response_time, '',
7, 100, true, '', true);
$table->data[1][1] = print_label(__('Max. resolution time (in hours)'), '', 'text', true);
示例6: get_db_value
echo '</tr>';
// Owner
$id_owner = get_db_value ( 'id_owner', 'tproject', 'id', $id_project);
echo '<tr>';
echo "<td colspan=2><b>".__('Manager')." </b></td>";
echo "</tr><tr>";
echo "<td colspan=2>" . print_input_text_extended ('id_owner', $owner, 'text-id_owner', '', 25, 20, false, '', '', true, '',''). "</td>" ;
echo "</tr>";
// Project group
echo "<tr>";
echo "<td colspan=2><b>". __('Project group')."</b><br>";
echo "</tr><tr>";
if (!$clean_output) {
echo "<td colspan=2>". print_select_from_sql ("SELECT * from tproject_group ORDER BY name", "id_project_group", $id_project_group, "", __('None'), '0', true, false, true, false) ."</td>";
} else {
echo "<td colspan=2>". get_db_value ("name", "tproject_group", "id", $id_project_group) ."</td>";
}
echo "</tr>";
// CC
echo '<tr>';
echo '<td colspan=2><b>'.__('CC').print_help_tip (__("Email to notify changes in workunits"), true).' </b></td>';
echo '</tr><tr>';
echo '<td colspan=2><input type="text" name="cc" size=25 value="'.$cc.'"></td>';
echo '</tr>';
// start and end date
echo '<tr>';
echo '<td><b>'.__('Start').' </b>';
示例7: array
}
$activity_order_image = " <a href='javascript:changeActivityOrder(\"DESC\")'><img src='images/block_orange.png'></a>";
$company_order_image = " <a href='javascript:changeCompanyOrder(\"ASC\")'><img src='images/block_orange.png'></a>";
} else {
$order_by .= "tcompany.last_update DESC";
$activity_order_image = " <a href='javascript:changeActivityOrder(\"ASC\")'><img src='images/arrow_up_orange.png'></a>";
$company_order_image = " <a href='javascript:changeCompanyOrder(\"ASC\")'><img src='images/block_orange.png'></a>";
$billing_order_image = " <a href='javascript:changeBillingOrder(\"ASC\")'><img src='images/block_orange.png'></a>";
}
$search_params = "&search_manager={$search_manager}&search_text={$search_text}&search_role={$search_role}&search_country={$search_country}&search_parent={$search_parent}&search_date_begin={$search_date_begin}&search_date_end={$search_date_end}&search_min_billing={$search_min_billing}&order_by_activity={$order_by_activity}&order_by_company={$order_by_company}&order_by_billing={$order_by_billing}";
$table->width = '99%';
$table->class = 'search-table-button';
$table->style = array();
$table->data = array();
$table->data[0][0] = print_input_text("search_text", $search_text, "", 15, 100, true, __('Search'));
$table->data[0][1] = print_select_from_sql('SELECT id, name FROM tcompany_role ORDER BY name', 'search_role', $search_role, '', __('Select'), 0, true, false, false, __('Company Role'));
$table->data[0][2] = print_input_text("search_country", $search_country, "", 10, 100, true, __('Country'));
$table->data[0][3] = print_input_text_extended('search_manager', $search_manager, 'text-user', '', 15, 30, false, '', array(), true, '', __('Manager')) . print_help_tip(__("Type at least two characters to search"), true);
// $companies_name = crm_get_companies_list("", false, "ORDER BY name", true);
// $table->data[1][0] = print_select ($companies_name, 'search_parent', $search_parent, '', __('Any'), 0, true, false, false, __('Parent'));
$params = array();
$params['input_id'] = 'search_parent';
$params['input_name'] = 'search_parent';
$params['input_value'] = $search_parent;
$params['title'] = __('Parent');
$params['return'] = true;
$table->data[1][0] = print_company_autocomplete_input($params);
$table->data[1][1] = print_input_text('search_date_begin', $search_date_begin, '', 15, 20, true, __('Date from'));
$table->data[1][2] = print_input_text('search_date_end', $search_date_end, '', 15, 20, true, __('Date to'));
$table->data[1][3] = print_input_text('search_min_billing', $search_min_billing, '', 15, 20, true, __('Min. billing'));
$buttons = print_submit_button(__('Search'), "search_btn", false, 'class="sub search"', true);
示例8: get_parameter
$search_parent = get_parameter("search_parent");
$search_date_begin = (string) get_parameter('search_date_begin');
$search_date_end = (string) get_parameter('search_date_end');
$date = false;
if ($search_date_end == 'undefined') {
$search_date_end = '';
}
$table->width = '99%';
$table->class = 'search-table-button';
$table->style = array();
$table->data = array();
$table->data[0][0] = print_input_text("search_text", $search_text, "", 15, 100, true, __('Search'));
$table->data[0][1] = print_select_from_sql('SELECT id, name FROM tcompany_role ORDER BY name', 'search_role', $search_role, '', __('Select'), 0, true, false, false, __('Company Role'));
$table->data[0][2] = print_input_text("search_country", $search_country, "", 10, 100, true, __('Country'));
$table->data[0][3] = print_input_text_extended('search_manager', $search_manager, 'text-search_user', '', 15, 30, false, '', array(), true, '', __('Manager')) . print_help_tip(__("Type at least two characters to search"), true);
$table->data[1][0] = print_select_from_sql('SELECT id, name FROM tcompany ORDER BY name', 'search_parent', $search_parent, '', __('Select'), 0, true, false, false, __('Parent'));
$table->colspan[1][0] = 2;
$table->data[1][2] = print_input_text('search_date_begin', $search_date_begin, '', 15, 20, true, __('Date from'));
$table->data[1][3] = print_input_text('search_date_end', $search_date_end, '', 15, 20, true, __('Date to'));
$table->data['button'][0] = "<input type='button' class='sub search' onClick='javascript: loadParamsCompany(\".{$search_text}.\");' value='" . __("Search") . "''>";
$table->colspan['button'][0] = 4;
echo '<form id="form-company_search" method="post" action="index.php?sec=customers&sec2=operation/companies/company_detail">';
print_table($table);
echo '</form>';
$where_clause = '';
if ($search) {
if ($search_text != "") {
$where_clause .= sprintf(' AND ( name LIKE "%%%s%%" OR country LIKE "%%%s%%") ', $search_text, $search_text);
}
if ($search_role != 0) {
$where_clause .= sprintf(' AND id_company_role = %d', $search_role);
示例9: StdClass
$comments = $manufacturer["comments"];
$address = $manufacturer["address"];
$id_sla = $manufacturer["id_sla"];
$id_company_role = $manufacturer["id_company_role"];
}
$table = new StdClass();
$table->width = "100%";
$table->class = "search-table-button";
$table->data = array ();
$table->colspan = array ();
$table->colspan[1][0] = 2;
$table->colspan[2][0] = 2;
$table->data[0][0] = print_input_text ("name", $name, "", 60, 100, true, __('Name'));
$table->data[0][1] = print_select_from_sql ('SELECT id, name FROM tcompany_role ORDER BY name',
'id_company_role', $id_company_role, '', __('Select'), '0', true, false, false, __('Company role'));
/*$table->data[1][1] = print_select_from_sql ('SELECT id, name FROM tsla ORDER BY name',
'id_sla', $id_sla, '', __('Select'), '0', true, false, false, __('Base SLA'));*/
$table->data[1][0] = print_textarea ("address", 4, 1, $address, '', true, __('Address'));
$table->data[2][0] = print_textarea ("comments", 10, 1, $comments, '', true, __('Comments'));
echo '<form id="form-manufacturer_detail" method="post" action="index.php?sec=inventory&sec2=operation/manufacturers/manufacturer_detail">';
print_table ($table);
echo '<div style="width:100%;">';
unset($table->data);
$table->width = '100%';
$table->class = "button-form";
if ($id) {
$button = print_submit_button (__('Update'), "update_btn", false, 'class="sub upd"', true);
示例10: get_parameter
} else {
if (!$manager) {
include "general/noaccess.php";
exit;
}
}
require_once 'include/functions_crm.php';
$merge = get_parameter('merge', 0);
if ($merge) {
$id_newsletter_source = get_parameter('id_newsletter_source');
$id_newsletter_destination = get_parameter('id_newsletter_destination');
if ($id_newsletter_source == $id_newsletter_destination) {
echo '<h3 class="error">' . __('Source and destination must be different') . '</h3>';
} else {
echo crm_merge_newsletter_address($id_newsletter_source, $id_newsletter_destination);
}
}
echo "<h2>" . __('Newsletter address merge') . "</h2>";
$table->width = '98%';
$table->class = 'databox';
$table->colspan = array();
$table->data = array();
$table->data[0][0] = print_select_from_sql('SELECT id, name FROM tnewsletter ORDER BY name', 'id_newsletter_source', $id_newsletter_source, '', '', '', true, false, false, __('Source'));
$table->data[0][1] = print_select_from_sql('SELECT id, name FROM tnewsletter ORDER BY name', 'id_newsletter_destination', $id_newsletter_destination, '', '', '', true, false, false, __('Destination'));
echo '<form method="post" action="index.php?sec=customers&sec2=operation/newsletter/manage_address">';
print_table($table);
echo '<div class="button" style="width: ' . $table->width . '">';
print_submit_button(__('Merge'), 'merge_btn', false, 'class="sub next"');
print_input_hidden('merge', 1);
echo '</div>';
echo '</form>';
示例11: __
echo __('Standard user') . ' <input type="radio" class="chk" name="nivel" value="0" checked>';
echo " ";
echo __('External user') . ' <input type="radio" class="chk" name="nivel" value="-1">';
} else {
echo __('Administrator') . ' <input type="radio" class="chk" name="nivel" value="1">';
echo " ";
echo __('Standard user') . ' <input type="radio" class="chk" name="nivel" value="0">';
echo " ";
echo __('External user') . ' <input type="radio" class="chk" name="nivel" value="-1" checked>';
}
print_help_tip(__("External users cannot work inside a group, will show only it's own data. Standard users works with the ACL system, and administrators have full access to everything", false));
echo "<tr>";
echo "<td>";
echo __('Language');
echo "<td>";
print_select_from_sql("SELECT * FROM tlanguage", "lang", $lang, '', __('Default'), '', false, false, true, false);
//Print user custom fields
//Clean cache to avoid strange behaviour
clean_cache_db();
foreach ($user_fields as $u) {
echo "<tr>";
echo "<td>";
echo $u["label"];
echo "</td>";
$sql_data = sprintf('SELECT data FROM tuser_field_data WHERE id_user = "%s" AND id_user_field = %d', $update_user, $u["id"]);
$result = process_sql($sql_data);
$data = "";
if ($result) {
$data = safe_output($result[0]["data"]);
}
switch ($u["type"]) {
示例12: __
$params['input_name'] = 'id_company_search';
$params['input_value'] = $id_company;
$params['title'] = __('Managed by');
$params['return'] = true;
$table_advanced .= '<td>';
$table_advanced .= print_company_autocomplete_input($params);
$table_advanced .= '</td><td>';
$table_advanced .= combo_kb_products ($id_category, true, 'Product type', true);
$table_advanced .= '</td>';
$table_advanced .= "<td rowspan=2 valign=top>".get_last_date_control ($last_date, 'last_date_search', __('Date'), $start_date, 'start_date_search', __('Start date'), $end_date, 'end_date_search', __('End date'));
$table_advanced .= '</td>';
$table_advanced .= '<tr><td>';
$progress_values = lead_progress_array ();
$table_advanced .= print_select ($progress_values, 'progress_search', $progress, '', __('Any'), 0, true, 0, false, __('Lead progress') );
$table_advanced .= '</td><td>';
$table_advanced .= print_select_from_sql ('SELECT id_language, name FROM tlanguage ORDER BY name',
'id_language', $id_language, '', __('Any'), '', true, false, false, __('Language'));
$table_advanced .= '<tr>';
$table->data['advanced'][2] = print_container('lead_search_advanced', __('Advanced search'), $table_advanced, 'closed', true, false,'','no_border',3);
$table->colspan['advanced'][2] = 4;
// Delete new lines from the string
$where_clause = str_replace(array("\r", "\n"), '', $where_clause);
$form .= "<div class='divresult_left'>";
$form .= print_table ($table,true);
$form .= '</div>';
$table->data = array ();
$form .= "<div class='divform_right'>";
$form .= "<div class='button-form'><ul>";
$form .= '<li>' . print_button(__('Export to CSV'), '', false,
示例13: __
echo '<td>' . $user['id_usuario'] . '</td>';
echo '<td>' . $user['nombre_real'] . '</td>';
echo '<td>' . $user['comentarios'] . '</td>';
echo '</tr>';
$total_users++;
}
if ($total_users == 0) {
echo '<tr colspan="4">' . __('No users found') . '</tr>';
}
if (defined('AJAX')) {
return;
}
}
$table->data = array();
$table->width = '90%';
$table->data[0][0] = print_select_from_sql('SELECT id,name FROM trole ORDER BY 2', 'user_profile_search', $id_profile, '', __('Any'), 0, true, false, false, __('Role'));
$table->data[0][1] = print_select(get_user_groups(), 'user_group_search', $id_group, '', __('Any'), -1, true, false, false, __('Group'));
$table->data[2][0] = print_input_text('search_string', '', '', 20, 255, true, __('Name'));
$table->data[2][1] = print_submit_button(__('Search'), 'search_button', false, 'class="sub search"', true);
echo '<form id="user_search_form" method="post">';
print_table($table);
print_input_hidden('search', 1);
echo '</form>';
unset($table);
$table->class = 'hide result_table listing';
$table->width = '90%';
$table->id = 'user_search_result_table';
$table->head = array();
$table->head[0] = __('Username');
$table->head[1] = __('Real name');
$table->head[2] = __('Comments');
示例14: str_replace
$mail = str_replace ("_DEST_NAME_", $lead["fullname"], $mail);
$mail = str_replace ("_DEST_EMAIL_", $lead["email"], $mail);
$mail = str_replace ("_SRC_NAME_", $user["nombre_real"], $mail);
$mail = str_replace ("_SRC_EMAIL_", $user["direccion"], $mail);
$sql = "SELECT id, name FROM tcrm_template WHERE id_language = '". $lead["id_language"]. "' ORDER BY name DESC";
$id_template = (int) get_parameter ("id_template");
echo "<div class='divform'>";
// Show form with available templates for this useraco
echo '<form method="post" id="lead_mail_filter">';
echo "<table width=100% class='search-table'>";
echo "<tr><td>";
echo print_select_from_sql ($sql, 'id_template', $id_template, '', __("None"), 0, true, false, true, __("CRM Template to use"));
echo "</td></tr><tr><td>";
print_submit_button (__('Apply'), 'apply_btn', false, 'class="sub upd"', false);
print_input_hidden ('id', $id);
echo "</td></tr></table>";
echo "</form>";
echo "</div>";
$sql = "SELECT `description` FROM tlead_activity
WHERE id_lead = $id
ORDER BY creation DESC LIMIT 1";
$result = process_sql ($sql);
if ($result !== false) {
$last_email = $result[0]['description'];
示例15: array
$name = $template["name"];
$description = $template["description"];
$id_language = $template["id_language"];
$id_company = $template["id_company"];
$subject = $template["subject"];
}
$table->width = '99%';
$table->class = 'search-table-button';
$table->colspan = array();
$table->colspan[3][0] = 2;
$table->data = array();
$table->data[1][0] = print_input_text('name', $name, '', 50, 100, true, __('Name'));
$table->data[1][1] = print_select_from_sql('SELECT id_language, name FROM tlanguage ORDER BY name', 'id_language', $id_language, '', '', '', true, false, false, __('Language'));
$sql2 = "SELECT id, name FROM tcompany ORDER by name";
$table->data[2][0] = print_input_text('subject', $subject, '', 70, 200, true, __('Subject'));
$table->data[2][1] = print_select_from_sql($sql2, 'id_company', $id_company, '', __("None"), 0, true, false, true, __("Managed by"));
$table->data[3][0] = print_textarea('description', 20, 60, $description, '', true, __('Contents'));
if ($operation == "create") {
$button = print_submit_button(__('Create'), 'crt', false, 'class="sub create"', true);
$button .= print_input_hidden('operation', 'insert', true);
} else {
$button = print_submit_button(__('Update'), 'crt', false, 'class="sub upd"', true);
$button .= print_input_hidden('operation', 'update', true);
$button .= print_input_hidden('id', $id, true);
}
$table->data['button'][0] = $button;
$table->colspan['button'][0] = 2;
echo '<form id="form-template_manager" method="post" action="index.php?sec=leads&sec2=operation/leads/template_manager">';
print_table($table);
echo '</form>';
}