forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Sending Http strings to browser with md5 encrypted passwords
Goto page 1, 2  Next
 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Miscellaneous
View previous topic :: View next topic  
Author Message
Teamgreentech
Valued Newbie


Joined: 07 Dec 2010
Posts: 46
Location: Somerset

PostPosted: Sat Dec 17, 2011 1:20 pm    Post subject: Sending Http strings to browser with md5 encrypted passwords Reply with quote

Hi All, I am working on a project that requires sending info to a browser with login information that php needs to check against mysql database.

As the passwords are md5 encrypted I need to get the password encrypted on loginbutton event then pass the user name and encrypted password string to the browser so that php gets the correct info to compare with the users table in mysql.

This is simple if I just use the browser and load a login page but as the browser dialog element does not use TAB key to go to next input box it is a pain for users to mouse click everywhere..

Anyway the question is... has anyone tried to md5 encrypt with a dialog script ?

Thanks in advance for help / suggestions
Fletch - Teamgreentech

_________________
Many thanks
Andy @ Team Green Technology
Back to top
View user's profile Send private message Visit poster's website
LiquidCode
Moderator Team


Joined: 05 Dec 2000
Posts: 1751
Location: Space and Time

PostPosted: Sat Dec 17, 2011 4:37 pm    Post subject: Reply with quote

VDS 5/6 had MD5 built in.

Code:
%t = @encrypt(String,MD5)

_________________
Chris
Http://theblindhouse.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Teamgreentech
Valued Newbie


Joined: 07 Dec 2010
Posts: 46
Location: Somerset

PostPosted: Mon Dec 19, 2011 12:15 pm    Post subject: Reply with quote

LiquidCode wrote:
VDS 5/6 had MD5 built in.

Code:
%t = @encrypt(String,MD5)


Nice one LiquidCode, I have VDS5 but did not look to see if it was incorporated doh Embarassed

I don't suppose you know a way of getting the tab key to work in the vds browser do you ? it's something that has frastrated me for years having to click to the next form eliment etc

_________________
Many thanks
Andy @ Team Green Technology
Back to top
View user's profile Send private message Visit poster's website
LiquidCode
Moderator Team


Joined: 05 Dec 2000
Posts: 1751
Location: Space and Time

PostPosted: Mon Dec 19, 2011 1:44 pm    Post subject: Reply with quote

No, not within VDS. But there are ways of getting the tab key to work if you are the one that created the web page, using java. I have not done it, but I know that it can be done.
_________________
Chris
Http://theblindhouse.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Teamgreentech
Valued Newbie


Joined: 07 Dec 2010
Posts: 46
Location: Somerset

PostPosted: Mon Dec 19, 2011 2:11 pm    Post subject: Reply with quote

LiquidCode wrote:
No, not within VDS. But there are ways of getting the tab key to work if you are the one that created the web page, using java. I have not done it, but I know that it can be done.


Thanks once again, I am the creator of the pages and had not thought about JAVA Script for this, I have a search around and see if there is some open source examples as my programming skills don't extend to java if I'm honest Wink

Thanks for the pointer

_________________
Many thanks
Andy @ Team Green Technology
Back to top
View user's profile Send private message Visit poster's website
Teamgreentech
Valued Newbie


Joined: 07 Dec 2010
Posts: 46
Location: Somerset

PostPosted: Mon Feb 06, 2012 2:27 pm    Post subject: Reply with quote

Hi All, I looked at loads of javascripts to try and solve the Tab key usage to move around a form in VDSBrowser but nothing worked well at all so am trying a different tacked. I have created a form in VDS with Groups Elements and Checkboxes As we can tab through our VDS elements that is sweet but I need to find a way to identify which checkboxes have been selected and return the checkbox name. These will give me the tables and columns names in which I want to query in a mysql database and I can form the http string from here and send to a browser dialog.
Can any of you guys help me with example of how to do this. I assume I need to do some kind of repeat loop through the group elements to test there value and then get the names of the "Selected" Elements...

