Announcement

Collapse
No announcement yet.

Controlling login and their corresponding records.

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Controlling login and their corresponding records.

    Hello guys,
    How to achieve this using Scriptcase :

    i have 5 user such as : user1, user2, user3, user4, user5

    they are set at different group : grp1 (user1, user2, user3) ; grp2 (user4, user5)

    Now, i need this :

    When each user login each day, he get 50 record from a database table which he edit and those 50 records get updated to second table on submit.

    grp1 : will get data from table1 which will be saved to grp1_table1
    grp2 : will get data from table2 which will be saved to grp2_table2

    Now, when user1 login he get 1st 50 records or say if user3 or user2 login first whoever first login get 1st 50 records, then 2nd login user get next 51 - 100 records, and so on..

    this same will be implemented for grp2 users..

    So please help me how to do this logic using scriptcase ??

  • #2
    First you need a table to store the status. Something like group / (user /) date / table / startrecnum. This way you can check on this table what the record# is to start with. If you use mysql you need to apply the correct sql syntax using variable. Like ' limit [glob_startrec], 50'

    In the onscriptinit you can determine the glob_startrec, put the value in the global var and it should work.
    Albert Drent
    aducom software netherlands
    scriptcase partner, reseller, support and (turn-key) development
    www.scriptcase.eu / www.scriptcase.nl

    Comment


    • #3
      ahhhhhh crazy a bit..

      i seriously don't understand that.. can you tell me a bit more detailed.

      and yea i am using MySQL.

      Comment


      • #4
        You need to keep track of which user is logged on and on which recordset he/she is working on. Otherwise you cannot determine which recordset needs to be retrieved for the next user. Thats the table containing group/data/table/startrecnum. Optional the user if you need to know which user has changed the dataset. Initially when your app starts you must determine which 50 records you need to select. You need the onscriptinit event for this. The variable you retrieve must be stored so you can use it if your application starts up and the sql is executed. Therefore you must apply the variable to a global and used this one in the sql of the grid the user will be working on.
        Albert Drent
        aducom software netherlands
        scriptcase partner, reseller, support and (turn-key) development
        www.scriptcase.eu / www.scriptcase.nl

        Comment


        • #5
          i am sorry, but can you provide a code snipes for this:


          Initially when your app starts you must determine which 50 records you need to select. You need the onscriptinit event for this. The variable you retrieve must be stored so you can use it if your application starts up and the sql is executed. Therefore you must apply the variable to a global and used this one in the sql of the grid the user will be working on.

          Comment


          • #6
            Just schematically

            Add your sql statement with ' limit [glob_startrec], 50

            In onapplicationinit:

            ***make a select on your statustable:

            select max(startrecnum) where group='...'
            $sr = valueabove + 50

            ***rework in your statutstable

            insert into etc. values (group, user etc)

            *** so that on next select nr 51 will be selected

            afaik that's it. IN the right part of the event editor you have code snippets you can use to select /insert the data.
            Albert Drent
            aducom software netherlands
            scriptcase partner, reseller, support and (turn-key) development
            www.scriptcase.eu / www.scriptcase.nl

            Comment


            • #7
              Thanks a lot will give it an attempt soon

              Comment


              • #8
                ahhh confusion all over..

                where to add up that query and if any code you can provide that looks really code will be helpful..

                buying this app soon..

                Comment


                • #9
                  That query is in you SQL entry left in the menu. Just add the global variable. Apply the code in the events necessary. I cannot be more specific than this, I would have to build this application. I think that's beyond the scope of this forum ;-)
                  Albert Drent
                  aducom software netherlands
                  scriptcase partner, reseller, support and (turn-key) development
                  www.scriptcase.eu / www.scriptcase.nl

                  Comment

                  Working...
                  X