From cvs w lms.org.pl Tue Nov 16 09:20:05 2010 From: cvs w lms.org.pl (LMS CVS) Date: Tue, 16 Nov 2010 09:20:05 +0100 (CET) Subject: [lms-commits] CVS update of lms/img (autosuggest.js) Message-ID: <20101116082005.2766C3027B8E@hydra.altec.pl> Date: Tuesday, November 16, 2010 @ 09:20:05 Author: alec Path: /cvsroot/lms/img Modified: autosuggest.js - Fix JS error in autosuggestion code + some CS cleanup Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/img/autosuggest.js.diff?&r1=1.7&r2=1.8 Index: lms/img/autosuggest.js diff -u lms/img/autosuggest.js:1.7 lms/img/autosuggest.js:1.8 --- lms/img/autosuggest.js:1.7 Wed May 25 15:23:55 2005 +++ lms/img/autosuggest.js Tue Nov 16 09:20:04 2010 @@ -39,7 +39,7 @@ var ESC = 27; var KEYUP = 38; var KEYDN = 40; - + //The browsers' own autocomplete feature can be problematic, since it will //be making suggestions from the users' past input. //Setting this attribute should turn it off. @@ -94,7 +94,7 @@ /******************************************************** onkeyup handler for the elem - If the text is of sufficient length, and has been changed, + If the text is of sufficient length, and has been changed, then display a list of eligible suggestions. ********************************************************/ elem.onkeyup = function(ev) { @@ -119,7 +119,7 @@ }; this.HTTPloaded = function () { - if ((xmlhttp)&&(xmlhttp.readyState == 4)) { + if ((xmlhttp) && (xmlhttp.readyState == 4)) { me.inputText = this.value; me.getEligible(); if (me.eligible.length>0) { @@ -173,7 +173,7 @@ ********************************************************/ this.changeHighlight = function() { var lis = this.div.getElementsByTagName('LI'); - for (i in lis) { + for (var i=0, len=lis.length; i Date: Wednesday, November 24, 2010 @ 10:28:08 Author: alec Path: /cvsroot/lms/modules Modified: customergroupadd.php customergroupedit.php nodegrouplist.php - Check group existance as a last name check Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/modules/customergroupadd.php.diff?&r1=1.9&r2=1.10 http://cvs.lms.org.pl/viewvc/Development/lms/modules/customergroupedit.php.diff?&r1=1.13&r2=1.14 http://cvs.lms.org.pl/viewvc/Development/lms/modules/nodegrouplist.php.diff?&r1=1.12&r2=1.13 Index: lms/modules/customergroupadd.php diff -u lms/modules/customergroupadd.php:1.9 lms/modules/customergroupadd.php:1.10 --- lms/modules/customergroupadd.php:1.9 Thu Mar 11 14:07:45 2010 +++ lms/modules/customergroupadd.php Wed Nov 24 10:28:08 2010 @@ -21,7 +21,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. * - * $Id: customergroupadd.php,v 1.9 2010/03/11 13:07:45 alec Exp $ + * $Id: customergroupadd.php,v 1.10 2010/11/24 09:28:08 alec Exp $ */ if(isset($_POST['customergroupadd'])) @@ -35,21 +35,21 @@ { $SESSION->redirect('?m=customergrouplist'); } - + if($customergroupadd['name'] == '') $error['name'] = trans('Group name required!'); elseif(strlen($customergroupadd['name']) > 16) $error['name'] = trans('Group name is too long!'); - elseif($LMS->CustomergroupGetId($customergroupadd['name'])) - $error['name'] = trans('Group with name $0 already exists!',$customergroupadd['name']); elseif(!preg_match('/^[._a-z0-9-]+$/i', $customergroupadd['name'])) $error['name'] = trans('Invalid chars in group name!'); + elseif($LMS->CustomergroupGetId($customergroupadd['name'])) + $error['name'] = trans('Group with name $0 already exists!',$customergroupadd['name']); if(!$error) { $SESSION->redirect('?m=customergrouplist&id='.$LMS->CustomergroupAdd($customergroupadd)); } - + $SMARTY->assign('error',$error); $SMARTY->assign('customergroupadd',$customergroupadd); } Index: lms/modules/customergroupedit.php diff -u lms/modules/customergroupedit.php:1.13 lms/modules/customergroupedit.php:1.14 --- lms/modules/customergroupedit.php:1.13 Thu Mar 11 14:07:45 2010 +++ lms/modules/customergroupedit.php Wed Nov 24 10:28:08 2010 @@ -21,7 +21,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. * - * $Id: customergroupedit.php,v 1.13 2010/03/11 13:07:45 alec Exp $ + * $Id: customergroupedit.php,v 1.14 2010/11/24 09:28:08 alec Exp $ */ if(!$LMS->CustomergroupExists($_GET['id'])) @@ -59,15 +59,15 @@ $customergroupedit[$key] = trim($value); $customergroupedit['id'] = $_GET['id']; - + if($customergroupedit['name'] == '') $error['name'] = trans('Group name required!'); elseif(strlen($customergroupedit['name']) > 16) $error['name'] = trans('Group name is too long!'); - elseif( ($id = $LMS->CustomergroupGetId($customergroupedit['name'])) && $id != $customergroupedit['id']) - $error['name'] = trans('Group with name $0 already exists!',$customergroupedit['name']); elseif(!preg_match('/^[._a-z0-9-]+$/i', $customergroupedit['name'])) $error['name'] = trans('Invalid chars in group name!'); + elseif(($id = $LMS->CustomergroupGetId($customergroupedit['name'])) && $id != $customergroupedit['id']) + $error['name'] = trans('Group with name $0 already exists!',$customergroupedit['name']); if(!$error) { Index: lms/modules/nodegrouplist.php diff -u lms/modules/nodegrouplist.php:1.12 lms/modules/nodegrouplist.php:1.13 --- lms/modules/nodegrouplist.php:1.12 Thu Mar 11 14:07:47 2010 +++ lms/modules/nodegrouplist.php Wed Nov 24 10:28:08 2010 @@ -21,7 +21,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. * - * $Id: nodegrouplist.php,v 1.12 2010/03/11 13:07:47 alec Exp $ + * $Id: nodegrouplist.php,v 1.13 2010/11/24 09:28:08 alec Exp $ */ function GroupList() @@ -43,7 +43,7 @@ $nodegrouplist['nodestotal'] += $row['nodescount']; } } - + return $nodegrouplist; } From cvs w lms.org.pl Fri Nov 26 11:35:41 2010 From: cvs w lms.org.pl (LMS CVS) Date: Fri, 26 Nov 2010 11:35:41 +0100 (CET) Subject: [lms-commits] CVS update of lms/doc (lms.pgsql) Message-ID: <20101126103541.E1E033027B8C@hydra.altec.pl> Date: Friday, November 26, 2010 @ 11:35:41 Author: alec Path: /cvsroot/lms/doc Modified: lms.pgsql - Fix + added CASCADE clause to DROP TABLE queries Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/doc/lms.pgsql.diff?&r1=1.169&r2=1.170 Index: lms/doc/lms.pgsql diff -u lms/doc/lms.pgsql:1.169 lms/doc/lms.pgsql:1.170 --- lms/doc/lms.pgsql:1.169 Tue Aug 17 10:56:12 2010 +++ lms/doc/lms.pgsql Fri Nov 26 11:35:41 2010 @@ -1,11 +1,11 @@ -/* $Id: lms.pgsql,v 1.169 2010/08/17 08:56:12 alec Exp $ */ +/* $Id: lms.pgsql,v 1.170 2010/11/26 10:35:41 alec Exp $ */ /* -------------------------------------------------------- Structure of table "users" -------------------------------------------------------- */ DROP SEQUENCE users_id_seq; CREATE SEQUENCE users_id_seq; -DROP TABLE users; +DROP TABLE users CASCADE; CREATE TABLE users ( id integer DEFAULT nextval('users_id_seq'::text) NOT NULL, login varchar(32) DEFAULT '' NOT NULL, @@ -29,7 +29,7 @@ ---------------------------------------------------*/ DROP SEQUENCE assignments_id_seq; CREATE SEQUENCE assignments_id_seq; -DROP TABLE assignments; +DROP TABLE assignments CASCADE; CREATE TABLE assignments ( id integer default nextval('assignments_id_seq'::text) NOT NULL, tariffid integer DEFAULT 0 NOT NULL, @@ -57,7 +57,7 @@ -------------------------------------------------------- */ DROP SEQUENCE cash_id_seq; CREATE SEQUENCE cash_id_seq; -DROP TABLE cash; +DROP TABLE cash CASCADE; CREATE TABLE cash ( id integer DEFAULT nextval('cash_id_seq'::text) NOT NULL, time integer DEFAULT 0 NOT NULL, @@ -84,7 +84,7 @@ -------------------------------------------------------- */ DROP SEQUENCE networks_id_seq; CREATE SEQUENCE networks_id_seq; -DROP TABLE networks; +DROP TABLE networks CASCADE; CREATE TABLE networks ( id integer DEFAULT nextval('networks_id_seq'::text) NOT NULL, name varchar(255) DEFAULT '' NOT NULL, @@ -110,7 +110,7 @@ -------------------------------------------------------- */ DROP SEQUENCE nodes_id_seq; CREATE SEQUENCE nodes_id_seq; -DROP TABLE nodes; +DROP TABLE nodes CASCADE; CREATE TABLE nodes ( id integer DEFAULT nextval('nodes_id_seq'::text) NOT NULL, name varchar(32) DEFAULT '' NOT NULL, @@ -140,14 +140,13 @@ CREATE INDEX nodes_netdev_idx ON nodes (netdev); CREATE INDEX nodes_ownerid_idx ON nodes (ownerid); CREATE INDEX nodes_ipaddr_pub_idx ON nodes (ipaddr_pub); -CREATE SEQUENCE nodegroups_id_seq; /* -------------------------------------------------------- Structure of table "macs" -------------------------------------------------------- */ DROP SEQUENCE macs_id_seq; CREATE SEQUENCE macs_id_seq; -DROP TABLE macs; +DROP TABLE macs CASCADE; CREATE TABLE macs ( id integer DEFAULT nextval('macs_id_seq'::text) NOT NULL, mac varchar(17) DEFAULT '' NOT NULL, @@ -162,7 +161,7 @@ -------------------------------------------------------- */ DROP SEQUENCE nodegroups_id_seq; CREATE SEQUENCE nodegroups_id_seq; -DROP TABLE nodegroups; +DROP TABLE nodegroups CASCADE; CREATE TABLE nodegroups ( id integer NOT NULL DEFAULT nextval('nodegroups_id_seq'::text), name varchar(255) NOT NULL DEFAULT '', @@ -177,7 +176,7 @@ -------------------------------------------------------- */ DROP SEQUENCE nodegroupassignments_id_seq; CREATE SEQUENCE nodegroupassignments_id_seq; -DROP TABLE nodegroupassignments; +DROP TABLE nodegroupassignments CASCADE; CREATE TABLE nodegroupassignments ( id integer NOT NULL DEFAULT nextval('nodegroupassignments_id_seq'::text), nodegroupid integer NOT NULL DEFAULT 0, @@ -191,7 +190,7 @@ -------------------------------------------------------- */ DROP SEQUENCE nodeassignments_id_seq; CREATE SEQUENCE nodeassignments_id_seq; -DROP TABLE nodeassignments; +DROP TABLE nodeassignments CASCADE; CREATE TABLE nodeassignments ( id integer DEFAULT nextval('nodeassignments_id_seq'::text) NOT NULL, nodeid integer NOT NULL @@ -209,7 +208,7 @@ -------------------------------------------------------- */ DROP SEQUENCE tariffs_id_seq; CREATE SEQUENCE tariffs_id_seq; -DROP TABLE tariffs; +DROP TABLE tariffs CASCADE; CREATE TABLE tariffs ( id integer DEFAULT nextval('tariffs_id_seq'::text) NOT NULL, name varchar(255) DEFAULT '' NOT NULL, @@ -229,7 +228,7 @@ downrate_n integer DEFAULT NULL, downceil_n integer DEFAULT NULL, climit_n integer DEFAULT NULL, - plimit_n integer DEFAULT NULL, + plimit_n integer DEFAULT NULL, domain_limit integer DEFAULT NULL, alias_limit integer DEFAULT NULL, sh_limit integer DEFAULT NULL, @@ -253,7 +252,7 @@ -------------------------------------------------------- */ DROP SEQUENCE liabilities_id_seq; CREATE SEQUENCE liabilities_id_seq; -DROP TABLE liabilities; +DROP TABLE liabilities CASCADE; CREATE TABLE liabilities ( id integer DEFAULT nextval('liabilities_id_seq'::text) NOT NULL, value numeric(9,2) DEFAULT 0 NOT NULL, @@ -262,13 +261,13 @@ prodid varchar(255) DEFAULT '' NOT NULL, PRIMARY KEY (id) ); - + /* --------------------------------------------------------- Structure of table "payments" --------------------------------------------------------- */ DROP SEQUENCE payments_id_seq; CREATE SEQUENCE payments_id_seq; -DROP TABLE payments; +DROP TABLE payments CASCADE; CREATE TABLE payments ( id integer DEFAULT nextval('payments_id_seq'::text) NOT NULL, name varchar(255) DEFAULT '' NOT NULL, @@ -285,7 +284,7 @@ -------------------------------------------------------- */ DROP SEQUENCE taxes_id_seq; CREATE SEQUENCE taxes_id_seq; -DROP TABLE taxes; +DROP TABLE taxes CASCADE; CREATE TABLE taxes ( id integer DEFAULT nextval('taxes_id_seq'::text) NOT NULL, value numeric(4,2) DEFAULT 0 NOT NULL, @@ -301,7 +300,7 @@ -------------------------------------------------------- */ DROP SEQUENCE documents_id_seq; CREATE SEQUENCE documents_id_seq; -DROP TABLE documents; +DROP TABLE documents CASCADE; CREATE TABLE documents ( id integer DEFAULT nextval('documents_id_seq'::text) NOT NULL, type smallint DEFAULT 0 NOT NULL, @@ -310,8 +309,8 @@ extnumber varchar(255) DEFAULT '' NOT NULL, cdate integer DEFAULT 0 NOT NULL, customerid integer DEFAULT 0 NOT NULL, - userid integer DEFAULT 0 NOT NULL, - divisionid integer DEFAULT 0 NOT NULL, + userid integer DEFAULT 0 NOT NULL, + divisionid integer DEFAULT 0 NOT NULL, name varchar(255) DEFAULT '' NOT NULL, address varchar(255) DEFAULT '' NOT NULL, zip varchar(10) DEFAULT '' NOT NULL, @@ -334,7 +333,7 @@ /* -------------------------------------------------------- Structure of table "documentcontents" -------------------------------------------------------- */ -DROP TABLE documentcontents; +DROP TABLE documentcontents CASCADE; CREATE TABLE documentcontents ( docid integer DEFAULT 0 NOT NULL, title text DEFAULT '' NOT NULL, @@ -354,7 +353,7 @@ /* -------------------------------------------------------- Structure of table "receiptcontents" -------------------------------------------------------- */ -DROP TABLE receiptcontents; +DROP TABLE receiptcontents CASCADE; CREATE TABLE receiptcontents ( docid integer DEFAULT 0 NOT NULL, itemid smallint DEFAULT 0 NOT NULL, @@ -368,7 +367,7 @@ /* -------------------------------------------------------- Structure of table "invoicecontents" -------------------------------------------------------- */ -DROP TABLE invoicecontents; +DROP TABLE invoicecontents CASCADE; CREATE TABLE invoicecontents ( docid integer DEFAULT 0 NOT NULL, itemid smallint DEFAULT 0 NOT NULL, @@ -386,7 +385,7 @@ /* -------------------------------------------------------- Structure of table "debitnotecontents" -------------------------------------------------------- */ -DROP TABLE debitnotecontents; +DROP TABLE debitnotecontents CASCADE; DROP SEQUENCE debitnotecontents_id_seq; CREATE SEQUENCE debitnotecontents_id_seq; CREATE TABLE debitnotecontents ( @@ -404,7 +403,7 @@ -------------------------------------------------------- */ DROP SEQUENCE numberplans_id_seq; CREATE SEQUENCE numberplans_id_seq; -DROP TABLE numberplans; +DROP TABLE numberplans CASCADE; CREATE TABLE numberplans ( id integer DEFAULT nextval('numberplans_id_seq'::text) NOT NULL, template varchar(255) DEFAULT '' NOT NULL, @@ -419,7 +418,7 @@ -------------------------------------------------------- */ DROP SEQUENCE numberplanassignments_id_seq; CREATE SEQUENCE numberplanassignments_id_seq; -DROP TABLE numberplanassignments; +DROP TABLE numberplanassignments CASCADE; CREATE TABLE numberplanassignments ( id integer DEFAULT nextval('numberplanassignments_id_seq'::text) NOT NULL, planid integer DEFAULT 0 NOT NULL, @@ -434,7 +433,7 @@ -------------------------------------------------------- */ DROP SEQUENCE customers_id_seq; CREATE SEQUENCE customers_id_seq; -DROP TABLE customers; +DROP TABLE customers CASCADE; CREATE TABLE customers ( id integer DEFAULT nextval('customers_id_seq'::text) NOT NULL, lastname varchar(128) DEFAULT '' NOT NULL, @@ -477,7 +476,7 @@ -------------------------------------------------------- */ DROP SEQUENCE customergroups_id_seq; CREATE SEQUENCE customergroups_id_seq; -DROP TABLE customergroups; +DROP TABLE customergroups CASCADE; CREATE TABLE customergroups ( id integer DEFAULT nextval('customergroups_id_seq'::text) NOT NULL, name varchar(255) DEFAULT '' NOT NULL, @@ -491,7 +490,7 @@ -------------------------------------------------------- */ DROP SEQUENCE customerassignments_id_seq; CREATE SEQUENCE customerassignments_id_seq; -DROP TABLE customerassignments; +DROP TABLE customerassignments CASCADE; CREATE TABLE customerassignments ( id integer DEFAULT nextval('customerassignments_id_seq'::text) NOT NULL, customergroupid integer DEFAULT 0 NOT NULL, @@ -503,7 +502,7 @@ /* -------------------------------------------------------- Structure of table "stats" -------------------------------------------------------- */ -DROP TABLE stats; +DROP TABLE stats CASCADE; CREATE TABLE stats ( nodeid integer DEFAULT 0 NOT NULL, dt integer DEFAULT 0 NOT NULL, @@ -518,7 +517,7 @@ ----------------------------------------------------*/ DROP SEQUENCE netlinks_id_seq; CREATE SEQUENCE netlinks_id_seq; -DROP TABLE netlinks; +DROP TABLE netlinks CASCADE; CREATE TABLE netlinks ( id integer default nextval('netlinks_id_seq'::text) NOT NULL, src integer DEFAULT 0 NOT NULL, @@ -565,7 +564,7 @@ /* -------------------------------------------------- Tables for RT (Helpdesk) -----------------------------------------------------*/ -DROP TABLE rtattachments; +DROP TABLE rtattachments CASCADE; CREATE TABLE rtattachments ( messageid integer NOT NULL REFERENCES rtmessages (id) ON DELETE CASCADE ON UPDATE CASCADE, @@ -577,7 +576,7 @@ DROP SEQUENCE rtqueues_id_seq; CREATE SEQUENCE rtqueues_id_seq; -DROP TABLE rtqueues; +DROP TABLE rtqueues CASCADE; CREATE TABLE rtqueues ( id integer default nextval('rtqueues_id_seq'::text) NOT NULL, name varchar(255) DEFAULT '' NOT NULL, @@ -589,7 +588,7 @@ DROP SEQUENCE rttickets_id_seq; CREATE SEQUENCE rttickets_id_seq; -DROP TABLE rttickets; +DROP TABLE rttickets CASCADE; CREATE TABLE rttickets ( id integer default nextval('rttickets_id_seq'::text) NOT NULL, queueid integer NOT NULL @@ -613,7 +612,7 @@ DROP SEQUENCE rtmessages_id_seq; CREATE SEQUENCE rtmessages_id_seq; -DROP TABLE rtmessages; +DROP TABLE rtmessages CASCADE; CREATE TABLE rtmessages ( id integer default nextval('rtmessages_id_seq'::text) NOT NULL, ticketid integer NOT NULL @@ -635,7 +634,7 @@ DROP SEQUENCE rtnotes_id_seq; CREATE SEQUENCE rtnotes_id_seq; -DROP TABLE rtnotes; +DROP TABLE rtnotes CASCADE; CREATE TABLE rtnotes ( id integer default nextval('rtnotes_id_seq'::text) NOT NULL, ticketid integer NOT NULL @@ -652,7 +651,7 @@ DROP SEQUENCE rtrights_id_seq; CREATE SEQUENCE rtrights_id_seq; -DROP TABLE rtrights; +DROP TABLE rtrights CASCADE; CREATE TABLE rtrights ( id integer DEFAULT nextval('rtrights_id_seq'::text) NOT NULL, userid integer NOT NULL @@ -669,7 +668,7 @@ ------------------------------------------------------*/ DROP SEQUENCE passwd_id_seq; CREATE SEQUENCE passwd_id_seq; -DROP TABLE passwd; +DROP TABLE passwd CASCADE; CREATE TABLE passwd ( id integer DEFAULT nextval('passwd_id_seq'::text) NOT NULL, ownerid integer DEFAULT 0 NOT NULL, @@ -701,7 +700,7 @@ ------------------------------------------------------*/ DROP SEQUENCE domains_id_seq; CREATE SEQUENCE domains_id_seq; -DROP TABLE domains; +DROP TABLE domains CASCADE; CREATE TABLE domains ( id integer DEFAULT nextval('domains_id_seq'::text) NOT NULL, ownerid integer DEFAULT 0 NOT NULL, @@ -722,7 +721,7 @@ ------------------------------------------------------*/ DROP SEQUENCE records_id_seq; CREATE SEQUENCE records_id_seq; -DROP TABLE records; +DROP TABLE records CASCADE; CREATE TABLE records ( id integer DEFAULT nextval('records_id_seq'::text) NOT NULL, domain_id integer DEFAULT NULL @@ -744,7 +743,7 @@ ------------------------------------------------------*/ DROP SEQUENCE supermasters_id_seq; CREATE SEQUENCE supermasters_id_seq; -DROP TABLE supermasters; +DROP TABLE supermasters CASCADE; CREATE TABLE supermasters ( id integer DEFAULT nextval('supermasters_id_seq'::text) NOT NULL, ip varchar(25) NOT NULL, @@ -758,7 +757,7 @@ ------------------------------------------------------*/ DROP SEQUENCE aliases_id_seq; CREATE SEQUENCE aliases_id_seq; -DROP TABLE aliases; +DROP TABLE aliases CASCADE; CREATE TABLE aliases ( id integer DEFAULT nextval('aliases_id_seq'::text) NOT NULL, login varchar(255) DEFAULT '' NOT NULL, @@ -772,7 +771,7 @@ ------------------------------------------------------*/ DROP SEQUENCE aliasassignments_id_seq; CREATE SEQUENCE aliasassignments_id_seq; -DROP TABLE aliasassignments; +DROP TABLE aliasassignments CASCADE; CREATE TABLE aliasassignments ( id integer DEFAULT nextval('passwd_id_seq'::text) NOT NULL, aliasid integer DEFAULT 0 NOT NULL, @@ -787,7 +786,7 @@ ------------------------------------------------------*/ DROP SEQUENCE uiconfig_id_seq; CREATE SEQUENCE uiconfig_id_seq; -DROP TABLE uiconfig; +DROP TABLE uiconfig CASCADE; CREATE TABLE uiconfig ( id integer DEFAULT nextval('uiconfig_id_seq'::text) NOT NULL, section varchar(64) NOT NULL DEFAULT '', @@ -804,7 +803,7 @@ ------------------------------------------------------*/ DROP SEQUENCE events_id_seq; CREATE SEQUENCE events_id_seq; -DROP TABLE events; +DROP TABLE events CASCADE; CREATE TABLE events ( id integer DEFAULT nextval('events_id_seq'::text) NOT NULL, title varchar(255) DEFAULT '' NOT NULL, @@ -824,7 +823,7 @@ /* --------------------------------------------------- Structure of table "events" (Timetable) ------------------------------------------------------*/ -DROP TABLE eventassignments; +DROP TABLE eventassignments CASCADE; CREATE TABLE eventassignments ( eventid integer DEFAULT 0 NOT NULL, userid integer DEFAULT 0 NOT NULL, @@ -834,7 +833,7 @@ /* --------------------------------------------------- Structure of table "sessions" ------------------------------------------------------*/ -DROP TABLE sessions; +DROP TABLE sessions CASCADE; CREATE TABLE sessions ( id varchar(50) NOT NULL DEFAULT '', ctime integer NOT NULL DEFAULT 0, @@ -850,7 +849,7 @@ ------------------------------------------------------*/ DROP SEQUENCE cashimport_id_seq; CREATE SEQUENCE cashimport_id_seq; -DROP TABLE cashimport; +DROP TABLE cashimport CASCADE; CREATE TABLE cashimport ( id integer DEFAULT nextval('cashimport_id_seq'::text) NOT NULL, date integer DEFAULT 0 NOT NULL, @@ -870,7 +869,7 @@ ------------------------------------------------------*/ DROP SEQUENCE cashsources_id_seq; CREATE SEQUENCE cashsources_id_seq; -DROP TABLE cashsources; +DROP TABLE cashsources CASCADE; CREATE TABLE cashsources ( id integer DEFAULT nextval('cashsources_id_seq'::text) NOT NULL, name varchar(32) DEFAULT '' NOT NULL, @@ -884,7 +883,7 @@ ------------------------------------------------------*/ DROP SEQUENCE hosts_id_seq; CREATE SEQUENCE hosts_id_seq; -DROP TABLE hosts; +DROP TABLE hosts CASCADE; CREATE TABLE hosts ( id integer DEFAULT nextval('hosts_id_seq'::text) NOT NULL, name varchar(255) DEFAULT '' NOT NULL, @@ -900,7 +899,7 @@ ------------------------------------------------------*/ DROP SEQUENCE daemoninstances_id_seq; CREATE SEQUENCE daemoninstances_id_seq; -DROP TABLE daemoninstances; +DROP TABLE daemoninstances CASCADE; CREATE TABLE daemoninstances ( id integer DEFAULT nextval('daemoninstances_id_seq'::text) NOT NULL, name varchar(255) DEFAULT '' NOT NULL, @@ -918,7 +917,7 @@ ------------------------------------------------------*/ DROP SEQUENCE daemonconfig_id_seq; CREATE SEQUENCE daemonconfig_id_seq; -DROP TABLE daemonconfig; +DROP TABLE daemonconfig CASCADE; CREATE TABLE daemonconfig ( id integer DEFAULT nextval('daemonconfig_id_seq'::text) NOT NULL, instanceid integer DEFAULT 0 NOT NULL, @@ -935,7 +934,7 @@ ------------------------------------------------------*/ DROP SEQUENCE docrights_id_seq; CREATE SEQUENCE docrights_id_seq; -DROP TABLE docrights; +DROP TABLE docrights CASCADE; CREATE TABLE docrights ( id integer DEFAULT nextval('docrights_id_seq'::text) NOT NULL, userid integer DEFAULT 0 NOT NULL, @@ -950,7 +949,7 @@ ------------------------------------------------------*/ DROP SEQUENCE cashrights_id_seq; CREATE SEQUENCE cashrights_id_seq; -DROP TABLE cashrights; +DROP TABLE cashrights CASCADE; CREATE TABLE cashrights ( id integer DEFAULT nextval('cashrights_id_seq'::text) NOT NULL, userid integer DEFAULT 0 NOT NULL, @@ -959,13 +958,13 @@ PRIMARY KEY (id), UNIQUE (userid, regid) ); - + /* --------------------------------------------------- Structure of table "cashregs" ------------------------------------------------------*/ DROP SEQUENCE cashregs_id_seq; CREATE SEQUENCE cashregs_id_seq; -DROP TABLE cashregs; +DROP TABLE cashregs CASCADE; CREATE TABLE cashregs ( id integer DEFAULT nextval('cashregs_id_seq'::text) NOT NULL, name varchar(255) DEFAULT '' NOT NULL, @@ -982,7 +981,7 @@ ------------------------------------------------------*/ DROP SEQUENCE cashreglog_id_seq; CREATE SEQUENCE cashreglog_id_seq; -DROP TABLE cashreglog; +DROP TABLE cashreglog CASCADE; CREATE TABLE cashreglog ( id integer DEFAULT nextval('cashreglog_id_seq'::text) NOT NULL, regid integer DEFAULT 0 NOT NULL, @@ -1000,7 +999,7 @@ ------------------------------------------------------*/ DROP SEQUENCE ewx_pt_config_id_seq; CREATE SEQUENCE ewx_pt_config_id_seq; -DROP TABLE ewx_pt_config; +DROP TABLE ewx_pt_config CASCADE; CREATE TABLE ewx_pt_config ( id integer DEFAULT nextval('ewx_pt_config_id_seq'::text) NOT NULL, nodeid integer DEFAULT 0 NOT NULL, @@ -1017,7 +1016,7 @@ ------------------------------------------------------*/ DROP SEQUENCE ewx_stm_nodes_id_seq; CREATE SEQUENCE ewx_stm_nodes_id_seq; -DROP TABLE ewx_stm_nodes; +DROP TABLE ewx_stm_nodes CASCADE; CREATE TABLE ewx_stm_nodes ( id integer DEFAULT nextval('ewx_stm_nodes_id_seq'::text) NOT NULL, nodeid integer DEFAULT 0 NOT NULL, @@ -1038,7 +1037,7 @@ ------------------------------------------------------*/ DROP SEQUENCE ewx_stm_channels_id_seq; CREATE SEQUENCE ewx_stm_channels_id_seq; -DROP TABLE ewx_stm_channels; +DROP TABLE ewx_stm_channels CASCADE; CREATE TABLE ewx_stm_channels ( id integer DEFAULT nextval('ewx_stm_channels_id_seq'::text) NOT NULL, cid integer DEFAULT 0 NOT NULL, @@ -1053,7 +1052,7 @@ ------------------------------------------------------*/ DROP SEQUENCE ewx_channels_id_seq; CREATE SEQUENCE ewx_channels_id_seq; -DROP TABLE ewx_channels; +DROP TABLE ewx_channels CASCADE; CREATE TABLE ewx_channels ( id integer DEFAULT nextval('ewx_channels_id_seq'::text) NOT NULL, name varchar(32) DEFAULT '' NOT NULL, @@ -1070,7 +1069,7 @@ ----------------------------------------------------*/ DROP SEQUENCE netdevices_id_seq; CREATE SEQUENCE netdevices_id_seq; -DROP TABLE netdevices; +DROP TABLE netdevices CASCADE; CREATE TABLE netdevices ( id integer default nextval('netdevices_id_seq'::text) NOT NULL, name varchar(32) DEFAULT '' NOT NULL, @@ -1097,7 +1096,7 @@ /* --------------------------------------------------- Structure of table "dbinfo" ------------------------------------------------------*/ -DROP TABLE dbinfo; +DROP TABLE dbinfo CASCADE; CREATE TABLE dbinfo ( keytype varchar(255) DEFAULT '' NOT NULL, keyvalue varchar(255) DEFAULT '' NOT NULL, @@ -1109,7 +1108,7 @@ ------------------------------------------------------*/ DROP SEQUENCE imessengers_id_seq; CREATE SEQUENCE imessengers_id_seq; -DROP TABLE imessengers; +DROP TABLE imessengers CASCADE; CREATE TABLE imessengers ( id integer DEFAULT nextval('imessengers_id_seq'::text) NOT NULL, customerid integer DEFAULT 0 NOT NULL, @@ -1124,7 +1123,7 @@ ------------------------------------------------------*/ DROP SEQUENCE customercontacts_id_seq; CREATE SEQUENCE customercontacts_id_seq; -DROP TABLE customercontacts; +DROP TABLE customercontacts CASCADE; CREATE TABLE customercontacts ( id integer DEFAULT nextval('customercontacts_id_seq'::text) NOT NULL, customerid integer NOT NULL DEFAULT 0, @@ -1140,7 +1139,7 @@ ------------------------------------------------------*/ DROP SEQUENCE excludedgroups_id_seq; CREATE SEQUENCE excludedgroups_id_seq; -DROP TABLE excludedgroups; +DROP TABLE excludedgroups CASCADE; CREATE TABLE excludedgroups ( id integer NOT NULL DEFAULT nextval('excludedgroups_id_seq'::text), customergroupid integer NOT NULL DEFAULT 0, @@ -1154,7 +1153,7 @@ ------------------------------------------------------*/ DROP SEQUENCE states_id_seq; CREATE SEQUENCE states_id_seq; -DROP TABLE states; +DROP TABLE states CASCADE; CREATE TABLE states ( id integer DEFAULT nextval('states_id_seq'::text) NOT NULL, name varchar(255) NOT NULL DEFAULT '', @@ -1168,7 +1167,7 @@ ------------------------------------------------------*/ DROP SEQUENCE countries_id_seq; CREATE SEQUENCE countries_id_seq; -DROP TABLE countries; +DROP TABLE countries CASCADE; CREATE TABLE countries ( id integer DEFAULT nextval('countries_id_seq'::text) NOT NULL, name varchar(255) NOT NULL DEFAULT '', @@ -1181,7 +1180,7 @@ ------------------------------------------------------*/ DROP SEQUENCE zipcodes_id_seq; CREATE SEQUENCE zipcodes_id_seq; -DROP TABLE zipcodes; +DROP TABLE zipcodes CASCADE; CREATE TABLE zipcodes ( id integer DEFAULT nextval('customerassignments_id_seq'::text) NOT NULL, zip varchar(10) NOT NULL DEFAULT '', @@ -1196,7 +1195,7 @@ ------------------------------------------------------*/ DROP SEQUENCE divisions_id_seq; CREATE SEQUENCE divisions_id_seq; -DROP TABLE divisions; +DROP TABLE divisions CASCADE; CREATE TABLE divisions ( id integer NOT NULL DEFAULT nextval('divisions_id_seq'::text), shortname varchar(255) NOT NULL DEFAULT '', @@ -1225,7 +1224,7 @@ ------------------------------------------------------*/ DROP SEQUENCE voipaccounts_id_seq; CREATE SEQUENCE voipaccounts_id_seq; -DROP TABLE voipaccounts; +DROP TABLE voipaccounts CASCADE; CREATE TABLE voipaccounts ( id integer NOT NULL DEFAULT nextval('voipaccounts_id_seq'::text), ownerid integer NOT NULL DEFAULT 0, @@ -1243,7 +1242,7 @@ Structure of table "messages" ------------------------------------------------------*/ DROP SEQUENCE messages_id_seq; -DROP TABLE messages; +DROP TABLE messages CASCADE; CREATE SEQUENCE messages_id_seq; CREATE TABLE messages ( id integer DEFAULT nextval('messages_id_seq'::text) NOT NULL, @@ -1263,7 +1262,7 @@ Structure of table "messageitems" ------------------------------------------------------*/ DROP SEQUENCE messageitems_id_seq; -DROP TABLE messageitems; +DROP TABLE messageitems CASCADE; CREATE SEQUENCE messageitems_id_seq; CREATE TABLE messageitems ( id integer DEFAULT nextval('messageitems_id_seq'::text) NOT NULL, @@ -1284,7 +1283,7 @@ ------------------------------------------------------*/ DROP SEQUENCE nastypes_id_seq; CREATE SEQUENCE nastypes_id_seq; -DROP TABLE nastypes; +DROP TABLE nastypes CASCADE; CREATE TABLE nastypes ( id integer DEFAULT nextval('nastypes_id_seq'::text) NOT NULL, name varchar(255) NOT NULL, @@ -1297,7 +1296,7 @@ ------------------------------------------------------*/ DROP SEQUENCE up_rights_id_seq; CREATE SEQUENCE up_rights_id_seq; -DROP TABLE up_rights; +DROP TABLE up_rights CASCADE; CREATE TABLE up_rights ( id integer DEFAULT nextval('up_rights_id_seq'::text) NOT NULL, module varchar(255) DEFAULT 0 NOT NULL, @@ -1312,21 +1311,21 @@ ------------------------------------------------------*/ DROP SEQUENCE up_rights_assignments_id_seq; CREATE SEQUENCE up_rights_assignments_id_seq; -DROP TABLE up_rights_assignments; +DROP TABLE up_rights_assignments CASCADE; CREATE TABLE up_rights_assignments ( id integer DEFAULT nextval('up_rights_assignments_id_seq'::text) NOT NULL, customerid integer DEFAULT 0 NOT NULL, rightid integer DEFAULT 0 NOT NULL, PRIMARY KEY (id), UNIQUE (customerid, rightid) -); +); /* --------------------------------------------------- Structure of table "up_customers" (Userpanel) ------------------------------------------------------*/ DROP SEQUENCE up_customers_id_seq; CREATE SEQUENCE up_customers_id_seq; -DROP TABLE up_customers; +DROP TABLE up_customers CASCADE; CREATE TABLE up_customers ( id integer DEFAULT nextval('up_customers_id_seq'::text) NOT NULL, customerid integer DEFAULT 0 NOT NULL, @@ -1336,14 +1335,14 @@ failedloginip varchar(16) DEFAULT '' NOT NULL, enabled smallint DEFAULT 0 NOT NULL, PRIMARY KEY (id) -); +); /* --------------------------------------------------- Structure of table "up_help" (Userpanel) ------------------------------------------------------*/ DROP SEQUENCE up_help_id_seq; CREATE SEQUENCE up_help_id_seq; -DROP TABLE up_help; +DROP TABLE up_help CASCADE; CREATE TABLE up_help ( id integer DEFAULT nextval('up_help_id_seq'::text) NOT NULL, reference integer DEFAULT 0 NOT NULL, @@ -1357,7 +1356,7 @@ ------------------------------------------------------*/ DROP SEQUENCE up_info_changes_id_seq; CREATE SEQUENCE up_info_changes_id_seq; -DROP TABLE up_info_changes; +DROP TABLE up_info_changes CASCADE; CREATE TABLE up_info_changes ( id integer DEFAULT nextval('up_info_changes_id_seq'::text) NOT NULL, customerid integer DEFAULT 0 NOT NULL, From cvs w lms.org.pl Tue Nov 30 12:43:41 2010 From: cvs w lms.org.pl (LMS CVS) Date: Tue, 30 Nov 2010 12:43:41 +0100 (CET) Subject: [lms-commits] CVS update of lms/doc (ChangeLog) Message-ID: <20101130114341.5E5833027B8F@hydra.altec.pl> Date: Tuesday, November 30, 2010 @ 12:43:41 Author: alec Path: /cvsroot/lms/doc Modified: ChangeLog - improved performance of traffic database compacting procedure (alec) Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/doc/ChangeLog.diff?&r1=1.1517&r2=1.1518 Index: lms/doc/ChangeLog diff -u lms/doc/ChangeLog:1.1517 lms/doc/ChangeLog:1.1518 --- lms/doc/ChangeLog:1.1517 Mon Sep 27 15:16:48 2010 +++ lms/doc/ChangeLog Tue Nov 30 12:43:40 2010 @@ -1,4 +1,4 @@ -$Id: ChangeLog,v 1.1517 2010/09/27 13:16:48 alec Exp $ +$Id: ChangeLog,v 1.1518 2010/11/30 11:43:40 alec Exp $ version ? (????-??-??) @@ -44,6 +44,7 @@ so reverse entries in named.conf are not duplicated and hosts entries are placed in one file for all subnetworks (alec) - allow setting assignment period for disposable liabilities (alec) + - improved performance of traffic database compacting procedure (alec) version 1.11.10 Kri (2010-04-19) From cvs w lms.org.pl Tue Nov 30 12:43:41 2010 From: cvs w lms.org.pl (LMS CVS) Date: Tue, 30 Nov 2010 12:43:41 +0100 (CET) Subject: [lms-commits] CVS update of lms/modules (trafficdbcompact.php) Message-ID: <20101130114341.B6F413027B90@hydra.altec.pl> Date: Tuesday, November 30, 2010 @ 12:43:41 Author: alec Path: /cvsroot/lms/modules Modified: trafficdbcompact.php - improved performance of traffic database compacting procedure (alec) Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/modules/trafficdbcompact.php.diff?&r1=1.33&r2=1.34 Index: lms/modules/trafficdbcompact.php diff -u lms/modules/trafficdbcompact.php:1.33 lms/modules/trafficdbcompact.php:1.34 --- lms/modules/trafficdbcompact.php:1.33 Tue May 4 09:23:42 2010 +++ lms/modules/trafficdbcompact.php Tue Nov 30 12:43:41 2010 @@ -21,7 +21,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. * - * $Id: trafficdbcompact.php,v 1.33 2010/05/04 07:23:42 alec Exp $ + * $Id: trafficdbcompact.php,v 1.34 2010/11/30 11:43:41 alec Exp $ */ $layout['pagetitle'] = trans('Network Statistics Compacting'); @@ -64,51 +64,92 @@ $time = time(); switch($_GET['level']) { - case 'medium' : $period = $time-30*24*60*60; $step = 24*60*60; break;//month, day - case 'high' : $period = $time-365*24*60*60; $step = 60*60; break; //month, hour - default: $period = $time-24*60*60; $step = 24*60*60; break; //1 day, day + case 'medium' : $period = $time-30*24*60*60; $step = 24*60*60; break;//month, day + case 'high' : $period = $time-365*24*60*60; $step = 60*60; break; //month, hour + default: $period = $time-24*60*60; $step = 24*60*60; break; //1 day, day } - if($mintime = $DB->GetOne('SELECT MIN(dt) FROM stats')) + if ($mintime = $DB->GetOne('SELECT MIN(dt) FROM stats')) { - $nodes = $DB->GetAll('SELECT id, name FROM nodes ORDER BY name'); - foreach($nodes as $node) - { - $deleted = 0; - $inserted = 0; - $maxtime = $period; - $timeoffset = date('Z'); - $dtdivider = 'FLOOR((dt+'.$timeoffset.')/'.$step.')'; - - $data = $DB->GetAll('SELECT SUM(download) AS download, SUM(upload) AS upload, - COUNT(dt) AS count, MIN(dt) AS mintime, MAX(dt) AS maxtime - FROM stats WHERE nodeid = ? AND dt >= ? AND dt < ? - GROUP BY nodeid, '.$dtdivider, array($node['id'], $mintime, $maxtime)); - - if($data) - { - $DB->BeginTrans(); - - $DB->Execute('DELETE FROM stats WHERE nodeid = ? AND dt >= ? AND dt <= ?', - array($node['id'], $mintime, $maxtime)); - - foreach($data as $record) - { - $deleted += $record['count']; - if($record['download'] || $record['upload']) - $inserted += $DB->Execute('INSERT INTO stats - (nodeid, dt, upload, download) - VALUES (?, ?, ?, ?)', - array($node['id'], $record['maxtime'], - $record['upload'], $record['download'])); - } - - $DB->CommitTrans(); - - echo $node['name'].': '.trans('$0 - removed, $1 - inserted
', $deleted, $inserted); - flush(); - } - } + if ($CONFIG['database']['type'] != 'postgres') + $multi_insert = true; + else if (version_compare($DB->GetDBVersion(), '8.2') >= 0) + $multi_insert = true; + else + $multi_insert = false; + + $nodes = $DB->GetAll('SELECT id, name FROM nodes ORDER BY name'); + + foreach ($nodes as $node) + { + $deleted = 0; + $inserted = 0; + $maxtime = $period; + $timeoffset = date('Z'); + $dtdivider = 'FLOOR((dt+'.$timeoffset.')/'.$step.')'; + + $data = $DB->GetAll('SELECT SUM(download) AS download, SUM(upload) AS upload, + COUNT(dt) AS count, MIN(dt) AS mintime, MAX(dt) AS maxtime + FROM stats WHERE nodeid = ? AND dt >= ? AND dt < ? + GROUP BY nodeid, '.$dtdivider.' + ORDER BY mintime', array($node['id'], $mintime, $maxtime)); + + if ($data) { + // If divider-record contains only one record we can skip it + // This way we'll minimize delete-insert operations count + // e.g. in situation when some records has been already compacted + foreach($data as $rid => $record) { + if ($record['count'] == 1) + unset($data[$rid]); + else + break; + } + + // all records for this node has been already compacted + if (empty($data)) { + echo $node['name'].': '.trans('$0 - removed, $1 - inserted
', 0, 0); + flush(); + continue; + } + + $values = array(); + // set start datetime of the period + $data = array_values($data); + $nodemintime = $data[0]['mintime']; + + $DB->BeginTrans(); + + // delete old records + $DB->Execute('DELETE FROM stats WHERE nodeid = ? AND dt >= ? AND dt <= ?', + array($node['id'], $nodemintime, $maxtime)); + + // insert new (summary) records + foreach ($data as $record) { + $deleted += $record['count']; + + if (!$record['download'] && !$record['upload']) + continue; + + if ($multi_insert) + $values[] = sprintf('(%d, %d, %d, %d)', + $node['id'], $record['maxtime'], $record['upload'], $record['download']); + else + $inserted += $DB->Execute('INSERT INTO stats + (nodeid, dt, upload, download) VALUES (?, ?, ?, ?)', + array($node['id'], $record['maxtime'], + $record['upload'], $record['download'])); + } + + if (!empty($values)) + $inserted = $DB->Execute('INSERT INTO stats + (nodeid, dt, upload, download) VALUES ' . implode(', ', $values)); + + $DB->CommitTrans(); + + echo $node['name'].': '.trans('$0 - removed, $1 - inserted
', $deleted, $inserted); + flush(); + } + } } } From cvs w lms.org.pl Tue Nov 30 12:43:41 2010 From: cvs w lms.org.pl (LMS CVS) Date: Tue, 30 Nov 2010 12:43:41 +0100 (CET) Subject: [lms-commits] CVS update of lms/lib/upgradedb (2 files) Message-ID: <20101130114341.8F0FC3027B8C@hydra.altec.pl> Date: Tuesday, November 30, 2010 @ 12:43:41 Author: alec Path: /cvsroot/lms/lib/upgradedb Modified: mysql.2010050600.php mysql.2010051400.php - improved performance of traffic database compacting procedure (alec) Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/lib/upgradedb/mysql.2010050600.php.diff?&r1=1.1&r2=1.2 http://cvs.lms.org.pl/viewvc/Development/lms/lib/upgradedb/mysql.2010051400.php.diff?&r1=1.4&r2=1.5 Index: lms/lib/upgradedb/mysql.2010050600.php diff -u lms/lib/upgradedb/mysql.2010050600.php:1.1 lms/lib/upgradedb/mysql.2010050600.php:1.2 --- lms/lib/upgradedb/mysql.2010050600.php:1.1 Thu May 6 22:25:19 2010 +++ lms/lib/upgradedb/mysql.2010050600.php Tue Nov 30 12:43:41 2010 @@ -21,7 +21,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. * - * $Id: mysql.2010050600.php,v 1.1 2010/05/06 20:25:19 chilek Exp $ + * $Id: mysql.2010050600.php,v 1.2 2010/11/30 11:43:41 alec Exp $ */ $DB->BeginTrans(); @@ -37,9 +37,8 @@ ) ENGINE=InnoDB "); -$DB->Execute("INSERT INTO macs (mac, nodeid) - SELECT mac, id FROM nodes"); - +$DB->Execute("INSERT INTO macs (mac, nodeid) SELECT mac, id FROM nodes"); + $DB->Execute("ALTER TABLE nodes DROP mac"); $DB->Execute("UPDATE dbinfo SET keyvalue = ? WHERE keytype = ?", array('2010050600', 'dbversion')); Index: lms/lib/upgradedb/mysql.2010051400.php diff -u lms/lib/upgradedb/mysql.2010051400.php:1.4 lms/lib/upgradedb/mysql.2010051400.php:1.5 --- lms/lib/upgradedb/mysql.2010051400.php:1.4 Sat May 15 12:41:21 2010 +++ lms/lib/upgradedb/mysql.2010051400.php Tue Nov 30 12:43:41 2010 @@ -21,7 +21,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. * - * $Id: mysql.2010051400.php,v 1.4 2010/05/15 10:41:21 chilek Exp $ + * $Id: mysql.2010051400.php,v 1.5 2010/11/30 11:43:41 alec Exp $ */ $DB->BeginTrans(); @@ -30,7 +30,8 @@ CREATE VIEW vnodes_mac AS SELECT nodeid, GROUP_CONCAT(mac ORDER BY id SEPARATOR ',') AS mac FROM macs GROUP BY nodeid - +"); +$DB->Execute(" CREATE VIEW vnodes AS SELECT n.*, m.mac FROM nodes n