Much appriceate your help as always...

Andy - Team Green Tech

Teamgreentech wrote:
LiquidCode wrote:
No, not within VDS. But there are ways of getting the tab key to work if you are the one that created the web page, using java. I have not done it, but I know that it can be done.


Thanks once again, I am the creator of the pages and had not thought about JAVA Script for this, I have a search around and see if there is some open source examples as my programming skills don't extend to java if I'm honest Wink

Thanks for the pointer

_________________
Many thanks
Andy @ Team Green Technology
Back to top
View user's profile Send private message Visit poster's website
Claz
Newbie


Joined: 03 Jan 2009
Posts: 23
Location: The Netherlands

PostPosted: Mon Feb 06, 2012 7:44 pm    Post subject: Reply with quote

Hi Teamgreentech,

I'm not sure if I understand your problem well, but to me it seems there are 2 methods to do this:

1. Query each checkbox using @dlgtext() e.g. when closing the form.
2. Add a Click style to each checkbox, leading to Check...Click events and then query the status of the checkbox using @dlgtext().

Hope this helps a bit....
Back to top
View user's profile Send private message
Teamgreentech
Valued Newbie


Joined: 07 Dec 2010
Posts: 46
Location: Somerset

PostPosted: Mon Feb 06, 2012 10:13 pm    Post subject: Reply with quote

Hi Claz, thanks for your advice it is appreciated. I kinda went down that route earlier today but becuase I have up to 10 checkboxes in each group element it makes for a very long and uneligent bit of cold with some kind of repeat loop that will look at every checkbox in the group and determine if selected or not.....
I want to do something like this:

:OKBUTTON
Goto Checkgroup

:checkgroup
Repeat
%%var = @Selected elements in Group
Until not any more sellected elements in group to add to %%var

Using the click event was ok but one problem. Wen user unchecks the element the click event still add the element ID to my string that I'm trying to build...

Perhaps you can see another way to achieve this code solution

Regards
Andy - Teamgreentech

Claz wrote:
Hi Teamgreentech,

I'm not sure if I understand your problem well, but to me it seems there are 2 methods to do this:

1. Query each checkbox using @dlgtext() e.g. when closing the form.
2. Add a Click style to each checkbox, leading to Check...Click events and then query the status of the checkbox using @dlgtext().

Hope this helps a bit....

_________________
Many thanks
Andy @ Team Green Technology
Back to top
View user's profile Send private message Visit poster's website
LiquidCode
Moderator Team


Joined: 05 Dec 2000
Posts: 1751
Location: Space and Time

PostPosted: Tue Feb 07, 2012 1:59 pm    Post subject: Reply with quote

The easiest way would be to have your check boxes numbered then use repeat until to get the values. Example:

Code:

  DIALOG CREATE,Get Checked,-1,0,255,229
REM *** Modified by Dialog Designer on 2/7/2012 - 07:56 ***
  DIALOG ADD,GROUP,GROUP1,12,10,113,159,GROUP1
  DIALOG ADD,CHECK,CHECK1,38,30,180,18,CHECK1,1
  DIALOG ADD,CHECK,CHECK2,64,30,180,18,CHECK2,
  DIALOG ADD,CHECK,CHECK3,90,30,180,18,CHECK3,
  DIALOG ADD,CHECK,CHECK4,116,30,180,18,CHECK4,1
  DIALOG ADD,CHECK,CHECK5,142,30,180,18,CHECK5,1
  DIALOG ADD,GROUP,GROUP2,13,142,97,160,GROUP2,1
  DIALOG ADD,CHECK,CHECK6,37,160,,,CHECK6,
  DIALOG ADD,CHECK,CHECK7,63,160,180,18,CHECK7,
  DIALOG ADD,CHECK,CHECK8,89,160,180,18,CHECK8,
  DIALOG ADD,CHECK,CHECK9,115,160,180,18,CHECK9,1
  DIALOG ADD,CHECK,CHECK10,141,160,180,18,CHECK10,1
  DIALOG ADD,BUTTON,BUTTON1,188,60,116,24,Get Checked
  DIALOG SHOW

  :evloop
  wait event
  %e = @event()
  goto %e
 
  :close
  stop
 
  :Button1button
  list create,1
  %x = 1
  repeat
     if @dlgtext(CHECK%x)
        list add,1,Box %x checked
     end
     %x = @succ(%x)
  until @equal(%x,11)
  info @text(1)
  list close,1
  goto evloop

