Active TopicsActive Topics  Display List of Forum MembersMemberlist  Search The ForumSearch  HelpHelp
  RegisterRegister  LoginLogin
PowerHome General
 PowerHome Messageboard : PowerHome General
Subject Topic: Database Structure Changed? Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
yodafrisk
Newbie
Newbie
Avatar

Joined: September 06 2006
Location: United States
Online Status: Offline
Posts: 4
Posted: September 06 2006 at 13:31 | IP Logged Quote yodafrisk

I am running
PH version 1.03.4.7
Database Version 1.03.9.1

When I run this SQL query: 'select * from x10unitcode',
I get: 'Table or view not found: Table 'x10unitcode' not found'

Has the DB table structure changed since the last documentation was included with it in Appendix B?
Back to Top View yodafrisk's Profile Search for other posts by yodafrisk Visit yodafrisk's Homepage
 
yodafrisk
Newbie
Newbie
Avatar

Joined: September 06 2006
Location: United States
Online Status: Offline
Posts: 4
Posted: September 06 2006 at 17:39 | IP Logged Quote yodafrisk

OK...I managed to crack open the DB finally and can see the differences. However I am still having a hard time recreating the default main page as a .psp file. I used your last mockup found in this forum, but it has the old DB structure aligned to it.

Is there any way for me to get the code for generating the main page (w/current DB)?
Back to Top View yodafrisk's Profile Search for other posts by yodafrisk Visit yodafrisk's Homepage
 
yodafrisk
Newbie
Newbie
Avatar

Joined: September 06 2006
Location: United States
Online Status: Offline
Posts: 4
Posted: September 07 2006 at 22:06 | IP Logged Quote yodafrisk

Well, I got close enuff. If anyone else is interested in checking out the most current PSP example in this board here it is.

From my 're-creation' of the default web page to match the current DB structure:

<%
ph_rtne(
ph_sqlselect(1,"select id,key_desc,location,if standard_dim = '1' and status = 2 then round(level,0) else null endif,
(case status when 0 then 'Unknown' when 1 then off_message else on_message end),dateformat(lastchange,'Mmm dd, yyyy hh:mm:ss'),standard_dim,status_only,
(case status when 0 then unk_textcolor when 1 then off_textcolor else if level < 100 then dim_textcolor else on_textcolor endif end),
(case status when 0 then unk_backcolor when 1 then off_backcolor else if level < 100 then dim_backcolor else on_backcolor endif end),status
from x10devices,x10types where x10devices.typeid = x10types.typeid order by 4,1"
) +
ph_setvar_a(1,1,1) +
ph_setvar_s(1,2,"") +
ph_forloop(
"ph_concatvar(1,2,

'<tr>~r~n<td align=left valign=center bgcolor=~~"' + ph_htmlcolor(long(ph_getdata(1,ph_getvar_n(1,1),10))) + '~~" nowrap><font color=~~"' +
ph_htmlcolor(long(ph_getdata(1,ph_getvar_n(1,1),9))) + '~~">' + ph_getdata(1,ph_getvar_n(1,1),5) + '</font></td>~r~n' +

'<td align=left valign=center bgcolor=~~"#cde2ff~~" nowrap>' + ph_getdata(1,ph_getvar_n(1,1),3) + '</td>~r~n' +

'<td align=left valign=center bgcolor=~~"#cde2ff~~" nowrap>' + ph_getdata(1,ph_getvar_n(1,1),2) + '</td>~r~n' +

'<td align=center valign=center bgcolor=~~"#cde2ff~~" nowrap>' + ph_getdata(1,ph_getvar_n(1,1),11) + ph_getdata(1,ph_getvar_n(1,1),1) + '</td>~r~n' +

'<td align=left valign=center bgcolor=~~"#cde2ff~~" nowrap>' + left(ph_getdata(1,ph_getvar_n(1,1),6),12) + '     ' +

mid(ph_getdata(1,ph_getvar_n(1,1),6),14) + '</td>~r~n' +

'<form method=~~"get~~" action=~~"/ph-cgi/devicebtn~~"><td align=left valign=center bgcolor=~~"#dcf0ff~~" nowrap class=xt1rec7>' +
if(ph_getdata(1,ph_getvar_n(1,1),8) = '0','<input type=~~"hidden~~" name=~~"type~~" value=~~"' + ph_getdata(1,ph_getvar_n(1,1),11) + '~~">' +
'<input type=~~"hidden~~" name=~~"id~~" value=~~"' + ph_getdata(1,ph_getvar_n(1,1),1) + '~~"> <input type=~~"submit~~" name=~~"cmd~~" value=~~"On~~" ' +

'class=xt1rec7e1> <input type=~~"submit~~" name=~~"cmd~~" value=~~"Off~~" class=xt1rec7e1>' +
if(ph_getdata(1,ph_getvar_n(1,1),7) = '1',' <input type=~~"text~~" name=~~"dim~~" size=~~"2~~" style=~~"font-family:arial; font-size:8pt~~">' +
' <input type=~~"submit~~" name=~~"cmd~~" value=~~"ADIM~~" style=~~"font-family:arial; font-size:8pt~~">',''),'') + '</td></form>~r~n</tr>~r~n'
) +
ph_rtne(ph_addtovar(1,1,1))",
1,
ph_getsqlrows(1),
1
)
) +
ph_getvar_s(1,2) +
ph_rtne(ph_sqldestroy(1))
%>



Edited by yodafrisk - September 07 2006 at 22:25
Back to Top View yodafrisk's Profile Search for other posts by yodafrisk Visit yodafrisk's Homepage
 
dhoward
Admin Group
Admin Group
Avatar

Joined: June 29 2001
Location: United States
Online Status: Offline
Posts: 4447
Posted: September 16 2006 at 15:49 | IP Logged Quote dhoward

Yoda,

You can get the latest PSP sample page from here: http://power-home.com/download/pspsample_10346.zip. It hasnt been updated to work with Insteon yet but it does work for X10 in version 1.03.4.7.

I will be working on updating the manual and help shortly as part of the release version.

Let me know if you have any other questions.

BTW, it looks like you got it figured out pretty well. Looks good.

Dave.
Back to Top View dhoward's Profile Search for other posts by dhoward Visit dhoward's Homepage
 

If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

  Post ReplyPost New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum