本文整理汇总了PHP中form::db_data_values方法的典型用法代码示例。如果您正苦于以下问题:PHP form::db_data_values方法的具体用法?PHP form::db_data_values怎么用?PHP form::db_data_values使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类form
的用法示例。
在下文中一共展示了form::db_data_values方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: form
function form_subnet()
{
global $db, $vars, $lang;
$form_subnet = new form(array('FORM_NAME' => 'form_subnet'));
$form_subnet->db_data('subnets.ip_start, subnets.ip_end, subnets.type, subnets.link_id, subnets.client_node_id');
$links = $db->get('links.id AS value, links.type, links.ssid, nodes.name, links.peer_node_id, "" AS output', "links\n\t\t\t\t\t\t\tLEFT JOIN nodes ON links.peer_node_id = nodes.id", "(links.type = 'ap' OR links.type = 'p2p') AND node_id = " . intval(get('node')), "", "links.type ASC, links.date_in ASC");
foreach ((array) $links as $key => $value) {
$links[$key]['output'] .= $lang['db']['links__type-' . $value['type']] . ' - ';
if ($value['type'] == 'ap') {
$links[$key]['output'] .= $links[$key]['ssid'];
}
if ($value['type'] == 'p2p') {
$links[$key]['output'] .= $links[$key]['name'] . ' (#' . $links[$key]['peer_node_id'] . ')';
}
}
$form_subnet->db_data_enum('subnets.link_id', $links);
$clients = $db->get('cl_n.id AS value, ap_l.ssid, cl_n.name, cl_n.id, "" AS output', "links AS cl_l " . "LEFT JOIN links AS ap_l ON cl_l.peer_ap_id = ap_l.id\n\t\t\t\t\t\t\tLEFT JOIN nodes AS ap_n ON ap_l.node_id = ap_n.id " . "LEFT JOIN nodes AS cl_n ON cl_l.node_id = cl_n.id", "cl_l.type = 'client' AND ap_l.type = 'ap' AND ap_l.node_id = " . intval(get('node')), "", "ap_l.date_in ASC, cl_l.date_in ASC");
foreach ((array) $clients as $key => $value) {
$clients[$key]['output'] = '[' . $lang['db']['links__type-ap'] . ' ' . $clients[$key]['ssid'] . '] - ' . $clients[$key]['name'] . ' (#' . $clients[$key]['id'] . ')';
}
$form_subnet->db_data_enum('subnets.client_node_id', $clients);
$form_subnet->db_data_values("subnets", "id", get('subnet'));
if (get('subnet') != 'add') {
$form_subnet->data[0]['value'] = long2ip($form_subnet->data[0]['value']);
$form_subnet->data[1]['value'] = long2ip($form_subnet->data[1]['value']);
}
return $form_subnet;
}
示例2: form
function form_range()
{
global $construct, $db, $vars, $main;
$form_range = new form(array('FORM_NAME' => 'form_range'));
$form_range->db_data('ip_ranges.ip_start, ip_ranges.ip_end, ip_ranges.info, ip_ranges.status');
$form_range->db_data_values("ip_ranges", "id", get('iprange'));
$form_range->data[0]['value'] = long2ip($form_range->data[0]['value']);
$form_range->data[1]['value'] = long2ip($form_range->data[1]['value']);
$tmp = $db->get('users.email, users_nodes.owner', 'users, users_nodes, ip_ranges', "users_nodes.user_id = users.id AND users_nodes.node_id = ip_ranges.node_id AND ip_ranges.id = '" . get("iprange") . "'");
if (!isset($form_range->info['email_all'])) {
$form_range->info['email_all'] = '';
}
if (!isset($form_range->info['email_owner'])) {
$form_range->info['email_owner'] = '';
}
foreach ((array) $tmp as $key => $value) {
$form_range->info['email_all'] .= $value['email'] . ', ';
if ($value['owner'] == 'Y') {
$form_range->info['email_owner'] .= $value['email'] . ', ';
}
}
$form_range->info['email_all'] = substr($form_range->info['email_all'], 0, -2);
$form_range->info['email_owner'] = substr($form_range->info['email_owner'], 0, -2);
$t = $db->get('nodes.id, nodes.name', 'nodes, ip_ranges', "ip_ranges.node_id = nodes.id AND ip_ranges.id = '" . get('iprange') . "'");
$form_range->info['node_name'] = $t[0]['name'];
$form_range->info['node_id'] = $t[0]['id'];
$form_range->info['hostmaster_username'] = $main->userdata->info['username'];
$form_range->info['hostmaster_name'] = $main->userdata->info['name'];
$form_range->info['hostmaster_surname'] = $main->userdata->info['surname'];
return $form_range;
}
示例3: form
function form_range()
{
global $construct, $db, $vars, $main;
if (!$this->has_edit_access()) {
$main->message->set_fromlang('info', 'no_privilege');
}
$form_range = new form(array('FORM_NAME' => 'form_range'));
$form_range->db_data('ip_ranges.ip_start, ip_ranges.ip_end, ip_ranges.info, ip_ranges.status');
#removed: ip_ranges.nodeid #bug
$form_range->db_data_values("ip_ranges", "id", get('iprange'));
$form_range->data[0]['value'] = long2ip($form_range->data[0]['value']);
$form_range->data[1]['value'] = long2ip($form_range->data[1]['value']);
$tmp = $db->get('users.email, users_nodes.owner', 'users, users_nodes, ip_ranges', "users_nodes.user_id = users.id AND users_nodes.node_id = ip_ranges.node_id AND ip_ranges.id = '" . get("iprange") . "'");
$form_range->info['email_all'] = null;
$form_range->info['email_owner'] = null;
foreach ((array) $tmp as $key => $value) {
$form_range->info['email_all'] .= $value['email'] . ', ';
if ($value['owner'] == 'Y') {
$form_range->info['email_owner'] .= $value['email'] . ', ';
}
}
$form_range->info['email_all'] = isset($form_range->info['email_all']) ? substr($form_range->info['email_all'], 0, -2) : null;
$form_range->info['email_owner'] = isset($form_range->info['email_owner']) ? substr($form_range->info['email_owner'], 0, -2) : null;
$t = $db->get('nodes.id, nodes.name', 'nodes, ip_ranges', "ip_ranges.node_id = nodes.id AND ip_ranges.id = '" . get('iprange') . "'");
$form_range->info['node_name'] = $t[0]['name'];
$form_range->info['node_id'] = $t[0]['id'];
$form_range->info['hostmaster_username'] = $main->userdata->info['username'];
$form_range->info['hostmaster_name'] = $main->userdata->info['name'];
$form_range->info['hostmaster_surname'] = $main->userdata->info['surname'];
return $form_range;
}
示例4: form
function form_zone()
{
global $db, $vars, $main;
$form_zone = new form(array('FORM_NAME' => 'form_zone'));
$form_zone->db_data('dns_zones.name, dns_zones.info, dns_zones_nameservers.nameserver_id, dns_zones.status');
$form_zone->db_data_values("dns_zones", "id", get('zone'));
$form_zone->db_data_pickup("dns_zones_nameservers.nameserver_id", "dns_nameservers", $db->get('dns_nameservers.id AS value, CONCAT(dns_nameservers.name, ".", nodes.name_ns, ".", "' . $vars['dns']['ns_zone'] . '") AS output', "dns_zones_nameservers, dns_nameservers, nodes", "dns_nameservers.node_id = nodes.id AND dns_nameservers.id = dns_zones_nameservers.nameserver_id AND dns_zones_nameservers.zone_id = '" . get('zone') . "'"), TRUE);
$tmp = $db->get('users.email, users_nodes.owner', 'users, users_nodes, dns_zones', "users_nodes.user_id = users.id AND users_nodes.node_id = dns_zones.node_id AND dns_zones.id = '" . get("zone") . "'");
foreach ((array) $tmp as $key => $value) {
$form_zone->info['email_all'] .= $value['email'] . ', ';
if ($value['owner'] == 'Y') {
$form_zone->info['email_owner'] .= $value['email'] . ', ';
}
}
$form_zone->info['email_all'] = substr($form_zone->info['email_all'], 0, -2);
$form_zone->info['email_owner'] = substr($form_zone->info['email_owner'], 0, -2);
$t = $db->get('nodes.id, nodes.name', 'nodes, dns_zones', "dns_zones.node_id = nodes.id AND dns_zones.id = '" . get('zone') . "'");
$form_zone->info['node_name'] = $t[0]['name'];
$form_zone->info['node_id'] = $t[0]['id'];
$form_zone->info['hostmaster_username'] = $main->userdata->info['username'];
$form_zone->info['hostmaster_name'] = $main->userdata->info['name'];
$form_zone->info['hostmaster_surname'] = $main->userdata->info['surname'];
$t = $db->get('type', 'dns_zones', "id = '" . get('zone') . "'");
if ($t[0]['type'] == 'forward') {
$form_zone->data[0]['value'] .= "." . $vars['dns']['root_zone'];
}
return $form_zone;
}
示例5: form
function form_community()
{
#global $db, $vars;
global $main, $db, $vars, $lang;
$form_community = new form(array('FORM_NAME' => 'form_community'));
$form_community->db_data('communities.id as community_id, communities.name, communities.windURL, communities.TOS, communities.fullname, communities.dnstld, communities.ns1,communities.ns2, communities.central-node as cnode, communities.admins AS cadmins_ids');
$form_community->db_data_values("communities", "id", get('community'));
if (get('community') != 'add') {
#$table_communities->data[$i]['ns1'] = long2ip($table_communities->data[$i]['ns1']);
#$table_communities->data[$i]['ns2'] = long2ip($table_communities->data[$i]['ns2']);
$form_community->data[5]['value'] = long2ip($form_community->data[5]['value']);
$form_community->data[6]['value'] = long2ip($form_community->data[6]['value']);
}
$form_community->data[7]['Field'] = 'cnode';
$form_community->data[8]['Field'] = 'cadmins_ids';
$form_community->data[8]['fullField'] = 'cadmins_ids';
#if (get('node') == 'add') {
$temp = $db->get("users.id AS value, users.username AS output", "users", "users.id = '" . $main->userdata->user . "'");
#} else {
# $temp = $db->get("users.id AS value, users.username AS output", "users_nodes, users", "users.id = users_nodes.user_id AND users_nodes.node_id = ".intval(get('node'))." AND users_nodes.owner = 'Y'");
#}
$form_community->db_data_pickup("cadmins_ids", "users", $temp);
#$form_community->db_data_pickup("users_nodes.user_id", "users", $db->get("users.id AS value, users.username AS output", "users_nodes, users", "users.id = users_nodes.user_id AND users_nodes.node_id = ".intval(get('node'))." AND users_nodes.owner != 'Y'"), TRUE);
#if (get('node') != 'add') {
######$form_community->db_data_pickup("users_nodes.user_id", "users", $db->get("users.id AS value, users.username AS output", "users_nodes, users", "users.id = users_nodes.user_id AND users_nodes.node_id = ".intval(get('node'))." AND users_nodes.owner != 'Y'"), TRUE);
# } else {
#$form_community->db_data_pickup("users_nodes.user_id", "users", null, TRUE);
# }
$form_community->db_data_remove('community_id');
return $form_community;
}
示例6: form
function form_cname()
{
global $db, $vars;
$form_cname = new form(array('FORM_NAME' => 'form_cname'));
$form_cname->db_data('ip_cname.hostname, ip_cname.cname, ip_cname.info');
$form_cname->db_data_values("ip_cname", "id", get('cname'));
return $form_cname;
}
示例7: form
function form_nameserver()
{
global $db, $vars;
$form_nameserver = new form(array('FORM_NAME' => 'form_nameserver'));
$form_nameserver->db_data('dns_nameservers.name' . (get('nameserver') == 'add' ? ", dns_nameservers.ip" : ""));
$form_nameserver->db_data_values("dns_nameservers", "id", get('nameserver'));
return $form_nameserver;
}
示例8: form
function form_nameserver()
{
global $db, $vars;
$form_nameserver = new form(array('FORM_NAME' => 'form_nameserver'));
$form_nameserver->db_data('dns_nameservers.name, dns_nameservers.ip, dns_nameservers.status');
$form_nameserver->db_data_values("dns_nameservers", "id", get('nameserver'));
$form_nameserver->data[1]['value'] = long2ip($form_nameserver->data[1]['value']);
return $form_nameserver;
}
示例9: form
function form_services()
{
global $db, $vars;
$form_services = new form(array('FORM_NAME' => 'form_services'));
$form_services->db_data('services.id, services.title, services.protocol, services.port');
$form_services->db_data_values("services", "id", get('service'));
$form_services->db_data_remove('services__id');
return $form_services;
}
示例10: form
function form_ipaddr()
{
global $db, $vars;
$form_ipaddr = new form(array('FORM_NAME' => 'form_ipaddr'));
$form_ipaddr->db_data('ip_addresses.hostname, ip_addresses.ip, ip_addresses.mac, ip_addresses.type, ip_addresses.always_on, ip_addresses.info');
$form_ipaddr->db_data_values("ip_addresses", "id", get('ipaddr'));
if (get('ipaddr') != 'add') {
$form_ipaddr->data[1]['value'] = long2ip($form_ipaddr->data[1]['value']);
}
return $form_ipaddr;
}
示例11: form
function form_link()
{
global $db, $vars;
$form_link = new form(array('FORM_NAME' => 'form_link'));
$form_link->db_data('links.type, links.peer_node_id, links.peer_ap_id, links.protocol, links.ssid, links.channel, links.frequency, links.status, links.due_date, links.equipment, links.info');
$form_link->db_data_values("links", "id", get('link'));
$form_link->db_data_pickup('links.peer_node_id', "nodes", $db->get("links.peer_node_id AS value, CONCAT(nodes.name, ' (#', nodes.id, ')') AS output", "links, nodes", "links.peer_node_id = nodes.id AND links.id = '" . get("link") . "'"));
$form_link->db_data_pickup('links.peer_ap_id', "links_ap", $db->get("l1.peer_ap_id AS value, l2.ssid AS output", "links AS l1, links AS l2", "l1.peer_ap_id = l2.id AND l1.id = '" . get("link") . "'"));
$form_link->data[1]['Null'] = '';
$form_link->data[2]['Null'] = '';
return $form_link;
}
示例12: form
function form_region()
{
global $db, $vars;
$form_region = new form(array('FORM_NAME' => 'form_region'));
$form_region->db_data('regions.id as region_id, regions.name, regions.ip_start, regions.ip_end,regions.dns_suffix, regions.info, regions.image, regions.min_lat, regions.min_long, regions.max_lat, regions.max_long');
$form_region->db_data_values("regions", "id", get('region'));
if (get('region') != 'add') {
$form_region->data[1]['value'] = long2ip($form_region->data[1]['value']);
$form_region->data[2]['value'] = long2ip($form_region->data[2]['value']);
}
$form_region->db_data_remove('region_id');
return $form_region;
}
示例13: form
function form_ipaddr_rev()
{
global $db, $vars;
$form_ipaddr_rev = new form(array('FORM_NAME' => 'form_ipaddr_rev'));
$form_ipaddr_rev->db_data('ip_addresses.ip, ip_addresses.hostname,ip_addresses.mac, ip_addresses.type, ip_addresses.always_on, ip_addresses.info,ip_addresses.zone_type');
$form_ipaddr_rev->db_data_values("ip_addresses", "id", get('ipaddr_rev'));
if (get('ipaddr_rev') != 'add') {
$form_ipaddr_rev->data[0]['value'] = long2ip($form_ipaddr_rev->data[0]['value']);
}
//Set default as reverse
$form_ipaddr_rev->data[6]['value'] = 'reverse';
return $form_ipaddr_rev;
}
示例14: form
function form_area()
{
global $db, $vars;
$form_area = new form(array('FORM_NAME' => 'form_area'));
$form_area->db_data('areas.id, areas.region_id, areas.name, areas.ip_start, areas.ip_end, areas.info');
$form_area->db_data_enum('areas.region_id', $db->get("id AS value, name AS output", "regions"));
$form_area->db_data_values("areas", "id", get('area'));
if (get('area') != 'add') {
$form_area->data[3]['value'] = long2ip($form_area->data[3]['value']);
$form_area->data[4]['value'] = long2ip($form_area->data[4]['value']);
}
$form_area->db_data_remove('areas__id');
return $form_area;
}
示例15: form
function form_region()
{
global $db, $vars;
$form_region = new form(array('FORM_NAME' => 'form_region'));
$form_region->db_data('regions.id, regions.name, regions.ip_start, regions.ip_end, regions.v6net, regions.v6prefix, regions.info');
$form_region->db_data_values("regions", "id", get('region'));
if (get('region') != 'add') {
$form_region->data[2]['value'] = long2ip($form_region->data[2]['value']);
$form_region->data[3]['value'] = long2ip($form_region->data[3]['value']);
$form_region->data[4]['value'] = inet_ntop($form_region->data[4]['value']);
}
$form_region->db_data_remove('regions__id');
return $form_region;
}