_________________
Chris
Http://theblindhouse.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Teamgreentech
Valued Newbie


Joined: 07 Dec 2010
Posts: 46
Location: Somerset

PostPosted: Tue Feb 07, 2012 3:48 pm    Post subject: Reply with quote

Hi LiquidCode, many thanks for your advise. Definitely better than the way I was doing it up to this afternoon when I saw your reply Wink

I had starteda include function that went through all the checkbox names and made for a very ugly solution ;-(

Is there a way to return the "title" of the element for example
CHECK1 title is INID rather that CHECK1
so that if CHECK1 is Selected I can get the title info back ? something like @title.....

Many thanks
Andy

LiquidCode wrote:
The easiest way would be to have your check boxes numbered then use repeat until to get the values. Example:

Code:

  DIALOG CREATE,Get Checked,-1,0,255,229
REM *** Modified by Dialog Designer on 2/7/2012 - 07:56 ***
  DIALOG ADD,GROUP,GROUP1,12,10,113,159,GROUP1
  DIALOG ADD,CHECK,CHECK1,38,30,180,18,CHECK1,1
  DIALOG ADD,CHECK,CHECK2,64,30,180,18,CHECK2,
  DIALOG ADD,CHECK,CHECK3,90,30,180,18,CHECK3,
  DIALOG ADD,CHECK,CHECK4,116,30,180,18,CHECK4,1
  DIALOG ADD,CHECK,CHECK5,142,30,180,18,CHECK5,1
  DIALOG ADD,GROUP,GROUP2,13,142,97,160,GROUP2,1
  DIALOG ADD,CHECK,CHECK6,37,160,,,CHECK6,
  DIALOG ADD,CHECK,CHECK7,63,160,180,18,CHECK7,
  DIALOG ADD,CHECK,CHECK8,89,160,180,18,CHECK8,
  DIALOG ADD,CHECK,CHECK9,115,160,180,18,CHECK9,1
  DIALOG ADD,CHECK,CHECK10,141,160,180,18,CHECK10,1
  DIALOG ADD,BUTTON,BUTTON1,188,60,116,24,Get Checked
  DIALOG SHOW

  :evloop
  wait event
  %e = @event()
  goto %e
 
  :close
  stop
 
  :Button1button
  list create,1
  %x = 1
  repeat
     if @dlgtext(CHECK%x)
        list add,1,Box %x checked
     end
     %x = @succ(%x)
  until @equal(%x,11)
  info @text(1)
  list close,1
  goto evloop

_________________
Many thanks
Andy @ Team Green Technology
Back to top
View user's profile Send private message Visit poster's website
Teamgreentech
Valued Newbie


Joined: 07 Dec 2010
Posts: 46
Location: Somerset

PostPosted: Tue Feb 07, 2012 3:52 pm    Post subject: Reply with quote

Also I need to remove the last character in my string which is always an "&". how can I do this ?

LiquidCode wrote:
The easiest way would be to have your check boxes numbered then use repeat until to get the values. Example:

Code:

  DIALOG CREATE,Get Checked,-1,0,255,229
REM *** Modified by Dialog Designer on 2/7/2012 - 07:56 ***
  DIALOG ADD,GROUP,GROUP1,12,10,113,159,GROUP1
  DIALOG ADD,CHECK,CHECK1,38,30,180,18,CHECK1,1
  DIALOG ADD,CHECK,CHECK2,64,30,180,18,CHECK2,
  DIALOG ADD,CHECK,CHECK3,90,30,180,18,CHECK3,
  DIALOG ADD,CHECK,CHECK4,116,30,180,18,CHECK4,1
  DIALOG ADD,CHECK,CHECK5,142,30,180,18,CHECK5,1
  DIALOG ADD,GROUP,GROUP2,13,142,97,160,GROUP2,1
  DIALOG ADD,CHECK,CHECK6,37,160,,,CHECK6,
  DIALOG ADD,CHECK,CHECK7,63,160,180,18,CHECK7,
  DIALOG ADD,CHECK,CHECK8,89,160,180,18,CHECK8,
  DIALOG ADD,CHECK,CHECK9,115,160,180,18,CHECK9,1
  DIALOG ADD,CHECK,CHECK10,141,160,180,18,CHECK10,1
  DIALOG ADD,BUTTON,BUTTON1,188,60,116,24,Get Checked
  DIALOG SHOW

  :evloop
  wait event
  %e = @event()
  goto %e
 
  :close
  stop
 
  :Button1button
  list create,1
  %x = 1
  repeat
     if @dlgtext(CHECK%x)
        list add,1,Box %x checked
     end
     %x = @succ(%x)
  until @equal(%x,11)
  info @text(1)
  list close,1
  goto evloop

_________________
Many thanks
Andy @ Team Green Technology
Back to top
View user's profile Send private message Visit poster's website
Aslan
Valued Contributor
Valued Contributor


Joined: 31 May 2001
Posts: 589
Location: Memphis, TN USA

PostPosted: Wed Feb 08, 2012 12:22 am    Post subject: Reply with quote

Teamgreentech, welcome to VDS

First I'm a bit confused as to what the issue is.
If this is a sudo form then I assume that you aren't actually posting anything until the form is completed in which Claz's answer should suffice. Since you the programmer already know what each check is for, just query all the checkboxes before posting.

Code:
If @equal(@dlgtext(Check1),1)
  %%INID = 1
end

-or-

If @equal(@dlgtext(Check1),1)
  List add,1,INID
end

You can also name each checkbox the same as the title as long as there aren't any spaces. This would easy the reading of your script during troubleshooting.
Code:
DIALOG ADD,CHECK,INID,38,30,180,18,INID,1

If @equal(@dlgtext(INID),1)
  %%INID = 1
end

-or-

If @equal(@dlgtext(INID),1)
  List add,1,INID
end

What exactly does the post string need to look like?

If the string is just the collection of the name of only the checkbox titles that were checked then maybe something like this would work where you concatenate the values serparated by a delimiter.
Code:
If @equal(@dlgtext(Check1),1)
  %%STR = %%STR<whatever delimiter you need>INID
end
If @equal(@dlgtext(<CheckboxName>),1)
  %%STR = %%STR<whatever delimiter you need><title of Checkbox>
end
Then work your way through the rest of the checkbox elements.

Can you show us exactly what your relevant posting code needs to look like? To clarify, what does the end result need to look like?
Back to top
View user's profile Send private message Send e-mail
Teamgreentech
Valued Newbie


Joined: 07 Dec 2010
Posts: 46
Location: Somerset

PostPosted: Wed Feb 08, 2012 9:39 am    Post subject: Reply with quote

Hi Aslan, many thanks for your input earlier today it is much appreciated.
I will try and explan further with some code included here also.....

The end result here is a string that can be write to a registry key containing all the information required for my query.php file to perform a mysql search against the columns rows and tables in the database.
Once My Script has got the search criteria and written it to the registry it creates a report.flag and closes the child window.

The Main_evloop looks for the existance of flags such as the once created above and takes the relevent action i.e goto :searchevent
:Searchevent
%%ReportQuery = http://%%net/Staff/Gui/query.php?@regread(HLM,SOFTWARE\TGTGMS,ReportQuery)
reads the relevent registry key and forms the URL and sends it to the browser. Happy Days we get some results back from Mysql....

My child window code for Report Form Code :
Code:
  DIALOG CREATE,Product Report Form,53,266,849,711,,SAVEPOS,NOMIN
REM *** Modified by Dialog Designer on 07/02/2012 - 16:04 ***
  DIALOG ADD,BUTTON,ReportOK,672,329,94,24,Query Database,,DEFAULT
  DIALOG ADD,BUTTON,ReportCancel,671,433,64,24,Cancel
REM ** DIALOG ADD,BUTTON,Script,328,31,64,24,Script
  DIALOG ADD,EDIT,Date,36,180,101,21,@datetime(yyyy-mm-dd)
  DIALOG ADD,TEXT,Date1,21,181,,,Date From:
  DIALOG ADD,EDIT,DateTo,36,295,101,22,@datetime(yyyy-mm-dd),Enter end date for your query
  DIALOG ADD,TEXT,Date2,22,296,,,Date To:
  DIALOG ADD,GROUP,Inwards,73,86,312,262,Inwards
  DIALOG ADD,CHECK,INID,98,119,49,18,IN_ID
  DIALOG ADD,CHECK,Intime,121,118,51,18,Intime
  DIALOG ADD,CHECK,InSource,142,118,64,18,InSource
  DIALOG ADD,CHECK,InPunnet,162,118,64,18,InPunnet
  DIALOG ADD,CHECK,ColorCode,183,118,70,18,ColorCode
  DIALOG ADD,CHECK,Brix1,207,118,43,18,Brix1
  DIALOG ADD,CHECK,Brix2,229,118,45,18,Brix2
  DIALOG ADD,CHECK,Brix3,251,118,45,18,Brix3
  DIALOG ADD,CHECK,Brix4,208,169,46,18,Brix4
  DIALOG ADD,CHECK,Brix5,228,169,45,18,Brix5
  DIALOG ADD,CHECK,Brix6,252,169,44,18,Brix6
  DIALOG ADD,CHECK,Brix7,209,221,47,18,Brix7
  DIALOG ADD,CHECK,Brix8,230,221,46,18,Brix8
  DIALOG ADD,CHECK,Brix9,251,222,47,18,Brix9
  DIALOG ADD,CHECK,Brix10,270,169,51,18,Brix10
  DIALOG ADD,CHECK,InDate,100,202,54,18,InDate
  DIALOG ADD,CHECK,InPalletNo,122,201,70,18,InPalletNo
  DIALOG ADD,CHECK,InClass,142,200,55,18,InClass
  DIALOG ADD,CHECK,Target_gms,162,200,77,18,Target_gms
  DIALOG ADD,CHECK,InTotalPacks,182,200,83,18,InTotalPacks
  DIALOG ADD,CHECK,Week,100,303,49,18,Week
  DIALOG ADD,CHECK,Product,122,303,57,18,Product
  DIALOG ADD,CHECK,Quality,142,303,54,18,Quality
  DIALOG ADD,CHECK,InField_ID,162,303,73,18,InField_ID
  DIALOG ADD,CHECK,Fruittemp,182,303,67,18,Fruittemp
  DIALOG ADD,CHECK,EstPicked,209,304,67,18,EstPicked
  DIALOG ADD,CHECK,AvgBrix,229,304,59,18,AvgBrix
  DIALOG ADD,GROUP,Packing,73,456,311,261,Packing
  DIALOG ADD,CHECK,ID,98,468,31,18,ID
  DIALOG ADD,CHECK,PakOrderID,98,545,77,18,PakOrderID
  DIALOG ADD,CHECK,PakDate,98,632,45,18,Date
  DIALOG ADD,CHECK,PakWeek,98,690,65,18,Week
  DIALOG ADD,CHECK,Pickdate,124,468,60,18,Pickdate
  DIALOG ADD,CHECK,Start,123,545,45,18,Start
  DIALOG ADD,CHECK,Finish,122,632,49,18,Finish
  DIALOG ADD,CHECK,StaffNo,122,690,58,18,StaffNo
  DIALOG ADD,CHECK,Customer,146,468,68,18,Customer
  DIALOG ADD,CHECK,PalletNo,146,546,62,18,PalletNo
  DIALOG ADD,CHECK,Class,145,633,47,18,Class
  DIALOG ADD,CHECK,Source,145,690,56,18,Source
  DIALOG ADD,CHECK,Field_ID,173,468,59,18,Field_ID
  DIALOG ADD,CHECK,PakProduct,172,546,59,18,Product
  DIALOG ADD,CHECK,Pack_Size,193,546,67,18,Pack_Size
  DIALOG ADD,CHECK,Total_Packs,191,468,77,18,TotalPacks
  DIALOG ADD,CHECK,Total_Kgs,192,633,68,18,Total_Kgs
  DIALOG ADD,CHECK,Checked,172,633,64,18,Checked
  DIALOG ADD,CHECK,Packed,213,468,55,18,Packed
  DIALOG ADD,CHECK,StaffCost,214,546,68,18,Staff Cost
  DIALOG ADD,CHECK,PunRate,213,633,63,18,PunRate
  DIALOG ADD,GROUP,SprayRecs,357,84,311,255,Spray Records
  DIALOG ADD,CHECK,SpID,384,107,32,18,ID
  DIALOG ADD,CHECK,Location,384,176,62,18,Location
  DIALOG ADD,CHECK,Operator,383,280,68,18,Operator
  DIALOG ADD,CHECK,SpDate,406,107,44,18,Date
  DIALOG ADD,CHECK,Starttime,406,176,65,18,Starttime
  DIALOG ADD,CHECK,Finishtime,407,279,69,18,Finishtime
  DIALOG ADD,CHECK,SpFieldID,432,107,180,18,Field_ID
  DIALOG ADD,CHECK,StartBay,430,176,62,18,StartBay
  DIALOG ADD,CHECK,finishbay,431,279,63,18,finishbay
  DIALOG ADD,CHECK,Variety,461,107,55,18,Variety
  DIALOG ADD,CHECK,Weather,459,175,62,18,Weather
  DIALOG ADD,CHECK,Vehicle,457,278,54,18,Vehicle
  DIALOG ADD,CHECK,Sprayer,488,107,60,18,Sprayer
  DIALOG ADD,CHECK,Speed,487,175,53,18,Speed
  DIALOG ADD,CHECK,harvdate,483,278,64,18,harvdate
  DIALOG ADD,CHECK,SpProduct,514,107,61,18,Product
  DIALOG ADD,CHECK,ActivChem,513,175,73,18,ActivChem
  DIALOG ADD,CHECK,Target,512,277,53,18,Target
  DIALOG ADD,CHECK,rate,538,106,43,18,rate
  DIALOG ADD,CHECK,Measure,540,174,62,18,Measure
  DIALOG ADD,CHECK,Water,539,276,52,18,Water
  DIALOG ADD,CHECK,TotUsed,560,105,64,18,TotUsed
  DIALOG ADD,CHECK,Harvint,561,174,57,18,Harvint
  DIALOG ADD,GROUP,Dispatch,354,457,309,257,Dispatch
  DIALOG ADD,CHECK,DispID,383,480,53,18,DispID
  DIALOG ADD,CHECK,DispDate,382,577,64,18,DispDate
  DIALOG ADD,CHECK,DispTime,381,673,63,18,DispTime
  DIALOG ADD,CHECK,DispCustomer,409,480,68,18,Customer
  DIALOG ADD,CHECK,Carrier,409,577,54,18,Carrier
  DIALOG ADD,CHECK,Destination,408,673,74,18,Destination
  DIALOG ADD,CHECK,DispClass,438,480,46,18,Class
  DIALOG ADD,CHECK,TraySize,438,577,62,18,TraySize
  DIALOG ADD,CHECK,PackSize,437,673,65,18,PackSize
  DIALOG ADD,CHECK,TotalTrays,471,480,73,18,TotalTrays
  DIALOG ADD,CHECK,DispTotal_Kgs,469,577,68,18,Total_Kgs
  DIALOG ADD,CHECK,DispChecked,467,673,63,18,Checked
  DIALOG ADD,CHECK,DispNotes,511,480,68,18,DispNotes
  DIALOG ADD,CHECK,DispPacked,510,577,78,18,Packed
  DIALOG ADD,CHECK,InChecked,250,304,72,18,InChecked
  DIALOG ADD,EDIT,OrderNo,37,456,95,21,OrderNo
  DIALOG ADD,TEXT,OrderName,22,457,,,Order Number
  DIALOG ADD,CHECK,SearchInwards,304,169,126,18,Search Inwards Data
  DIALOG ADD,CHECK,SearchPacking,303,556,120,18,Search Packing Data
  DIALOG ADD,CHECK,SearchSpray,589,174,129,18,Search Spray Records
  DIALOG ADD,CHECK,SearchDisp,584,579,125,18,Search Dispatch Data
  DIALOG SHOW

:Child_evloop2
   wait event
   parse "%E;%D",@event(D)
    if @zero(%D)
      beep
        goto Child_evloop2
   else
      goto Child_%E
       end
REM The modal dialog has disappeared from the screen, although
REM it still exists so you can get the data from it.

:Child_ReportOKBUTTON
   List Create,1
    List Savefile,1,C:\TGTPMS\Reportform.flag
    List Close,1
       %%Query = @TestChecked(%X)
       info %%Query
       Registry Write,HLM,SOFTWARE\TGTGMS,ReportQuery,%%Query
          
:Child_ReportCancelBUTTON
:Child_ReportCLOSE
   DIALOG CLOSE
   wait event
   while @event()
                wend
   goto Evloop


My timer and evloop in Main Window
Code:
:Timer
%A = @Datetime(hh:nn:ss)
Dialog Set,Status1,%A %%Copyright
       if @file(C:\TGTPMS\Searchform.flag)
       goto BasicQuery
       end
       if @file(C:\TGTPMS\Reportform.flag)
       goto ReportQuery
       end
:Evloop
  wait event,1
  %E = @event()
  if @null(%E)
    Goto Timer 
    Else
    Goto %E


My Code for the event that send the url to browser
Code:
:ReportQuery
   Dialog set,TAB1,Advanced Analytics
   Dialog Hide,Home
   Dialog Hide,Packing
   Dialog Hide,PackHeader
   Dialog Hide,Rejections
   Dialog Hide,Dispatch
   Dialog Hide,DispHeader
   Dialog Hide,Inwards
   Dialog Hide,PackingUpdates
   Dialog Hide,Orders
   Dialog Hide,Statistics
   Dialog Hide,SprayRecords
   Dialog Show,AdvancedAnalytics
   %%ReportQuery = http://%%net/Staff/Gui/query.php?@regread(HLM,SOFTWARE\TGTGMS,ReportQuery)
   File Delete,C:\TGTPMS\Reportform.flag
   Dialog set,AdvancedAnalytics,%%ReportQuery
   goto Evloop


The query string could be any combination that is selected from the child window so I can right a rigid peace of code for a specific query.
What is written to the registry is the part of the URL that follows after the question Mark ?
like this:
?Location=Location&Field_ID=Field_ID&Product=Product&

Recieving PHP file will get the information from "Location" "Field_ID" etc and do what it need to do....

Does this help you understand a little better ?

To be honest I am really surprised I can't just get the name of the dialog element that is select with a nice little already made @function Sad


Many thanks Alsan once again.

Andy - TeamGreenTech

Aslan wrote:
Teamgreentech, welcome to VDS

First I'm a bit confused as to what the issue is.
If this is a sudo form then I assume that you aren't actually posting anything until the form is completed in which Claz's answer should suffice. Since you the programmer already know what each check is for, just query all the checkboxes before posting.

Code:
If @equal(@dlgtext(Check1),1)
  %%INID = 1
end

-or-

If @equal(@dlgtext(Check1),1)
  List add,1,INID
end

You can also name each checkbox the same as the title as long as there aren't any spaces. This would easy the reading of your script during troubleshooting.
Code:
DIALOG ADD,CHECK,INID,38,30,180,18,INID,1

If @equal(@dlgtext(INID),1)
  %%INID = 1
end

-or-

If @equal(@dlgtext(INID),1)
  List add,1,INID
end

What exactly does the post string need to look like?

If the string is just the collection of the name of only the checkbox titles that were checked then maybe something like this would work where you concatenate the values serparated by a delimiter.
Code:
If @equal(@dlgtext(Check1),1)
  %%STR = %%STR<whatever delimiter you need>INID
end
If @equal(@dlgtext(<CheckboxName>),1)
  %%STR = %%STR<whatever delimiter you need><title of Checkbox>
end
Then work your way through the rest of the checkbox elements.

Can you show us exactly what your relevant posting code needs to look like? To clarify, what does the end result need to look like?
Code:

_________________
Many thanks
Andy @ Team Green Technology
Back to top
View user's profile Send private message Visit poster's website
Aslan
Valued Contributor
Valued Contributor


Joined: 31 May 2001
Posts: 589
Location: Memphis, TN USA

PostPosted: Fri Feb 10, 2012 2:59 am    Post subject: Reply with quote

I'm assuming that this is the part you're trying to figure out.
Code:
%%Query = @TestChecked(%X)
Registry Write,HLM,SOFTWARE\TGTGMS,ReportQuery,%%Query


Also assuming "@TestChecked(%X)" is the function you're trying create to populate %%Query

Ok, so if I checked everything in the "Spray Records" group and then clicked the "Query Database" button, what would %%Query need to look like and what is %X?

Teamgreentech wrote:
To be honest I am really surprised I can't just get the name of the dialog element that is select with a nice little already made @function Sad
Maybe a multi style list with checkboxes would work better instead of multiple elements. Even with this though, you would have to read the list line-by-line to see what is checked.

I love a challenge Wink
Back to top
View user's profile Send private message Send e-mail
Teamgreentech
Valued Newbie


Joined: 07 Dec 2010
Posts: 46
Location: Somerset

PostPosted: Fri Feb 10, 2012 2:24 pm    Post subject: Reply with quote

Indeed this is a challenge Wink

The check boxes represent columns in a mysql datebase that a user may or may not choose to have selected in the query he or she is making. Thus we will have a fully customisable report form. We have already acheived this with a html form and php but would prefer everything through VDS as the dialogs look snappier and more professional than a simple web page + Users can use the tab key to travel between boxes if they so wish. This is not possible with webpages in vds browser Sad

I thought of using the checkboxes as it is more visual for the user as they are reviewing their selections before commiting the report criteria. But I do agree a multi list might be a great alternative. can you offer up an example of coding to do this Smile

BTW,Yes the TestCheck is a function and %X is what it returns, which is of course a string of Tables and Columns that have been selected.

Many thanks once again for your help Aslan
Best Regards
Andy - TGT

Aslan wrote:
I'm assuming that this is the part you're trying to figure out.
Code:
%%Query = @TestChecked(%X)
Registry Write,HLM,SOFTWARE\TGTGMS,ReportQuery,%%Query


Also assuming "@TestChecked(%X)" is the function you're trying create to populate %%Query

Ok, so if I checked everything in the "Spray Records" group and then clicked the "Query Database" button, what would %%Query need to look like and what is %X?

Teamgreentech wrote:
To be honest I am really surprised I can't just get the name of the dialog element that is select with a nice little already made @function Sad
Maybe a multi style list with checkboxes would work better instead of multiple elements. Even with this though, you would have to read the list line-by-line to see what is checked.

I love a challenge Wink

_________________
Many thanks
Andy @ Team Green Technology
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Miscellaneous All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group