Keeping track of database entires

29 views
Skip to first unread message

mostwanted

unread,
Dec 13, 2021, 12:27:10 AM12/13/21
to web2py-users
Is there a way of keeping track of table entries? I have to create a function that shows a pop-up warning when a client has not made payments in 3 months ,i dont know where to begin, any ideas?

Clemens

unread,
Dec 13, 2021, 4:55:56 AM12/13/21
to web2py-users
My first thought was to check this when an user has logged in. Having a redirect after login to a controller checking the time, the last payment was made, can then produce a corresponding message.

I googled "web2py redirect after login" and found how to do a redirect after login:
https://stackoverflow.com/questions/18902549/web2py-redirect-after-login

Is it what you want?

Best regards
Clemens

mostwanted

unread,
Dec 13, 2021, 11:03:50 AM12/13/21
to web2py-users
You gave an idea and it seems to be working, below is the code i'm using in the view:

{{
for dt in dt:
        now_dt=request.now.date()-dt.payment_date
        now_dt2=now_dt.days
        name=dt.client.parent_name
policy_number=dt.client.policy_number
}}
<script>
    $(document).ready(function(){
        if ({{=now_dt2}} >=60)
        {
         $('#expiry').show();
        }
    });
</script>

<div class="behind">
 <i class="fa fa-user-circle-o user"></i><br />
    <span class="message">{{=name}} ({{=policy_number}})'s payments are behind by {{=now_dt2}} DAYS!!! <br /></span>
</div>
{{pass}}

Thanks alot Clemens
Reply all
Reply to author
Forward
0 new messages