本文整理汇总了PHP中table::db_data_search方法的典型用法代码示例。如果您正苦于以下问题:PHP table::db_data_search方法的具体用法?PHP table::db_data_search怎么用?PHP table::db_data_search使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类table
的用法示例。
在下文中一共展示了table::db_data_search方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: substr
function table_dns()
{
global $construct, $db, $vars;
$form_search_dns = $this->form_search_dns();
if (substr($form_search_dns->data[1]['value'], -strlen("." . $vars['dns']['root_zone'])) == "." . $vars['dns']['root_zone']) {
$form_search_dns->data[1]['value'] = substr($form_search_dns->data[1]['value'], 0, -strlen("." . $vars['dns']['root_zone']));
}
$where = $form_search_dns->db_data_where(array("dns_zones__name" => "starts_with"));
$table_dns = new table(array('TABLE_NAME' => 'table_dns', 'FORM_NAME' => 'table_dns'));
$table_dns->db_data('dns_zones.id AS dns_zones__id, dns_zones.name AS dns_zones__name, dns_zones.type, dns_zones.date_in, dns_zones.status, nodes.name AS nodes__name, nodes.id AS nodes__id', 'dns_zones
LEFT JOIN nodes ON dns_zones.node_id = nodes.id', $where, "", "dns_zones.status ASC, dns_zones.type ASC, dns_zones.name ASC");
$table_dns->db_data_search($form_search_dns);
for ($i = 1; $i < count($table_dns->data); $i++) {
if (isset($table_dns->data[$i])) {
$table_dns->data[$i]['nodes__name'] .= " (#" . $table_dns->data[$i]['nodes__id'] . ")";
if ($table_dns->data[$i]['type'] == 'forward') {
$table_dns->data[$i]['dns_zones__name'] .= "." . $vars['dns']['root_zone'];
}
$table_dns->info['EDIT'][$i] = make_ref('/nodes', array("node" => $table_dns->data[$i]['nodes__id']));
}
}
$table_dns->info['EDIT_COLUMN'] = 'nodes__name';
$table_dns->db_data_remove('dns_zones__id', 'type', 'nodes__id');
$table_dns->db_data_translate('dns_zones__status');
return $table_dns;
}
示例2: table
function table_services()
{
global $construct, $db, $lang;
$form_search_services = $this->form_search_services();
$where = $form_search_services->db_data_where();
$table_services = new table(array('TABLE_NAME' => 'table_services', 'FORM_NAME' => 'table_services'));
$table_services->db_data('services.title, nodes.name AS nodes__name, nodes.id AS nodes__id, ip_addresses.ip, nodes_services.url, nodes_services.info, nodes_services.date_in, nodes_services.status, IFNULL(nodes_services.protocol, services.protocol) AS protocol, IFNULL(nodes_services.port, services.port) AS port', 'nodes_services
LEFT JOIN nodes on nodes_services.node_id = nodes.id
LEFT JOIN services on nodes_services.service_id = services.id
LEFT JOIN ip_addresses ON ip_addresses.id = nodes_services.ip_id', $where, '', "nodes_services.date_in DESC");
$table_services->db_data_search($form_search_services);
foreach ((array) $table_services->data as $key => $value) {
if ($key != 0) {
if ($table_services->data[$key]['ip']) {
$table_services->data[$key]['ip'] = long2ip($table_services->data[$key]['ip']);
if ($table_services->data[$key]['protocol'] && $table_services->data[$key]['port']) {
$table_services->data[$key]['ip'] .= ' (' . $lang['db']['nodes_services__protocol-' . $table_services->data[$key]['protocol']] . '/' . $table_services->data[$key]['port'] . ')';
}
}
$table_services->data[$key]['nodes__name'] .= " (#" . $table_services->data[$key]['nodes__id'] . ")";
$table_services->info['LINK']['nodes__name'][$key] = make_ref('/nodes', array("node" => $table_services->data[$key]['nodes__id']));
$table_services->info['LINK']['services__title'][$key] = htmlspecialchars($table_services->data[$key]['url']);
}
}
$table_services->db_data_translate('nodes_services__status');
$table_services->db_data_remove('nodes__id', 'nodes_services__id', 'url', 'protocol', 'port');
return $table_services;
}
示例3: table
function table_services()
{
global $construct, $db, $main, $lang;
$form_search_services_edit = $this->form_search_services_edit();
$where = $form_search_services_edit->db_data_where();
$table_services = new table(array('TABLE_NAME' => 'table_services', 'FORM_NAME' => 'table_services'));
$table_services->db_data('services.title, nodes_services.id, nodes.name, nodes.id AS nodes__id, ip_addresses.ip, nodes_services.date_in, nodes_services.info, nodes_services.status, IFNULL(nodes_services.protocol, services.protocol) AS protocol, IFNULL(nodes_services.port, services.port) AS port', 'nodes_services
LEFT JOIN nodes on nodes_services.node_id = nodes.id
LEFT JOIN services on nodes_services.service_id = services.id
LEFT JOIN ip_addresses ON ip_addresses.id = nodes_services.ip_id', $where, '', "nodes_services.date_in DESC");
$table_services->db_data_search($form_search_services_edit);
foreach ((array) $table_services->data as $key => $value) {
if ($key != 0) {
if ($table_services->data[$key]['ip']) {
$table_services->data[$key]['ip'] = long2ip($table_services->data[$key]['ip']);
if ($table_services->data[$key]['protocol'] && $table_services->data[$key]['port']) {
$table_services->data[$key]['ip'] .= ' (' . $lang['db']['nodes_services__protocol-' . $table_services->data[$key]['protocol']] . '/' . $table_services->data[$key]['port'] . ')';
}
}
$table_services->data[$key]['name'] .= " (#" . $table_services->data[$key]['nodes__id'] . ")";
$table_services->info['EDIT'][$key] = make_ref('/node_editor/services', array("node" => $table_services->data[$key]['nodes__id'], "service" => $table_services->data[$key]['id']));
}
}
$table_services->info['EDIT_COLUMN'] = 'title';
$table_services->db_data_translate('nodes_services__status');
$table_services->db_data_multichoice('nodes_services', 'id');
$table_services->info['MULTICHOICE_LABEL'] = 'delete';
$table_services->db_data_remove('id', 'nodes__id', 'protocol', 'port');
return $table_services;
}
示例4: AND
function table_nodes()
{
global $construct, $db, $main;
$form_search_nodes = $this->form_search_nodes();
$where = $form_search_nodes->db_data_where(array("nodes__name" => "starts_with"));
if ($main->userdata->privileges['admin'] !== TRUE) {
$where = "users.status = 'activated'" . ($where != '' ? ' AND (' . $where . ')' : "");
}
$table_nodes = new table(array('TABLE_NAME' => 'table_nodes'));
$table_nodes->db_data('nodes.id, nodes.name AS nodes__name, areas.name AS areas__name', 'nodes
LEFT JOIN areas ON nodes.area_id = areas.id
LEFT JOIN regions ON areas.region_id = regions.id ' . 'INNER JOIN users_nodes ON nodes.id = users_nodes.node_id ' . 'LEFT JOIN users ON users.id = users_nodes.user_id', $where != '' ? $where : "", "nodes.id", "nodes.id ASC");
$table_nodes->db_data_search($form_search_nodes);
for ($i = 1; $i < count($table_nodes->data); $i++) {
if (isset($table_nodes->data[$i])) {
$table_nodes->data[$i]['nodes__name'] .= " (#" . $table_nodes->data[$i]['id'] . ")";
$table_nodes->info['PICKUP_VALUE'][$i] = $table_nodes->data[$i]['id'];
$table_nodes->info['PICKUP_OUTPUT'][$i] = $table_nodes->data[$i]['nodes__name'];
}
}
$table_nodes->info['PICKUP_COLUMN'] = 'nodes__name';
$table_nodes->info['PICKUP_OBJECT'] = stripslashes(get('object'));
$table_nodes->db_data_remove('id');
return $table_nodes;
}
示例5: table
function table_ip_ranges()
{
global $construct, $db, $lang;
$form_search_ranges = $this->form_search_ranges();
$where = $form_search_ranges->db_data_where(array('ip' => 'exclude', 'nodes__name' => 'starts_with', "total_active_p2p" => 'exclude', "total_active_aps" => 'exclude'));
$table_ip_ranges = new table(array('TABLE_NAME' => 'table_ip_ranges', 'FORM_NAME' => 'table_ip_ranges'));
$where = $where != '' ? "(" . $where . ") AND " : "";
if ($form_search_ranges->data[0]['value'] != '') {
$where .= "(";
$s_ranges = ip_to_ranges($form_search_ranges->data[0]['value']);
foreach ($s_ranges as $s_range) {
$where .= "(ip_ranges.ip_start BETWEEN " . ip2long($s_range['min']) . " AND " . ip2long($s_range['max']) . ") OR ";
}
$where = substr($where, 0, -4) . ") AND ";
}
if ($where != '') {
$where = substr($where, 0, -5);
}
$having = $form_search_ranges->db_data_where(array('ip' => 'exclude', 'ip_ranges__status' => 'exclude', 'ip_ranges__delete_req' => 'exclude', 'nodes__id' => 'exclude', 'nodes__name' => 'exclude'));
$table_ip_ranges->db_data('ip_ranges.id,
"" AS ip_range,
ip_ranges.ip_start,
ip_ranges.ip_end,
ip_ranges.date_in,
ip_ranges.status,
ip_ranges.delete_req,
COUNT(DISTINCT p2p.id) AS total_active_p2p,
COUNT(DISTINCT aps.id) AS total_active_aps,
"" AS total_active_peers', 'ip_ranges ' . 'LEFT JOIN nodes ON ip_ranges.node_id = nodes.id
LEFT JOIN links ON ip_ranges.node_id = links.node_id AND links.status = "active"
LEFT JOIN links AS p2p ON links.type = "p2p"
AND links.peer_node_id = p2p.node_id
AND p2p.type = "p2p"
AND p2p.peer_node_id = links.node_id
AND p2p.status = "active"
LEFT JOIN links as aps ON links.type = "ap"
AND links.id = aps.id', $where, "ip_ranges.id" . ($having != '' ? ' HAVING (' . $having . ')' : ""), "ip_ranges.date_in DESC, ip_ranges.status ASC");
$table_ip_ranges->db_data_search($form_search_ranges);
foreach ((array) $table_ip_ranges->data as $key => $value) {
if ($key != 0) {
$table_ip_ranges->data[$key]['ip_start'] = long2ip($table_ip_ranges->data[$key]['ip_start']);
$table_ip_ranges->data[$key]['ip_end'] = long2ip($table_ip_ranges->data[$key]['ip_end']);
$table_ip_ranges->data[$key]['ip_range'] = $table_ip_ranges->data[$key]['ip_start'] . " - " . $table_ip_ranges->data[$key]['ip_end'];
}
}
$table_ip_ranges->db_data_multichoice('ip_ranges', 'id');
for ($i = 1; $i < count($table_ip_ranges->data); $i++) {
if (isset($table_ip_ranges->data[$i])) {
$table_ip_ranges->data[$i]['total_active_peers'] = ($table_ip_ranges->data[$i]['total_active_p2p'] > 0 ? $table_ip_ranges->data[$i]['total_active_p2p'] . " " . $lang['backbones_abbr'] : "") . ($table_ip_ranges->data[$i]['total_active_aps'] > 0 ? " + " . $table_ip_ranges->data[$i]['total_active_aps'] . " " . $lang['aps_abbr'] : "");
$table_ip_ranges->info['EDIT'][$i] = make_ref('/hostmaster/range', array("iprange" => $table_ip_ranges->data[$i]['id']));
}
}
$table_ip_ranges->info['EDIT_COLUMN'] = 'ip_range';
$table_ip_ranges->info['MULTICHOICE_LABEL'] = 'delete';
$table_ip_ranges->db_data_remove('id', 'ip_start', 'ip_end', 'total_active_p2p', 'total_active_aps');
$table_ip_ranges->db_data_translate('ip_ranges__status', 'ip_ranges__delete_req');
return $table_ip_ranges;
}
示例6: table
function table_nodes()
{
global $construct, $db, $main, $lang;
$form_search_nodes = $this->form_search_nodes();
$where = $form_search_nodes->db_data_where(array("nodes__name" => "starts_with", "total_active_peers" => 'exclude', "total_active_clients" => 'exclude', "has_ap" => 'exclude'));
$having = $form_search_nodes->db_data_where(array("nodes__id" => "exclude", "nodes__name" => "exclude", "areas__id" => "exclude", "regions__id" => "exclude", "has_ap" => 'exclude'));
if ($form_search_nodes->data[6]['value'] != '') {
$having .= ($having != '' ? ' AND ' : '') . 'total_active_aps ' . ($form_search_nodes->data[6]['value'] == 'Y' ? '>' : '=') . ' 0';
}
$table_nodes = new table(array('TABLE_NAME' => 'table_nodes'));
$table_nodes->db_data('nodes.id,
nodes.name AS nodes__name,
areas.name AS areas__name,
communities.name AS communities__name,
COUNT(DISTINCT p2p.id) AS total_active_p2p,
COUNT(DISTINCT aps.id) AS total_active_aps,
COUNT(DISTINCT p2p.id)+COUNT(DISTINCT client.id) AS total_active_peers,
COUNT(DISTINCT cl.id) AS total_active_clients, nodes.freeifs AS nodes__freeifs', 'nodes
LEFT JOIN areas ON nodes.area_id = areas.id
LEFT JOIN regions ON areas.region_id = regions.id
LEFT JOIN communities ON nodes.community_id = communities.id
LEFT JOIN links ON nodes.id = links.node_id AND links.status = "active"
LEFT JOIN links AS client ON links.peer_ap_id = client.id
AND links.type = "client"
AND client.type = "ap"
AND client.status = "active"
LEFT JOIN links AS p2p ON p2p.peer_node_id = links.node_id
AND links.peer_node_id = p2p.node_id
AND links.type = "p2p"
AND p2p.type = "p2p"
AND p2p.status = "active"
LEFT JOIN links AS aps ON nodes.id = aps.node_id
AND aps.type = "ap"
AND aps.status = "active"
LEFT JOIN links AS cl ON cl.peer_ap_id = aps.id
AND cl.type = "client"
AND cl.status = "active"
INNER JOIN users_nodes ON nodes.id = users_nodes.node_id
LEFT JOIN users ON users.id = users_nodes.user_id', 'users.status = "activated"' . ($where != '' ? ' AND (' . $where . ')' : ""), 'nodes.id' . ($having != '' ? ' HAVING (' . $having . ')' : ""), "total_active_peers DESC, total_active_aps DESC, total_active_clients DESC, nodes.id");
$table_nodes->db_data_search($form_search_nodes);
for ($i = 1; $i < count($table_nodes->data); $i++) {
if (isset($table_nodes->data[$i])) {
$table_nodes->data[$i]['nodes__name'] .= " (#" . $table_nodes->data[$i]['id'] . ")";
$table_nodes->data[$i]['total_active_peers'] = $table_nodes->data[$i]['total_active_peers'] . ($table_nodes->data[$i]['total_active_aps'] > 0 ? " (+" . $table_nodes->data[$i]['total_active_aps'] . " " . $lang['aps'] . ")" : "");
$table_nodes->info['EDIT'][$i] = makelink(array("page" => "nodes", "node" => $table_nodes->data[$i]['id']));
}
}
$table_nodes->info['EDIT_COLUMN'] = 'nodes__name';
$table_nodes->db_data_remove('id', 'total_active_p2p', 'total_active_aps');
return $table_nodes;
}
示例7: table
function table_communities()
{
global $construct, $db, $lang;
$form_search_communities = $this->form_search_communities();
$where = "";
#$form_search_communities->db_data_where();
$table_communities = new table(array('TABLE_NAME' => 'table_communities', 'FORM_NAME' => 'table_communities'));
$table_communities->db_data('communities.id, communities.name,communities.fullname, communities.windURL, communities.TOS, communities.dnstld, communities.ns1, communities.ns2, communities.admins', 'communities', $where, '', "communities.id ASC");
$table_communities->db_data_search($form_search_communities);
foreach ((array) $table_communities->data as $key => $value) {
if ($key != 0) {
if ($table_communities->data[$key]['ns1']) {
$table_communities->data[$key]['ns1'] = long2ip($table_communities->data[$key]['ns1']);
#if ($table_services->data[$key]['protocol'] && $table_communities->data[$key]['port']) {
# $table_services->data[$key]['ip'] .= ' ('.$lang['db']['nodes_services__protocol-'.$table_communities->data[$key]['protocol']].'/'.$table_communities->data[$key]['port'].')';
#}
}
if ($table_communities->data[$key]['ns2']) {
$table_communities->data[$key]['ns2'] = long2ip($table_communities->data[$key]['ns2']);
}
$cadmins = explode(",", $table_communities->data[$key]['admins']);
#print_r($cadmins);echo "admins<br>";
foreach ($cadmins as $key_name => $key_value) {
$i++;
#print_r($key_value);
$queryusers = $db->query("SELECT\n\t\t\t\t\t\t\t\t\tusers.username\n\t\t\t\t\t\t\t\t\tFROM\n\t\t\t\t\t\t\t\t\tusers\n\t\t\t\t\t\t\t\t\tWHERE\n\t\t\t\t\t\t\t\t\tusers.id = '{$key_value}'\n\t\t\t\t\t\t\t\t\t");
$usernames = mysql_fetch_assoc($queryusers);
#echo $usernames['username'];
$cadmins[$key_name] = $usernames['username'];
#echo $cadmins[$key_name];
#print_r($usernames);
#$cadmins[$key_name]=$usernames[$i];#echo "users:$key_name:$key_value<br>"; print_r($usernames);
#$new=implode(",",$usernames);
#$basket = array_replace_recursive($base, $replacements);print_r($basket);
#$usernames_comma_separated = implode(",", $usernames);
#$basket = array_combine($cadmins, $usernames);print_r($basket);
}
#$basket = array_combine($cadmins, $usernames);print_r($basket);
$table_communities->data[$key]['admins'] = implode(", ", $cadmins);
# $cadmins->data[$k]['links__ip'] = $cadmins->data[$k]['links__ip'];#@#
#$table_communities->data[$key]['nodes__name'] .= " (#".$table_communities->data[$key]['nodes__id'].")";
#$table_communities->info['LINK']['nodes__name'][$key] = makelink(array("page" => "nodes", "node" => $table_communities->data[$key]['nodes__id']));
#$table_communities->info['LINK']['services__title'][$key] = $table_communities->data[$key]['url'];
}
}
#$table_communities->db_data_translate('communities__TOS');
$table_communities->db_data_remove('TOS');
return $table_communities;
}
示例8: table
function table_users()
{
global $construct, $db, $main;
$form_search_users = $this->form_search_users();
$where = $form_search_users->db_data_where(array("users__username" => "starts_with"));
$table_users = new table(array('TABLE_NAME' => 'table_users'));
$table_users->db_data('users.id, users.username', 'users', "users.status = 'activated'" . ($where != '' ? ' AND (' . $where . ')' : ""), 'users.id', "users.username ASC");
$table_users->db_data_search($form_search_users);
for ($i = 1; $i < count($table_users->data); $i++) {
if (isset($table_users->data[$i])) {
$table_users->info['PICKUP_VALUE'][$i] = $table_users->data[$i]['id'];
$table_users->info['PICKUP_OUTPUT'][$i] = $table_users->data[$i]['username'];
}
}
$table_users->info['PICKUP_COLUMN'] = 'username';
$table_users->info['PICKUP_OBJECT'] = stripslashes(get('object'));
$table_users->db_data_remove('id');
return $table_users;
}
示例9: table
function table_users()
{
global $construct, $db, $main;
$form_search_users = $this->form_search_users();
$where = $form_search_users->db_data_where(array("users__username" => "starts_with", "users__surname" => "starts_with", "users__name" => "starts_with", "users__email" => "starts_with"));
$table_users = new table(array('FORM_NAME' => 'table_users', 'TABLE_NAME' => 'table_users'));
$table_users->db_data('users.id, users.username, "" AS fullname, users.surname, users.name, users.email, users.phone', 'users LEFT JOIN rights ON users.id = rights.user_id', $where, 'users.id', 'users.date_in DESC');
$table_users->db_data_search($form_search_users);
for ($i = 1; $i < count($table_users->data); $i++) {
if (isset($table_users->data[$i])) {
$table_users->data[$i]['fullname'] = $table_users->data[$i]['surname'] . " " . $table_users->data[$i]['name'];
$table_users->info['EDIT'][$i] = makelink(array("page" => "users", "user" => $table_users->data[$i]['id']));
}
}
$table_users->info['EDIT_COLUMN'] = 'username';
$table_users->db_data_multichoice('users', 'id');
$table_users->info['MULTICHOICE_LABEL'] = 'delete';
$table_users->db_data_remove('id', 'surname', 'name');
return $table_users;
}
示例10: table
function table_nodes()
{
global $construct, $db, $main;
$form_search_nodes = $this->form_search_nodes();
$where = $form_search_nodes->db_data_where(array("nodes__name" => "starts_with"));
$table_nodes = new table(array('FORM_NAME' => 'table_nodes', 'TABLE_NAME' => 'table_nodes'));
$table_nodes->db_data('nodes.id, nodes.name AS nodes__name, areas.name AS areas__name', 'nodes ' . 'LEFT JOIN areas ON nodes.area_id = areas.id ' . 'LEFT JOIN regions ON areas.region_id = regions.id', $where, "", "nodes.id ASC");
$table_nodes->db_data_search($form_search_nodes);
for ($i = 1; $i < count($table_nodes->data); $i++) {
if (isset($table_nodes->data[$i])) {
$table_nodes->data[$i]['nodes__name'] .= " (#" . $table_nodes->data[$i]['id'] . ")";
$table_nodes->info['EDIT'][$i] = make_ref('/node_editor', array("node" => $table_nodes->data[$i]['id']));
}
}
$table_nodes->info['EDIT_COLUMN'] = 'nodes__name';
$table_nodes->db_data_multichoice('node', 'id');
$table_nodes->info['MULTICHOICE_LABEL'] = 'delete';
$table_nodes->db_data_remove('id');
return $table_nodes;
}
示例11: table
function table_nameservers()
{
global $construct, $db, $main, $vars;
$form_search_nameservers = $this->form_search_nameservers();
$where = $form_search_nameservers->db_data_where(array("nodes__name" => "starts_with"));
$table_nameservers = new table(array('TABLE_NAME' => 'table_nameservers'));
$table_nameservers->db_data('dns_nameservers.id, dns_nameservers.name, nodes.id AS nodes__id, nodes.name AS nodes__name, nodes.name_ns AS nodes__name_ns, areas.name AS areas__name', 'dns_nameservers, nodes, areas, regions', 'dns_nameservers.node_id = nodes.id AND nodes.area_id = areas.id AND areas.region_id = regions.id' . ($where != '' ? ' AND (' . $where . ')' : ""), "", "nodes.id ASC");
$table_nameservers->db_data_search($form_search_nameservers);
for ($i = 1; $i < count($table_nameservers->data); $i++) {
if (isset($table_nameservers->data[$i])) {
$table_nameservers->data[$i]['nodes__name'] .= " (#" . $table_nameservers->data[$i]['nodes__id'] . ")";
$table_nameservers->data[$i]['name'] .= "." . $table_nameservers->data[$i]['nodes__name_ns'] . "." . $vars['dns']['ns_zone'];
$table_nameservers->info['PICKUP_VALUE'][$i] = $table_nameservers->data[$i]['id'];
$table_nameservers->info['PICKUP_OUTPUT'][$i] = $table_nameservers->data[$i]['name'];
}
}
$table_nameservers->info['PICKUP_COLUMN'] = 'name';
$table_nameservers->info['PICKUP_OBJECT'] = stripslashes(get('object'));
$table_nameservers->db_data_remove('id', 'nodes__id', 'nodes__name_ns');
return $table_nameservers;
}
示例12: unserialize
function table_nameservers()
{
global $construct, $db, $vars;
if (isset($_POST['dns_nameservers__ip']) && $_POST['dns_nameservers__ip'] != '') {
$_POST['dns_nameservers__ip'] = ip2long($_POST['dns_nameservers__ip']);
}
if (isset($_GET['form_search_nameservers_search']) && $_GET['form_search_nameservers_search'] != '') {
$t = unserialize(stripslashes($_GET['form_search_nameservers_search']));
if (isset($t['dns_nameservers__ip']) && $t['dns_nameservers__ip'] != '') {
$t['dns_nameservers__ip'] = ip2long($t['dns_nameservers__ip']);
}
$_GET['form_search_nameservers_search'] = addslashes(serialize($t));
}
$form_search_nameservers = $this->form_search_nameservers();
$where = $form_search_nameservers->db_data_where(array('nodes__name' => 'starts_with'));
$table_nameservers = new table(array('TABLE_NAME' => 'table_nameservers', 'FORM_NAME' => 'table_nameservers'));
$table_nameservers->db_data('dns_nameservers.id, dns_nameservers.name,communities.name AS communities__name, nodes.name_ns, dns_nameservers.ip, communities.dnstld , dns_nameservers.date_in, dns_nameservers.status, dns_nameservers.delete_req', 'dns_nameservers
LEFT JOIN nodes ON dns_nameservers.node_id = nodes.id
LEFT JOIN communities ON nodes.community_id = communities.id ', $where, "", "dns_nameservers.date_in DESC, dns_nameservers.status ASC");
$table_nameservers->db_data_search($form_search_nameservers);
foreach ((array) $table_nameservers->data as $key => $value) {
if ($key != 0) {
$table_nameservers->data[$key]['ip'] = long2ip($table_nameservers->data[$key]['ip']);
$table_nameservers->data[$key]['name'] = strtolower(($table_nameservers->data[$key]['name'] != '' ? $table_nameservers->data[$key]['name'] . "." : "") . $table_nameservers->data[$key]['name_ns'] . "." . $table_nameservers->data[$key]['dnstld'] . "." . $vars['dns']['ns_zone']);
}
}
$table_nameservers->db_data_multichoice('dns_nameservers', 'id');
for ($i = 1; $i < count($table_nameservers->data); $i++) {
if (isset($table_nameservers->data[$i])) {
$table_nameservers->info['EDIT'][$i] = makelink(array("page" => "hostmaster", "subpage" => "dnsnameserver", "nameserver" => $table_nameservers->data[$i]['id']));
}
}
$table_nameservers->info['EDIT_COLUMN'] = 'name';
$table_nameservers->info['MULTICHOICE_LABEL'] = 'delete';
$table_nameservers->db_data_remove('id', 'name_ns');
$table_nameservers->db_data_translate('dns_nameservers__status', 'dns_nameservers__delete_req');
return $table_nameservers;
}
示例13: table
function table_links_ap()
{
global $construct, $db, $main, $lang;
$form_search_links_ap = $this->form_search_links_ap();
$where = $form_search_links_ap->db_data_where(array("links__ssid" => "starts_with", "nodes__name" => "starts_with"));
$table_links_ap = new table(array('TABLE_NAME' => 'table_links_ap'));
$table_links_ap->db_data('links.id AS links__id, links.ssid, nodes.id AS nodes__id, nodes.name AS nodes__name, areas.name AS areas__name', 'links ' . 'INNER JOIN nodes ON links.node_id = nodes.id ' . 'LEFT JOIN areas ON nodes.area_id = areas.id ' . 'LEFT JOIN regions ON areas.region_id = regions.id', "links.type = 'ap'" . ($where != '' ? ' AND (' . $where . ')' : ""), "", "nodes.id ASC");
$table_links_ap->db_data_search($form_search_links_ap);
for ($i = 1; $i < count($table_links_ap->data); $i++) {
if (isset($table_links_ap->data[$i])) {
if ($table_links_ap->data[$i]['ssid'] == '') {
$table_links_ap->data[$i]['ssid'] = $lang['null'];
}
$table_links_ap->data[$i]['nodes__name'] .= " (#" . $table_links_ap->data[$i]['nodes__id'] . ")";
$table_links_ap->info['PICKUP_VALUE'][$i] = $table_links_ap->data[$i]['links__id'];
$table_links_ap->info['PICKUP_OUTPUT'][$i] = $table_links_ap->data[$i]['nodes__name'] . " [" . $lang['db']['links__ssid'] . ": " . $table_links_ap->data[$i]['ssid'] . "]";
}
}
$table_links_ap->info['PICKUP_COLUMN'] = 'ssid';
$table_links_ap->info['PICKUP_OBJECT'] = stripslashes(get('object'));
$table_links_ap->db_data_remove('links__id', 'nodes__id');
return $table_links_ap;
}
示例14: table
function table_dns()
{
global $construct, $db, $vars;
$form_search_dns = $this->form_search_dns();
$where = $form_search_dns->db_data_where(array("dns_zones__name" => "starts_with", 'nodes__name' => 'starts_with'));
$table_dns = new table(array('TABLE_NAME' => 'table_dns', 'FORM_NAME' => 'table_dns'));
$table_dns->db_data('dns_zones.id, dns_zones.name, dns_zones.type, dns_zones.date_in, dns_zones.status', 'dns_zones ' . 'LEFT JOIN nodes ON dns_zones.node_id = nodes.id', $where, "", "dns_zones.date_in DESC, dns_zones.status ASC");
$table_dns->db_data_search($form_search_dns);
$table_dns->db_data_multichoice('dns_zones', 'id');
for ($i = 1; $i < count($table_dns->data); $i++) {
if (isset($table_dns->data[$i])) {
if ($table_dns->data[$i]['type'] == 'forward') {
$table_dns->data[$i]['name'] .= "." . $vars['dns']['root_zone'];
}
$table_dns->info['EDIT'][$i] = make_ref('/hostmaster/dnszone', array("zone" => $table_dns->data[$i]['id']));
}
}
$table_dns->info['EDIT_COLUMN'] = 'name';
$table_dns->info['MULTICHOICE_LABEL'] = 'delete';
$table_dns->db_data_remove('id', 'type');
$table_dns->db_data_translate('dns_zones__status');
return $table_dns;
}
示例15: table
function table_ip_ranges_v6()
{
global $construct, $db, $lang;
$form_search_ranges_v6 = $this->form_search_ranges_v6();
$table_ip_ranges_v6 = new table(array('TABLE_NAME' => 'table_ip_ranges_v6', 'FORM_NAME' => 'table_ip_ranges_v6'));
$table_ip_ranges_v6->db_data('ipv6_node_repos.v6net AS v6net, ip_ranges_v6.id AS v6net_id, ip_ranges_v6.date_in, ip_ranges_v6.status, ip_ranges_v6.delete_req', 'ip_ranges_v6, ipv6_node_repos ', 'ipv6_node_repos.id = ip_ranges_v6.v6net_id', "ip_ranges_v6.id", "ip_ranges_v6.date_in DESC, ip_ranges_v6.status ASC");
$table_ip_ranges_v6->db_data_search($form_search_ranges_v6);
foreach ((array) $table_ip_ranges_v6->data as $key => $value) {
if ($key != 0) {
$table_ip_ranges_v6->data[$key]['v6net'] = inet_ntop($table_ip_ranges_v6->data[$key]['v6net']);
}
}
$table_ip_ranges_v6->db_data_multichoice('ip_ranges_v6', 'v6net_id');
for ($i = 1; $i < count($table_ip_ranges_v6->data); $i++) {
if (isset($table_ip_ranges_v6->data[$i])) {
$table_ip_ranges_v6->info['EDIT'][$i] = make_ref('/hostmaster/range_v6', array("v6net_id" => $table_ip_ranges_v6->data[$i]['v6net_id']));
}
}
$table_ip_ranges_v6->info['EDIT_COLUMN'] = 'v6net';
$table_ip_ranges_v6->info['MULTICHOICE_LABEL'] = 'delete';
$table_ip_ranges_v6->db_data_remove('v6net_id');
$table_ip_ranges_v6->db_data_translate('ip_ranges_v6__status', 'ip_ranges_v6__delete_req');
return $table_ip_ranges_v6;
}