romaldus 10/15/2016 | |
Hi, I am trying to limit the number of records a user can add to a specific details table based on how many records are already present. I'd like to do this by disabling the "Add New" and "Inline Add" buttons on the list page. So, for example, if a user has already added 50 records to this details table, then these buttons will no longer work and a message will be displayed. For context,this is for a quiz app where I'd like to limit the number of questions a teacher can add. I am having a hard time finding and using the variable that stores the info for how many records have been found for the list page. Thanks, Brett
|
B
|
bioman author 10/16/2016 |
Hi Romaldus, https://xlinesoft.com/phprunner/docs/limit_number_of_records_users_can_add.htm |
S
|
stiven 10/27/2016 |
on the list page before display event you can add this code.. you just have to create your own condition
|
B
|
bioman author 10/27/2016 |
Thanks for this idea. Do you know how to access the variable for the number of records found? I will need to use this in my condition, but I'm not sure how to access it. Thanks, |
S
|
stiven 10/27/2016 |
just how the link says
|
B
|
bioman author 10/27/2016 |
Great! Thanks Stivens. I will try this out. |
B
|
bioman author 10/28/2016 |
Hi, |
admin 10/28/2016 | |
If your UserID is a text field you need to use this: $rs = CustomQuery("select count(*) as c from ads where userid = '" . $_SESSION["UserID"]."'"); |
B
|
bioman author 10/29/2016 |
Thanks Sergey, If your UserID is a text field you need to use this: $rs = CustomQuery("select count(*) as c from ads where userid = '" . $_SESSION["UserID"]."'"); |