yodafrisk Newbie
Joined: September 06 2006 Location: United States
Online Status: Offline Posts: 4
|
Posted: September 07 2006 at 22:06 | IP Logged
|
|
|
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
|